From 4c3c7eaa2d225ecc0c16644f1a23e848bf539164 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 2 Aug 2010 19:12:15 +0000 Subject: Starting work on Qt4 interface... git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/tqtinterface@1158413 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- qtinterface/qt4/Qt/Qt3Support | 115 + qtinterface/qt4/Qt/QtCore | 137 + qtinterface/qt4/Qt/QtDBus | 21 + qtinterface/qt4/Qt/QtGui | 228 ++ qtinterface/qt4/Qt/QtHelp | 11 + qtinterface/qt4/Qt/QtMultimedia | 16 + qtinterface/qt4/Qt/QtNetwork | 32 + qtinterface/qt4/Qt/QtOpenGL | 10 + qtinterface/qt4/Qt/QtScript | 17 + qtinterface/qt4/Qt/QtScriptTools | 7 + qtinterface/qt4/Qt/QtSql | 18 + qtinterface/qt4/Qt/QtSvg | 9 + qtinterface/qt4/Qt/QtTest | 21 + qtinterface/qt4/Qt/QtWebKit | 18 + qtinterface/qt4/Qt/QtXml | 7 + qtinterface/qt4/Qt/QtXmlPatterns | 18 + qtinterface/qt4/Qt/q3accel.h | 110 + qtinterface/qt4/Qt/q3action.h | 225 ++ qtinterface/qt4/Qt/q3asciicache.h | 132 + qtinterface/qt4/Qt/q3asciidict.h | 130 + qtinterface/qt4/Qt/q3boxlayout.h | 122 + qtinterface/qt4/Qt/q3button.h | 71 + qtinterface/qt4/Qt/q3buttongroup.h | 152 ++ qtinterface/qt4/Qt/q3cache.h | 130 + qtinterface/qt4/Qt/q3canvas.h | 787 ++++++ qtinterface/qt4/Qt/q3cleanuphandler.h | 110 + qtinterface/qt4/Qt/q3combobox.h | 224 ++ qtinterface/qt4/Qt/q3cstring.h | 273 ++ qtinterface/qt4/Qt/q3databrowser.h | 183 ++ qtinterface/qt4/Qt/q3datatable.h | 251 ++ qtinterface/qt4/Qt/q3dataview.h | 90 + qtinterface/qt4/Qt/q3datetimeedit.h | 288 +++ qtinterface/qt4/Qt/q3deepcopy.h | 89 + qtinterface/qt4/Qt/q3dict.h | 130 + qtinterface/qt4/Qt/q3dns.h | 174 ++ qtinterface/qt4/Qt/q3dockarea.h | 199 ++ qtinterface/qt4/Qt/q3dockwindow.h | 239 ++ qtinterface/qt4/Qt/q3dragobject.h | 218 ++ qtinterface/qt4/Qt/q3dropsite.h | 65 + qtinterface/qt4/Qt/q3editorfactory.h | 77 + qtinterface/qt4/Qt/q3filedialog.h | 346 +++ qtinterface/qt4/Qt/q3frame.h | 90 + qtinterface/qt4/Qt/q3ftp.h | 204 ++ qtinterface/qt4/Qt/q3garray.h | 140 ++ qtinterface/qt4/Qt/q3gcache.h | 137 + qtinterface/qt4/Qt/q3gdict.h | 233 ++ qtinterface/qt4/Qt/q3glist.h | 279 +++ qtinterface/qt4/Qt/q3grid.h | 79 + qtinterface/qt4/Qt/q3gridlayout.h | 78 + qtinterface/qt4/Qt/q3gridview.h | 137 + qtinterface/qt4/Qt/q3groupbox.h | 159 ++ qtinterface/qt4/Qt/q3gvector.h | 132 + qtinterface/qt4/Qt/q3hbox.h | 77 + qtinterface/qt4/Qt/q3header.h | 225 ++ qtinterface/qt4/Qt/q3hgroupbox.h | 69 + qtinterface/qt4/Qt/q3http.h | 277 ++ qtinterface/qt4/Qt/q3iconview.h | 519 ++++ qtinterface/qt4/Qt/q3intcache.h | 131 + qtinterface/qt4/Qt/q3intdict.h | 126 + qtinterface/qt4/Qt/q3listbox.h | 429 ++++ qtinterface/qt4/Qt/q3listview.h | 609 +++++ qtinterface/qt4/Qt/q3localfs.h | 84 + qtinterface/qt4/Qt/q3mainwindow.h | 267 ++ qtinterface/qt4/Qt/q3memarray.h | 144 ++ qtinterface/qt4/Qt/q3mimefactory.h | 102 + qtinterface/qt4/Qt/q3multilineedit.h | 143 ++ qtinterface/qt4/Qt/q3network.h | 63 + qtinterface/qt4/Qt/q3networkprotocol.h | 250 ++ qtinterface/qt4/Qt/q3objectdict.h | 74 + qtinterface/qt4/Qt/q3paintdevicemetrics.h | 77 + qtinterface/qt4/Qt/q3painter.h | 123 + qtinterface/qt4/Qt/q3picture.h | 68 + qtinterface/qt4/Qt/q3pointarray.h | 74 + qtinterface/qt4/Qt/q3polygonscanner.h | 70 + qtinterface/qt4/Qt/q3popupmenu.h | 93 + qtinterface/qt4/Qt/q3process.h | 186 ++ qtinterface/qt4/Qt/q3progressbar.h | 148 ++ qtinterface/qt4/Qt/q3progressdialog.h | 149 ++ qtinterface/qt4/Qt/q3ptrcollection.h | 83 + qtinterface/qt4/Qt/q3ptrdict.h | 127 + qtinterface/qt4/Qt/q3ptrlist.h | 198 ++ qtinterface/qt4/Qt/q3ptrqueue.h | 99 + qtinterface/qt4/Qt/q3ptrstack.h | 99 + qtinterface/qt4/Qt/q3ptrvector.h | 121 + qtinterface/qt4/Qt/q3rangecontrol.h | 194 ++ qtinterface/qt4/Qt/q3scrollview.h | 253 ++ qtinterface/qt4/Qt/q3semaphore.h | 83 + qtinterface/qt4/Qt/q3serversocket.h | 94 + qtinterface/qt4/Qt/q3shared.h | 65 + qtinterface/qt4/Qt/q3signal.h | 97 + qtinterface/qt4/Qt/q3simplerichtext.h | 109 + qtinterface/qt4/Qt/q3socket.h | 157 ++ qtinterface/qt4/Qt/q3socketdevice.h | 177 ++ qtinterface/qt4/Qt/q3sortedlist.h | 71 + qtinterface/qt4/Qt/q3sqlcursor.h | 167 ++ qtinterface/qt4/Qt/q3sqleditorfactory.h | 78 + qtinterface/qt4/Qt/q3sqlfieldinfo.h | 167 ++ qtinterface/qt4/Qt/q3sqlform.h | 109 + qtinterface/qt4/Qt/q3sqlpropertymap.h | 86 + qtinterface/qt4/Qt/q3sqlrecordinfo.h | 122 + qtinterface/qt4/Qt/q3sqlselectcursor.h | 115 + qtinterface/qt4/Qt/q3strlist.h | 137 + qtinterface/qt4/Qt/q3strvec.h | 93 + qtinterface/qt4/Qt/q3stylesheet.h | 235 ++ qtinterface/qt4/Qt/q3syntaxhighlighter.h | 89 + qtinterface/qt4/Qt/q3tabdialog.h | 143 ++ qtinterface/qt4/Qt/q3table.h | 548 ++++ qtinterface/qt4/Qt/q3textbrowser.h | 108 + qtinterface/qt4/Qt/q3textedit.h | 613 +++++ qtinterface/qt4/Qt/q3textstream.h | 297 +++ qtinterface/qt4/Qt/q3textview.h | 76 + qtinterface/qt4/Qt/q3tl.h | 212 ++ qtinterface/qt4/Qt/q3toolbar.h | 122 + qtinterface/qt4/Qt/q3url.h | 139 + qtinterface/qt4/Qt/q3urloperator.h | 138 + qtinterface/qt4/Qt/q3valuelist.h | 238 ++ qtinterface/qt4/Qt/q3valuestack.h | 75 + qtinterface/qt4/Qt/q3valuevector.h | 113 + qtinterface/qt4/Qt/q3vbox.h | 67 + qtinterface/qt4/Qt/q3vgroupbox.h | 69 + qtinterface/qt4/Qt/q3whatsthis.h | 89 + qtinterface/qt4/Qt/q3widgetstack.h | 112 + qtinterface/qt4/Qt/q3wizard.h | 141 ++ qtinterface/qt4/Qt/qabstractanimation.h | 141 ++ qtinterface/qt4/Qt/qabstractbutton.h | 180 ++ qtinterface/qt4/Qt/qabstracteventdispatcher.h | 107 + qtinterface/qt4/Qt/qabstractfileengine.h | 248 ++ qtinterface/qt4/Qt/qabstractfontengine_qws.h | 221 ++ qtinterface/qt4/Qt/qabstractitemdelegate.h | 134 + qtinterface/qt4/Qt/qabstractitemmodel.h | 410 +++ qtinterface/qt4/Qt/qabstractitemview.h | 377 +++ qtinterface/qt4/Qt/qabstractmessagehandler.h | 81 + qtinterface/qt4/Qt/qabstractnetworkcache.h | 141 ++ qtinterface/qt4/Qt/qabstractpagesetupdialog.h | 82 + qtinterface/qt4/Qt/qabstractprintdialog.h | 127 + qtinterface/qt4/Qt/qabstractproxymodel.h | 101 + qtinterface/qt4/Qt/qabstractscrollarea.h | 144 ++ qtinterface/qt4/Qt/qabstractslider.h | 184 ++ qtinterface/qt4/Qt/qabstractsocket.h | 257 ++ qtinterface/qt4/Qt/qabstractspinbox.h | 179 ++ qtinterface/qt4/Qt/qabstractstate.h | 97 + qtinterface/qt4/Qt/qabstracttextdocumentlayout.h | 150 ++ qtinterface/qt4/Qt/qabstracttransition.h | 118 + qtinterface/qt4/Qt/qabstracturiresolver.h | 74 + qtinterface/qt4/Qt/qabstractvideobuffer.h | 104 + qtinterface/qt4/Qt/qabstractvideosurface.h | 110 + qtinterface/qt4/Qt/qabstractxmlnodemodel.h | 429 ++++ qtinterface/qt4/Qt/qabstractxmlreceiver.h | 107 + qtinterface/qt4/Qt/qaccessible.h | 428 ++++ qtinterface/qt4/Qt/qaccessible2.h | 246 ++ qtinterface/qt4/Qt/qaccessiblebridge.h | 92 + qtinterface/qt4/Qt/qaccessibleobject.h | 140 ++ qtinterface/qt4/Qt/qaccessibleplugin.h | 87 + qtinterface/qt4/Qt/qaccessiblewidget.h | 141 ++ qtinterface/qt4/Qt/qaction.h | 261 ++ qtinterface/qt4/Qt/qactiongroup.h | 112 + qtinterface/qt4/Qt/qalgorithms.h | 526 ++++ qtinterface/qt4/Qt/qanimationgroup.h | 88 + qtinterface/qt4/Qt/qapplication.h | 415 +++ qtinterface/qt4/Qt/qatomic.h | 227 ++ qtinterface/qt4/Qt/qatomic_alpha.h | 642 +++++ qtinterface/qt4/Qt/qatomic_arch.h | 97 + qtinterface/qt4/Qt/qatomic_arm.h | 431 ++++ qtinterface/qt4/Qt/qatomic_armv6.h | 500 ++++ qtinterface/qt4/Qt/qatomic_avr32.h | 252 ++ qtinterface/qt4/Qt/qatomic_bfin.h | 343 +++ qtinterface/qt4/Qt/qatomic_bootstrap.h | 99 + qtinterface/qt4/Qt/qatomic_generic.h | 282 +++ qtinterface/qt4/Qt/qatomic_i386.h | 361 +++ qtinterface/qt4/Qt/qatomic_ia64.h | 813 ++++++ qtinterface/qt4/Qt/qatomic_macosx.h | 57 + qtinterface/qt4/Qt/qatomic_mips.h | 892 +++++++ qtinterface/qt4/Qt/qatomic_parisc.h | 305 +++ qtinterface/qt4/Qt/qatomic_powerpc.h | 648 +++++ qtinterface/qt4/Qt/qatomic_s390.h | 430 ++++ qtinterface/qt4/Qt/qatomic_sh.h | 330 +++ qtinterface/qt4/Qt/qatomic_sh4a.h | 537 ++++ qtinterface/qt4/Qt/qatomic_sparc.h | 525 ++++ qtinterface/qt4/Qt/qatomic_symbian.h | 285 +++ qtinterface/qt4/Qt/qatomic_vxworks.h | 318 +++ qtinterface/qt4/Qt/qatomic_windows.h | 496 ++++ qtinterface/qt4/Qt/qatomic_windowsce.h | 56 + qtinterface/qt4/Qt/qatomic_x86_64.h | 363 +++ qtinterface/qt4/Qt/qaudio.h | 71 + qtinterface/qt4/Qt/qaudiodeviceinfo.h | 112 + qtinterface/qt4/Qt/qaudioengine.h | 131 + qtinterface/qt4/Qt/qaudioengineplugin.h | 93 + qtinterface/qt4/Qt/qaudioformat.h | 103 + qtinterface/qt4/Qt/qaudioinput.h | 111 + qtinterface/qt4/Qt/qaudiooutput.h | 111 + qtinterface/qt4/Qt/qauthenticator.h | 87 + qtinterface/qt4/Qt/qbasicatomic.h | 230 ++ qtinterface/qt4/Qt/qbasictimer.h | 74 + qtinterface/qt4/Qt/qbenchmark.h | 90 + qtinterface/qt4/Qt/qbitarray.h | 174 ++ qtinterface/qt4/Qt/qbitmap.h | 108 + qtinterface/qt4/Qt/qboxlayout.h | 173 ++ qtinterface/qt4/Qt/qbrush.h | 332 +++ qtinterface/qt4/Qt/qbuffer.h | 112 + qtinterface/qt4/Qt/qbuttongroup.h | 112 + qtinterface/qt4/Qt/qbytearray.h | 596 +++++ qtinterface/qt4/Qt/qbytearraymatcher.h | 103 + qtinterface/qt4/Qt/qcache.h | 217 ++ qtinterface/qt4/Qt/qcalendarwidget.h | 204 ++ qtinterface/qt4/Qt/qcdestyle.h | 82 + qtinterface/qt4/Qt/qchar.h | 397 +++ qtinterface/qt4/Qt/qcheckbox.h | 113 + qtinterface/qt4/Qt/qcleanlooksstyle.h | 114 + qtinterface/qt4/Qt/qclipboard.h | 130 + qtinterface/qt4/Qt/qcolor.h | 305 +++ qtinterface/qt4/Qt/qcolordialog.h | 150 ++ qtinterface/qt4/Qt/qcolormap.h | 97 + qtinterface/qt4/Qt/qcolumnview.h | 123 + qtinterface/qt4/Qt/qcombobox.h | 337 +++ qtinterface/qt4/Qt/qcommandlinkbutton.h | 85 + qtinterface/qt4/Qt/qcommonstyle.h | 109 + qtinterface/qt4/Qt/qcompleter.h | 170 ++ qtinterface/qt4/Qt/qconfig-dist.h | 50 + qtinterface/qt4/Qt/qconfig-large.h | 173 ++ qtinterface/qt4/Qt/qconfig-medium.h | 294 +++ qtinterface/qt4/Qt/qconfig-minimal.h | 597 +++++ qtinterface/qt4/Qt/qconfig-small.h | 332 +++ qtinterface/qt4/Qt/qconfig.h | 126 + qtinterface/qt4/Qt/qcontainerfwd.h | 71 + qtinterface/qt4/Qt/qcontiguouscache.h | 454 ++++ qtinterface/qt4/Qt/qcopchannel_qws.h | 108 + qtinterface/qt4/Qt/qcoreapplication.h | 281 +++ qtinterface/qt4/Qt/qcoreevent.h | 389 +++ qtinterface/qt4/Qt/qcryptographichash.h | 84 + qtinterface/qt4/Qt/qcursor.h | 175 ++ qtinterface/qt4/Qt/qdatastream.h | 436 ++++ qtinterface/qt4/Qt/qdatawidgetmapper.h | 128 + qtinterface/qt4/Qt/qdatetime.h | 334 +++ qtinterface/qt4/Qt/qdatetimeedit.h | 232 ++ qtinterface/qt4/Qt/qdbusabstractadaptor.h | 76 + qtinterface/qt4/Qt/qdbusabstractinterface.h | 162 ++ qtinterface/qt4/Qt/qdbusargument.h | 383 +++ qtinterface/qt4/Qt/qdbusconnection.h | 184 ++ qtinterface/qt4/Qt/qdbusconnectioninterface.h | 129 + qtinterface/qt4/Qt/qdbuscontext.h | 84 + qtinterface/qt4/Qt/qdbuserror.h | 123 + qtinterface/qt4/Qt/qdbusextratypes.h | 190 ++ qtinterface/qt4/Qt/qdbusinterface.h | 79 + qtinterface/qt4/Qt/qdbusmacros.h | 73 + qtinterface/qt4/Qt/qdbusmessage.h | 126 + qtinterface/qt4/Qt/qdbusmetatype.h | 97 + qtinterface/qt4/Qt/qdbuspendingcall.h | 122 + qtinterface/qt4/Qt/qdbuspendingreply.h | 214 ++ qtinterface/qt4/Qt/qdbusreply.h | 196 ++ qtinterface/qt4/Qt/qdbusserver.h | 80 + qtinterface/qt4/Qt/qdbusservicewatcher.h | 103 + qtinterface/qt4/Qt/qdebug.h | 284 +++ qtinterface/qt4/Qt/qdecoration_qws.h | 124 + qtinterface/qt4/Qt/qdecorationdefault_qws.h | 101 + qtinterface/qt4/Qt/qdecorationfactory_qws.h | 66 + qtinterface/qt4/Qt/qdecorationplugin_qws.h | 80 + qtinterface/qt4/Qt/qdecorationstyled_qws.h | 73 + qtinterface/qt4/Qt/qdecorationwindows_qws.h | 77 + qtinterface/qt4/Qt/qdesktopservices.h | 91 + qtinterface/qt4/Qt/qdesktopwidget.h | 110 + qtinterface/qt4/Qt/qdial.h | 122 + qtinterface/qt4/Qt/qdialog.h | 140 ++ qtinterface/qt4/Qt/qdialogbuttonbox.h | 168 ++ qtinterface/qt4/Qt/qdir.h | 265 ++ qtinterface/qt4/Qt/qdirectpainter_qws.h | 112 + qtinterface/qt4/Qt/qdiriterator.h | 97 + qtinterface/qt4/Qt/qdirmodel.h | 160 ++ qtinterface/qt4/Qt/qdockwidget.h | 146 ++ qtinterface/qt4/Qt/qdom.h | 681 +++++ qtinterface/qt4/Qt/qdrag.h | 105 + qtinterface/qt4/Qt/qdrawutil.h | 220 ++ qtinterface/qt4/Qt/qeasingcurve.h | 114 + qtinterface/qt4/Qt/qendian.h | 347 +++ qtinterface/qt4/Qt/qerrormessage.h | 88 + qtinterface/qt4/Qt/qevent.h | 883 +++++++ qtinterface/qt4/Qt/qeventloop.h | 101 + qtinterface/qt4/Qt/qeventtransition.h | 95 + qtinterface/qt4/Qt/qfactoryinterface.h | 67 + qtinterface/qt4/Qt/qfeatures.h | 877 +++++++ qtinterface/qt4/Qt/qfile.h | 204 ++ qtinterface/qt4/Qt/qfiledialog.h | 330 +++ qtinterface/qt4/Qt/qfileiconprovider.h | 82 + qtinterface/qt4/Qt/qfileinfo.h | 188 ++ qtinterface/qt4/Qt/qfilesystemmodel.h | 181 ++ qtinterface/qt4/Qt/qfilesystemwatcher.h | 89 + qtinterface/qt4/Qt/qfinalstate.h | 80 + qtinterface/qt4/Qt/qfocusframe.h | 82 + qtinterface/qt4/Qt/qfont.h | 358 +++ qtinterface/qt4/Qt/qfontcombobox.h | 112 + qtinterface/qt4/Qt/qfontdatabase.h | 178 ++ qtinterface/qt4/Qt/qfontdialog.h | 144 ++ qtinterface/qt4/Qt/qfontinfo.h | 88 + qtinterface/qt4/Qt/qfontmetrics.h | 198 ++ qtinterface/qt4/Qt/qformlayout.h | 163 ++ qtinterface/qt4/Qt/qframe.h | 148 ++ qtinterface/qt4/Qt/qfsfileengine.h | 121 + qtinterface/qt4/Qt/qftp.h | 180 ++ qtinterface/qt4/Qt/qfunctions_vxworks.h | 153 ++ qtinterface/qt4/Qt/qfunctions_wince.h | 401 +++ qtinterface/qt4/Qt/qfuture.h | 278 ++ qtinterface/qt4/Qt/qfutureinterface.h | 313 +++ qtinterface/qt4/Qt/qfuturesynchronizer.h | 121 + qtinterface/qt4/Qt/qfuturewatcher.h | 222 ++ qtinterface/qt4/Qt/qgenericmatrix.h | 395 +++ qtinterface/qt4/Qt/qgesture.h | 261 ++ qtinterface/qt4/Qt/qgesturerecognizer.h | 98 + qtinterface/qt4/Qt/qgl.h | 617 +++++ qtinterface/qt4/Qt/qglcolormap.h | 105 + qtinterface/qt4/Qt/qglframebufferobject.h | 175 ++ qtinterface/qt4/Qt/qglobal.h | 2649 ++++++++++++++++++++ qtinterface/qt4/Qt/qglpixelbuffer.h | 121 + qtinterface/qt4/Qt/qglscreen_qws.h | 127 + qtinterface/qt4/Qt/qglshaderprogram.h | 298 +++ qtinterface/qt4/Qt/qgraphicsanchorlayout.h | 128 + qtinterface/qt4/Qt/qgraphicseffect.h | 289 +++ qtinterface/qt4/Qt/qgraphicsgridlayout.h | 143 ++ qtinterface/qt4/Qt/qgraphicsitem.h | 1146 +++++++++ qtinterface/qt4/Qt/qgraphicsitemanimation.h | 120 + qtinterface/qt4/Qt/qgraphicslayout.h | 98 + qtinterface/qt4/Qt/qgraphicslayoutitem.h | 155 ++ qtinterface/qt4/Qt/qgraphicslinearlayout.h | 119 + qtinterface/qt4/Qt/qgraphicsproxywidget.h | 147 ++ qtinterface/qt4/Qt/qgraphicsscene.h | 326 +++ qtinterface/qt4/Qt/qgraphicssceneevent.h | 316 +++ qtinterface/qt4/Qt/qgraphicssvgitem.h | 101 + qtinterface/qt4/Qt/qgraphicstransform.h | 156 ++ qtinterface/qt4/Qt/qgraphicsview.h | 316 +++ qtinterface/qt4/Qt/qgraphicswebview.h | 142 ++ qtinterface/qt4/Qt/qgraphicswidget.h | 249 ++ qtinterface/qt4/Qt/qgridlayout.h | 176 ++ qtinterface/qt4/Qt/qgroupbox.h | 122 + qtinterface/qt4/Qt/qgtkstyle.h | 128 + qtinterface/qt4/Qt/qguifunctions_wince.h | 151 ++ qtinterface/qt4/Qt/qhash.h | 1040 ++++++++ qtinterface/qt4/Qt/qheaderview.h | 250 ++ qtinterface/qt4/Qt/qhelp_global.h | 78 + qtinterface/qt4/Qt/qhelpcontentwidget.h | 146 ++ qtinterface/qt4/Qt/qhelpengine.h | 84 + qtinterface/qt4/Qt/qhelpenginecore.h | 136 + qtinterface/qt4/Qt/qhelpindexwidget.h | 114 + qtinterface/qt4/Qt/qhelpsearchengine.h | 124 + qtinterface/qt4/Qt/qhelpsearchquerywidget.h | 88 + qtinterface/qt4/Qt/qhelpsearchresultwidget.h | 85 + qtinterface/qt4/Qt/qhistorystate.h | 95 + qtinterface/qt4/Qt/qhostaddress.h | 155 ++ qtinterface/qt4/Qt/qhostinfo.h | 102 + qtinterface/qt4/Qt/qhttp.h | 315 +++ qtinterface/qt4/Qt/qicon.h | 154 ++ qtinterface/qt4/Qt/qiconengine.h | 101 + qtinterface/qt4/Qt/qiconengineplugin.h | 104 + qtinterface/qt4/Qt/qiconset.h | 48 + qtinterface/qt4/Qt/qimage.h | 361 +++ qtinterface/qt4/Qt/qimageiohandler.h | 152 ++ qtinterface/qt4/Qt/qimagereader.h | 147 ++ qtinterface/qt4/Qt/qimagewriter.h | 116 + qtinterface/qt4/Qt/qinputcontext.h | 139 + qtinterface/qt4/Qt/qinputcontextfactory.h | 88 + qtinterface/qt4/Qt/qinputcontextplugin.h | 106 + qtinterface/qt4/Qt/qinputdialog.h | 237 ++ qtinterface/qt4/Qt/qiodevice.h | 254 ++ qtinterface/qt4/Qt/qitemdelegate.h | 141 ++ qtinterface/qt4/Qt/qitemeditorfactory.h | 124 + qtinterface/qt4/Qt/qitemselectionmodel.h | 229 ++ qtinterface/qt4/Qt/qiterator.h | 202 ++ qtinterface/qt4/Qt/qkbd_qws.h | 103 + qtinterface/qt4/Qt/qkbddriverfactory_qws.h | 70 + qtinterface/qt4/Qt/qkbddriverplugin_qws.h | 84 + qtinterface/qt4/Qt/qkbdlinuxinput_qws.h | 79 + qtinterface/qt4/Qt/qkbdqnx_qws.h | 76 + qtinterface/qt4/Qt/qkbdtty_qws.h | 79 + qtinterface/qt4/Qt/qkbdum_qws.h | 77 + qtinterface/qt4/Qt/qkbdvfb_qws.h | 86 + qtinterface/qt4/Qt/qkeyeventtransition.h | 88 + qtinterface/qt4/Qt/qkeysequence.h | 233 ++ qtinterface/qt4/Qt/qlabel.h | 175 ++ qtinterface/qt4/Qt/qlayout.h | 245 ++ qtinterface/qt4/Qt/qlayoutitem.h | 182 ++ qtinterface/qt4/Qt/qlcdnumber.h | 144 ++ qtinterface/qt4/Qt/qlibrary.h | 120 + qtinterface/qt4/Qt/qlibraryinfo.h | 93 + qtinterface/qt4/Qt/qline.h | 424 ++++ qtinterface/qt4/Qt/qlineedit.h | 300 +++ qtinterface/qt4/Qt/qlinkedlist.h | 518 ++++ qtinterface/qt4/Qt/qlist.h | 784 ++++++ qtinterface/qt4/Qt/qlistview.h | 203 ++ qtinterface/qt4/Qt/qlistwidget.h | 335 +++ qtinterface/qt4/Qt/qlocale.h | 676 +++++ qtinterface/qt4/Qt/qlocalserver.h | 99 + qtinterface/qt4/Qt/qlocalsocket.h | 158 ++ qtinterface/qt4/Qt/qmaccocoaviewcontainer_mac.h | 73 + qtinterface/qt4/Qt/qmacdefines_mac.h | 192 ++ qtinterface/qt4/Qt/qmacnativewidget_mac.h | 74 + qtinterface/qt4/Qt/qmacstyle_mac.h | 144 ++ qtinterface/qt4/Qt/qmainwindow.h | 219 ++ qtinterface/qt4/Qt/qmap.h | 1066 ++++++++ qtinterface/qt4/Qt/qmargins.h | 147 ++ qtinterface/qt4/Qt/qmath.h | 288 +++ qtinterface/qt4/Qt/qmatrix.h | 206 ++ qtinterface/qt4/Qt/qmatrix4x4.h | 1024 ++++++++ qtinterface/qt4/Qt/qmdiarea.h | 169 ++ qtinterface/qt4/Qt/qmdisubwindow.h | 159 ++ qtinterface/qt4/Qt/qmenu.h | 427 ++++ qtinterface/qt4/Qt/qmenubar.h | 367 +++ qtinterface/qt4/Qt/qmenudata.h | 80 + qtinterface/qt4/Qt/qmessagebox.h | 365 +++ qtinterface/qt4/Qt/qmetaobject.h | 237 ++ qtinterface/qt4/Qt/qmetatype.h | 372 +++ qtinterface/qt4/Qt/qmime.h | 176 ++ qtinterface/qt4/Qt/qmimedata.h | 104 + qtinterface/qt4/Qt/qmotifstyle.h | 128 + qtinterface/qt4/Qt/qmouse_qws.h | 123 + qtinterface/qt4/Qt/qmousedriverfactory_qws.h | 67 + qtinterface/qt4/Qt/qmousedriverplugin_qws.h | 84 + qtinterface/qt4/Qt/qmouseeventtransition.h | 92 + qtinterface/qt4/Qt/qmouselinuxinput_qws.h | 78 + qtinterface/qt4/Qt/qmouselinuxtp_qws.h | 77 + qtinterface/qt4/Qt/qmousepc_qws.h | 76 + qtinterface/qt4/Qt/qmouseqnx_qws.h | 79 + qtinterface/qt4/Qt/qmousetslib_qws.h | 80 + qtinterface/qt4/Qt/qmousevfb_qws.h | 83 + qtinterface/qt4/Qt/qmovie.h | 177 ++ qtinterface/qt4/Qt/qmutex.h | 193 ++ qtinterface/qt4/Qt/qnamespace.h | 1830 ++++++++++++++ qtinterface/qt4/Qt/qnetworkaccessmanager.h | 131 + qtinterface/qt4/Qt/qnetworkcookie.h | 124 + qtinterface/qt4/Qt/qnetworkcookiejar.h | 81 + qtinterface/qt4/Qt/qnetworkdiskcache.h | 97 + qtinterface/qt4/Qt/qnetworkinterface.h | 136 + qtinterface/qt4/Qt/qnetworkproxy.h | 186 ++ qtinterface/qt4/Qt/qnetworkreply.h | 175 ++ qtinterface/qt4/Qt/qnetworkrequest.h | 137 + qtinterface/qt4/Qt/qnumeric.h | 71 + qtinterface/qt4/Qt/qobject.h | 497 ++++ qtinterface/qt4/Qt/qobjectcleanuphandler.h | 78 + qtinterface/qt4/Qt/qobjectdefs.h | 484 ++++ qtinterface/qt4/Qt/qpagesetupdialog.h | 112 + qtinterface/qt4/Qt/qpaintdevice.h | 177 ++ qtinterface/qt4/Qt/qpaintengine.h | 364 +++ qtinterface/qt4/Qt/qpainter.h | 960 +++++++ qtinterface/qt4/Qt/qpainterpath.h | 428 ++++ qtinterface/qt4/Qt/qpair.h | 127 + qtinterface/qt4/Qt/qpalette.h | 262 ++ qtinterface/qt4/Qt/qparallelanimationgroup.h | 86 + qtinterface/qt4/Qt/qpauseanimation.h | 84 + qtinterface/qt4/Qt/qpen.h | 140 ++ qtinterface/qt4/Qt/qpicture.h | 199 ++ qtinterface/qt4/Qt/qpictureformatplugin.h | 94 + qtinterface/qt4/Qt/qpixmap.h | 329 +++ qtinterface/qt4/Qt/qpixmapcache.h | 92 + qtinterface/qt4/Qt/qplaintextedit.h | 327 +++ qtinterface/qt4/Qt/qplastiquestyle.h | 119 + qtinterface/qt4/Qt/qplugin.h | 141 ++ qtinterface/qt4/Qt/qpluginloader.h | 100 + qtinterface/qt4/Qt/qpoint.h | 363 +++ qtinterface/qt4/Qt/qpointer.h | 168 ++ qtinterface/qt4/Qt/qpolygon.h | 186 ++ qtinterface/qt4/Qt/qprintdialog.h | 174 ++ qtinterface/qt4/Qt/qprintengine.h | 117 + qtinterface/qt4/Qt/qprinter.h | 333 +++ qtinterface/qt4/Qt/qprinterinfo.h | 89 + qtinterface/qt4/Qt/qprintpreviewdialog.h | 107 + qtinterface/qt4/Qt/qprintpreviewwidget.h | 127 + qtinterface/qt4/Qt/qprocess.h | 236 ++ qtinterface/qt4/Qt/qprogressbar.h | 130 + qtinterface/qt4/Qt/qprogressdialog.h | 145 ++ qtinterface/qt4/Qt/qpropertyanimation.h | 89 + qtinterface/qt4/Qt/qproxymodel.h | 142 ++ qtinterface/qt4/Qt/qproxystyle.h | 114 + qtinterface/qt4/Qt/qpushbutton.h | 124 + qtinterface/qt4/Qt/qquaternion.h | 328 +++ qtinterface/qt4/Qt/qqueue.h | 69 + qtinterface/qt4/Qt/qradiobutton.h | 88 + qtinterface/qt4/Qt/qreadwritelock.h | 245 ++ qtinterface/qt4/Qt/qrect.h | 858 +++++++ qtinterface/qt4/Qt/qregexp.h | 164 ++ qtinterface/qt4/Qt/qregion.h | 235 ++ qtinterface/qt4/Qt/qresource.h | 104 + qtinterface/qt4/Qt/qrgb.h | 88 + qtinterface/qt4/Qt/qrubberband.h | 104 + qtinterface/qt4/Qt/qrunnable.h | 73 + qtinterface/qt4/Qt/qs60mainapplication.h | 79 + qtinterface/qt4/Qt/qs60mainappui.h | 86 + qtinterface/qt4/Qt/qs60maindocument.h | 80 + qtinterface/qt4/Qt/qs60style.h | 112 + qtinterface/qt4/Qt/qscopedpointer.h | 215 ++ qtinterface/qt4/Qt/qscreen_qws.h | 390 +++ qtinterface/qt4/Qt/qscreendriverfactory_qws.h | 67 + qtinterface/qt4/Qt/qscreendriverplugin_qws.h | 84 + qtinterface/qt4/Qt/qscreenlinuxfb_qws.h | 131 + qtinterface/qt4/Qt/qscreenproxy_qws.h | 153 ++ qtinterface/qt4/Qt/qscreenqnx_qws.h | 82 + qtinterface/qt4/Qt/qscreentransformed_qws.h | 103 + qtinterface/qt4/Qt/qscreenvfb_qws.h | 86 + qtinterface/qt4/Qt/qscriptable.h | 70 + qtinterface/qt4/Qt/qscriptclass.h | 100 + qtinterface/qt4/Qt/qscriptclasspropertyiterator.h | 75 + qtinterface/qt4/Qt/qscriptcontext.h | 104 + qtinterface/qt4/Qt/qscriptcontextinfo.h | 104 + qtinterface/qt4/Qt/qscriptengine.h | 465 ++++ qtinterface/qt4/Qt/qscriptengineagent.h | 91 + qtinterface/qt4/Qt/qscriptenginedebugger.h | 137 + qtinterface/qt4/Qt/qscriptextensioninterface.h | 52 + qtinterface/qt4/Qt/qscriptextensionplugin.h | 58 + qtinterface/qt4/Qt/qscriptprogram.h | 68 + qtinterface/qt4/Qt/qscriptstring.h | 69 + qtinterface/qt4/Qt/qscriptvalue.h | 223 ++ qtinterface/qt4/Qt/qscriptvalueiterator.h | 79 + qtinterface/qt4/Qt/qscrollarea.h | 101 + qtinterface/qt4/Qt/qscrollbar.h | 104 + qtinterface/qt4/Qt/qsemaphore.h | 83 + qtinterface/qt4/Qt/qsequentialanimationgroup.h | 96 + qtinterface/qt4/Qt/qsessionmanager.h | 111 + qtinterface/qt4/Qt/qset.h | 366 +++ qtinterface/qt4/Qt/qsettings.h | 313 +++ qtinterface/qt4/Qt/qshareddata.h | 260 ++ qtinterface/qt4/Qt/qsharedmemory.h | 119 + qtinterface/qt4/Qt/qsharedpointer.h | 155 ++ qtinterface/qt4/Qt/qsharedpointer_impl.h | 805 ++++++ qtinterface/qt4/Qt/qshortcut.h | 107 + qtinterface/qt4/Qt/qsignalmapper.h | 100 + qtinterface/qt4/Qt/qsignalspy.h | 148 ++ qtinterface/qt4/Qt/qsignaltransition.h | 90 + qtinterface/qt4/Qt/qsimplexmlnodemodel.h | 77 + qtinterface/qt4/Qt/qsize.h | 368 +++ qtinterface/qt4/Qt/qsizegrip.h | 95 + qtinterface/qt4/Qt/qsizepolicy.h | 239 ++ qtinterface/qt4/Qt/qslider.h | 134 + qtinterface/qt4/Qt/qsocketnotifier.h | 93 + qtinterface/qt4/Qt/qsortfilterproxymodel.h | 200 ++ qtinterface/qt4/Qt/qsound.h | 95 + qtinterface/qt4/Qt/qsoundqss_qws.h | 177 ++ qtinterface/qt4/Qt/qsourcelocation.h | 101 + qtinterface/qt4/Qt/qspinbox.h | 188 ++ qtinterface/qt4/Qt/qsplashscreen.h | 99 + qtinterface/qt4/Qt/qsplitter.h | 191 ++ qtinterface/qt4/Qt/qsql.h | 113 + qtinterface/qt4/Qt/qsql_db2.h | 124 + qtinterface/qt4/Qt/qsql_ibase.h | 131 + qtinterface/qt4/Qt/qsql_mysql.h | 143 ++ qtinterface/qt4/Qt/qsql_oci.h | 130 + qtinterface/qt4/Qt/qsql_odbc.h | 169 ++ qtinterface/qt4/Qt/qsql_psql.h | 156 ++ qtinterface/qt4/Qt/qsql_sqlite.h | 123 + qtinterface/qt4/Qt/qsql_sqlite2.h | 126 + qtinterface/qt4/Qt/qsql_tds.h | 134 + qtinterface/qt4/Qt/qsqldatabase.h | 161 ++ qtinterface/qt4/Qt/qsqldriver.h | 160 ++ qtinterface/qt4/Qt/qsqldriverplugin.h | 81 + qtinterface/qt4/Qt/qsqlerror.h | 104 + qtinterface/qt4/Qt/qsqlfield.h | 119 + qtinterface/qt4/Qt/qsqlindex.h | 92 + qtinterface/qt4/Qt/qsqlquery.h | 130 + qtinterface/qt4/Qt/qsqlquerymodel.h | 105 + qtinterface/qt4/Qt/qsqlrecord.h | 123 + qtinterface/qt4/Qt/qsqlrelationaldelegate.h | 129 + qtinterface/qt4/Qt/qsqlrelationaltablemodel.h | 112 + qtinterface/qt4/Qt/qsqlresult.h | 153 ++ qtinterface/qt4/Qt/qsqltablemodel.h | 141 ++ qtinterface/qt4/Qt/qssl.h | 88 + qtinterface/qt4/Qt/qsslcertificate.h | 139 + qtinterface/qt4/Qt/qsslcipher.h | 98 + qtinterface/qt4/Qt/qsslconfiguration.h | 137 + qtinterface/qt4/Qt/qsslerror.h | 123 + qtinterface/qt4/Qt/qsslkey.h | 111 + qtinterface/qt4/Qt/qsslsocket.h | 224 ++ qtinterface/qt4/Qt/qstack.h | 82 + qtinterface/qt4/Qt/qstackedlayout.h | 115 + qtinterface/qt4/Qt/qstackedwidget.h | 100 + qtinterface/qt4/Qt/qstandarditemmodel.h | 456 ++++ qtinterface/qt4/Qt/qstate.h | 119 + qtinterface/qt4/Qt/qstatemachine.h | 196 ++ qtinterface/qt4/Qt/qstatusbar.h | 116 + qtinterface/qt4/Qt/qstring.h | 1245 +++++++++ qtinterface/qt4/Qt/qstringbuilder.h | 287 +++ qtinterface/qt4/Qt/qstringlist.h | 259 ++ qtinterface/qt4/Qt/qstringlistmodel.h | 91 + qtinterface/qt4/Qt/qstringmatcher.h | 103 + qtinterface/qt4/Qt/qstyle.h | 887 +++++++ qtinterface/qt4/Qt/qstyleditemdelegate.h | 116 + qtinterface/qt4/Qt/qstylefactory.h | 66 + qtinterface/qt4/Qt/qstyleoption.h | 968 +++++++ qtinterface/qt4/Qt/qstylepainter.h | 112 + qtinterface/qt4/Qt/qstyleplugin.h | 81 + qtinterface/qt4/Qt/qsvggenerator.h | 112 + qtinterface/qt4/Qt/qsvgrenderer.h | 120 + qtinterface/qt4/Qt/qsvgwidget.h | 85 + qtinterface/qt4/Qt/qsymbianevent.h | 104 + qtinterface/qt4/Qt/qsyntaxhighlighter.h | 112 + qtinterface/qt4/Qt/qsystemsemaphore.h | 103 + qtinterface/qt4/Qt/qsystemtrayicon.h | 132 + qtinterface/qt4/Qt/qt_windows.h | 151 ++ qtinterface/qt4/Qt/qtabbar.h | 226 ++ qtinterface/qt4/Qt/qtableview.h | 197 ++ qtinterface/qt4/Qt/qtablewidget.h | 377 +++ qtinterface/qt4/Qt/qtabwidget.h | 252 ++ qtinterface/qt4/Qt/qtconcurrentcompilertest.h | 71 + qtinterface/qt4/Qt/qtconcurrentexception.h | 128 + qtinterface/qt4/Qt/qtconcurrentfilter.h | 736 ++++++ qtinterface/qt4/Qt/qtconcurrentfilterkernel.h | 351 +++ qtinterface/qt4/Qt/qtconcurrentfunctionwrappers.h | 173 ++ qtinterface/qt4/Qt/qtconcurrentiteratekernel.h | 343 +++ qtinterface/qt4/Qt/qtconcurrentmap.h | 780 ++++++ qtinterface/qt4/Qt/qtconcurrentmapkernel.h | 273 ++ qtinterface/qt4/Qt/qtconcurrentmedian.h | 130 + qtinterface/qt4/Qt/qtconcurrentreducekernel.h | 255 ++ qtinterface/qt4/Qt/qtconcurrentresultstore.h | 239 ++ qtinterface/qt4/Qt/qtconcurrentrun.h | 297 +++ qtinterface/qt4/Qt/qtconcurrentrunbase.h | 134 + .../qt4/Qt/qtconcurrentstoredfunctioncall.h | 1328 ++++++++++ qtinterface/qt4/Qt/qtconcurrentthreadengine.h | 285 +++ qtinterface/qt4/Qt/qtcpserver.h | 109 + qtinterface/qt4/Qt/qtcpsocket.h | 75 + qtinterface/qt4/Qt/qtemporaryfile.h | 108 + qtinterface/qt4/Qt/qtest.h | 283 +++ qtinterface/qt4/Qt/qtest_global.h | 92 + qtinterface/qt4/Qt/qtest_gui.h | 118 + qtinterface/qt4/Qt/qtestaccessible.h | 165 ++ qtinterface/qt4/Qt/qtestassert.h | 61 + qtinterface/qt4/Qt/qtestbasicstreamer.h | 91 + qtinterface/qt4/Qt/qtestcase.h | 375 +++ qtinterface/qt4/Qt/qtestcoreelement.h | 172 ++ qtinterface/qt4/Qt/qtestcorelist.h | 136 + qtinterface/qt4/Qt/qtestdata.h | 97 + qtinterface/qt4/Qt/qtestelement.h | 75 + qtinterface/qt4/Qt/qtestelementattribute.h | 111 + qtinterface/qt4/Qt/qtestevent.h | 221 ++ qtinterface/qt4/Qt/qtesteventloop.h | 136 + qtinterface/qt4/Qt/qtestfilelogger.h | 67 + qtinterface/qt4/Qt/qtestkeyboard.h | 194 ++ qtinterface/qt4/Qt/qtestlightxmlstreamer.h | 72 + qtinterface/qt4/Qt/qtestmouse.h | 146 ++ qtinterface/qt4/Qt/qtestspontaneevent.h | 118 + qtinterface/qt4/Qt/qtestsystem.h | 95 + qtinterface/qt4/Qt/qtesttouch.h | 153 ++ qtinterface/qt4/Qt/qtestxmlstreamer.h | 72 + qtinterface/qt4/Qt/qtestxunitstreamer.h | 77 + qtinterface/qt4/Qt/qtextboundaryfinder.h | 114 + qtinterface/qt4/Qt/qtextbrowser.h | 140 ++ qtinterface/qt4/Qt/qtextcodec.h | 197 ++ qtinterface/qt4/Qt/qtextcodecplugin.h | 96 + qtinterface/qt4/Qt/qtextcursor.h | 232 ++ qtinterface/qt4/Qt/qtextdocument.h | 302 +++ qtinterface/qt4/Qt/qtextdocumentfragment.h | 92 + qtinterface/qt4/Qt/qtextdocumentwriter.h | 93 + qtinterface/qt4/Qt/qtextedit.h | 430 ++++ qtinterface/qt4/Qt/qtextformat.h | 914 +++++++ qtinterface/qt4/Qt/qtextlayout.h | 247 ++ qtinterface/qt4/Qt/qtextlist.h | 94 + qtinterface/qt4/Qt/qtextobject.h | 328 +++ qtinterface/qt4/Qt/qtextoption.h | 161 ++ qtinterface/qt4/Qt/qtextstream.h | 376 +++ qtinterface/qt4/Qt/qtexttable.h | 145 ++ qtinterface/qt4/Qt/qthread.h | 166 ++ qtinterface/qt4/Qt/qthreadpool.h | 95 + qtinterface/qt4/Qt/qthreadstorage.h | 157 ++ qtinterface/qt4/Qt/qtimeline.h | 147 ++ qtinterface/qt4/Qt/qtimer.h | 116 + qtinterface/qt4/Qt/qtoolbar.h | 187 ++ qtinterface/qt4/Qt/qtoolbox.h | 148 ++ qtinterface/qt4/Qt/qtoolbutton.h | 199 ++ qtinterface/qt4/Qt/qtooltip.h | 84 + qtinterface/qt4/Qt/qtransform.h | 395 +++ qtinterface/qt4/Qt/qtranslator.h | 98 + qtinterface/qt4/Qt/qtransportauth_qws.h | 281 +++ qtinterface/qt4/Qt/qtransportauthdefs_qws.h | 174 ++ qtinterface/qt4/Qt/qtreeview.h | 239 ++ qtinterface/qt4/Qt/qtreewidget.h | 432 ++++ qtinterface/qt4/Qt/qtreewidgetitemiterator.h | 159 ++ qtinterface/qt4/Qt/qudpsocket.h | 99 + qtinterface/qt4/Qt/qundogroup.h | 110 + qtinterface/qt4/Qt/qundostack.h | 158 ++ qtinterface/qt4/Qt/qundoview.h | 102 + qtinterface/qt4/Qt/qurl.h | 288 +++ qtinterface/qt4/Qt/qurlinfo.h | 131 + qtinterface/qt4/Qt/quuid.h | 190 ++ qtinterface/qt4/Qt/qvalidator.h | 215 ++ qtinterface/qt4/Qt/qvariant.h | 617 +++++ qtinterface/qt4/Qt/qvariantanimation.h | 130 + qtinterface/qt4/Qt/qvarlengtharray.h | 256 ++ qtinterface/qt4/Qt/qvector.h | 800 ++++++ qtinterface/qt4/Qt/qvector2d.h | 260 ++ qtinterface/qt4/Qt/qvector3d.h | 284 +++ qtinterface/qt4/Qt/qvector4d.h | 289 +++ qtinterface/qt4/Qt/qvfbhdr.h | 118 + qtinterface/qt4/Qt/qvideoframe.h | 169 ++ qtinterface/qt4/Qt/qvideosurfaceformat.h | 147 ++ qtinterface/qt4/Qt/qwaitcondition.h | 105 + qtinterface/qt4/Qt/qwebdatabase.h | 59 + qtinterface/qt4/Qt/qwebelement.h | 258 ++ qtinterface/qt4/Qt/qwebframe.h | 235 ++ qtinterface/qt4/Qt/qwebhistory.h | 115 + qtinterface/qt4/Qt/qwebhistoryinterface.h | 42 + qtinterface/qt4/Qt/qwebinspector.h | 55 + qtinterface/qt4/Qt/qwebkitglobal.h | 54 + qtinterface/qt4/Qt/qwebkitversion.h | 32 + qtinterface/qt4/Qt/qwebpage.h | 388 +++ qtinterface/qt4/Qt/qwebpluginfactory.h | 75 + qtinterface/qt4/Qt/qwebsecurityorigin.h | 69 + qtinterface/qt4/Qt/qwebsettings.h | 151 ++ qtinterface/qt4/Qt/qwebview.h | 167 ++ qtinterface/qt4/Qt/qwhatsthis.h | 88 + qtinterface/qt4/Qt/qwidget.h | 1074 ++++++++ qtinterface/qt4/Qt/qwidgetaction.h | 91 + qtinterface/qt4/Qt/qwindowdefs.h | 157 ++ qtinterface/qt4/Qt/qwindowdefs_win.h | 132 + qtinterface/qt4/Qt/qwindowscestyle.h | 103 + qtinterface/qt4/Qt/qwindowsmobilestyle.h | 116 + qtinterface/qt4/Qt/qwindowsstyle.h | 111 + qtinterface/qt4/Qt/qwindowsvistastyle.h | 108 + qtinterface/qt4/Qt/qwindowsxpstyle.h | 107 + qtinterface/qt4/Qt/qwindowsystem_qws.h | 508 ++++ qtinterface/qt4/Qt/qwizard.h | 263 ++ qtinterface/qt4/Qt/qwmatrix.h | 61 + qtinterface/qt4/Qt/qworkspace.h | 137 + qtinterface/qt4/Qt/qwscursor_qws.h | 83 + qtinterface/qt4/Qt/qwsdisplay_qws.h | 185 ++ qtinterface/qt4/Qt/qwsembedwidget.h | 82 + qtinterface/qt4/Qt/qwsevent_qws.h | 459 ++++ qtinterface/qt4/Qt/qwsmanager_qws.h | 122 + qtinterface/qt4/Qt/qwsproperty_qws.h | 96 + qtinterface/qt4/Qt/qwsprotocolitem_qws.h | 100 + qtinterface/qt4/Qt/qwssocket_qws.h | 120 + qtinterface/qt4/Qt/qwsutils_qws.h | 98 + qtinterface/qt4/Qt/qx11embed_x11.h | 132 + qtinterface/qt4/Qt/qx11info_x11.h | 123 + qtinterface/qt4/Qt/qxml.h | 427 ++++ qtinterface/qt4/Qt/qxmlformatter.h | 94 + qtinterface/qt4/Qt/qxmlname.h | 142 ++ qtinterface/qt4/Qt/qxmlnamepool.h | 95 + qtinterface/qt4/Qt/qxmlquery.h | 155 ++ qtinterface/qt4/Qt/qxmlresultitems.h | 77 + qtinterface/qt4/Qt/qxmlschema.h | 97 + qtinterface/qt4/Qt/qxmlschemavalidator.h | 97 + qtinterface/qt4/Qt/qxmlserializer.h | 158 ++ qtinterface/qt4/Qt/qxmlstream.h | 73 + 735 files changed, 145607 insertions(+) create mode 100644 qtinterface/qt4/Qt/Qt3Support create mode 100644 qtinterface/qt4/Qt/QtCore create mode 100644 qtinterface/qt4/Qt/QtDBus create mode 100644 qtinterface/qt4/Qt/QtGui create mode 100644 qtinterface/qt4/Qt/QtHelp create mode 100644 qtinterface/qt4/Qt/QtMultimedia create mode 100644 qtinterface/qt4/Qt/QtNetwork create mode 100644 qtinterface/qt4/Qt/QtOpenGL create mode 100644 qtinterface/qt4/Qt/QtScript create mode 100644 qtinterface/qt4/Qt/QtScriptTools create mode 100644 qtinterface/qt4/Qt/QtSql create mode 100644 qtinterface/qt4/Qt/QtSvg create mode 100644 qtinterface/qt4/Qt/QtTest create mode 100644 qtinterface/qt4/Qt/QtWebKit create mode 100644 qtinterface/qt4/Qt/QtXml create mode 100644 qtinterface/qt4/Qt/QtXmlPatterns create mode 100644 qtinterface/qt4/Qt/q3accel.h create mode 100644 qtinterface/qt4/Qt/q3action.h create mode 100644 qtinterface/qt4/Qt/q3asciicache.h create mode 100644 qtinterface/qt4/Qt/q3asciidict.h create mode 100644 qtinterface/qt4/Qt/q3boxlayout.h create mode 100644 qtinterface/qt4/Qt/q3button.h create mode 100644 qtinterface/qt4/Qt/q3buttongroup.h create mode 100644 qtinterface/qt4/Qt/q3cache.h create mode 100644 qtinterface/qt4/Qt/q3canvas.h create mode 100644 qtinterface/qt4/Qt/q3cleanuphandler.h create mode 100644 qtinterface/qt4/Qt/q3combobox.h create mode 100644 qtinterface/qt4/Qt/q3cstring.h create mode 100644 qtinterface/qt4/Qt/q3databrowser.h create mode 100644 qtinterface/qt4/Qt/q3datatable.h create mode 100644 qtinterface/qt4/Qt/q3dataview.h create mode 100644 qtinterface/qt4/Qt/q3datetimeedit.h create mode 100644 qtinterface/qt4/Qt/q3deepcopy.h create mode 100644 qtinterface/qt4/Qt/q3dict.h create mode 100644 qtinterface/qt4/Qt/q3dns.h create mode 100644 qtinterface/qt4/Qt/q3dockarea.h create mode 100644 qtinterface/qt4/Qt/q3dockwindow.h create mode 100644 qtinterface/qt4/Qt/q3dragobject.h create mode 100644 qtinterface/qt4/Qt/q3dropsite.h create mode 100644 qtinterface/qt4/Qt/q3editorfactory.h create mode 100644 qtinterface/qt4/Qt/q3filedialog.h create mode 100644 qtinterface/qt4/Qt/q3frame.h create mode 100644 qtinterface/qt4/Qt/q3ftp.h create mode 100644 qtinterface/qt4/Qt/q3garray.h create mode 100644 qtinterface/qt4/Qt/q3gcache.h create mode 100644 qtinterface/qt4/Qt/q3gdict.h create mode 100644 qtinterface/qt4/Qt/q3glist.h create mode 100644 qtinterface/qt4/Qt/q3grid.h create mode 100644 qtinterface/qt4/Qt/q3gridlayout.h create mode 100644 qtinterface/qt4/Qt/q3gridview.h create mode 100644 qtinterface/qt4/Qt/q3groupbox.h create mode 100644 qtinterface/qt4/Qt/q3gvector.h create mode 100644 qtinterface/qt4/Qt/q3hbox.h create mode 100644 qtinterface/qt4/Qt/q3header.h create mode 100644 qtinterface/qt4/Qt/q3hgroupbox.h create mode 100644 qtinterface/qt4/Qt/q3http.h create mode 100644 qtinterface/qt4/Qt/q3iconview.h create mode 100644 qtinterface/qt4/Qt/q3intcache.h create mode 100644 qtinterface/qt4/Qt/q3intdict.h create mode 100644 qtinterface/qt4/Qt/q3listbox.h create mode 100644 qtinterface/qt4/Qt/q3listview.h create mode 100644 qtinterface/qt4/Qt/q3localfs.h create mode 100644 qtinterface/qt4/Qt/q3mainwindow.h create mode 100644 qtinterface/qt4/Qt/q3memarray.h create mode 100644 qtinterface/qt4/Qt/q3mimefactory.h create mode 100644 qtinterface/qt4/Qt/q3multilineedit.h create mode 100644 qtinterface/qt4/Qt/q3network.h create mode 100644 qtinterface/qt4/Qt/q3networkprotocol.h create mode 100644 qtinterface/qt4/Qt/q3objectdict.h create mode 100644 qtinterface/qt4/Qt/q3paintdevicemetrics.h create mode 100644 qtinterface/qt4/Qt/q3painter.h create mode 100644 qtinterface/qt4/Qt/q3picture.h create mode 100644 qtinterface/qt4/Qt/q3pointarray.h create mode 100644 qtinterface/qt4/Qt/q3polygonscanner.h create mode 100644 qtinterface/qt4/Qt/q3popupmenu.h create mode 100644 qtinterface/qt4/Qt/q3process.h create mode 100644 qtinterface/qt4/Qt/q3progressbar.h create mode 100644 qtinterface/qt4/Qt/q3progressdialog.h create mode 100644 qtinterface/qt4/Qt/q3ptrcollection.h create mode 100644 qtinterface/qt4/Qt/q3ptrdict.h create mode 100644 qtinterface/qt4/Qt/q3ptrlist.h create mode 100644 qtinterface/qt4/Qt/q3ptrqueue.h create mode 100644 qtinterface/qt4/Qt/q3ptrstack.h create mode 100644 qtinterface/qt4/Qt/q3ptrvector.h create mode 100644 qtinterface/qt4/Qt/q3rangecontrol.h create mode 100644 qtinterface/qt4/Qt/q3scrollview.h create mode 100644 qtinterface/qt4/Qt/q3semaphore.h create mode 100644 qtinterface/qt4/Qt/q3serversocket.h create mode 100644 qtinterface/qt4/Qt/q3shared.h create mode 100644 qtinterface/qt4/Qt/q3signal.h create mode 100644 qtinterface/qt4/Qt/q3simplerichtext.h create mode 100644 qtinterface/qt4/Qt/q3socket.h create mode 100644 qtinterface/qt4/Qt/q3socketdevice.h create mode 100644 qtinterface/qt4/Qt/q3sortedlist.h create mode 100644 qtinterface/qt4/Qt/q3sqlcursor.h create mode 100644 qtinterface/qt4/Qt/q3sqleditorfactory.h create mode 100644 qtinterface/qt4/Qt/q3sqlfieldinfo.h create mode 100644 qtinterface/qt4/Qt/q3sqlform.h create mode 100644 qtinterface/qt4/Qt/q3sqlpropertymap.h create mode 100644 qtinterface/qt4/Qt/q3sqlrecordinfo.h create mode 100644 qtinterface/qt4/Qt/q3sqlselectcursor.h create mode 100644 qtinterface/qt4/Qt/q3strlist.h create mode 100644 qtinterface/qt4/Qt/q3strvec.h create mode 100644 qtinterface/qt4/Qt/q3stylesheet.h create mode 100644 qtinterface/qt4/Qt/q3syntaxhighlighter.h create mode 100644 qtinterface/qt4/Qt/q3tabdialog.h create mode 100644 qtinterface/qt4/Qt/q3table.h create mode 100644 qtinterface/qt4/Qt/q3textbrowser.h create mode 100644 qtinterface/qt4/Qt/q3textedit.h create mode 100644 qtinterface/qt4/Qt/q3textstream.h create mode 100644 qtinterface/qt4/Qt/q3textview.h create mode 100644 qtinterface/qt4/Qt/q3tl.h create mode 100644 qtinterface/qt4/Qt/q3toolbar.h create mode 100644 qtinterface/qt4/Qt/q3url.h create mode 100644 qtinterface/qt4/Qt/q3urloperator.h create mode 100644 qtinterface/qt4/Qt/q3valuelist.h create mode 100644 qtinterface/qt4/Qt/q3valuestack.h create mode 100644 qtinterface/qt4/Qt/q3valuevector.h create mode 100644 qtinterface/qt4/Qt/q3vbox.h create mode 100644 qtinterface/qt4/Qt/q3vgroupbox.h create mode 100644 qtinterface/qt4/Qt/q3whatsthis.h create mode 100644 qtinterface/qt4/Qt/q3widgetstack.h create mode 100644 qtinterface/qt4/Qt/q3wizard.h create mode 100644 qtinterface/qt4/Qt/qabstractanimation.h create mode 100644 qtinterface/qt4/Qt/qabstractbutton.h create mode 100644 qtinterface/qt4/Qt/qabstracteventdispatcher.h create mode 100644 qtinterface/qt4/Qt/qabstractfileengine.h create mode 100644 qtinterface/qt4/Qt/qabstractfontengine_qws.h create mode 100644 qtinterface/qt4/Qt/qabstractitemdelegate.h create mode 100644 qtinterface/qt4/Qt/qabstractitemmodel.h create mode 100644 qtinterface/qt4/Qt/qabstractitemview.h create mode 100644 qtinterface/qt4/Qt/qabstractmessagehandler.h create mode 100644 qtinterface/qt4/Qt/qabstractnetworkcache.h create mode 100644 qtinterface/qt4/Qt/qabstractpagesetupdialog.h create mode 100644 qtinterface/qt4/Qt/qabstractprintdialog.h create mode 100644 qtinterface/qt4/Qt/qabstractproxymodel.h create mode 100644 qtinterface/qt4/Qt/qabstractscrollarea.h create mode 100644 qtinterface/qt4/Qt/qabstractslider.h create mode 100644 qtinterface/qt4/Qt/qabstractsocket.h create mode 100644 qtinterface/qt4/Qt/qabstractspinbox.h create mode 100644 qtinterface/qt4/Qt/qabstractstate.h create mode 100644 qtinterface/qt4/Qt/qabstracttextdocumentlayout.h create mode 100644 qtinterface/qt4/Qt/qabstracttransition.h create mode 100644 qtinterface/qt4/Qt/qabstracturiresolver.h create mode 100644 qtinterface/qt4/Qt/qabstractvideobuffer.h create mode 100644 qtinterface/qt4/Qt/qabstractvideosurface.h create mode 100644 qtinterface/qt4/Qt/qabstractxmlnodemodel.h create mode 100644 qtinterface/qt4/Qt/qabstractxmlreceiver.h create mode 100644 qtinterface/qt4/Qt/qaccessible.h create mode 100644 qtinterface/qt4/Qt/qaccessible2.h create mode 100644 qtinterface/qt4/Qt/qaccessiblebridge.h create mode 100644 qtinterface/qt4/Qt/qaccessibleobject.h create mode 100644 qtinterface/qt4/Qt/qaccessibleplugin.h create mode 100644 qtinterface/qt4/Qt/qaccessiblewidget.h create mode 100644 qtinterface/qt4/Qt/qaction.h create mode 100644 qtinterface/qt4/Qt/qactiongroup.h create mode 100644 qtinterface/qt4/Qt/qalgorithms.h create mode 100644 qtinterface/qt4/Qt/qanimationgroup.h create mode 100644 qtinterface/qt4/Qt/qapplication.h create mode 100644 qtinterface/qt4/Qt/qatomic.h create mode 100644 qtinterface/qt4/Qt/qatomic_alpha.h create mode 100644 qtinterface/qt4/Qt/qatomic_arch.h create mode 100644 qtinterface/qt4/Qt/qatomic_arm.h create mode 100644 qtinterface/qt4/Qt/qatomic_armv6.h create mode 100644 qtinterface/qt4/Qt/qatomic_avr32.h create mode 100644 qtinterface/qt4/Qt/qatomic_bfin.h create mode 100644 qtinterface/qt4/Qt/qatomic_bootstrap.h create mode 100644 qtinterface/qt4/Qt/qatomic_generic.h create mode 100644 qtinterface/qt4/Qt/qatomic_i386.h create mode 100644 qtinterface/qt4/Qt/qatomic_ia64.h create mode 100644 qtinterface/qt4/Qt/qatomic_macosx.h create mode 100644 qtinterface/qt4/Qt/qatomic_mips.h create mode 100644 qtinterface/qt4/Qt/qatomic_parisc.h create mode 100644 qtinterface/qt4/Qt/qatomic_powerpc.h create mode 100644 qtinterface/qt4/Qt/qatomic_s390.h create mode 100644 qtinterface/qt4/Qt/qatomic_sh.h create mode 100644 qtinterface/qt4/Qt/qatomic_sh4a.h create mode 100644 qtinterface/qt4/Qt/qatomic_sparc.h create mode 100644 qtinterface/qt4/Qt/qatomic_symbian.h create mode 100644 qtinterface/qt4/Qt/qatomic_vxworks.h create mode 100644 qtinterface/qt4/Qt/qatomic_windows.h create mode 100644 qtinterface/qt4/Qt/qatomic_windowsce.h create mode 100644 qtinterface/qt4/Qt/qatomic_x86_64.h create mode 100644 qtinterface/qt4/Qt/qaudio.h create mode 100644 qtinterface/qt4/Qt/qaudiodeviceinfo.h create mode 100644 qtinterface/qt4/Qt/qaudioengine.h create mode 100644 qtinterface/qt4/Qt/qaudioengineplugin.h create mode 100644 qtinterface/qt4/Qt/qaudioformat.h create mode 100644 qtinterface/qt4/Qt/qaudioinput.h create mode 100644 qtinterface/qt4/Qt/qaudiooutput.h create mode 100644 qtinterface/qt4/Qt/qauthenticator.h create mode 100644 qtinterface/qt4/Qt/qbasicatomic.h create mode 100644 qtinterface/qt4/Qt/qbasictimer.h create mode 100644 qtinterface/qt4/Qt/qbenchmark.h create mode 100644 qtinterface/qt4/Qt/qbitarray.h create mode 100644 qtinterface/qt4/Qt/qbitmap.h create mode 100644 qtinterface/qt4/Qt/qboxlayout.h create mode 100644 qtinterface/qt4/Qt/qbrush.h create mode 100644 qtinterface/qt4/Qt/qbuffer.h create mode 100644 qtinterface/qt4/Qt/qbuttongroup.h create mode 100644 qtinterface/qt4/Qt/qbytearray.h create mode 100644 qtinterface/qt4/Qt/qbytearraymatcher.h create mode 100644 qtinterface/qt4/Qt/qcache.h create mode 100644 qtinterface/qt4/Qt/qcalendarwidget.h create mode 100644 qtinterface/qt4/Qt/qcdestyle.h create mode 100644 qtinterface/qt4/Qt/qchar.h create mode 100644 qtinterface/qt4/Qt/qcheckbox.h create mode 100644 qtinterface/qt4/Qt/qcleanlooksstyle.h create mode 100644 qtinterface/qt4/Qt/qclipboard.h create mode 100644 qtinterface/qt4/Qt/qcolor.h create mode 100644 qtinterface/qt4/Qt/qcolordialog.h create mode 100644 qtinterface/qt4/Qt/qcolormap.h create mode 100644 qtinterface/qt4/Qt/qcolumnview.h create mode 100644 qtinterface/qt4/Qt/qcombobox.h create mode 100644 qtinterface/qt4/Qt/qcommandlinkbutton.h create mode 100644 qtinterface/qt4/Qt/qcommonstyle.h create mode 100644 qtinterface/qt4/Qt/qcompleter.h create mode 100644 qtinterface/qt4/Qt/qconfig-dist.h create mode 100644 qtinterface/qt4/Qt/qconfig-large.h create mode 100644 qtinterface/qt4/Qt/qconfig-medium.h create mode 100644 qtinterface/qt4/Qt/qconfig-minimal.h create mode 100644 qtinterface/qt4/Qt/qconfig-small.h create mode 100644 qtinterface/qt4/Qt/qconfig.h create mode 100644 qtinterface/qt4/Qt/qcontainerfwd.h create mode 100644 qtinterface/qt4/Qt/qcontiguouscache.h create mode 100644 qtinterface/qt4/Qt/qcopchannel_qws.h create mode 100644 qtinterface/qt4/Qt/qcoreapplication.h create mode 100644 qtinterface/qt4/Qt/qcoreevent.h create mode 100644 qtinterface/qt4/Qt/qcryptographichash.h create mode 100644 qtinterface/qt4/Qt/qcursor.h create mode 100644 qtinterface/qt4/Qt/qdatastream.h create mode 100644 qtinterface/qt4/Qt/qdatawidgetmapper.h create mode 100644 qtinterface/qt4/Qt/qdatetime.h create mode 100644 qtinterface/qt4/Qt/qdatetimeedit.h create mode 100644 qtinterface/qt4/Qt/qdbusabstractadaptor.h create mode 100644 qtinterface/qt4/Qt/qdbusabstractinterface.h create mode 100644 qtinterface/qt4/Qt/qdbusargument.h create mode 100644 qtinterface/qt4/Qt/qdbusconnection.h create mode 100644 qtinterface/qt4/Qt/qdbusconnectioninterface.h create mode 100644 qtinterface/qt4/Qt/qdbuscontext.h create mode 100644 qtinterface/qt4/Qt/qdbuserror.h create mode 100644 qtinterface/qt4/Qt/qdbusextratypes.h create mode 100644 qtinterface/qt4/Qt/qdbusinterface.h create mode 100644 qtinterface/qt4/Qt/qdbusmacros.h create mode 100644 qtinterface/qt4/Qt/qdbusmessage.h create mode 100644 qtinterface/qt4/Qt/qdbusmetatype.h create mode 100644 qtinterface/qt4/Qt/qdbuspendingcall.h create mode 100644 qtinterface/qt4/Qt/qdbuspendingreply.h create mode 100644 qtinterface/qt4/Qt/qdbusreply.h create mode 100644 qtinterface/qt4/Qt/qdbusserver.h create mode 100644 qtinterface/qt4/Qt/qdbusservicewatcher.h create mode 100644 qtinterface/qt4/Qt/qdebug.h create mode 100644 qtinterface/qt4/Qt/qdecoration_qws.h create mode 100644 qtinterface/qt4/Qt/qdecorationdefault_qws.h create mode 100644 qtinterface/qt4/Qt/qdecorationfactory_qws.h create mode 100644 qtinterface/qt4/Qt/qdecorationplugin_qws.h create mode 100644 qtinterface/qt4/Qt/qdecorationstyled_qws.h create mode 100644 qtinterface/qt4/Qt/qdecorationwindows_qws.h create mode 100644 qtinterface/qt4/Qt/qdesktopservices.h create mode 100644 qtinterface/qt4/Qt/qdesktopwidget.h create mode 100644 qtinterface/qt4/Qt/qdial.h create mode 100644 qtinterface/qt4/Qt/qdialog.h create mode 100644 qtinterface/qt4/Qt/qdialogbuttonbox.h create mode 100644 qtinterface/qt4/Qt/qdir.h create mode 100644 qtinterface/qt4/Qt/qdirectpainter_qws.h create mode 100644 qtinterface/qt4/Qt/qdiriterator.h create mode 100644 qtinterface/qt4/Qt/qdirmodel.h create mode 100644 qtinterface/qt4/Qt/qdockwidget.h create mode 100644 qtinterface/qt4/Qt/qdom.h create mode 100644 qtinterface/qt4/Qt/qdrag.h create mode 100644 qtinterface/qt4/Qt/qdrawutil.h create mode 100644 qtinterface/qt4/Qt/qeasingcurve.h create mode 100644 qtinterface/qt4/Qt/qendian.h create mode 100644 qtinterface/qt4/Qt/qerrormessage.h create mode 100644 qtinterface/qt4/Qt/qevent.h create mode 100644 qtinterface/qt4/Qt/qeventloop.h create mode 100644 qtinterface/qt4/Qt/qeventtransition.h create mode 100644 qtinterface/qt4/Qt/qfactoryinterface.h create mode 100644 qtinterface/qt4/Qt/qfeatures.h create mode 100644 qtinterface/qt4/Qt/qfile.h create mode 100644 qtinterface/qt4/Qt/qfiledialog.h create mode 100644 qtinterface/qt4/Qt/qfileiconprovider.h create mode 100644 qtinterface/qt4/Qt/qfileinfo.h create mode 100644 qtinterface/qt4/Qt/qfilesystemmodel.h create mode 100644 qtinterface/qt4/Qt/qfilesystemwatcher.h create mode 100644 qtinterface/qt4/Qt/qfinalstate.h create mode 100644 qtinterface/qt4/Qt/qfocusframe.h create mode 100644 qtinterface/qt4/Qt/qfont.h create mode 100644 qtinterface/qt4/Qt/qfontcombobox.h create mode 100644 qtinterface/qt4/Qt/qfontdatabase.h create mode 100644 qtinterface/qt4/Qt/qfontdialog.h create mode 100644 qtinterface/qt4/Qt/qfontinfo.h create mode 100644 qtinterface/qt4/Qt/qfontmetrics.h create mode 100644 qtinterface/qt4/Qt/qformlayout.h create mode 100644 qtinterface/qt4/Qt/qframe.h create mode 100644 qtinterface/qt4/Qt/qfsfileengine.h create mode 100644 qtinterface/qt4/Qt/qftp.h create mode 100644 qtinterface/qt4/Qt/qfunctions_vxworks.h create mode 100644 qtinterface/qt4/Qt/qfunctions_wince.h create mode 100644 qtinterface/qt4/Qt/qfuture.h create mode 100644 qtinterface/qt4/Qt/qfutureinterface.h create mode 100644 qtinterface/qt4/Qt/qfuturesynchronizer.h create mode 100644 qtinterface/qt4/Qt/qfuturewatcher.h create mode 100644 qtinterface/qt4/Qt/qgenericmatrix.h create mode 100644 qtinterface/qt4/Qt/qgesture.h create mode 100644 qtinterface/qt4/Qt/qgesturerecognizer.h create mode 100644 qtinterface/qt4/Qt/qgl.h create mode 100644 qtinterface/qt4/Qt/qglcolormap.h create mode 100644 qtinterface/qt4/Qt/qglframebufferobject.h create mode 100644 qtinterface/qt4/Qt/qglobal.h create mode 100644 qtinterface/qt4/Qt/qglpixelbuffer.h create mode 100644 qtinterface/qt4/Qt/qglscreen_qws.h create mode 100644 qtinterface/qt4/Qt/qglshaderprogram.h create mode 100644 qtinterface/qt4/Qt/qgraphicsanchorlayout.h create mode 100644 qtinterface/qt4/Qt/qgraphicseffect.h create mode 100644 qtinterface/qt4/Qt/qgraphicsgridlayout.h create mode 100644 qtinterface/qt4/Qt/qgraphicsitem.h create mode 100644 qtinterface/qt4/Qt/qgraphicsitemanimation.h create mode 100644 qtinterface/qt4/Qt/qgraphicslayout.h create mode 100644 qtinterface/qt4/Qt/qgraphicslayoutitem.h create mode 100644 qtinterface/qt4/Qt/qgraphicslinearlayout.h create mode 100644 qtinterface/qt4/Qt/qgraphicsproxywidget.h create mode 100644 qtinterface/qt4/Qt/qgraphicsscene.h create mode 100644 qtinterface/qt4/Qt/qgraphicssceneevent.h create mode 100644 qtinterface/qt4/Qt/qgraphicssvgitem.h create mode 100644 qtinterface/qt4/Qt/qgraphicstransform.h create mode 100644 qtinterface/qt4/Qt/qgraphicsview.h create mode 100644 qtinterface/qt4/Qt/qgraphicswebview.h create mode 100644 qtinterface/qt4/Qt/qgraphicswidget.h create mode 100644 qtinterface/qt4/Qt/qgridlayout.h create mode 100644 qtinterface/qt4/Qt/qgroupbox.h create mode 100644 qtinterface/qt4/Qt/qgtkstyle.h create mode 100644 qtinterface/qt4/Qt/qguifunctions_wince.h create mode 100644 qtinterface/qt4/Qt/qhash.h create mode 100644 qtinterface/qt4/Qt/qheaderview.h create mode 100644 qtinterface/qt4/Qt/qhelp_global.h create mode 100644 qtinterface/qt4/Qt/qhelpcontentwidget.h create mode 100644 qtinterface/qt4/Qt/qhelpengine.h create mode 100644 qtinterface/qt4/Qt/qhelpenginecore.h create mode 100644 qtinterface/qt4/Qt/qhelpindexwidget.h create mode 100644 qtinterface/qt4/Qt/qhelpsearchengine.h create mode 100644 qtinterface/qt4/Qt/qhelpsearchquerywidget.h create mode 100644 qtinterface/qt4/Qt/qhelpsearchresultwidget.h create mode 100644 qtinterface/qt4/Qt/qhistorystate.h create mode 100644 qtinterface/qt4/Qt/qhostaddress.h create mode 100644 qtinterface/qt4/Qt/qhostinfo.h create mode 100644 qtinterface/qt4/Qt/qhttp.h create mode 100644 qtinterface/qt4/Qt/qicon.h create mode 100644 qtinterface/qt4/Qt/qiconengine.h create mode 100644 qtinterface/qt4/Qt/qiconengineplugin.h create mode 100644 qtinterface/qt4/Qt/qiconset.h create mode 100644 qtinterface/qt4/Qt/qimage.h create mode 100644 qtinterface/qt4/Qt/qimageiohandler.h create mode 100644 qtinterface/qt4/Qt/qimagereader.h create mode 100644 qtinterface/qt4/Qt/qimagewriter.h create mode 100644 qtinterface/qt4/Qt/qinputcontext.h create mode 100644 qtinterface/qt4/Qt/qinputcontextfactory.h create mode 100644 qtinterface/qt4/Qt/qinputcontextplugin.h create mode 100644 qtinterface/qt4/Qt/qinputdialog.h create mode 100644 qtinterface/qt4/Qt/qiodevice.h create mode 100644 qtinterface/qt4/Qt/qitemdelegate.h create mode 100644 qtinterface/qt4/Qt/qitemeditorfactory.h create mode 100644 qtinterface/qt4/Qt/qitemselectionmodel.h create mode 100644 qtinterface/qt4/Qt/qiterator.h create mode 100644 qtinterface/qt4/Qt/qkbd_qws.h create mode 100644 qtinterface/qt4/Qt/qkbddriverfactory_qws.h create mode 100644 qtinterface/qt4/Qt/qkbddriverplugin_qws.h create mode 100644 qtinterface/qt4/Qt/qkbdlinuxinput_qws.h create mode 100644 qtinterface/qt4/Qt/qkbdqnx_qws.h create mode 100644 qtinterface/qt4/Qt/qkbdtty_qws.h create mode 100644 qtinterface/qt4/Qt/qkbdum_qws.h create mode 100644 qtinterface/qt4/Qt/qkbdvfb_qws.h create mode 100644 qtinterface/qt4/Qt/qkeyeventtransition.h create mode 100644 qtinterface/qt4/Qt/qkeysequence.h create mode 100644 qtinterface/qt4/Qt/qlabel.h create mode 100644 qtinterface/qt4/Qt/qlayout.h create mode 100644 qtinterface/qt4/Qt/qlayoutitem.h create mode 100644 qtinterface/qt4/Qt/qlcdnumber.h create mode 100644 qtinterface/qt4/Qt/qlibrary.h create mode 100644 qtinterface/qt4/Qt/qlibraryinfo.h create mode 100644 qtinterface/qt4/Qt/qline.h create mode 100644 qtinterface/qt4/Qt/qlineedit.h create mode 100644 qtinterface/qt4/Qt/qlinkedlist.h create mode 100644 qtinterface/qt4/Qt/qlist.h create mode 100644 qtinterface/qt4/Qt/qlistview.h create mode 100644 qtinterface/qt4/Qt/qlistwidget.h create mode 100644 qtinterface/qt4/Qt/qlocale.h create mode 100644 qtinterface/qt4/Qt/qlocalserver.h create mode 100644 qtinterface/qt4/Qt/qlocalsocket.h create mode 100644 qtinterface/qt4/Qt/qmaccocoaviewcontainer_mac.h create mode 100644 qtinterface/qt4/Qt/qmacdefines_mac.h create mode 100644 qtinterface/qt4/Qt/qmacnativewidget_mac.h create mode 100644 qtinterface/qt4/Qt/qmacstyle_mac.h create mode 100644 qtinterface/qt4/Qt/qmainwindow.h create mode 100644 qtinterface/qt4/Qt/qmap.h create mode 100644 qtinterface/qt4/Qt/qmargins.h create mode 100644 qtinterface/qt4/Qt/qmath.h create mode 100644 qtinterface/qt4/Qt/qmatrix.h create mode 100644 qtinterface/qt4/Qt/qmatrix4x4.h create mode 100644 qtinterface/qt4/Qt/qmdiarea.h create mode 100644 qtinterface/qt4/Qt/qmdisubwindow.h create mode 100644 qtinterface/qt4/Qt/qmenu.h create mode 100644 qtinterface/qt4/Qt/qmenubar.h create mode 100644 qtinterface/qt4/Qt/qmenudata.h create mode 100644 qtinterface/qt4/Qt/qmessagebox.h create mode 100644 qtinterface/qt4/Qt/qmetaobject.h create mode 100644 qtinterface/qt4/Qt/qmetatype.h create mode 100644 qtinterface/qt4/Qt/qmime.h create mode 100644 qtinterface/qt4/Qt/qmimedata.h create mode 100644 qtinterface/qt4/Qt/qmotifstyle.h create mode 100644 qtinterface/qt4/Qt/qmouse_qws.h create mode 100644 qtinterface/qt4/Qt/qmousedriverfactory_qws.h create mode 100644 qtinterface/qt4/Qt/qmousedriverplugin_qws.h create mode 100644 qtinterface/qt4/Qt/qmouseeventtransition.h create mode 100644 qtinterface/qt4/Qt/qmouselinuxinput_qws.h create mode 100644 qtinterface/qt4/Qt/qmouselinuxtp_qws.h create mode 100644 qtinterface/qt4/Qt/qmousepc_qws.h create mode 100644 qtinterface/qt4/Qt/qmouseqnx_qws.h create mode 100644 qtinterface/qt4/Qt/qmousetslib_qws.h create mode 100644 qtinterface/qt4/Qt/qmousevfb_qws.h create mode 100644 qtinterface/qt4/Qt/qmovie.h create mode 100644 qtinterface/qt4/Qt/qmutex.h create mode 100644 qtinterface/qt4/Qt/qnamespace.h create mode 100644 qtinterface/qt4/Qt/qnetworkaccessmanager.h create mode 100644 qtinterface/qt4/Qt/qnetworkcookie.h create mode 100644 qtinterface/qt4/Qt/qnetworkcookiejar.h create mode 100644 qtinterface/qt4/Qt/qnetworkdiskcache.h create mode 100644 qtinterface/qt4/Qt/qnetworkinterface.h create mode 100644 qtinterface/qt4/Qt/qnetworkproxy.h create mode 100644 qtinterface/qt4/Qt/qnetworkreply.h create mode 100644 qtinterface/qt4/Qt/qnetworkrequest.h create mode 100644 qtinterface/qt4/Qt/qnumeric.h create mode 100644 qtinterface/qt4/Qt/qobject.h create mode 100644 qtinterface/qt4/Qt/qobjectcleanuphandler.h create mode 100644 qtinterface/qt4/Qt/qobjectdefs.h create mode 100644 qtinterface/qt4/Qt/qpagesetupdialog.h create mode 100644 qtinterface/qt4/Qt/qpaintdevice.h create mode 100644 qtinterface/qt4/Qt/qpaintengine.h create mode 100644 qtinterface/qt4/Qt/qpainter.h create mode 100644 qtinterface/qt4/Qt/qpainterpath.h create mode 100644 qtinterface/qt4/Qt/qpair.h create mode 100644 qtinterface/qt4/Qt/qpalette.h create mode 100644 qtinterface/qt4/Qt/qparallelanimationgroup.h create mode 100644 qtinterface/qt4/Qt/qpauseanimation.h create mode 100644 qtinterface/qt4/Qt/qpen.h create mode 100644 qtinterface/qt4/Qt/qpicture.h create mode 100644 qtinterface/qt4/Qt/qpictureformatplugin.h create mode 100644 qtinterface/qt4/Qt/qpixmap.h create mode 100644 qtinterface/qt4/Qt/qpixmapcache.h create mode 100644 qtinterface/qt4/Qt/qplaintextedit.h create mode 100644 qtinterface/qt4/Qt/qplastiquestyle.h create mode 100644 qtinterface/qt4/Qt/qplugin.h create mode 100644 qtinterface/qt4/Qt/qpluginloader.h create mode 100644 qtinterface/qt4/Qt/qpoint.h create mode 100644 qtinterface/qt4/Qt/qpointer.h create mode 100644 qtinterface/qt4/Qt/qpolygon.h create mode 100644 qtinterface/qt4/Qt/qprintdialog.h create mode 100644 qtinterface/qt4/Qt/qprintengine.h create mode 100644 qtinterface/qt4/Qt/qprinter.h create mode 100644 qtinterface/qt4/Qt/qprinterinfo.h create mode 100644 qtinterface/qt4/Qt/qprintpreviewdialog.h create mode 100644 qtinterface/qt4/Qt/qprintpreviewwidget.h create mode 100644 qtinterface/qt4/Qt/qprocess.h create mode 100644 qtinterface/qt4/Qt/qprogressbar.h create mode 100644 qtinterface/qt4/Qt/qprogressdialog.h create mode 100644 qtinterface/qt4/Qt/qpropertyanimation.h create mode 100644 qtinterface/qt4/Qt/qproxymodel.h create mode 100644 qtinterface/qt4/Qt/qproxystyle.h create mode 100644 qtinterface/qt4/Qt/qpushbutton.h create mode 100644 qtinterface/qt4/Qt/qquaternion.h create mode 100644 qtinterface/qt4/Qt/qqueue.h create mode 100644 qtinterface/qt4/Qt/qradiobutton.h create mode 100644 qtinterface/qt4/Qt/qreadwritelock.h create mode 100644 qtinterface/qt4/Qt/qrect.h create mode 100644 qtinterface/qt4/Qt/qregexp.h create mode 100644 qtinterface/qt4/Qt/qregion.h create mode 100644 qtinterface/qt4/Qt/qresource.h create mode 100644 qtinterface/qt4/Qt/qrgb.h create mode 100644 qtinterface/qt4/Qt/qrubberband.h create mode 100644 qtinterface/qt4/Qt/qrunnable.h create mode 100644 qtinterface/qt4/Qt/qs60mainapplication.h create mode 100644 qtinterface/qt4/Qt/qs60mainappui.h create mode 100644 qtinterface/qt4/Qt/qs60maindocument.h create mode 100644 qtinterface/qt4/Qt/qs60style.h create mode 100644 qtinterface/qt4/Qt/qscopedpointer.h create mode 100644 qtinterface/qt4/Qt/qscreen_qws.h create mode 100644 qtinterface/qt4/Qt/qscreendriverfactory_qws.h create mode 100644 qtinterface/qt4/Qt/qscreendriverplugin_qws.h create mode 100644 qtinterface/qt4/Qt/qscreenlinuxfb_qws.h create mode 100644 qtinterface/qt4/Qt/qscreenproxy_qws.h create mode 100644 qtinterface/qt4/Qt/qscreenqnx_qws.h create mode 100644 qtinterface/qt4/Qt/qscreentransformed_qws.h create mode 100644 qtinterface/qt4/Qt/qscreenvfb_qws.h create mode 100644 qtinterface/qt4/Qt/qscriptable.h create mode 100644 qtinterface/qt4/Qt/qscriptclass.h create mode 100644 qtinterface/qt4/Qt/qscriptclasspropertyiterator.h create mode 100644 qtinterface/qt4/Qt/qscriptcontext.h create mode 100644 qtinterface/qt4/Qt/qscriptcontextinfo.h create mode 100644 qtinterface/qt4/Qt/qscriptengine.h create mode 100644 qtinterface/qt4/Qt/qscriptengineagent.h create mode 100644 qtinterface/qt4/Qt/qscriptenginedebugger.h create mode 100644 qtinterface/qt4/Qt/qscriptextensioninterface.h create mode 100644 qtinterface/qt4/Qt/qscriptextensionplugin.h create mode 100644 qtinterface/qt4/Qt/qscriptprogram.h create mode 100644 qtinterface/qt4/Qt/qscriptstring.h create mode 100644 qtinterface/qt4/Qt/qscriptvalue.h create mode 100644 qtinterface/qt4/Qt/qscriptvalueiterator.h create mode 100644 qtinterface/qt4/Qt/qscrollarea.h create mode 100644 qtinterface/qt4/Qt/qscrollbar.h create mode 100644 qtinterface/qt4/Qt/qsemaphore.h create mode 100644 qtinterface/qt4/Qt/qsequentialanimationgroup.h create mode 100644 qtinterface/qt4/Qt/qsessionmanager.h create mode 100644 qtinterface/qt4/Qt/qset.h create mode 100644 qtinterface/qt4/Qt/qsettings.h create mode 100644 qtinterface/qt4/Qt/qshareddata.h create mode 100644 qtinterface/qt4/Qt/qsharedmemory.h create mode 100644 qtinterface/qt4/Qt/qsharedpointer.h create mode 100644 qtinterface/qt4/Qt/qsharedpointer_impl.h create mode 100644 qtinterface/qt4/Qt/qshortcut.h create mode 100644 qtinterface/qt4/Qt/qsignalmapper.h create mode 100644 qtinterface/qt4/Qt/qsignalspy.h create mode 100644 qtinterface/qt4/Qt/qsignaltransition.h create mode 100644 qtinterface/qt4/Qt/qsimplexmlnodemodel.h create mode 100644 qtinterface/qt4/Qt/qsize.h create mode 100644 qtinterface/qt4/Qt/qsizegrip.h create mode 100644 qtinterface/qt4/Qt/qsizepolicy.h create mode 100644 qtinterface/qt4/Qt/qslider.h create mode 100644 qtinterface/qt4/Qt/qsocketnotifier.h create mode 100644 qtinterface/qt4/Qt/qsortfilterproxymodel.h create mode 100644 qtinterface/qt4/Qt/qsound.h create mode 100644 qtinterface/qt4/Qt/qsoundqss_qws.h create mode 100644 qtinterface/qt4/Qt/qsourcelocation.h create mode 100644 qtinterface/qt4/Qt/qspinbox.h create mode 100644 qtinterface/qt4/Qt/qsplashscreen.h create mode 100644 qtinterface/qt4/Qt/qsplitter.h create mode 100644 qtinterface/qt4/Qt/qsql.h create mode 100644 qtinterface/qt4/Qt/qsql_db2.h create mode 100644 qtinterface/qt4/Qt/qsql_ibase.h create mode 100644 qtinterface/qt4/Qt/qsql_mysql.h create mode 100644 qtinterface/qt4/Qt/qsql_oci.h create mode 100644 qtinterface/qt4/Qt/qsql_odbc.h create mode 100644 qtinterface/qt4/Qt/qsql_psql.h create mode 100644 qtinterface/qt4/Qt/qsql_sqlite.h create mode 100644 qtinterface/qt4/Qt/qsql_sqlite2.h create mode 100644 qtinterface/qt4/Qt/qsql_tds.h create mode 100644 qtinterface/qt4/Qt/qsqldatabase.h create mode 100644 qtinterface/qt4/Qt/qsqldriver.h create mode 100644 qtinterface/qt4/Qt/qsqldriverplugin.h create mode 100644 qtinterface/qt4/Qt/qsqlerror.h create mode 100644 qtinterface/qt4/Qt/qsqlfield.h create mode 100644 qtinterface/qt4/Qt/qsqlindex.h create mode 100644 qtinterface/qt4/Qt/qsqlquery.h create mode 100644 qtinterface/qt4/Qt/qsqlquerymodel.h create mode 100644 qtinterface/qt4/Qt/qsqlrecord.h create mode 100644 qtinterface/qt4/Qt/qsqlrelationaldelegate.h create mode 100644 qtinterface/qt4/Qt/qsqlrelationaltablemodel.h create mode 100644 qtinterface/qt4/Qt/qsqlresult.h create mode 100644 qtinterface/qt4/Qt/qsqltablemodel.h create mode 100644 qtinterface/qt4/Qt/qssl.h create mode 100644 qtinterface/qt4/Qt/qsslcertificate.h create mode 100644 qtinterface/qt4/Qt/qsslcipher.h create mode 100644 qtinterface/qt4/Qt/qsslconfiguration.h create mode 100644 qtinterface/qt4/Qt/qsslerror.h create mode 100644 qtinterface/qt4/Qt/qsslkey.h create mode 100644 qtinterface/qt4/Qt/qsslsocket.h create mode 100644 qtinterface/qt4/Qt/qstack.h create mode 100644 qtinterface/qt4/Qt/qstackedlayout.h create mode 100644 qtinterface/qt4/Qt/qstackedwidget.h create mode 100644 qtinterface/qt4/Qt/qstandarditemmodel.h create mode 100644 qtinterface/qt4/Qt/qstate.h create mode 100644 qtinterface/qt4/Qt/qstatemachine.h create mode 100644 qtinterface/qt4/Qt/qstatusbar.h create mode 100644 qtinterface/qt4/Qt/qstring.h create mode 100644 qtinterface/qt4/Qt/qstringbuilder.h create mode 100644 qtinterface/qt4/Qt/qstringlist.h create mode 100644 qtinterface/qt4/Qt/qstringlistmodel.h create mode 100644 qtinterface/qt4/Qt/qstringmatcher.h create mode 100644 qtinterface/qt4/Qt/qstyle.h create mode 100644 qtinterface/qt4/Qt/qstyleditemdelegate.h create mode 100644 qtinterface/qt4/Qt/qstylefactory.h create mode 100644 qtinterface/qt4/Qt/qstyleoption.h create mode 100644 qtinterface/qt4/Qt/qstylepainter.h create mode 100644 qtinterface/qt4/Qt/qstyleplugin.h create mode 100644 qtinterface/qt4/Qt/qsvggenerator.h create mode 100644 qtinterface/qt4/Qt/qsvgrenderer.h create mode 100644 qtinterface/qt4/Qt/qsvgwidget.h create mode 100644 qtinterface/qt4/Qt/qsymbianevent.h create mode 100644 qtinterface/qt4/Qt/qsyntaxhighlighter.h create mode 100644 qtinterface/qt4/Qt/qsystemsemaphore.h create mode 100644 qtinterface/qt4/Qt/qsystemtrayicon.h create mode 100644 qtinterface/qt4/Qt/qt_windows.h create mode 100644 qtinterface/qt4/Qt/qtabbar.h create mode 100644 qtinterface/qt4/Qt/qtableview.h create mode 100644 qtinterface/qt4/Qt/qtablewidget.h create mode 100644 qtinterface/qt4/Qt/qtabwidget.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentcompilertest.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentexception.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentfilter.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentfilterkernel.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentfunctionwrappers.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentiteratekernel.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentmap.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentmapkernel.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentmedian.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentreducekernel.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentresultstore.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentrun.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentrunbase.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentstoredfunctioncall.h create mode 100644 qtinterface/qt4/Qt/qtconcurrentthreadengine.h create mode 100644 qtinterface/qt4/Qt/qtcpserver.h create mode 100644 qtinterface/qt4/Qt/qtcpsocket.h create mode 100644 qtinterface/qt4/Qt/qtemporaryfile.h create mode 100644 qtinterface/qt4/Qt/qtest.h create mode 100644 qtinterface/qt4/Qt/qtest_global.h create mode 100644 qtinterface/qt4/Qt/qtest_gui.h create mode 100644 qtinterface/qt4/Qt/qtestaccessible.h create mode 100644 qtinterface/qt4/Qt/qtestassert.h create mode 100644 qtinterface/qt4/Qt/qtestbasicstreamer.h create mode 100644 qtinterface/qt4/Qt/qtestcase.h create mode 100644 qtinterface/qt4/Qt/qtestcoreelement.h create mode 100644 qtinterface/qt4/Qt/qtestcorelist.h create mode 100644 qtinterface/qt4/Qt/qtestdata.h create mode 100644 qtinterface/qt4/Qt/qtestelement.h create mode 100644 qtinterface/qt4/Qt/qtestelementattribute.h create mode 100644 qtinterface/qt4/Qt/qtestevent.h create mode 100644 qtinterface/qt4/Qt/qtesteventloop.h create mode 100644 qtinterface/qt4/Qt/qtestfilelogger.h create mode 100644 qtinterface/qt4/Qt/qtestkeyboard.h create mode 100644 qtinterface/qt4/Qt/qtestlightxmlstreamer.h create mode 100644 qtinterface/qt4/Qt/qtestmouse.h create mode 100644 qtinterface/qt4/Qt/qtestspontaneevent.h create mode 100644 qtinterface/qt4/Qt/qtestsystem.h create mode 100644 qtinterface/qt4/Qt/qtesttouch.h create mode 100644 qtinterface/qt4/Qt/qtestxmlstreamer.h create mode 100644 qtinterface/qt4/Qt/qtestxunitstreamer.h create mode 100644 qtinterface/qt4/Qt/qtextboundaryfinder.h create mode 100644 qtinterface/qt4/Qt/qtextbrowser.h create mode 100644 qtinterface/qt4/Qt/qtextcodec.h create mode 100644 qtinterface/qt4/Qt/qtextcodecplugin.h create mode 100644 qtinterface/qt4/Qt/qtextcursor.h create mode 100644 qtinterface/qt4/Qt/qtextdocument.h create mode 100644 qtinterface/qt4/Qt/qtextdocumentfragment.h create mode 100644 qtinterface/qt4/Qt/qtextdocumentwriter.h create mode 100644 qtinterface/qt4/Qt/qtextedit.h create mode 100644 qtinterface/qt4/Qt/qtextformat.h create mode 100644 qtinterface/qt4/Qt/qtextlayout.h create mode 100644 qtinterface/qt4/Qt/qtextlist.h create mode 100644 qtinterface/qt4/Qt/qtextobject.h create mode 100644 qtinterface/qt4/Qt/qtextoption.h create mode 100644 qtinterface/qt4/Qt/qtextstream.h create mode 100644 qtinterface/qt4/Qt/qtexttable.h create mode 100644 qtinterface/qt4/Qt/qthread.h create mode 100644 qtinterface/qt4/Qt/qthreadpool.h create mode 100644 qtinterface/qt4/Qt/qthreadstorage.h create mode 100644 qtinterface/qt4/Qt/qtimeline.h create mode 100644 qtinterface/qt4/Qt/qtimer.h create mode 100644 qtinterface/qt4/Qt/qtoolbar.h create mode 100644 qtinterface/qt4/Qt/qtoolbox.h create mode 100644 qtinterface/qt4/Qt/qtoolbutton.h create mode 100644 qtinterface/qt4/Qt/qtooltip.h create mode 100644 qtinterface/qt4/Qt/qtransform.h create mode 100644 qtinterface/qt4/Qt/qtranslator.h create mode 100644 qtinterface/qt4/Qt/qtransportauth_qws.h create mode 100644 qtinterface/qt4/Qt/qtransportauthdefs_qws.h create mode 100644 qtinterface/qt4/Qt/qtreeview.h create mode 100644 qtinterface/qt4/Qt/qtreewidget.h create mode 100644 qtinterface/qt4/Qt/qtreewidgetitemiterator.h create mode 100644 qtinterface/qt4/Qt/qudpsocket.h create mode 100644 qtinterface/qt4/Qt/qundogroup.h create mode 100644 qtinterface/qt4/Qt/qundostack.h create mode 100644 qtinterface/qt4/Qt/qundoview.h create mode 100644 qtinterface/qt4/Qt/qurl.h create mode 100644 qtinterface/qt4/Qt/qurlinfo.h create mode 100644 qtinterface/qt4/Qt/quuid.h create mode 100644 qtinterface/qt4/Qt/qvalidator.h create mode 100644 qtinterface/qt4/Qt/qvariant.h create mode 100644 qtinterface/qt4/Qt/qvariantanimation.h create mode 100644 qtinterface/qt4/Qt/qvarlengtharray.h create mode 100644 qtinterface/qt4/Qt/qvector.h create mode 100644 qtinterface/qt4/Qt/qvector2d.h create mode 100644 qtinterface/qt4/Qt/qvector3d.h create mode 100644 qtinterface/qt4/Qt/qvector4d.h create mode 100644 qtinterface/qt4/Qt/qvfbhdr.h create mode 100644 qtinterface/qt4/Qt/qvideoframe.h create mode 100644 qtinterface/qt4/Qt/qvideosurfaceformat.h create mode 100644 qtinterface/qt4/Qt/qwaitcondition.h create mode 100644 qtinterface/qt4/Qt/qwebdatabase.h create mode 100644 qtinterface/qt4/Qt/qwebelement.h create mode 100644 qtinterface/qt4/Qt/qwebframe.h create mode 100644 qtinterface/qt4/Qt/qwebhistory.h create mode 100644 qtinterface/qt4/Qt/qwebhistoryinterface.h create mode 100644 qtinterface/qt4/Qt/qwebinspector.h create mode 100644 qtinterface/qt4/Qt/qwebkitglobal.h create mode 100644 qtinterface/qt4/Qt/qwebkitversion.h create mode 100644 qtinterface/qt4/Qt/qwebpage.h create mode 100644 qtinterface/qt4/Qt/qwebpluginfactory.h create mode 100644 qtinterface/qt4/Qt/qwebsecurityorigin.h create mode 100644 qtinterface/qt4/Qt/qwebsettings.h create mode 100644 qtinterface/qt4/Qt/qwebview.h create mode 100644 qtinterface/qt4/Qt/qwhatsthis.h create mode 100644 qtinterface/qt4/Qt/qwidget.h create mode 100644 qtinterface/qt4/Qt/qwidgetaction.h create mode 100644 qtinterface/qt4/Qt/qwindowdefs.h create mode 100644 qtinterface/qt4/Qt/qwindowdefs_win.h create mode 100644 qtinterface/qt4/Qt/qwindowscestyle.h create mode 100644 qtinterface/qt4/Qt/qwindowsmobilestyle.h create mode 100644 qtinterface/qt4/Qt/qwindowsstyle.h create mode 100644 qtinterface/qt4/Qt/qwindowsvistastyle.h create mode 100644 qtinterface/qt4/Qt/qwindowsxpstyle.h create mode 100644 qtinterface/qt4/Qt/qwindowsystem_qws.h create mode 100644 qtinterface/qt4/Qt/qwizard.h create mode 100644 qtinterface/qt4/Qt/qwmatrix.h create mode 100644 qtinterface/qt4/Qt/qworkspace.h create mode 100644 qtinterface/qt4/Qt/qwscursor_qws.h create mode 100644 qtinterface/qt4/Qt/qwsdisplay_qws.h create mode 100644 qtinterface/qt4/Qt/qwsembedwidget.h create mode 100644 qtinterface/qt4/Qt/qwsevent_qws.h create mode 100644 qtinterface/qt4/Qt/qwsmanager_qws.h create mode 100644 qtinterface/qt4/Qt/qwsproperty_qws.h create mode 100644 qtinterface/qt4/Qt/qwsprotocolitem_qws.h create mode 100644 qtinterface/qt4/Qt/qwssocket_qws.h create mode 100644 qtinterface/qt4/Qt/qwsutils_qws.h create mode 100644 qtinterface/qt4/Qt/qx11embed_x11.h create mode 100644 qtinterface/qt4/Qt/qx11info_x11.h create mode 100644 qtinterface/qt4/Qt/qxml.h create mode 100644 qtinterface/qt4/Qt/qxmlformatter.h create mode 100644 qtinterface/qt4/Qt/qxmlname.h create mode 100644 qtinterface/qt4/Qt/qxmlnamepool.h create mode 100644 qtinterface/qt4/Qt/qxmlquery.h create mode 100644 qtinterface/qt4/Qt/qxmlresultitems.h create mode 100644 qtinterface/qt4/Qt/qxmlschema.h create mode 100644 qtinterface/qt4/Qt/qxmlschemavalidator.h create mode 100644 qtinterface/qt4/Qt/qxmlserializer.h create mode 100644 qtinterface/qt4/Qt/qxmlstream.h (limited to 'qtinterface/qt4/Qt') diff --git a/qtinterface/qt4/Qt/Qt3Support b/qtinterface/qt4/Qt/Qt3Support new file mode 100644 index 0000000..666f7a3 --- /dev/null +++ b/qtinterface/qt4/Qt/Qt3Support @@ -0,0 +1,115 @@ +#ifndef QT_QT3SUPPORT_MODULE_H +#define QT_QT3SUPPORT_MODULE_H +#include +#include +#include +#include +#include "q3action.h" +#include "q3button.h" +#include "q3buttongroup.h" +#include "q3combobox.h" +#include "q3datetimeedit.h" +#include "q3dockarea.h" +#include "q3dockwindow.h" +#include "q3frame.h" +#include "q3grid.h" +#include "q3gridview.h" +#include "q3groupbox.h" +#include "q3hbox.h" +#include "q3header.h" +#include "q3hgroupbox.h" +#include "q3mainwindow.h" +#include "q3popupmenu.h" +#include "q3progressbar.h" +#include "q3rangecontrol.h" +#include "q3scrollview.h" +#include "q3toolbar.h" +#include "q3vbox.h" +#include "q3vgroupbox.h" +#include "q3whatsthis.h" +#include "q3widgetstack.h" +#include "q3databrowser.h" +#include "q3datatable.h" +#include "q3dataview.h" +#include "q3editorfactory.h" +#include "q3sqlcursor.h" +#include "q3sqleditorfactory.h" +#include "q3sqlfieldinfo.h" +#include "q3sqlform.h" +#include "q3sqlpropertymap.h" +#include "q3sqlrecordinfo.h" +#include "q3sqlselectcursor.h" +#include "q3dns.h" +#include "q3ftp.h" +#include "q3http.h" +#include "q3localfs.h" +#include "q3network.h" +#include "q3networkprotocol.h" +#include "q3serversocket.h" +#include "q3socket.h" +#include "q3socketdevice.h" +#include "q3url.h" +#include "q3urloperator.h" +#include "q3multilineedit.h" +#include "q3simplerichtext.h" +#include "q3stylesheet.h" +#include "q3syntaxhighlighter.h" +#include "q3textbrowser.h" +#include "q3textedit.h" +#include "q3textstream.h" +#include "q3textview.h" +#include "q3filedialog.h" +#include "q3progressdialog.h" +#include "q3tabdialog.h" +#include "q3wizard.h" +#include "q3accel.h" +#include "q3boxlayout.h" +#include "q3dragobject.h" +#include "q3dropsite.h" +#include "q3gridlayout.h" +#include "q3mimefactory.h" +#include "q3polygonscanner.h" +#include "q3process.h" +#include "qiconset.h" +#include "q3asciicache.h" +#include "q3asciidict.h" +#include "q3cache.h" +#include "q3cleanuphandler.h" +#include "q3cstring.h" +#include "q3deepcopy.h" +#include "q3dict.h" +#include "q3garray.h" +#include "q3gcache.h" +#include "q3gdict.h" +#include "q3glist.h" +#include "q3gvector.h" +#include "q3intcache.h" +#include "q3intdict.h" +#include "q3memarray.h" +#include "q3objectdict.h" +#include "q3ptrcollection.h" +#include "q3ptrdict.h" +#include "q3ptrlist.h" +#include "q3ptrqueue.h" +#include "q3ptrstack.h" +#include "q3ptrvector.h" +#include "q3semaphore.h" +#include "q3shared.h" +#include "q3signal.h" +#include "q3sortedlist.h" +#include "q3strlist.h" +#include "q3strvec.h" +#include "q3tl.h" +#include "q3valuelist.h" +#include "q3valuestack.h" +#include "q3valuevector.h" +#include "q3iconview.h" +#include "q3listbox.h" +#include "q3listview.h" +#include "q3table.h" +#include "q3paintdevicemetrics.h" +#include "q3painter.h" +#include "q3picture.h" +#include "q3pointarray.h" +#include "q3canvas.h" +#endif diff --git a/qtinterface/qt4/Qt/QtCore b/qtinterface/qt4/Qt/QtCore new file mode 100644 index 0000000..58dee0b --- /dev/null +++ b/qtinterface/qt4/Qt/QtCore @@ -0,0 +1,137 @@ +#ifndef QT_QTCORE_MODULE_H +#define QT_QTCORE_MODULE_H +#include "qxmlstream.h" +#include "qabstractfileengine.h" +#include "qbuffer.h" +#include "qdatastream.h" +#include "qdebug.h" +#include "qdir.h" +#include "qdiriterator.h" +#include "qfile.h" +#include "qfileinfo.h" +#include "qfilesystemwatcher.h" +#include "qfsfileengine.h" +#include "qiodevice.h" +#include "qprocess.h" +#include "qresource.h" +#include "qsettings.h" +#include "qtemporaryfile.h" +#include "qtextstream.h" +#include "qurl.h" +#include "qtextcodec.h" +#include "qtextcodecplugin.h" +#include "qalgorithms.h" +#include "qbitarray.h" +#include "qbytearray.h" +#include "qbytearraymatcher.h" +#include "qcache.h" +#include "qchar.h" +#include "qcontainerfwd.h" +#include "qcontiguouscache.h" +#include "qcryptographichash.h" +#include "qdatetime.h" +#include "qeasingcurve.h" +#include "qhash.h" +#include "qiterator.h" +#include "qline.h" +#include "qlinkedlist.h" +#include "qlist.h" +#include "qlocale.h" +#include "qmap.h" +#include "qmargins.h" +#include "qpair.h" +#include "qpoint.h" +#include "qqueue.h" +#include "qrect.h" +#include "qregexp.h" +#include "qscopedpointer.h" +#include "qset.h" +#include "qshareddata.h" +#include "qsharedpointer.h" +#include "qsize.h" +#include "qstack.h" +#include "qstring.h" +#include "qstringbuilder.h" +#include "qstringlist.h" +#include "qstringmatcher.h" +#include "qtextboundaryfinder.h" +#include "qtimeline.h" +#include "qvarlengtharray.h" +#include "qvector.h" +#include "qendian.h" +#include "qfeatures.h" +#include "qglobal.h" +#include "qlibraryinfo.h" +#include "qnamespace.h" +#include "qnumeric.h" +#include "qabstracteventdispatcher.h" +#include "qabstractitemmodel.h" +#include "qbasictimer.h" +#include "qcoreapplication.h" +#include "qcoreevent.h" +#include "qeventloop.h" +#include "qmath.h" +#include "qmetaobject.h" +#include "qmetatype.h" +#include "qmimedata.h" +#include "qobject.h" +#include "qobjectcleanuphandler.h" +#include "qobjectdefs.h" +#include "qpointer.h" +#include "qsharedmemory.h" +#include "qsignalmapper.h" +#include "qsocketnotifier.h" +#include "qsystemsemaphore.h" +#include "qtimer.h" +#include "qtranslator.h" +#include "qvariant.h" +#include "qfuture.h" +#include "qfutureinterface.h" +#include "qfuturesynchronizer.h" +#include "qfuturewatcher.h" +#include "qrunnable.h" +#include "qtconcurrentcompilertest.h" +#include "qtconcurrentexception.h" +#include "qtconcurrentfilter.h" +#include "qtconcurrentfilterkernel.h" +#include "qtconcurrentfunctionwrappers.h" +#include "qtconcurrentiteratekernel.h" +#include "qtconcurrentmap.h" +#include "qtconcurrentmapkernel.h" +#include "qtconcurrentmedian.h" +#include "qtconcurrentreducekernel.h" +#include "qtconcurrentresultstore.h" +#include "qtconcurrentrun.h" +#include "qtconcurrentrunbase.h" +#include "qtconcurrentstoredfunctioncall.h" +#include "qtconcurrentthreadengine.h" +#include "qthreadpool.h" +#include "qfactoryinterface.h" +#include "qlibrary.h" +#include "qplugin.h" +#include "qpluginloader.h" +#include "quuid.h" +#include "qatomic.h" +#include "qbasicatomic.h" +#include "qmutex.h" +#include "qreadwritelock.h" +#include "qsemaphore.h" +#include "qthread.h" +#include "qthreadstorage.h" +#include "qwaitcondition.h" +#include "qabstractstate.h" +#include "qabstracttransition.h" +#include "qeventtransition.h" +#include "qfinalstate.h" +#include "qhistorystate.h" +#include "qsignaltransition.h" +#include "qstate.h" +#include "qstatemachine.h" +#include "qabstractanimation.h" +#include "qanimationgroup.h" +#include "qparallelanimationgroup.h" +#include "qpauseanimation.h" +#include "qpropertyanimation.h" +#include "qsequentialanimationgroup.h" +#include "qvariantanimation.h" +#endif diff --git a/qtinterface/qt4/Qt/QtDBus b/qtinterface/qt4/Qt/QtDBus new file mode 100644 index 0000000..32cf13d --- /dev/null +++ b/qtinterface/qt4/Qt/QtDBus @@ -0,0 +1,21 @@ +#ifndef QT_QTDBUS_MODULE_H +#define QT_QTDBUS_MODULE_H +#include +#include "qdbusabstractadaptor.h" +#include "qdbusabstractinterface.h" +#include "qdbusargument.h" +#include "qdbusconnection.h" +#include "qdbusconnectioninterface.h" +#include "qdbuscontext.h" +#include "qdbuserror.h" +#include "qdbusextratypes.h" +#include "qdbusinterface.h" +#include "qdbusmacros.h" +#include "qdbusmessage.h" +#include "qdbusmetatype.h" +#include "qdbuspendingcall.h" +#include "qdbuspendingreply.h" +#include "qdbusreply.h" +#include "qdbusserver.h" +#include "qdbusservicewatcher.h" +#endif diff --git a/qtinterface/qt4/Qt/QtGui b/qtinterface/qt4/Qt/QtGui new file mode 100644 index 0000000..640382d --- /dev/null +++ b/qtinterface/qt4/Qt/QtGui @@ -0,0 +1,228 @@ +#ifndef QT_QTGUI_MODULE_H +#define QT_QTGUI_MODULE_H +#include +#include "qbitmap.h" +#include "qicon.h" +#include "qiconengine.h" +#include "qiconengineplugin.h" +#include "qimage.h" +#include "qimageiohandler.h" +#include "qimagereader.h" +#include "qimagewriter.h" +#include "qmovie.h" +#include "qpicture.h" +#include "qpictureformatplugin.h" +#include "qpixmap.h" +#include "qpixmapcache.h" +#include "qs60mainapplication.h" +#include "qs60mainappui.h" +#include "qs60maindocument.h" +#include "qvfbhdr.h" +#include "qwsembedwidget.h" +#include "qabstractbutton.h" +#include "qabstractscrollarea.h" +#include "qabstractslider.h" +#include "qabstractspinbox.h" +#include "qbuttongroup.h" +#include "qcalendarwidget.h" +#include "qcheckbox.h" +#include "qcombobox.h" +#include "qcommandlinkbutton.h" +#include "qdatetimeedit.h" +#include "qdial.h" +#include "qdialogbuttonbox.h" +#include "qdockwidget.h" +#include "qfocusframe.h" +#include "qfontcombobox.h" +#include "qframe.h" +#include "qgroupbox.h" +#include "qlabel.h" +#include "qlcdnumber.h" +#include "qlineedit.h" +#include "qmainwindow.h" +#include "qmdiarea.h" +#include "qmdisubwindow.h" +#include "qmenu.h" +#include "qmenubar.h" +#include "qmenudata.h" +#include "qplaintextedit.h" +#include "qprintpreviewwidget.h" +#include "qprogressbar.h" +#include "qpushbutton.h" +#include "qradiobutton.h" +#include "qrubberband.h" +#include "qscrollarea.h" +#include "qscrollbar.h" +#include "qsizegrip.h" +#include "qslider.h" +#include "qspinbox.h" +#include "qsplashscreen.h" +#include "qsplitter.h" +#include "qstackedwidget.h" +#include "qstatusbar.h" +#include "qtabbar.h" +#include "qtabwidget.h" +#include "qtextbrowser.h" +#include "qtextedit.h" +#include "qtoolbar.h" +#include "qtoolbox.h" +#include "qtoolbutton.h" +#include "qvalidator.h" +#include "qworkspace.h" +#include "qinputcontext.h" +#include "qinputcontextfactory.h" +#include "qinputcontextplugin.h" +#include "qgraphicsanchorlayout.h" +#include "qgraphicsgridlayout.h" +#include "qgraphicsitem.h" +#include "qgraphicsitemanimation.h" +#include "qgraphicslayout.h" +#include "qgraphicslayoutitem.h" +#include "qgraphicslinearlayout.h" +#include "qgraphicsproxywidget.h" +#include "qgraphicsscene.h" +#include "qgraphicssceneevent.h" +#include "qgraphicstransform.h" +#include "qgraphicsview.h" +#include "qgraphicswidget.h" +#include "qgenericmatrix.h" +#include "qmatrix4x4.h" +#include "qquaternion.h" +#include "qvector2d.h" +#include "qvector3d.h" +#include "qvector4d.h" +#include "qabstracttextdocumentlayout.h" +#include "qfont.h" +#include "qfontdatabase.h" +#include "qfontinfo.h" +#include "qfontmetrics.h" +#include "qsyntaxhighlighter.h" +#include "qtextcursor.h" +#include "qtextdocument.h" +#include "qtextdocumentfragment.h" +#include "qtextdocumentwriter.h" +#include "qtextformat.h" +#include "qtextlayout.h" +#include "qtextlist.h" +#include "qtextobject.h" +#include "qtextoption.h" +#include "qtexttable.h" +#include "qabstractpagesetupdialog.h" +#include "qabstractprintdialog.h" +#include "qcolordialog.h" +#include "qdialog.h" +#include "qerrormessage.h" +#include "qfiledialog.h" +#include "qfilesystemmodel.h" +#include "qfontdialog.h" +#include "qinputdialog.h" +#include "qmessagebox.h" +#include "qpagesetupdialog.h" +#include "qprintdialog.h" +#include "qprintpreviewdialog.h" +#include "qprogressdialog.h" +#include "qwizard.h" +#include "qaccessible.h" +#include "qaccessible2.h" +#include "qaccessiblebridge.h" +#include "qaccessibleobject.h" +#include "qaccessibleplugin.h" +#include "qaccessiblewidget.h" +#include "qaction.h" +#include "qactiongroup.h" +#include "qapplication.h" +#include "qboxlayout.h" +#include "qclipboard.h" +#include "qcursor.h" +#include "qdesktopwidget.h" +#include "qdrag.h" +#include "qevent.h" +#include "qformlayout.h" +#include "qgesture.h" +#include "qgesturerecognizer.h" +#include "qgridlayout.h" +#include "qkeysequence.h" +#include "qlayout.h" +#include "qlayoutitem.h" +#include "qmime.h" +#include "qpalette.h" +#include "qsessionmanager.h" +#include "qshortcut.h" +#include "qsizepolicy.h" +#include "qsound.h" +#include "qstackedlayout.h" +#include "qtooltip.h" +#include "qwhatsthis.h" +#include "qwidget.h" +#include "qwidgetaction.h" +#include "qwindowdefs.h" +#include "qabstractitemdelegate.h" +#include "qabstractitemview.h" +#include "qabstractproxymodel.h" +#include "qcolumnview.h" +#include "qdatawidgetmapper.h" +#include "qdirmodel.h" +#include "qfileiconprovider.h" +#include "qheaderview.h" +#include "qitemdelegate.h" +#include "qitemeditorfactory.h" +#include "qitemselectionmodel.h" +#include "qlistview.h" +#include "qlistwidget.h" +#include "qproxymodel.h" +#include "qsortfilterproxymodel.h" +#include "qstandarditemmodel.h" +#include "qstringlistmodel.h" +#include "qstyleditemdelegate.h" +#include "qtableview.h" +#include "qtablewidget.h" +#include "qtreeview.h" +#include "qtreewidget.h" +#include "qtreewidgetitemiterator.h" +#include "qbrush.h" +#include "qcolor.h" +#include "qcolormap.h" +#include "qdrawutil.h" +#include "qmatrix.h" +#include "qpaintdevice.h" +#include "qpaintengine.h" +#include "qpainter.h" +#include "qpainterpath.h" +#include "qpen.h" +#include "qpolygon.h" +#include "qprintengine.h" +#include "qprinter.h" +#include "qprinterinfo.h" +#include "qregion.h" +#include "qrgb.h" +#include "qstylepainter.h" +#include "qtransform.h" +#include "qwmatrix.h" +#include "qsymbianevent.h" +#include "qcdestyle.h" +#include "qcleanlooksstyle.h" +#include "qcommonstyle.h" +#include "qgtkstyle.h" +#include "qmotifstyle.h" +#include "qplastiquestyle.h" +#include "qproxystyle.h" +#include "qs60style.h" +#include "qstyle.h" +#include "qstylefactory.h" +#include "qstyleoption.h" +#include "qstyleplugin.h" +#include "qwindowscestyle.h" +#include "qwindowsmobilestyle.h" +#include "qwindowsstyle.h" +#include "qwindowsvistastyle.h" +#include "qwindowsxpstyle.h" +#include "qkeyeventtransition.h" +#include "qmouseeventtransition.h" +#include "qgraphicseffect.h" +#include "qcompleter.h" +#include "qdesktopservices.h" +#include "qsystemtrayicon.h" +#include "qundogroup.h" +#include "qundostack.h" +#include "qundoview.h" +#endif diff --git a/qtinterface/qt4/Qt/QtHelp b/qtinterface/qt4/Qt/QtHelp new file mode 100644 index 0000000..01c53dd --- /dev/null +++ b/qtinterface/qt4/Qt/QtHelp @@ -0,0 +1,11 @@ +#ifndef QT_QTHELP_MODULE_H +#define QT_QTHELP_MODULE_H +#include +#include "qhelpcontentwidget.h" +#include "qhelpengine.h" +#include "qhelpenginecore.h" +#include "qhelpindexwidget.h" +#include "qhelpsearchengine.h" +#include "qhelpsearchquerywidget.h" +#include "qhelpsearchresultwidget.h" +#endif diff --git a/qtinterface/qt4/Qt/QtMultimedia b/qtinterface/qt4/Qt/QtMultimedia new file mode 100644 index 0000000..ae9eb88 --- /dev/null +++ b/qtinterface/qt4/Qt/QtMultimedia @@ -0,0 +1,16 @@ +#ifndef QT_QTMULTIMEDIA_MODULE_H +#define QT_QTMULTIMEDIA_MODULE_H +#include +#include +#include "qaudio.h" +#include "qaudiodeviceinfo.h" +#include "qaudioengine.h" +#include "qaudioengineplugin.h" +#include "qaudioformat.h" +#include "qaudioinput.h" +#include "qaudiooutput.h" +#include "qabstractvideobuffer.h" +#include "qabstractvideosurface.h" +#include "qvideoframe.h" +#include "qvideosurfaceformat.h" +#endif diff --git a/qtinterface/qt4/Qt/QtNetwork b/qtinterface/qt4/Qt/QtNetwork new file mode 100644 index 0000000..bb9e9ea --- /dev/null +++ b/qtinterface/qt4/Qt/QtNetwork @@ -0,0 +1,32 @@ +#ifndef QT_QTNETWORK_MODULE_H +#define QT_QTNETWORK_MODULE_H +#include +#include "qabstractnetworkcache.h" +#include "qftp.h" +#include "qhttp.h" +#include "qnetworkaccessmanager.h" +#include "qnetworkcookie.h" +#include "qnetworkcookiejar.h" +#include "qnetworkdiskcache.h" +#include "qnetworkreply.h" +#include "qnetworkrequest.h" +#include "qauthenticator.h" +#include "qhostaddress.h" +#include "qhostinfo.h" +#include "qnetworkinterface.h" +#include "qnetworkproxy.h" +#include "qurlinfo.h" +#include "qabstractsocket.h" +#include "qlocalserver.h" +#include "qlocalsocket.h" +#include "qtcpserver.h" +#include "qtcpsocket.h" +#include "qudpsocket.h" +#include "qssl.h" +#include "qsslcertificate.h" +#include "qsslcipher.h" +#include "qsslconfiguration.h" +#include "qsslerror.h" +#include "qsslkey.h" +#include "qsslsocket.h" +#endif diff --git a/qtinterface/qt4/Qt/QtOpenGL b/qtinterface/qt4/Qt/QtOpenGL new file mode 100644 index 0000000..5f7fece --- /dev/null +++ b/qtinterface/qt4/Qt/QtOpenGL @@ -0,0 +1,10 @@ +#ifndef QT_QTOPENGL_MODULE_H +#define QT_QTOPENGL_MODULE_H +#include +#include +#include "qgl.h" +#include "qglcolormap.h" +#include "qglframebufferobject.h" +#include "qglpixelbuffer.h" +#include "qglshaderprogram.h" +#endif diff --git a/qtinterface/qt4/Qt/QtScript b/qtinterface/qt4/Qt/QtScript new file mode 100644 index 0000000..7628ff8 --- /dev/null +++ b/qtinterface/qt4/Qt/QtScript @@ -0,0 +1,17 @@ +#ifndef QT_QTSCRIPT_MODULE_H +#define QT_QTSCRIPT_MODULE_H +#include +#include "qscriptable.h" +#include "qscriptclass.h" +#include "qscriptclasspropertyiterator.h" +#include "qscriptcontext.h" +#include "qscriptcontextinfo.h" +#include "qscriptengine.h" +#include "qscriptengineagent.h" +#include "qscriptextensioninterface.h" +#include "qscriptextensionplugin.h" +#include "qscriptprogram.h" +#include "qscriptstring.h" +#include "qscriptvalue.h" +#include "qscriptvalueiterator.h" +#endif diff --git a/qtinterface/qt4/Qt/QtScriptTools b/qtinterface/qt4/Qt/QtScriptTools new file mode 100644 index 0000000..00ade43 --- /dev/null +++ b/qtinterface/qt4/Qt/QtScriptTools @@ -0,0 +1,7 @@ +#ifndef QT_QTSCRIPTTOOLS_MODULE_H +#define QT_QTSCRIPTTOOLS_MODULE_H +#include +#include +#include +#include "qscriptenginedebugger.h" +#endif diff --git a/qtinterface/qt4/Qt/QtSql b/qtinterface/qt4/Qt/QtSql new file mode 100644 index 0000000..e61f02b --- /dev/null +++ b/qtinterface/qt4/Qt/QtSql @@ -0,0 +1,18 @@ +#ifndef QT_QTSQL_MODULE_H +#define QT_QTSQL_MODULE_H +#include +#include "qsql.h" +#include "qsqldatabase.h" +#include "qsqldriver.h" +#include "qsqldriverplugin.h" +#include "qsqlerror.h" +#include "qsqlfield.h" +#include "qsqlindex.h" +#include "qsqlquery.h" +#include "qsqlrecord.h" +#include "qsqlresult.h" +#include "qsqlquerymodel.h" +#include "qsqlrelationaldelegate.h" +#include "qsqlrelationaltablemodel.h" +#include "qsqltablemodel.h" +#endif diff --git a/qtinterface/qt4/Qt/QtSvg b/qtinterface/qt4/Qt/QtSvg new file mode 100644 index 0000000..193fcc5 --- /dev/null +++ b/qtinterface/qt4/Qt/QtSvg @@ -0,0 +1,9 @@ +#ifndef QT_QTSVG_MODULE_H +#define QT_QTSVG_MODULE_H +#include +#include +#include "qgraphicssvgitem.h" +#include "qsvggenerator.h" +#include "qsvgrenderer.h" +#include "qsvgwidget.h" +#endif diff --git a/qtinterface/qt4/Qt/QtTest b/qtinterface/qt4/Qt/QtTest new file mode 100644 index 0000000..6fb1ce2 --- /dev/null +++ b/qtinterface/qt4/Qt/QtTest @@ -0,0 +1,21 @@ +#ifndef QT_QTTEST_MODULE_H +#define QT_QTTEST_MODULE_H +#include +#include "qbenchmark.h" +#include "qsignalspy.h" +#include "qtest.h" +#include "qtestassert.h" +#include "qtestbasicstreamer.h" +#include "qtestcase.h" +#include "qtestcoreelement.h" +#include "qtestcorelist.h" +#include "qtestdata.h" +#include "qtestelement.h" +#include "qtestelementattribute.h" +#include "qtesteventloop.h" +#include "qtestfilelogger.h" +#include "qtestlightxmlstreamer.h" +#include "qtestsystem.h" +#include "qtestxmlstreamer.h" +#include "qtestxunitstreamer.h" +#endif diff --git a/qtinterface/qt4/Qt/QtWebKit b/qtinterface/qt4/Qt/QtWebKit new file mode 100644 index 0000000..4a83a1c --- /dev/null +++ b/qtinterface/qt4/Qt/QtWebKit @@ -0,0 +1,18 @@ +#ifndef QT_QTWEBKIT_MODULE_H +#define QT_QTWEBKIT_MODULE_H +#include +#include "qgraphicswebview.h" +#include "qwebdatabase.h" +#include "qwebelement.h" +#include "qwebframe.h" +#include "qwebhistory.h" +#include "qwebhistoryinterface.h" +#include "qwebinspector.h" +#include "qwebkitglobal.h" +#include "qwebkitversion.h" +#include "qwebpage.h" +#include "qwebpluginfactory.h" +#include "qwebsecurityorigin.h" +#include "qwebsettings.h" +#include "qwebview.h" +#endif diff --git a/qtinterface/qt4/Qt/QtXml b/qtinterface/qt4/Qt/QtXml new file mode 100644 index 0000000..41ee387 --- /dev/null +++ b/qtinterface/qt4/Qt/QtXml @@ -0,0 +1,7 @@ +#ifndef QT_QTXML_MODULE_H +#define QT_QTXML_MODULE_H +#include +#include "qxml.h" +#include "qdom.h" +#include "qxmlstream.h" +#endif diff --git a/qtinterface/qt4/Qt/QtXmlPatterns b/qtinterface/qt4/Qt/QtXmlPatterns new file mode 100644 index 0000000..fb10661 --- /dev/null +++ b/qtinterface/qt4/Qt/QtXmlPatterns @@ -0,0 +1,18 @@ +#ifndef QT_QTXMLPATTERNS_MODULE_H +#define QT_QTXMLPATTERNS_MODULE_H +#include +#include "qabstractmessagehandler.h" +#include "qabstracturiresolver.h" +#include "qabstractxmlnodemodel.h" +#include "qabstractxmlreceiver.h" +#include "qsimplexmlnodemodel.h" +#include "qsourcelocation.h" +#include "qxmlformatter.h" +#include "qxmlname.h" +#include "qxmlnamepool.h" +#include "qxmlquery.h" +#include "qxmlresultitems.h" +#include "qxmlschema.h" +#include "qxmlschemavalidator.h" +#include "qxmlserializer.h" +#endif diff --git a/qtinterface/qt4/Qt/q3accel.h b/qtinterface/qt4/Qt/q3accel.h new file mode 100644 index 0000000..01f8165 --- /dev/null +++ b/qtinterface/qt4/Qt/q3accel.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3ACCEL_H +#define Q3ACCEL_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3AccelPrivate; + +class Q_COMPAT_EXPORT Q3Accel : public QObject // accelerator class +{ + Q_OBJECT +public: + Q3Accel( QWidget *parent, const char *name=0 ); + Q3Accel( QWidget* watch, QObject *parent, const char *name=0 ); + ~Q3Accel(); + + bool isEnabled() const; + void setEnabled( bool ); + + uint count() const; + + int insertItem( const QKeySequence& key, int id=-1); + void removeItem( int id ); + void clear(); + + QKeySequence key( int id ); + int findKey( const QKeySequence& key ) const; + + bool isItemEnabled( int id ) const; + void setItemEnabled( int id, bool enable ); + + bool connectItem( int id, const QObject *receiver, const char* member ); + bool disconnectItem( int id, const QObject *receiver, const char* member ); + + void repairEventFilter() {} + + void setWhatsThis( int id, const QString& ); + QString whatsThis( int id ) const; + void setIgnoreWhatsThis( bool ); + bool ignoreWhatsThis() const; + + static QKeySequence shortcutKey( const QString & ); + static QString keyToString(QKeySequence k ); + static QKeySequence stringToKey( const QString & ); + +Q_SIGNALS: + void activated( int id ); + void activatedAmbiguously( int id ); + +private: + Q3AccelPrivate * d; + +private: + Q_DISABLE_COPY(Q3Accel) + friend class Q3AccelPrivate; + friend class Q3AccelManager; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3ACCEL_H diff --git a/qtinterface/qt4/Qt/q3action.h b/qtinterface/qt4/Qt/q3action.h new file mode 100644 index 0000000..df5bba8 --- /dev/null +++ b/qtinterface/qt4/Qt/q3action.h @@ -0,0 +1,225 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3ACTION_H +#define Q3ACTION_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_ACTION + +class Q3ActionPrivate; +class Q3ActionGroupPrivate; +class QStatusBar; +class Q3PopupMenu; +class QToolTipGroup; +class QWidget; + +class Q_COMPAT_EXPORT Q3Action : public QObject +{ + Q_OBJECT + Q_PROPERTY(bool toggleAction READ isToggleAction WRITE setToggleAction) + Q_PROPERTY(bool on READ isOn WRITE setOn) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) + Q_PROPERTY(QIcon iconSet READ iconSet WRITE setIconSet) + Q_PROPERTY(QString text READ text WRITE setText) + Q_PROPERTY(QString menuText READ menuText WRITE setMenuText) + Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip) + Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip) + Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis) +#ifndef QT_NO_ACCEL + Q_PROPERTY(QKeySequence accel READ accel WRITE setAccel) +#endif + Q_PROPERTY(bool visible READ isVisible WRITE setVisible) + +public: + Q3Action(QObject* parent, const char* name = 0); +#ifndef QT_NO_ACCEL + Q3Action(const QString& menuText, QKeySequence accel, + QObject* parent, const char* name = 0); + Q3Action(const QIcon& icon, const QString& menuText, QKeySequence accel, + QObject* parent, const char* name = 0); + + Q3Action(const QString& text, const QIcon& icon, const QString& menuText, QKeySequence accel, + QObject* parent, const char* name = 0, bool toggle = false); // obsolete + Q3Action(const QString& text, const QString& menuText, QKeySequence accel, QObject* parent, + const char* name = 0, bool toggle = false); // obsolete +#endif + Q3Action(QObject* parent, const char* name , bool toggle); // obsolete + ~Q3Action(); + + virtual void setIconSet(const QIcon&); + QIcon iconSet() const; + virtual void setText(const QString&); + QString text() const; + virtual void setMenuText(const QString&); + QString menuText() const; + virtual void setToolTip(const QString&); + QString toolTip() const; + virtual void setStatusTip(const QString&); + QString statusTip() const; + virtual void setWhatsThis(const QString&); + QString whatsThis() const; +#ifndef QT_NO_ACCEL + virtual void setAccel(const QKeySequence& key); + QKeySequence accel() const; +#endif + virtual void setToggleAction(bool); + + bool isToggleAction() const; + bool isOn() const; + bool isEnabled() const; + bool isVisible() const; + virtual bool addTo(QWidget*); + virtual bool removeFrom(QWidget*); + +protected: + virtual void addedTo(QWidget *actionWidget, QWidget *container); + virtual void addedTo(int index, Q3PopupMenu *menu); + +public Q_SLOTS: + void activate(); + void toggle(); + virtual void setOn(bool); + virtual void setEnabled(bool); + void setDisabled(bool); + virtual void setVisible(bool); + +Q_SIGNALS: + void activated(); + void toggled(bool); + +private Q_SLOTS: + void internalActivation(); + void toolButtonToggled(bool); + void objectDestroyed(); + void menuStatusText(int id); + void showStatusText(const QString&); + void clearStatusText(); + +private: + Q_DISABLE_COPY(Q3Action) + + void init(); + + Q3ActionPrivate* d; + + friend class Q3ActionPrivate; + friend class Q3ActionGroup; + friend class Q3ActionGroupPrivate; +}; + +class Q_COMPAT_EXPORT Q3ActionGroup : public Q3Action +{ + Q_OBJECT + Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive) + Q_PROPERTY(bool usesDropDown READ usesDropDown WRITE setUsesDropDown) + +public: + Q3ActionGroup(QObject* parent, const char* name = 0); + Q3ActionGroup(QObject* parent, const char* name , bool exclusive ); // obsolete + ~Q3ActionGroup(); + void setExclusive(bool); + bool isExclusive() const; + void add(Q3Action* a); + void addSeparator(); + bool addTo(QWidget*); + bool removeFrom(QWidget*); + void setEnabled(bool); + void setToggleAction(bool toggle); + void setOn(bool on); + void setVisible(bool); + + void setUsesDropDown(bool enable); + bool usesDropDown() const; + + void setIconSet(const QIcon &); + void setText(const QString&); + void setMenuText(const QString&); + void setToolTip(const QString&); + void setWhatsThis(const QString&); + +protected: + void childEvent(QChildEvent*); + virtual void addedTo(QWidget *actionWidget, QWidget *container, Q3Action *a); + virtual void addedTo(int index, Q3PopupMenu *menu, Q3Action *a); + virtual void addedTo(QWidget *actionWidget, QWidget *container); + virtual void addedTo(int index, Q3PopupMenu *menu); + +Q_SIGNALS: + void selected(Q3Action*); + void activated(Q3Action *); + +private Q_SLOTS: + void childToggled(bool); + void childActivated(); + void childDestroyed(); + void internalComboBoxActivated(int); + void internalComboBoxHighlighted(int); + void internalToggle(Q3Action*); + void objectDestroyed(); + +private: + Q3ActionGroupPrivate* d; + +public: + void insert(Q3Action *a) { add(a); } + +private: + Q_DISABLE_COPY(Q3ActionGroup) +}; + +#endif // QT_NO_ACTION + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3ACTION_H diff --git a/qtinterface/qt4/Qt/q3asciicache.h b/qtinterface/qt4/Qt/q3asciicache.h new file mode 100644 index 0000000..873e63e --- /dev/null +++ b/qtinterface/qt4/Qt/q3asciicache.h @@ -0,0 +1,132 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3ASCIICACHE_H +#define Q3ASCIICACHE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3AsciiCache +#ifdef qdoc + : public Q3PtrCollection +#else + : public Q3GCache +#endif +{ +public: + Q3AsciiCache(const Q3AsciiCache &c) : Q3GCache(c) {} + Q3AsciiCache(int maxCost=100, int size=17, bool caseSensitive=true, + bool copyKeys=true) + : Q3GCache(maxCost, size, AsciiKey, caseSensitive, copyKeys) {} + ~Q3AsciiCache() { clear(); } + Q3AsciiCache &operator=(const Q3AsciiCache &c) + { return (Q3AsciiCache&)Q3GCache::operator=(c); } + int maxCost() const { return Q3GCache::maxCost(); } + int totalCost() const { return Q3GCache::totalCost(); } + void setMaxCost(int m) { Q3GCache::setMaxCost(m); } + uint count() const { return Q3GCache::count(); } + uint size() const { return Q3GCache::size(); } + bool isEmpty() const { return Q3GCache::count() == 0; } + void clear() { Q3GCache::clear(); } + bool insert(const char *k, const type *d, int c=1, int p=0) + { return Q3GCache::insert_other(k,(Item)d,c,p);} + bool remove(const char *k) + { return Q3GCache::remove_other(k); } + type *take(const char *k) + { return (type *)Q3GCache::take_other(k); } + type *find(const char *k, bool ref=true) const + { return (type *)Q3GCache::find_other(k,ref);} + type *operator[](const char *k) const + { return (type *)Q3GCache::find_other(k);} + void statistics() const { Q3GCache::statistics(); } +private: + void deleteItem(Item d); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3AsciiCache::deleteItem(Q3PtrCollection::Item) +{ +} +#endif + +template inline void Q3AsciiCache::deleteItem(Q3PtrCollection::Item d) +{ + if (del_item) delete (type *)d; +} + + +template +class Q3AsciiCacheIterator : public Q3GCacheIterator +{ +public: + Q3AsciiCacheIterator(const Q3AsciiCache &c):Q3GCacheIterator((Q3GCache &)c) {} + Q3AsciiCacheIterator(const Q3AsciiCacheIterator &ci) + : Q3GCacheIterator((Q3GCacheIterator &)ci) {} + Q3AsciiCacheIterator &operator=(const Q3AsciiCacheIterator&ci) + { return (Q3AsciiCacheIterator&)Q3GCacheIterator::operator=(ci); } + uint count() const { return Q3GCacheIterator::count(); } + bool isEmpty() const { return Q3GCacheIterator::count() == 0; } + bool atFirst() const { return Q3GCacheIterator::atFirst(); } + bool atLast() const { return Q3GCacheIterator::atLast(); } + type *toFirst() { return (type *)Q3GCacheIterator::toFirst(); } + type *toLast() { return (type *)Q3GCacheIterator::toLast(); } + operator type *() const { return (type *)Q3GCacheIterator::get(); } + type *current() const { return (type *)Q3GCacheIterator::get(); } + const char *currentKey() const { return Q3GCacheIterator::getKeyAscii(); } + type *operator()() { return (type *)Q3GCacheIterator::operator()();} + type *operator++() { return (type *)Q3GCacheIterator::operator++(); } + type *operator+=(uint j) { return (type *)Q3GCacheIterator::operator+=(j);} + type *operator--() { return (type *)Q3GCacheIterator::operator--(); } + type *operator-=(uint j) { return (type *)Q3GCacheIterator::operator-=(j);} +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3ASCIICACHE_H diff --git a/qtinterface/qt4/Qt/q3asciidict.h b/qtinterface/qt4/Qt/q3asciidict.h new file mode 100644 index 0000000..6bbf388 --- /dev/null +++ b/qtinterface/qt4/Qt/q3asciidict.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3ASCIIDICT_H +#define Q3ASCIIDICT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3AsciiDict +#ifdef qdoc + : public Q3PtrCollection +#else + : public Q3GDict +#endif +{ +public: + Q3AsciiDict(int size=17, bool caseSensitive=true, bool copyKeys=true) + : Q3GDict(size,AsciiKey,caseSensitive,copyKeys) {} + Q3AsciiDict(const Q3AsciiDict &d) : Q3GDict(d) {} + ~Q3AsciiDict() { clear(); } + Q3AsciiDict &operator=(const Q3AsciiDict &d) + { return (Q3AsciiDict&)Q3GDict::operator=(d); } + uint count() const { return Q3GDict::count(); } + uint size() const { return Q3GDict::size(); } + bool isEmpty() const { return Q3GDict::count() == 0; } + + void insert(const char *k, const type *d) + { Q3GDict::look_ascii(k,(Item)d,1); } + void replace(const char *k, const type *d) + { Q3GDict::look_ascii(k,(Item)d,2); } + bool remove(const char *k) { return Q3GDict::remove_ascii(k); } + type *take(const char *k) { return (type *)Q3GDict::take_ascii(k); } + type *find(const char *k) const + { return (type *)((Q3GDict*)this)->Q3GDict::look_ascii(k,0,0); } + type *operator[](const char *k) const + { return (type *)((Q3GDict*)this)->Q3GDict::look_ascii(k,0,0); } + + void clear() { Q3GDict::clear(); } + void resize(uint n) { Q3GDict::resize(n); } + void statistics() const { Q3GDict::statistics(); } + +#ifdef qdoc +protected: + virtual QDataStream& read(QDataStream &, Q3PtrCollection::Item &); + virtual QDataStream& write(QDataStream &, Q3PtrCollection::Item) const; +#endif + +private: + void deleteItem(Item d); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3AsciiDict::deleteItem(Q3PtrCollection::Item) +{ +} +#endif + +template inline void Q3AsciiDict::deleteItem(Q3PtrCollection::Item d) +{ + if (del_item) delete (type *)d; +} + +template +class Q3AsciiDictIterator : public Q3GDictIterator +{ +public: + Q3AsciiDictIterator(const Q3AsciiDict &d) + : Q3GDictIterator((Q3GDict &)d) {} + ~Q3AsciiDictIterator() {} + uint count() const { return dict->count(); } + bool isEmpty() const { return dict->count() == 0; } + type *toFirst() { return (type *)Q3GDictIterator::toFirst(); } + operator type *() const { return (type *)Q3GDictIterator::get(); } + type *current() const { return (type *)Q3GDictIterator::get(); } + const char *currentKey() const { return Q3GDictIterator::getKeyAscii(); } + type *operator()() { return (type *)Q3GDictIterator::operator()(); } + type *operator++() { return (type *)Q3GDictIterator::operator++(); } + type *operator+=(uint j) { return (type *)Q3GDictIterator::operator+=(j);} +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3ASCIIDICT_H diff --git a/qtinterface/qt4/Qt/q3boxlayout.h b/qtinterface/qt4/Qt/q3boxlayout.h new file mode 100644 index 0000000..f901406 --- /dev/null +++ b/qtinterface/qt4/Qt/q3boxlayout.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3BOXLAYOUT_H +#define Q3BOXLAYOUT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3BoxLayout : public QBoxLayout +{ +public: + inline explicit Q3BoxLayout(Direction dir, QWidget *parent = 0) + : QBoxLayout(dir, parent) { setMargin(0); setSpacing(0); } + + inline Q3BoxLayout(QWidget *parent, Direction dir, int margin = 0, int spacing = -1, + const char *name = 0) + : QBoxLayout(parent, dir, margin, spacing, name) {} + + inline Q3BoxLayout(QLayout *parentLayout, Direction dir, int spacing = -1, + const char *name = 0) + : QBoxLayout(parentLayout, dir, spacing, name) { setMargin(0); } + + inline Q3BoxLayout(Direction dir, int spacing, const char *name = 0) + : QBoxLayout(dir, spacing, name) { setMargin(0); } + +private: + Q_DISABLE_COPY(Q3BoxLayout) +}; + +class Q3HBoxLayout : public Q3BoxLayout +{ +public: + inline Q3HBoxLayout() : Q3BoxLayout(LeftToRight) {} + + inline explicit Q3HBoxLayout(QWidget *parent) : Q3BoxLayout(LeftToRight, parent) {} + + inline Q3HBoxLayout(QWidget *parent, int margin, + int spacing = -1, const char *name = 0) + : Q3BoxLayout(parent, LeftToRight, margin, spacing, name) {} + + inline Q3HBoxLayout(QLayout *parentLayout, + int spacing = -1, const char *name = 0) + : Q3BoxLayout(parentLayout, LeftToRight, spacing, name) {} + + inline Q3HBoxLayout(int spacing, const char *name = 0) + : Q3BoxLayout(LeftToRight, spacing, name) {} + +private: + Q_DISABLE_COPY(Q3HBoxLayout) +}; + +class Q3VBoxLayout : public Q3BoxLayout +{ +public: + inline Q3VBoxLayout() : Q3BoxLayout(TopToBottom) {} + + inline explicit Q3VBoxLayout(QWidget *parent) : Q3BoxLayout(TopToBottom, parent) {} + + inline Q3VBoxLayout(QWidget *parent, int margin, + int spacing = -1, const char *name = 0) + : Q3BoxLayout(parent, TopToBottom, margin, spacing, name) {} + + inline Q3VBoxLayout(QLayout *parentLayout, + int spacing = -1, const char *name = 0) + : Q3BoxLayout(parentLayout, TopToBottom, spacing, name) {} + + inline Q3VBoxLayout(int spacing, const char *name = 0) + : Q3BoxLayout(TopToBottom, spacing, name) {} + +private: + Q_DISABLE_COPY(Q3VBoxLayout) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3BOXLAYOUT_H diff --git a/qtinterface/qt4/Qt/q3button.h b/qtinterface/qt4/Qt/q3button.h new file mode 100644 index 0000000..dc09877 --- /dev/null +++ b/qtinterface/qt4/Qt/q3button.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3BUTTON_H +#define Q3BUTTON_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3Button : public QAbstractButton +{ + Q_OBJECT +public: + Q3Button( QWidget* parent=0, const char* name=0, Qt::WindowFlags f=0 ); + ~Q3Button(); + +protected: + virtual void drawButton( QPainter * ); + virtual void drawButtonLabel( QPainter * ); + void paintEvent( QPaintEvent * ); + +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3BUTTON_H diff --git a/qtinterface/qt4/Qt/q3buttongroup.h b/qtinterface/qt4/Qt/q3buttongroup.h new file mode 100644 index 0000000..9a5297f --- /dev/null +++ b/qtinterface/qt4/Qt/q3buttongroup.h @@ -0,0 +1,152 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3BUTTONGROUP_H +#define Q3BUTTONGROUP_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class QAbstractButton; + +class Q_COMPAT_EXPORT Q3ButtonGroup : public Q3GroupBox +{ + Q_OBJECT + Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive) + Q_PROPERTY(bool radioButtonExclusive READ isRadioButtonExclusive WRITE setRadioButtonExclusive) + Q_PROPERTY(int selectedId READ selectedId WRITE setButton) + +public: + Q3ButtonGroup(QWidget* parent=0, const char* name=0); + Q3ButtonGroup(const QString &title, + QWidget* parent=0, const char* name=0); + Q3ButtonGroup(int columns, Qt::Orientation o, + QWidget* parent=0, const char* name=0); + Q3ButtonGroup(int columns, Qt::Orientation o, const QString &title, + QWidget* parent=0, const char* name=0); + ~Q3ButtonGroup(); + + bool isExclusive() const; + bool isRadioButtonExclusive() const { return radio_excl; } + void setExclusive(bool); + void setRadioButtonExclusive(bool); + +public: + int insert(QAbstractButton *, int id=-1); + void remove(QAbstractButton *); + QAbstractButton *find(int id) const; + int id(QAbstractButton *) const; + int count() const; + + void setButton(int id); + + QAbstractButton *selected() const; + int selectedId() const; + +Q_SIGNALS: + void pressed(int id); + void released(int id); + void clicked(int id); + +protected Q_SLOTS: + void buttonPressed(); + void buttonReleased(); + void buttonClicked(); + +protected: + bool event(QEvent * e); + +private Q_SLOTS: + void buttonDestroyed(); + +private: + Q_DISABLE_COPY(Q3ButtonGroup) + + void init(); + void fixChildren() const; + int insert_helper(QAbstractButton* , int id=-1); + void remove_helper(QAbstractButton *); + + bool excl_grp; // Not used. + bool radio_excl; + QMap buttonIds; + QButtonGroup group; +}; + +class Q_COMPAT_EXPORT Q3VButtonGroup : public Q3ButtonGroup +{ + Q_OBJECT +public: + inline Q3VButtonGroup(QWidget* parent=0, const char* name=0) + : Q3ButtonGroup(1, Qt::Horizontal /* sic! */, parent, name) {} + inline Q3VButtonGroup(const QString &title, QWidget* parent=0, const char* name=0) + : Q3ButtonGroup(1, Qt::Horizontal /* sic! */, title, parent, name) {} + +private: + Q_DISABLE_COPY(Q3VButtonGroup) +}; + + +class Q_COMPAT_EXPORT Q3HButtonGroup : public Q3ButtonGroup +{ + Q_OBJECT +public: + inline Q3HButtonGroup(QWidget* parent=0, const char* name=0) + : Q3ButtonGroup(1, Qt::Vertical /* sic! */, parent, name) {} + inline Q3HButtonGroup(const QString &title, QWidget* parent=0, const char* name=0) + : Q3ButtonGroup(1, Qt::Vertical /* sic! */, title, parent, name) {} + +private: + Q_DISABLE_COPY(Q3HButtonGroup) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3BUTTONGROUP_H diff --git a/qtinterface/qt4/Qt/q3cache.h b/qtinterface/qt4/Qt/q3cache.h new file mode 100644 index 0000000..8a227b7 --- /dev/null +++ b/qtinterface/qt4/Qt/q3cache.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3CACHE_H +#define Q3CACHE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3Cache +#ifdef qdoc + : public Q3PtrCollection +#else + : public Q3GCache +#endif +{ +public: + Q3Cache(const Q3Cache &c) : Q3GCache(c) {} + Q3Cache(int maxCost=100, int size=17, bool caseSensitive=true) + : Q3GCache(maxCost, size, StringKey, caseSensitive, false) {} + ~Q3Cache() { clear(); } + Q3Cache &operator=(const Q3Cache &c) + { return (Q3Cache&)Q3GCache::operator=(c); } + int maxCost() const { return Q3GCache::maxCost(); } + int totalCost() const { return Q3GCache::totalCost(); } + void setMaxCost(int m) { Q3GCache::setMaxCost(m); } + uint count() const { return Q3GCache::count(); } + uint size() const { return Q3GCache::size(); } + bool isEmpty() const { return Q3GCache::count() == 0; } + void clear() { Q3GCache::clear(); } + bool insert(const QString &k, const type *d, int c=1, int p=0) + { return Q3GCache::insert_string(k,(Item)d,c,p);} + bool remove(const QString &k) + { return Q3GCache::remove_string(k); } + type *take(const QString &k) + { return (type *)Q3GCache::take_string(k); } + type *find(const QString &k, bool ref=true) const + { return (type *)Q3GCache::find_string(k,ref);} + type *operator[](const QString &k) const + { return (type *)Q3GCache::find_string(k);} + void statistics() const { Q3GCache::statistics(); } +private: + void deleteItem(Item d); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3Cache::deleteItem(Q3PtrCollection::Item) +{ +} +#endif + +template inline void Q3Cache::deleteItem(Q3PtrCollection::Item d) +{ + if (del_item) delete (type *)d; +} + +template +class Q3CacheIterator : public Q3GCacheIterator +{ +public: + Q3CacheIterator(const Q3Cache &c):Q3GCacheIterator((Q3GCache &)c) {} + Q3CacheIterator(const Q3CacheIterator &ci) + : Q3GCacheIterator((Q3GCacheIterator &)ci) {} + Q3CacheIterator &operator=(const Q3CacheIterator&ci) + { return (Q3CacheIterator&)Q3GCacheIterator::operator=(ci); } + uint count() const { return Q3GCacheIterator::count(); } + bool isEmpty() const { return Q3GCacheIterator::count() == 0; } + bool atFirst() const { return Q3GCacheIterator::atFirst(); } + bool atLast() const { return Q3GCacheIterator::atLast(); } + type *toFirst() { return (type *)Q3GCacheIterator::toFirst(); } + type *toLast() { return (type *)Q3GCacheIterator::toLast(); } + operator type *() const { return (type *)Q3GCacheIterator::get(); } + type *current() const { return (type *)Q3GCacheIterator::get(); } + QString currentKey() const{ return Q3GCacheIterator::getKeyString(); } + type *operator()() { return (type *)Q3GCacheIterator::operator()();} + type *operator++() { return (type *)Q3GCacheIterator::operator++(); } + type *operator+=(uint j) { return (type *)Q3GCacheIterator::operator+=(j);} + type *operator--() { return (type *)Q3GCacheIterator::operator--(); } + type *operator-=(uint j) { return (type *)Q3GCacheIterator::operator-=(j);} +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3CACHE_H diff --git a/qtinterface/qt4/Qt/q3canvas.h b/qtinterface/qt4/Qt/q3canvas.h new file mode 100644 index 0000000..be820e3 --- /dev/null +++ b/qtinterface/qt4/Qt/q3canvas.h @@ -0,0 +1,787 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3CANVAS_H +#define Q3CANVAS_H + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +class Q3CanvasSprite; +class Q3CanvasPolygonalItem; +class Q3CanvasRectangle; +class Q3CanvasPolygon; +class Q3CanvasEllipse; +class Q3CanvasText; +class Q3CanvasLine; +class Q3CanvasChunk; +class Q3Canvas; +class Q3CanvasItem; +class Q3CanvasView; +class Q3CanvasPixmap; + +class Q_COMPAT_EXPORT Q3CanvasItemList : public Q3ValueList { +public: + void sort(); + void drawUnique(QPainter& painter); + Q3CanvasItemList operator+(const Q3CanvasItemList &l) const; +}; + + +class Q3CanvasItemExtra; + +class Q_COMPAT_EXPORT Q3CanvasItem +{ +public: + Q3CanvasItem(Q3Canvas* canvas); + virtual ~Q3CanvasItem(); + + double x() const + { return myx; } + double y() const + { return myy; } + double z() const + { return myz; } // (depth) + + virtual void moveBy(double dx, double dy); + void move(double x, double y); + void setX(double a) { move(a,y()); } + void setY(double a) { move(x(),a); } + void setZ(double a) { myz=a; changeChunks(); } + + bool animated() const; + virtual void setAnimated(bool y); + virtual void setVelocity(double vx, double vy); + void setXVelocity(double vx) { setVelocity(vx,yVelocity()); } + void setYVelocity(double vy) { setVelocity(xVelocity(),vy); } + double xVelocity() const; + double yVelocity() const; + virtual void advance(int stage); + + virtual bool collidesWith(const Q3CanvasItem*) const=0; + + Q3CanvasItemList collisions(bool exact /* NO DEFAULT */) const; + + virtual void setCanvas(Q3Canvas*); + + virtual void draw(QPainter&)=0; + + void show(); + void hide(); + + virtual void setVisible(bool yes); + bool isVisible() const + { return (bool)vis; } + virtual void setSelected(bool yes); + bool isSelected() const + { return (bool)sel; } + virtual void setEnabled(bool yes); + bool isEnabled() const + { return (bool)ena; } + virtual void setActive(bool yes); + bool isActive() const + { return (bool)act; } + bool visible() const + { return (bool)vis; } + bool selected() const + { return (bool)sel; } + bool enabled() const + { return (bool)ena; } + bool active() const + { return (bool)act; } + + enum RttiValues { + Rtti_Item = 0, + Rtti_Sprite = 1, + Rtti_PolygonalItem = 2, + Rtti_Text = 3, + Rtti_Polygon = 4, + Rtti_Rectangle = 5, + Rtti_Ellipse = 6, + Rtti_Line = 7, + Rtti_Spline = 8 + }; + + virtual int rtti() const; + static int RTTI; + + virtual QRect boundingRect() const=0; + virtual QRect boundingRectAdvanced() const; + + Q3Canvas* canvas() const + { return cnv; } + +protected: + void update() { changeChunks(); } + +private: + // For friendly subclasses... + + friend class Q3CanvasPolygonalItem; + friend class Q3CanvasSprite; + friend class Q3CanvasRectangle; + friend class Q3CanvasPolygon; + friend class Q3CanvasEllipse; + friend class Q3CanvasText; + friend class Q3CanvasLine; + + virtual Q3PointArray chunks() const; + virtual void addToChunks(); + virtual void removeFromChunks(); + virtual void changeChunks(); + virtual bool collidesWith(const Q3CanvasSprite*, + const Q3CanvasPolygonalItem*, + const Q3CanvasRectangle*, + const Q3CanvasEllipse*, + const Q3CanvasText*) const = 0; + // End of friend stuff + + Q3Canvas* cnv; + static Q3Canvas* current_canvas; + double myx,myy,myz; + Q3CanvasItemExtra *ext; + Q3CanvasItemExtra& extra(); + uint ani:1; + uint vis:1; + uint val:1; + uint sel:1; + uint ena:1; + uint act:1; +}; + + +class Q3CanvasData; + +class Q_COMPAT_EXPORT Q3Canvas : public QObject +{ + Q_OBJECT +public: + Q3Canvas(QObject* parent = 0, const char* name = 0); + Q3Canvas(int w, int h); + Q3Canvas(QPixmap p, int h, int v, int tilewidth, int tileheight); + + virtual ~Q3Canvas(); + + virtual void setTiles(QPixmap tiles, int h, int v, + int tilewidth, int tileheight); + virtual void setBackgroundPixmap(const QPixmap& p); + QPixmap backgroundPixmap() const; + + virtual void setBackgroundColor(const QColor& c); + QColor backgroundColor() const; + + virtual void setTile(int x, int y, int tilenum); + int tile(int x, int y) const + { return grid[x+y*htiles]; } + + int tilesHorizontally() const + { return htiles; } + int tilesVertically() const + { return vtiles; } + + int tileWidth() const + { return tilew; } + int tileHeight() const + { return tileh; } + + virtual void resize(int width, int height); + int width() const + { return awidth; } + int height() const + { return aheight; } + QSize size() const + { return QSize(awidth,aheight); } + QRect rect() const + { return QRect(0, 0, awidth, aheight); } + bool onCanvas(int x, int y) const + { return x>=0 && y>=0 && x=0 && y>=0 && x, Q3PtrList hotspots); + + Q3CanvasPixmapArray(Q3ValueList, Q3PointArray hotspots = Q3PointArray()); + ~Q3CanvasPixmapArray(); + +#ifndef QT_NO_IMAGEIO + bool readPixmaps(const QString& datafilenamepattern, int framecount=0); + bool readCollisionMasks(const QString& filenamepattern); +#endif + + // deprecated + bool operator!(); // Failure check. + bool isValid() const; + + Q3CanvasPixmap* image(int i) const + { return img ? img[i] : 0; } + void setImage(int i, Q3CanvasPixmap* p); + uint count() const + { return (uint)framecount; } + +private: + Q_DISABLE_COPY(Q3CanvasPixmapArray) + +#ifndef QT_NO_IMAGEIO + bool readPixmaps(const QString& datafilenamepattern, int framecount, bool maskonly); +#endif + + void reset(); + int framecount; + Q3CanvasPixmap** img; +}; + + +class Q_COMPAT_EXPORT Q3CanvasSprite : public Q3CanvasItem +{ +public: + Q3CanvasSprite(Q3CanvasPixmapArray* array, Q3Canvas* canvas); + + void setSequence(Q3CanvasPixmapArray* seq); + + virtual ~Q3CanvasSprite(); + + void move(double x, double y); + virtual void move(double x, double y, int frame); + void setFrame(int); + enum FrameAnimationType { Cycle, Oscillate }; + virtual void setFrameAnimation(FrameAnimationType=Cycle, int step=1, int state=0); + int frame() const + { return frm; } + int frameCount() const + { return images->count(); } + + int rtti() const; + static int RTTI; + + bool collidesWith(const Q3CanvasItem*) const; + + QRect boundingRect() const; + + // is there a reason for these to be protected? Lars +//protected: + + int width() const; + int height() const; + + int leftEdge() const; + int topEdge() const; + int rightEdge() const; + int bottomEdge() const; + + int leftEdge(int nx) const; + int topEdge(int ny) const; + int rightEdge(int nx) const; + int bottomEdge(int ny) const; + Q3CanvasPixmap* image() const + { return images->image(frm); } + virtual Q3CanvasPixmap* imageAdvanced() const; + Q3CanvasPixmap* image(int f) const + { return images->image(f); } + virtual void advance(int stage); + +public: + void draw(QPainter& painter); + +private: + Q_DISABLE_COPY(Q3CanvasSprite) + + void addToChunks(); + void removeFromChunks(); + void changeChunks(); + + int frm; + ushort anim_val; + uint anim_state:2; + uint anim_type:14; + bool collidesWith(const Q3CanvasSprite*, + const Q3CanvasPolygonalItem*, + const Q3CanvasRectangle*, + const Q3CanvasEllipse*, + const Q3CanvasText*) const; + + friend bool qt_testCollision(const Q3CanvasSprite* s1, + const Q3CanvasSprite* s2); + + Q3CanvasPixmapArray* images; +}; + +class QPolygonalProcessor; + +class Q_COMPAT_EXPORT Q3CanvasPolygonalItem : public Q3CanvasItem +{ +public: + Q3CanvasPolygonalItem(Q3Canvas* canvas); + virtual ~Q3CanvasPolygonalItem(); + + bool collidesWith(const Q3CanvasItem*) const; + + virtual void setPen(QPen p); + virtual void setBrush(QBrush b); + + QPen pen() const + { return pn; } + QBrush brush() const + { return br; } + + virtual Q3PointArray areaPoints() const=0; + virtual Q3PointArray areaPointsAdvanced() const; + QRect boundingRect() const; + + int rtti() const; + static int RTTI; + +protected: + void draw(QPainter &); + virtual void drawShape(QPainter &) = 0; + + bool winding() const; + void setWinding(bool); + + void invalidate(); + bool isValid() const + { return (bool)val; } + +private: + void scanPolygon(const Q3PointArray& pa, int winding, + QPolygonalProcessor& process) const; + Q3PointArray chunks() const; + + bool collidesWith(const Q3CanvasSprite*, + const Q3CanvasPolygonalItem*, + const Q3CanvasRectangle*, + const Q3CanvasEllipse*, + const Q3CanvasText*) const; + + QBrush br; + QPen pn; + uint wind:1; +}; + + +class Q_COMPAT_EXPORT Q3CanvasRectangle : public Q3CanvasPolygonalItem +{ +public: + Q3CanvasRectangle(Q3Canvas* canvas); + Q3CanvasRectangle(const QRect&, Q3Canvas* canvas); + Q3CanvasRectangle(int x, int y, int width, int height, Q3Canvas* canvas); + + ~Q3CanvasRectangle(); + + int width() const; + int height() const; + void setSize(int w, int h); + QSize size() const + { return QSize(w,h); } + Q3PointArray areaPoints() const; + QRect rect() const + { return QRect(int(x()),int(y()),w,h); } + + bool collidesWith(const Q3CanvasItem*) const; + + int rtti() const; + static int RTTI; + +protected: + void drawShape(QPainter &); + Q3PointArray chunks() const; + +private: + bool collidesWith( const Q3CanvasSprite*, + const Q3CanvasPolygonalItem*, + const Q3CanvasRectangle*, + const Q3CanvasEllipse*, + const Q3CanvasText*) const; + + int w, h; +}; + + +class Q_COMPAT_EXPORT Q3CanvasPolygon : public Q3CanvasPolygonalItem +{ +public: + Q3CanvasPolygon(Q3Canvas* canvas); + ~Q3CanvasPolygon(); + void setPoints(Q3PointArray); + Q3PointArray points() const; + void moveBy(double dx, double dy); + + Q3PointArray areaPoints() const; + + int rtti() const; + static int RTTI; + +protected: + void drawShape(QPainter &); + Q3PointArray poly; +}; + + +class Q_COMPAT_EXPORT Q3CanvasSpline : public Q3CanvasPolygon +{ +public: + Q3CanvasSpline(Q3Canvas* canvas); + ~Q3CanvasSpline(); + + void setControlPoints(Q3PointArray, bool closed=true); + Q3PointArray controlPoints() const; + bool closed() const; + + int rtti() const; + static int RTTI; + +private: + void recalcPoly(); + Q3PointArray bez; + bool cl; +}; + + +class Q_COMPAT_EXPORT Q3CanvasLine : public Q3CanvasPolygonalItem +{ +public: + Q3CanvasLine(Q3Canvas* canvas); + ~Q3CanvasLine(); + void setPoints(int x1, int y1, int x2, int y2); + + QPoint startPoint() const + { return QPoint(x1,y1); } + QPoint endPoint() const + { return QPoint(x2,y2); } + + int rtti() const; + static int RTTI; + + void setPen(QPen p); + void moveBy(double dx, double dy); + +protected: + void drawShape(QPainter &); + Q3PointArray areaPoints() const; + +private: + int x1,y1,x2,y2; +}; + + +class Q_COMPAT_EXPORT Q3CanvasEllipse : public Q3CanvasPolygonalItem +{ + +public: + Q3CanvasEllipse(Q3Canvas* canvas); + Q3CanvasEllipse(int width, int height, Q3Canvas* canvas); + Q3CanvasEllipse(int width, int height, int startangle, int angle, + Q3Canvas* canvas); + + ~Q3CanvasEllipse(); + + int width() const; + int height() const; + void setSize(int w, int h); + void setAngles(int start, int length); + int angleStart() const + { return a1; } + int angleLength() const + { return a2; } + Q3PointArray areaPoints() const; + + bool collidesWith(const Q3CanvasItem*) const; + + int rtti() const; + static int RTTI; + +protected: + void drawShape(QPainter &); + +private: + bool collidesWith(const Q3CanvasSprite*, + const Q3CanvasPolygonalItem*, + const Q3CanvasRectangle*, + const Q3CanvasEllipse*, + const Q3CanvasText*) const; + int w, h; + int a1, a2; +}; + + +class Q3CanvasTextExtra; + +class Q_COMPAT_EXPORT Q3CanvasText : public Q3CanvasItem +{ +public: + Q3CanvasText(Q3Canvas* canvas); + Q3CanvasText(const QString&, Q3Canvas* canvas); + Q3CanvasText(const QString&, QFont, Q3Canvas* canvas); + + virtual ~Q3CanvasText(); + + void setText(const QString&); + void setFont(const QFont&); + void setColor(const QColor&); + QString text() const; + QFont font() const; + QColor color() const; + + void moveBy(double dx, double dy); + + int textFlags() const + { return flags; } + void setTextFlags(int); + + QRect boundingRect() const; + + bool collidesWith(const Q3CanvasItem*) const; + + int rtti() const; + static int RTTI; + +protected: + virtual void draw(QPainter&); + +private: + Q_DISABLE_COPY(Q3CanvasText) + + void addToChunks(); + void removeFromChunks(); + void changeChunks(); + + void setRect(); + QRect brect; + QString txt; + int flags; + QFont fnt; + QColor col; + Q3CanvasTextExtra* extra; + + bool collidesWith(const Q3CanvasSprite*, + const Q3CanvasPolygonalItem*, + const Q3CanvasRectangle*, + const Q3CanvasEllipse*, + const Q3CanvasText*) const; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3CANVAS_H diff --git a/qtinterface/qt4/Qt/q3cleanuphandler.h b/qtinterface/qt4/Qt/q3cleanuphandler.h new file mode 100644 index 0000000..921b27f --- /dev/null +++ b/qtinterface/qt4/Qt/q3cleanuphandler.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3CLEANUPHANDLER_H +#define Q3CLEANUPHANDLER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3CleanupHandler +{ + QListData p; +public: + inline Q3CleanupHandler() + { p.d = 0; } + ~Q3CleanupHandler() + { + if (p.d) { + for (int i = 0; i < p.size(); ++i) { + T** t = static_cast(*p.at(i)); + delete *t; + *t = 0; + } + qFree(p.d); + p.d = 0; + } + } + + T* add(T **object) + { + if (!p.d) { + p.d = &QListData::shared_null; + p.d->ref.ref(); + p.detach(); + } + *p.prepend() = object; + return *object; + } + void remove(T **object) + { + if (p.d) + for (int i = 0; i < p.size(); ++i) + if (*p.at(i) == object) + p.remove(i--); + } +}; + +template +class Q3SingleCleanupHandler +{ + T **object; +public: + inline Q3SingleCleanupHandler() + : object(0) {} + inline ~Q3SingleCleanupHandler() + { if (object) { delete *object; *object = 0; } } + inline T* set(T **o) + { object = o; return *object; } + inline void reset() { object = 0; } +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif //Q3CLEANUPHANDLER_H diff --git a/qtinterface/qt4/Qt/q3combobox.h b/qtinterface/qt4/Qt/q3combobox.h new file mode 100644 index 0000000..d779f71 --- /dev/null +++ b/qtinterface/qt4/Qt/q3combobox.h @@ -0,0 +1,224 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3COMBOBOX_H +#define Q3COMBOBOX_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_COMBOBOX + +class Q3StrList; +class QStringList; +class QLineEdit; +class QValidator; +class Q3ListBox; +class Q3ComboBoxData; +class QWheelEvent; + +class Q_COMPAT_EXPORT Q3ComboBox : public QWidget +{ + Q_OBJECT + Q_ENUMS( Policy ) + Q_PROPERTY( bool editable READ editable WRITE setEditable ) + Q_PROPERTY( int count READ count ) + Q_PROPERTY( QString currentText READ currentText WRITE setCurrentText DESIGNABLE false ) + Q_PROPERTY( int currentItem READ currentItem WRITE setCurrentItem ) + Q_PROPERTY( bool autoResize READ autoResize WRITE setAutoResize DESIGNABLE false ) + Q_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit ) + Q_PROPERTY( int maxCount READ maxCount WRITE setMaxCount ) + Q_PROPERTY( Policy insertionPolicy READ insertionPolicy WRITE setInsertionPolicy ) + Q_PROPERTY( bool autoCompletion READ autoCompletion WRITE setAutoCompletion ) + Q_PROPERTY( bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled ) + +public: + Q3ComboBox( QWidget* parent=0, const char* name=0 ); + Q3ComboBox( bool rw, QWidget* parent=0, const char* name=0 ); + ~Q3ComboBox(); + + int count() const; + + void insertStringList( const QStringList &, int index=-1 ); + void insertStrList( const Q3StrList &, int index=-1 ); + void insertStrList( const Q3StrList *, int index=-1 ); + void insertStrList( const char **, int numStrings=-1, int index=-1); + + void insertItem( const QString &text, int index=-1 ); + void insertItem( const QPixmap &pixmap, int index=-1 ); + void insertItem( const QPixmap &pixmap, const QString &text, int index=-1 ); + + void removeItem( int index ); + + int currentItem() const; + virtual void setCurrentItem( int index ); + + QString currentText() const; + virtual void setCurrentText( const QString& ); + + QString text( int index ) const; + const QPixmap *pixmap( int index ) const; + + void changeItem( const QString &text, int index ); + void changeItem( const QPixmap &pixmap, int index ); + void changeItem( const QPixmap &pixmap, const QString &text, int index ); + + bool autoResize() const; + virtual void setAutoResize( bool ); + QSize sizeHint() const; + + void setPalette( const QPalette & ); + void setFont( const QFont & ); + void setEnabled( bool ); + + virtual void setSizeLimit( int ); + int sizeLimit() const; + + virtual void setMaxCount( int ); + int maxCount() const; + + enum Policy { NoInsertion, + AtTop, + AtCurrent, + AtBottom, + AfterCurrent, + BeforeCurrent, + NoInsert = NoInsertion, + InsertAtTop = AtTop, + InsertAtCurrent = AtCurrent, + InsertAtBottom = AtBottom, + InsertAfterCurrent = AfterCurrent, + InsertBeforeCurrent = BeforeCurrent + }; + + virtual void setInsertionPolicy( Policy policy ); + Policy insertionPolicy() const; + + virtual void setValidator( const QValidator * ); + const QValidator * validator() const; + + virtual void setListBox( Q3ListBox * ); + Q3ListBox * listBox() const; + + virtual void setLineEdit( QLineEdit *edit ); + QLineEdit* lineEdit() const; + + virtual void setAutoCompletion( bool ); + bool autoCompletion() const; + + bool eventFilter( QObject *object, QEvent *event ); + + void setDuplicatesEnabled( bool enable ); + bool duplicatesEnabled() const; + + bool editable() const; + void setEditable( bool ); + + virtual void popup(); + + void hide(); + +public Q_SLOTS: + void clear(); + void clearValidator(); + void clearEdit(); + virtual void setEditText( const QString &); + +Q_SIGNALS: + void activated( int index ); + void highlighted( int index ); + void activated( const QString &); + void highlighted( const QString &); + void textChanged( const QString &); + +private Q_SLOTS: + void internalActivate( int ); + void internalHighlight( int ); + void internalClickTimeout(); + void returnPressed(); + +protected: + void paintEvent( QPaintEvent * ); + void resizeEvent( QResizeEvent * ); + void mousePressEvent( QMouseEvent * ); + void mouseMoveEvent( QMouseEvent * ); + void mouseReleaseEvent( QMouseEvent * ); + void mouseDoubleClickEvent( QMouseEvent * ); + void keyPressEvent( QKeyEvent *e ); + void focusInEvent( QFocusEvent *e ); + void focusOutEvent( QFocusEvent *e ); +#ifndef QT_NO_WHEELEVENT + void wheelEvent( QWheelEvent *e ); +#endif + void styleChange( QStyle& ); + + void updateMask(); + +private: + void setUpListBox(); + void setUpLineEdit(); + void popDownListBox(); + void reIndex(); + void currentChanged(); + int completionIndex( const QString &, int ) const; + + Q3ComboBoxData *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + Q3ComboBox( const Q3ComboBox & ); + Q3ComboBox &operator=( const Q3ComboBox & ); +#endif +}; + + +#endif // QT_NO_COMBOBOX + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3COMBOBOX_H diff --git a/qtinterface/qt4/Qt/q3cstring.h b/qtinterface/qt4/Qt/q3cstring.h new file mode 100644 index 0000000..604dc9a --- /dev/null +++ b/qtinterface/qt4/Qt/q3cstring.h @@ -0,0 +1,273 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3CSTRING_H +#define Q3CSTRING_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +/***************************************************************************** + QCString class + *****************************************************************************/ + +class QRegExp; + +class Q_COMPAT_EXPORT Q3CString : public QByteArray +{ +public: + Q3CString() {} + Q3CString(int size) : QByteArray(size, '\0') {} + Q3CString(const Q3CString &s) : QByteArray(s) {} + Q3CString(const QByteArray &ba) : QByteArray(ba) {} + Q3CString(const char *str) : QByteArray(str) {} + Q3CString(const char *str, uint maxlen) : QByteArray(str, qMin(qstrlen(str), maxlen - 1)) {} + + Q3CString &operator=(const Q3CString &s) { + QByteArray::operator=(s); return *this; + } + Q3CString &operator=(const char *str) { + QByteArray::operator=(str); return *this; + } + Q3CString &operator=(const QByteArray &ba) { + QByteArray::operator=(ba); return *this; + } + + Q3CString copy() const { return *this; } + Q3CString &sprintf(const char *format, ...); + + Q3CString left(uint len) const { return QByteArray::left(len); } + Q3CString right(uint len) const { return QByteArray::right(len); } + Q3CString mid(uint index, uint len=0xffffffff) const { return QByteArray::mid(index, len); } + + Q3CString leftJustify(uint width, char fill=' ', bool trunc=false)const; + Q3CString rightJustify(uint width, char fill=' ',bool trunc=false)const; + + Q3CString lower() const { return QByteArray::toLower(); } + Q3CString upper() const { return QByteArray::toUpper(); } + + Q3CString stripWhiteSpace() const { return QByteArray::trimmed(); } + Q3CString simplifyWhiteSpace() const { return QByteArray::simplified(); } + + Q3CString &insert(uint index, const char *c) { QByteArray::insert(index, c); return *this; } + Q3CString &insert(uint index, char c) { QByteArray::insert(index, c); return *this; } + Q3CString &append(const char *c) { QByteArray::append(c); return *this; } + Q3CString &prepend(const char *c) { QByteArray::prepend(c); return *this; } + Q3CString &remove(uint index, uint len) { QByteArray::remove(index, len); return *this; } + Q3CString &replace(uint index, uint len, const char *c) + { QByteArray::replace(index, len, c); return *this; } + Q3CString &replace(char c, const Q3CString &after) { return replace(c, after.constData()); } + Q3CString &replace(char c, const char *after) { QByteArray::replace(c, after); return *this; } + Q3CString &replace(const Q3CString &b, const Q3CString &a) + { return replace(b.constData(), a.constData()); } + Q3CString &replace(const char *b, const char *a) { QByteArray::replace(b, a); return *this; } + Q3CString &replace(char b, char a) { QByteArray::replace(b, a); return *this; } + + short toShort(bool *ok=0) const; + ushort toUShort(bool *ok=0) const; + int toInt(bool *ok=0) const; + uint toUInt(bool *ok=0) const; + long toLong(bool *ok=0) const; + ulong toULong(bool *ok=0) const; + float toFloat(bool *ok=0) const; + double toDouble(bool *ok=0) const; + + Q3CString &setStr(const char *s) { *this = s; return *this; } + Q3CString &setNum(short); + Q3CString &setNum(ushort); + Q3CString &setNum(int); + Q3CString &setNum(uint); + Q3CString &setNum(long); + Q3CString &setNum(ulong); + Q3CString &setNum(float, char f='g', int prec=6); + Q3CString &setNum(double, char f='g', int prec=6); + + bool setExpand(uint index, char c); + +}; + + +/***************************************************************************** + Q3CString stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_COMPAT_EXPORT QDataStream &operator<<(QDataStream &d, const Q3CString &s); +Q_COMPAT_EXPORT QDataStream &operator>>(QDataStream &d, Q3CString &s); +#endif + +/***************************************************************************** + Q3CString inline functions + *****************************************************************************/ + +inline Q3CString &Q3CString::setNum(short n) +{ return setNum(long(n)); } + +inline Q3CString &Q3CString::setNum(ushort n) +{ return setNum(ulong(n)); } + +inline Q3CString &Q3CString::setNum(int n) +{ return setNum(long(n)); } + +inline Q3CString &Q3CString::setNum(uint n) +{ return setNum(ulong(n)); } + +inline Q3CString &Q3CString::setNum(float n, char f, int prec) +{ return setNum(double(n),f,prec); } + +/***************************************************************************** + Q3CString non-member operators + *****************************************************************************/ + +Q_COMPAT_EXPORT inline bool operator==(const Q3CString &s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) == 0; } + +Q_COMPAT_EXPORT inline bool operator==(const Q3CString &s1, const char *s2) +{ return qstrcmp(s1, s2) == 0; } + +Q_COMPAT_EXPORT inline bool operator==(const char *s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) == 0; } + +Q_COMPAT_EXPORT inline bool operator!=(const Q3CString &s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) != 0; } + +Q_COMPAT_EXPORT inline bool operator!=(const Q3CString &s1, const char *s2) +{ return qstrcmp(s1, s2) != 0; } + +Q_COMPAT_EXPORT inline bool operator!=(const char *s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) != 0; } + +Q_COMPAT_EXPORT inline bool operator<(const Q3CString &s1, const Q3CString& s2) +{ return qstrcmp(s1, s2) < 0; } + +Q_COMPAT_EXPORT inline bool operator<(const Q3CString &s1, const char *s2) +{ return qstrcmp(s1, s2) < 0; } + +Q_COMPAT_EXPORT inline bool operator<(const char *s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) < 0; } + +Q_COMPAT_EXPORT inline bool operator<=(const Q3CString &s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) <= 0; } + +Q_COMPAT_EXPORT inline bool operator<=(const Q3CString &s1, const char *s2) +{ return qstrcmp(s1, s2) <= 0; } + +Q_COMPAT_EXPORT inline bool operator<=(const char *s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) <= 0; } + +Q_COMPAT_EXPORT inline bool operator>(const Q3CString &s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) > 0; } + +Q_COMPAT_EXPORT inline bool operator>(const Q3CString &s1, const char *s2) +{ return qstrcmp(s1, s2) > 0; } + +Q_COMPAT_EXPORT inline bool operator>(const char *s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) > 0; } + +Q_COMPAT_EXPORT inline bool operator>=(const Q3CString &s1, const Q3CString& s2) +{ return qstrcmp(s1, s2) >= 0; } + +Q_COMPAT_EXPORT inline bool operator>=(const Q3CString &s1, const char *s2) +{ return qstrcmp(s1, s2) >= 0; } + +Q_COMPAT_EXPORT inline bool operator>=(const char *s1, const Q3CString &s2) +{ return qstrcmp(s1, s2) >= 0; } + +Q_COMPAT_EXPORT inline const Q3CString operator+(const Q3CString &s1, + const Q3CString &s2) +{ + Q3CString tmp(s1); + tmp += s2; + return tmp; +} +Q_COMPAT_EXPORT inline const Q3CString operator+(const Q3CString &s1, + const QByteArray &s2) +{ + QByteArray tmp(s1); + tmp += s2; + return tmp; +} +Q_COMPAT_EXPORT inline const Q3CString operator+(const QByteArray &s1, + const Q3CString &s2) +{ + QByteArray tmp(s1); + tmp += s2; + return tmp; +} + +Q_COMPAT_EXPORT inline const Q3CString operator+(const Q3CString &s1, const char *s2) +{ + Q3CString tmp(s1); + tmp += s2; + return tmp; +} + +Q_COMPAT_EXPORT inline const Q3CString operator+(const char *s1, const Q3CString &s2) +{ + Q3CString tmp(s1); + tmp += s2; + return tmp; +} + +Q_COMPAT_EXPORT inline const Q3CString operator+(const Q3CString &s1, char c2) +{ + Q3CString tmp(s1); + tmp += c2; + return tmp; +} + +Q_COMPAT_EXPORT inline const Q3CString operator+(char c1, const Q3CString &s2) +{ + Q3CString tmp; + tmp += c1; + tmp += s2; + return tmp; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3CSTRING_H diff --git a/qtinterface/qt4/Qt/q3databrowser.h b/qtinterface/qt4/Qt/q3databrowser.h new file mode 100644 index 0000000..a532adb --- /dev/null +++ b/qtinterface/qt4/Qt/q3databrowser.h @@ -0,0 +1,183 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DATABROWSER_H +#define Q3DATABROWSER_H + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL_VIEW_WIDGETS + +class Q3SqlForm; +class Q3DataBrowserPrivate; + +class Q_COMPAT_EXPORT Q3DataBrowser : public QWidget +{ + Q_OBJECT + Q_PROPERTY(bool boundaryChecking READ boundaryChecking WRITE setBoundaryChecking) + Q_PROPERTY(QString filter READ filter WRITE setFilter) + Q_PROPERTY(QStringList sort READ sort WRITE setSort) + Q_PROPERTY(bool confirmEdits READ confirmEdits WRITE setConfirmEdits) + Q_PROPERTY(bool confirmInsert READ confirmInsert WRITE setConfirmInsert) + Q_PROPERTY(bool confirmUpdate READ confirmUpdate WRITE setConfirmUpdate) + Q_PROPERTY(bool confirmDelete READ confirmDelete WRITE setConfirmDelete) + Q_PROPERTY(bool confirmCancels READ confirmCancels WRITE setConfirmCancels) + Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) + Q_PROPERTY(bool autoEdit READ autoEdit WRITE setAutoEdit) + +public: + Q3DataBrowser(QWidget* parent=0, const char* name=0, Qt::WindowFlags fl = 0); + ~Q3DataBrowser(); + + enum Boundary { + Unknown, + None, + BeforeBeginning, + Beginning, + End, + AfterEnd + }; + + Boundary boundary(); + void setBoundaryChecking(bool active); + bool boundaryChecking() const; + + void setSort(const QSqlIndex& sort); + void setSort(const QStringList& sort); + QStringList sort() const; + void setFilter(const QString& filter); + QString filter() const; + virtual void setSqlCursor(Q3SqlCursor* cursor, bool autoDelete = false); + Q3SqlCursor* sqlCursor() const; + virtual void setForm(Q3SqlForm* form); + Q3SqlForm* form(); + + virtual void setConfirmEdits(bool confirm); + virtual void setConfirmInsert(bool confirm); + virtual void setConfirmUpdate(bool confirm); + virtual void setConfirmDelete(bool confirm); + virtual void setConfirmCancels(bool confirm); + bool confirmEdits() const; + bool confirmInsert() const; + bool confirmUpdate() const; + bool confirmDelete() const; + bool confirmCancels() const; + + virtual void setReadOnly(bool active); + bool isReadOnly() const; + virtual void setAutoEdit(bool autoEdit); + bool autoEdit() const; + + virtual bool seek(int i, bool relative = false); + +Q_SIGNALS: + void firstRecordAvailable(bool available); + void lastRecordAvailable(bool available); + void nextRecordAvailable(bool available); + void prevRecordAvailable(bool available); + + void currentChanged(const QSqlRecord* record); + void primeInsert(QSqlRecord* buf); + void primeUpdate(QSqlRecord* buf); + void primeDelete(QSqlRecord* buf); + void beforeInsert(QSqlRecord* buf); + void beforeUpdate(QSqlRecord* buf); + void beforeDelete(QSqlRecord* buf); + void cursorChanged(Q3SqlCursor::Mode mode); + +public Q_SLOTS: + virtual void refresh(); + + virtual void insert(); + virtual void update(); + virtual void del(); + + virtual void first(); + virtual void last(); + virtual void next(); + virtual void prev(); + + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + + void updateBoundary(); + +protected: + virtual bool insertCurrent(); + virtual bool updateCurrent(); + virtual bool deleteCurrent(); + virtual bool currentEdited(); + + virtual QSql::Confirm confirmEdit(QSql::Op m); + virtual QSql::Confirm confirmCancel(QSql::Op m); + + virtual void handleError(const QSqlError& error); + +private: + typedef bool (Q3SqlCursor::*Nav)(); + bool preNav(); + void postNav(bool primeUpd); + void nav(Nav nav); + Q3DataBrowserPrivate* d; + + Q_DISABLE_COPY(Q3DataBrowser) +}; + +#endif // QT_NO_SQL_VIEW_WIDGETS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DATABROWSER_H diff --git a/qtinterface/qt4/Qt/q3datatable.h b/qtinterface/qt4/Qt/q3datatable.h new file mode 100644 index 0000000..68d0ec1 --- /dev/null +++ b/qtinterface/qt4/Qt/q3datatable.h @@ -0,0 +1,251 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DATATABLE_H +#define Q3DATATABLE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL_VIEW_WIDGETS + +class QPainter; +class QSqlField; +class Q3SqlPropertyMap; +class Q3DataTablePrivate; + +class Q_COMPAT_EXPORT Q3DataTable : public Q3Table +{ + Q_OBJECT + + Q_PROPERTY( QString nullText READ nullText WRITE setNullText ) + Q_PROPERTY( QString trueText READ trueText WRITE setTrueText ) + Q_PROPERTY( QString falseText READ falseText WRITE setFalseText ) + Q_PROPERTY( Qt::DateFormat dateFormat READ dateFormat WRITE setDateFormat ) + Q_PROPERTY( bool confirmEdits READ confirmEdits WRITE setConfirmEdits ) + Q_PROPERTY( bool confirmInsert READ confirmInsert WRITE setConfirmInsert ) + Q_PROPERTY( bool confirmUpdate READ confirmUpdate WRITE setConfirmUpdate ) + Q_PROPERTY( bool confirmDelete READ confirmDelete WRITE setConfirmDelete ) + Q_PROPERTY( bool confirmCancels READ confirmCancels WRITE setConfirmCancels ) + Q_PROPERTY( bool autoEdit READ autoEdit WRITE setAutoEdit ) + Q_PROPERTY( QString filter READ filter WRITE setFilter ) + Q_PROPERTY( QStringList sort READ sort WRITE setSort ) + Q_PROPERTY( int numCols READ numCols ) + Q_PROPERTY( int numRows READ numRows ) + +public: + Q3DataTable ( QWidget* parent=0, const char* name=0 ); + Q3DataTable ( Q3SqlCursor* cursor, bool autoPopulate = false, QWidget* parent=0, const char* name=0 ); + ~Q3DataTable(); + + virtual void addColumn( const QString& fieldName, + const QString& label = QString(), + int width = -1, + const QIconSet& iconset = QIconSet() ); + virtual void removeColumn( int col ); + virtual void setColumn( uint col, const QString& fieldName, + const QString& label = QString(), + int width = -1, + const QIconSet& iconset = QIconSet() ); + + QString nullText() const; + QString trueText() const; + QString falseText() const; + Qt::DateFormat dateFormat() const; + bool confirmEdits() const; + bool confirmInsert() const; + bool confirmUpdate() const; + bool confirmDelete() const; + bool confirmCancels() const; + bool autoDelete() const; + bool autoEdit() const; + QString filter() const; + QStringList sort() const; + + virtual void setSqlCursor( Q3SqlCursor* cursor = 0, + bool autoPopulate = false, bool autoDelete = false ); + Q3SqlCursor* sqlCursor() const; + + virtual void setNullText( const QString& nullText ); + virtual void setTrueText( const QString& trueText ); + virtual void setFalseText( const QString& falseText ); + virtual void setDateFormat( const Qt::DateFormat f ); + virtual void setConfirmEdits( bool confirm ); + virtual void setConfirmInsert( bool confirm ); + virtual void setConfirmUpdate( bool confirm ); + virtual void setConfirmDelete( bool confirm ); + virtual void setConfirmCancels( bool confirm ); + virtual void setAutoDelete( bool enable ); + virtual void setAutoEdit( bool autoEdit ); + virtual void setFilter( const QString& filter ); + virtual void setSort( const QStringList& sort ); + virtual void setSort( const QSqlIndex& sort ); + + enum Refresh { + RefreshData = 1, + RefreshColumns = 2, + RefreshAll = 3 + }; + void refresh( Refresh mode ); + void sortColumn ( int col, bool ascending = true, + bool wholeRows = false ); + QString text ( int row, int col ) const; + QVariant value ( int row, int col ) const; + QSqlRecord* currentRecord() const; + + void installEditorFactory( Q3SqlEditorFactory * f ); + void installPropertyMap( Q3SqlPropertyMap* m ); + + int numCols() const; + int numRows() const; + void setNumCols( int c ); + void setNumRows ( int r ); + bool findBuffer( const QSqlIndex& idx, int atHint = 0 ); + + void hideColumn( int col ); + void showColumn( int col ); + int indexOf( uint i ) const; + void selectRow(int row); + +Q_SIGNALS: + void currentChanged( QSqlRecord* record ); + void primeInsert( QSqlRecord* buf ); + void primeUpdate( QSqlRecord* buf ); + void primeDelete( QSqlRecord* buf ); + void beforeInsert( QSqlRecord* buf ); + void beforeUpdate( QSqlRecord* buf ); + void beforeDelete( QSqlRecord* buf ); + void cursorChanged( QSql::Op mode ); + +public Q_SLOTS: + virtual void find( const QString & str, bool caseSensitive, + bool backwards ); + virtual void sortAscending( int col ); + virtual void sortDescending( int col ); + virtual void refresh(); + void setColumnWidth( int col, int w ); + void adjustColumn( int col ); + void setColumnStretchable( int col, bool stretch ); + void swapColumns( int col1, int col2, bool swapHeaders = false ); + +protected: + virtual bool insertCurrent(); + virtual bool updateCurrent(); + virtual bool deleteCurrent(); + + virtual QSql::Confirm confirmEdit( QSql::Op m ); + virtual QSql::Confirm confirmCancel( QSql::Op m ); + + virtual void handleError( const QSqlError& e ); + + virtual bool beginInsert(); + virtual QWidget* beginUpdate ( int row, int col, bool replace ); + + bool eventFilter( QObject *o, QEvent *e ); + void keyPressEvent( QKeyEvent* ); + void resizeEvent ( QResizeEvent * ); + void contentsMousePressEvent( QMouseEvent* e ); + void contentsContextMenuEvent( QContextMenuEvent* e ); + void endEdit( int row, int col, bool accept, bool replace ); + QWidget * createEditor( int row, int col, bool initFromCell ) const; + void activateNextCell(); + void reset(); + void setSize( Q3SqlCursor* sql ); + void repaintCell( int row, int col ); + void paintCell ( QPainter * p, int row, int col, const QRect & cr, + bool selected, const QColorGroup &cg ); + virtual void paintField( QPainter * p, const QSqlField* field, const QRect & cr, + bool selected ); + void drawContents( QPainter * p, int cx, int cy, int cw, int ch ); + virtual int fieldAlignment( const QSqlField* field ); + void columnClicked ( int col ); + void resizeData ( int len ); + + Q3TableItem * item ( int row, int col ) const; + void setItem ( int row, int col, Q3TableItem * item ); + void clearCell ( int row, int col ) ; + void setPixmap ( int row, int col, const QPixmap & pix ); + void takeItem ( Q3TableItem * i ); + +private Q_SLOTS: + void loadNextPage(); + void setCurrentSelection( int row, int col ); + void updateCurrentSelection(); + void sliderPressed(); + void sliderReleased(); + void doInsertCurrent(); + void doUpdateCurrent(); + +private: + void drawContents( QPainter *p); + QString fieldToString( const QSqlField * field ); + void init(); + QWidget* beginEdit ( int row, int col, bool replace ); + void updateRow( int row ); + void endInsert(); + void endUpdate(); + Q3DataTablePrivate* d; + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + Q3DataTable( const Q3DataTable & ); + Q3DataTable &operator=( const Q3DataTable & ); +#endif +}; + +#endif // QT_NO_SQL_VIEW_WIDGETS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DATATABLE_H diff --git a/qtinterface/qt4/Qt/q3dataview.h b/qtinterface/qt4/Qt/q3dataview.h new file mode 100644 index 0000000..17ea2a1 --- /dev/null +++ b/qtinterface/qt4/Qt/q3dataview.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DATAVIEW_H +#define Q3DATAVIEW_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL_VIEW_WIDGETS + +class Q3SqlForm; +class QSqlRecord; +class Q3DataViewPrivate; + +class Q_COMPAT_EXPORT Q3DataView : public QWidget +{ + Q_OBJECT + +public: + Q3DataView(QWidget* parent=0, const char* name=0, Qt::WindowFlags fl = 0); + ~Q3DataView(); + + virtual void setForm(Q3SqlForm* form); + Q3SqlForm* form(); + virtual void setRecord(QSqlRecord* record); + QSqlRecord* record(); + +public Q_SLOTS: + virtual void refresh(QSqlRecord* buf); + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + +private: + Q_DISABLE_COPY(Q3DataView) + + Q3DataViewPrivate* d; +}; + +#endif // QT_NO_SQL_VIEW_WIDGETS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DATAVIEW_H diff --git a/qtinterface/qt4/Qt/q3datetimeedit.h b/qtinterface/qt4/Qt/q3datetimeedit.h new file mode 100644 index 0000000..18b2615 --- /dev/null +++ b/qtinterface/qt4/Qt/q3datetimeedit.h @@ -0,0 +1,288 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DATETIMEEDIT_H +#define Q3DATETIMEEDIT_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_DATETIMEEDIT + +class Q_COMPAT_EXPORT Q3DateTimeEditBase : public QWidget +{ + Q_OBJECT +public: + Q3DateTimeEditBase(QWidget* parent=0, const char* name=0) + : QWidget(parent) { setObjectName(QString::fromAscii(name)); } + + virtual bool setFocusSection(int sec) = 0; + virtual QString sectionFormattedText(int sec) = 0; + virtual void addNumber(int sec, int num) = 0; + virtual void removeLastNumber(int sec) = 0; + +public Q_SLOTS: + virtual void stepUp() = 0; + virtual void stepDown() = 0; + +private: + Q_DISABLE_COPY(Q3DateTimeEditBase) +}; + +class Q3DateEditPrivate; + +class Q_COMPAT_EXPORT Q3DateEdit : public Q3DateTimeEditBase +{ + Q_OBJECT + Q_ENUMS(Order) + Q_PROPERTY(Order order READ order WRITE setOrder) + Q_PROPERTY(QDate date READ date WRITE setDate USER true) + Q_PROPERTY(bool autoAdvance READ autoAdvance WRITE setAutoAdvance) + Q_PROPERTY(QDate maxValue READ maxValue WRITE setMaxValue) + Q_PROPERTY(QDate minValue READ minValue WRITE setMinValue) + +public: + Q3DateEdit(QWidget* parent=0, const char* name=0); + Q3DateEdit(const QDate& date, QWidget* parent=0, const char* name=0); + ~Q3DateEdit(); + + enum Order { DMY, MDY, YMD, YDM }; + + QSize sizeHint() const; + QSize minimumSizeHint() const; + +public Q_SLOTS: + virtual void setDate(const QDate& date); + +public: + QDate date() const; + virtual void setOrder(Order order); + Order order() const; + virtual void setAutoAdvance(bool advance); + bool autoAdvance() const; + + virtual void setMinValue(const QDate& d) { setRange(d, maxValue()); } + QDate minValue() const; + virtual void setMaxValue(const QDate& d) { setRange(minValue(), d); } + QDate maxValue() const; + virtual void setRange(const QDate& min, const QDate& max); + QString separator() const; + virtual void setSeparator(const QString& s); + + // Make removeFirstNumber() virtual in Q3DateTimeEditBase in 4.0 + void removeFirstNumber(int sec); + +Q_SIGNALS: + void valueChanged(const QDate& date); + +protected: + bool event(QEvent *e); + void timerEvent(QTimerEvent *); + void resizeEvent(QResizeEvent *); + void stepUp(); + void stepDown(); + QString sectionFormattedText(int sec); + void addNumber(int sec, int num); + + void removeLastNumber(int sec); + bool setFocusSection(int s); + + virtual void setYear(int year); + virtual void setMonth(int month); + virtual void setDay(int day); + virtual void fix(); + virtual bool outOfRange(int y, int m, int d) const; + +protected Q_SLOTS: + void updateButtons(); + +private: + Q_DISABLE_COPY(Q3DateEdit) + + void init(); + int sectionOffsetEnd(int sec) const; + int sectionLength(int sec) const; + QString sectionText(int sec) const; + Q3DateEditPrivate* d; +}; + +class Q3TimeEditPrivate; + +class Q_COMPAT_EXPORT Q3TimeEdit : public Q3DateTimeEditBase +{ + Q_OBJECT + Q_FLAGS(Display) + Q_PROPERTY(QTime time READ time WRITE setTime USER true) + Q_PROPERTY(bool autoAdvance READ autoAdvance WRITE setAutoAdvance) + Q_PROPERTY(QTime maxValue READ maxValue WRITE setMaxValue) + Q_PROPERTY(QTime minValue READ minValue WRITE setMinValue) + Q_PROPERTY(Display display READ display WRITE setDisplay) + +public: + enum Display { + Hours = 0x01, + Minutes = 0x02, + Seconds = 0x04, + /*Reserved = 0x08,*/ + AMPM = 0x10 + }; + + Q3TimeEdit(QWidget* parent=0, const char* name=0); + Q3TimeEdit(const QTime& time, QWidget* parent=0, const char* name=0); + ~Q3TimeEdit(); + + QSize sizeHint() const; + QSize minimumSizeHint() const; + +public Q_SLOTS: + virtual void setTime(const QTime& time); + +public: + QTime time() const; + virtual void setAutoAdvance(bool advance); + bool autoAdvance() const; + + virtual void setMinValue(const QTime& d) { setRange(d, maxValue()); } + QTime minValue() const; + virtual void setMaxValue(const QTime& d) { setRange(minValue(), d); } + QTime maxValue() const; + virtual void setRange(const QTime& min, const QTime& max); + QString separator() const; + virtual void setSeparator(const QString& s); + + uint display() const; + void setDisplay(uint disp); + + // Make removeFirstNumber() virtual in Q3DateTimeEditBase in 4.0 + void removeFirstNumber(int sec); + +Q_SIGNALS: + void valueChanged(const QTime& time); + +protected: + bool event(QEvent *e); + void timerEvent(QTimerEvent *e); + void resizeEvent(QResizeEvent *); + void stepUp(); + void stepDown(); + QString sectionFormattedText(int sec); + void addNumber(int sec, int num); + void removeLastNumber(int sec); + bool setFocusSection(int s); + + virtual bool outOfRange(int h, int m, int s) const; + virtual void setHour(int h); + virtual void setMinute(int m); + virtual void setSecond(int s); + +protected Q_SLOTS: + void updateButtons(); + +private: + Q_DISABLE_COPY(Q3TimeEdit) + + void init(); + QString sectionText(int sec); + Q3TimeEditPrivate* d; +}; + + +class Q3DateTimeEditPrivate; + +class Q_COMPAT_EXPORT Q3DateTimeEdit : public QWidget +{ + Q_OBJECT + Q_PROPERTY(QDateTime dateTime READ dateTime WRITE setDateTime USER true) + +public: + Q3DateTimeEdit(QWidget* parent=0, const char* name=0); + Q3DateTimeEdit(const QDateTime& datetime, QWidget* parent=0, + const char* name=0); + ~Q3DateTimeEdit(); + + QSize sizeHint() const; + QSize minimumSizeHint() const; + +public Q_SLOTS: + virtual void setDateTime(const QDateTime & dt); + +public: + QDateTime dateTime() const; + + Q3DateEdit* dateEdit() { return de; } + Q3TimeEdit* timeEdit() { return te; } + + virtual void setAutoAdvance(bool advance); + bool autoAdvance() const; + +Q_SIGNALS: + void valueChanged(const QDateTime& datetime); + +protected: + void init(); + void resizeEvent(QResizeEvent *); + +protected Q_SLOTS: + void newValue(const QDate& d); + void newValue(const QTime& t); + +private: + Q_DISABLE_COPY(Q3DateTimeEdit) + + Q3DateEdit* de; + Q3TimeEdit* te; + Q3DateTimeEditPrivate* d; +}; + +#endif // QT_NO_DATETIMEEDIT + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DATETIMEEDIT_H diff --git a/qtinterface/qt4/Qt/q3deepcopy.h b/qtinterface/qt4/Qt/q3deepcopy.h new file mode 100644 index 0000000..6df4342 --- /dev/null +++ b/qtinterface/qt4/Qt/q3deepcopy.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DEEPCOPY_H +#define Q3DEEPCOPY_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3DeepCopy +{ +public: + inline Q3DeepCopy() + { + } + + inline Q3DeepCopy(const T &t) + : deepcopy(t) + { + deepcopy.detach(); + } + + inline Q3DeepCopy &operator=(const T &t) + { + deepcopy = t; + deepcopy.detach(); + return *this; + } + + inline operator T () + { + T tmp = deepcopy; + tmp.detach(); + return tmp; + } + +private: + T deepcopy; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DEEPCOPY_H diff --git a/qtinterface/qt4/Qt/q3dict.h b/qtinterface/qt4/Qt/q3dict.h new file mode 100644 index 0000000..d18ddf9 --- /dev/null +++ b/qtinterface/qt4/Qt/q3dict.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DICT_H +#define Q3DICT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3Dict +#ifdef qdoc + : public Q3PtrCollection +#else + : public Q3GDict +#endif +{ +public: + Q3Dict(int size = 17, bool caseSensitive = true) + : Q3GDict(size, StringKey, caseSensitive, false) { } + Q3Dict(const Q3Dict &d) : Q3GDict(d) { } + ~Q3Dict() { clear(); } + Q3Dict &operator=(const Q3Dict &d) + { return (Q3Dict&)Q3GDict::operator=(d); } + uint count() const { return Q3GDict::count(); } + uint size() const { return Q3GDict::size(); } + bool isEmpty() const { return Q3GDict::count() == 0; } + + void insert(const QString &k, const type *d) + { Q3GDict::look_string(k,(Item)d,1); } + void replace(const QString &k, const type *d) + { Q3GDict::look_string(k,(Item)d,2); } + bool remove(const QString &k) { return Q3GDict::remove_string(k); } + type *take(const QString &k) { return (type *)Q3GDict::take_string(k); } + type *find(const QString &k) const + { return (type *)((Q3GDict*)this)->Q3GDict::look_string(k,0,0); } + type *operator[](const QString &k) const + { return (type *)((Q3GDict*)this)->Q3GDict::look_string(k,0,0); } + + void clear() { Q3GDict::clear(); } + void resize(uint n) { Q3GDict::resize(n); } + void statistics() const { Q3GDict::statistics(); } + +#ifdef qdoc +protected: + virtual QDataStream& read(QDataStream &, Q3PtrCollection::Item &); + virtual QDataStream& write(QDataStream &, Q3PtrCollection::Item) const; +#endif + +private: + void deleteItem(Item d); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3Dict::deleteItem(Item) +{ +} +#endif + +template inline void Q3Dict::deleteItem(Q3PtrCollection::Item d) +{ + if (del_item) delete (type *)d; +} + +template +class Q3DictIterator : public Q3GDictIterator +{ +public: + Q3DictIterator(const Q3Dict &d) : Q3GDictIterator((Q3GDict &)d) { } + ~Q3DictIterator() {} + uint count() const { return dict->count(); } + bool isEmpty() const { return dict->count() == 0; } + type *toFirst() { return (type *)Q3GDictIterator::toFirst(); } + operator type *() const { return (type *)Q3GDictIterator::get(); } + type *operator*() { return (type *)Q3GDictIterator::get(); } + type *current() const { return (type *)Q3GDictIterator::get(); } + QString currentKey() const{ return Q3GDictIterator::getKeyString(); } + type *operator()() { return (type *)Q3GDictIterator::operator()(); } + type *operator++() { return (type *)Q3GDictIterator::operator++(); } + type *operator+=(uint j) { return (type *)Q3GDictIterator::operator+=(j); } +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DICT_H diff --git a/qtinterface/qt4/Qt/q3dns.h b/qtinterface/qt4/Qt/q3dns.h new file mode 100644 index 0000000..c90cf0a --- /dev/null +++ b/qtinterface/qt4/Qt/q3dns.h @@ -0,0 +1,174 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DNS_H +#define Q3DNS_H + +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_DNS + +//#define Q_DNS_SYNCHRONOUS + +class Q3DnsPrivate; + +class Q_COMPAT_EXPORT Q3Dns: public QObject { + Q_OBJECT +public: + enum RecordType { + None, + A, Aaaa, + Mx, Srv, + Cname, + Ptr, + Txt + }; + + Q3Dns(); + Q3Dns( const QString & label, RecordType rr = A ); + Q3Dns( const QHostAddress & address, RecordType rr = Ptr ); + virtual ~Q3Dns(); + + // to set/change the query + virtual void setLabel( const QString & label ); + virtual void setLabel( const QHostAddress & address ); + QString label() const { return l; } + + virtual void setRecordType( RecordType rr = A ); + RecordType recordType() const { return t; } + + // whether something is happening behind the scenes + bool isWorking() const; + + // to query for replies + Q3ValueList addresses() const; + + class Q_COMPAT_EXPORT MailServer { + public: + MailServer( const QString & n=QString(), Q_UINT16 p=0 ) + :name(n), priority(p) {} + QString name; + Q_UINT16 priority; + Q_DUMMY_COMPARISON_OPERATOR(MailServer) + }; + Q3ValueList mailServers() const; + + class Q_COMPAT_EXPORT Server { + public: + Server(const QString & n=QString(), Q_UINT16 p=0, Q_UINT16 w=0, Q_UINT16 po=0 ) + : name(n), priority(p), weight(w), port(po) {} + QString name; + Q_UINT16 priority; + Q_UINT16 weight; + Q_UINT16 port; + Q_DUMMY_COMPARISON_OPERATOR(Server) + }; + Q3ValueList servers() const; + + QStringList hostNames() const; + + QStringList texts() const; + + QString canonicalName() const; // ### real-world but uncommon: QStringList + + QStringList qualifiedNames() const { return n; } + +#if defined(Q_DNS_SYNCHRONOUS) +protected: + void connectNotify( const char *signal ); +#endif + +Q_SIGNALS: + void resultsReady(); + +private Q_SLOTS: + void startQuery(); + +private: + static void doResInit(); + void setStartQueryTimer(); + static QString toInAddrArpaDomain( const QHostAddress &address ); +#if defined(Q_DNS_SYNCHRONOUS) + void doSynchronousLookup(); +#endif + + QString l; + QStringList n; + RecordType t; + Q3DnsPrivate * d; + + friend class Q3DnsAnswer; + friend class Q3DnsManager; +}; + + +// Q3DnsSocket are sockets that are used for DNS lookup + +class Q3DnsSocket: public QObject { + Q_OBJECT + // note: Private not public. This class contains NO public API. +protected: + Q3DnsSocket( QObject *, const char * ); + virtual ~Q3DnsSocket(); + +private Q_SLOTS: + virtual void cleanCache(); + virtual void retransmit(); + virtual void answer(); +}; + +#endif // QT_NO_DNS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DNS_H diff --git a/qtinterface/qt4/Qt/q3dockarea.h b/qtinterface/qt4/Qt/q3dockarea.h new file mode 100644 index 0000000..c506368 --- /dev/null +++ b/qtinterface/qt4/Qt/q3dockarea.h @@ -0,0 +1,199 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DOCKAREA_H +#define Q3DOCKAREA_H + +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_MAINWINDOW + +class QBoxLayout; +class Q3DockAreaLayout; +class QMouseEvent; +class Q3DockWindowResizeHandle; +class Q3DockAreaPrivate; +class QTextStream; + +class Q_COMPAT_EXPORT Q3DockAreaLayout : public QLayout +{ + Q_OBJECT + friend class Q3DockArea; + +public: + Q3DockAreaLayout(QWidget* parent, Qt::Orientation o, QList *wl, int space = -1, int margin = -1, const char *name = 0) + : QLayout(parent), orient(o), dirty(true), dockWindows(wl), parentWidget(parent) + { + if (space != -1) + setSpacing(space); + if (margin != -1) + setMargin(margin); + setObjectName(QString::fromAscii(name)); + init(); + } + ~Q3DockAreaLayout() {} + + void addItem(QLayoutItem *) {} + bool hasHeightForWidth() const; + int heightForWidth(int) const; + int widthForHeight(int) const; + QSize sizeHint() const; + QSize minimumSize() const; + QLayoutItem *itemAt(int) const; + QLayoutItem *takeAt(int); + int count() const; + Qt::Orientations expandingDirections() const { return Qt::Orientations(0); } + void invalidate(); + Qt::Orientation orientation() const { return orient; } + QList lineList() const { return lines; } + QList lineStarts() const { return ls; } + +protected: + void setGeometry(const QRect&); + +private: + Q_DISABLE_COPY(Q3DockAreaLayout) + + void init(); + int layoutItems(const QRect&, bool testonly = false); + Qt::Orientation orient; + bool dirty; + int cached_width, cached_height; + int cached_hfw, cached_wfh; + QList *dockWindows; + QWidget *parentWidget; + QList lines; + QList ls; +}; + +class Q_COMPAT_EXPORT Q3DockArea : public QWidget +{ + Q_OBJECT + Q_ENUMS(HandlePosition) + Q_PROPERTY(Qt::Orientation orientation READ orientation) + Q_PROPERTY(int count READ count) + Q_PROPERTY(bool empty READ isEmpty) + Q_PROPERTY(HandlePosition handlePosition READ handlePosition) + + friend class Q3DockWindow; + friend class Q3DockWindowResizeHandle; + friend class Q3DockAreaLayout; + +public: + enum HandlePosition { Normal, Reverse }; + + Q3DockArea(Qt::Orientation o, HandlePosition h = Normal, QWidget* parent=0, const char* name=0); + ~Q3DockArea(); + + void moveDockWindow(Q3DockWindow *w, const QPoint &globalPos, const QRect &rect, bool swap); + void removeDockWindow(Q3DockWindow *w, bool makeFloating, bool swap, bool fixNewLines = true); + void moveDockWindow(Q3DockWindow *w, int index = -1); + bool hasDockWindow(Q3DockWindow *w, int *index = 0); + + void invalidNextOffset(Q3DockWindow *dw); + + Qt::Orientation orientation() const { return orient; } + HandlePosition handlePosition() const { return hPos; } + + bool eventFilter(QObject *, QEvent *); + bool isEmpty() const; + int count() const; + QList dockWindowList() const; + + bool isDockWindowAccepted(Q3DockWindow *dw); + void setAcceptDockWindow(Q3DockWindow *dw, bool accept); + +public Q_SLOTS: + void lineUp(bool keepNewLines); + +private: + struct DockWindowData + { + int index; + int offset; + int line; + QSize fixedExtent; + QPointer area; + }; + + int findDockWindow(Q3DockWindow *w); + int lineOf(int index); + DockWindowData *dockWindowData(Q3DockWindow *w); + void dockWindow(Q3DockWindow *dockWindow, DockWindowData *data); + void updateLayout(); + void invalidateFixedSizes(); + int maxSpace(int hint, Q3DockWindow *dw); + void setFixedExtent(int d, Q3DockWindow *dw); + bool isLastDockWindow(Q3DockWindow *dw); + +private: + Q_DISABLE_COPY(Q3DockArea) + + Qt::Orientation orient; + QList dockWindows; + Q3DockAreaLayout *layout; + HandlePosition hPos; + QList forbiddenWidgets; + Q3DockAreaPrivate *d; +}; + +#ifndef QT_NO_TEXTSTREAM +Q_COMPAT_EXPORT QTextStream &operator<<(QTextStream &, const Q3DockArea &); +Q_COMPAT_EXPORT QTextStream &operator>>(QTextStream &, Q3DockArea &); +#endif + +#endif // QT_NO_MAINWINDOW + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DOCKAREA_H diff --git a/qtinterface/qt4/Qt/q3dockwindow.h b/qtinterface/qt4/Qt/q3dockwindow.h new file mode 100644 index 0000000..1069012 --- /dev/null +++ b/qtinterface/qt4/Qt/q3dockwindow.h @@ -0,0 +1,239 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DOCKWINDOW_H +#define Q3DOCKWINDOW_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_MAINWINDOW + +class Q3DockWindowHandle; +class Q3DockWindowTitleBar; +class QPainter; +class Q3DockWindowResizeHandle; +class QBoxLayout; +class QHBoxLayout; +class QVBoxLayout; +class Q3DockArea; +class QWidgetResizeHandler; +class Q3MainWindow; +class Q3DockAreaLayout; +class Q3DockWindowPrivate; +class Q3ToolBar; +class QWindowsXPStyle; +class QRubberBand; + +class Q_COMPAT_EXPORT Q3DockWindow : public Q3Frame +{ + Q_OBJECT + Q_ENUMS(CloseMode Place) + Q_PROPERTY(int closeMode READ closeMode WRITE setCloseMode) + Q_PROPERTY(bool resizeEnabled READ isResizeEnabled WRITE setResizeEnabled) + Q_PROPERTY(bool movingEnabled READ isMovingEnabled WRITE setMovingEnabled) + Q_PROPERTY(bool horizontallyStretchable READ isHorizontallyStretchable WRITE setHorizontallyStretchable) + Q_PROPERTY(bool verticallyStretchable READ isVerticallyStretchable WRITE setVerticallyStretchable) + Q_PROPERTY(bool stretchable READ isStretchable) + Q_PROPERTY(bool newLine READ newLine WRITE setNewLine) + Q_PROPERTY(bool opaqueMoving READ opaqueMoving WRITE setOpaqueMoving) + Q_PROPERTY(int offset READ offset WRITE setOffset) + Q_PROPERTY(Place place READ place) + + friend class Q3DockWindowHandle; + friend class Q3DockWindowTitleBar; + friend class Q3DockArea; + friend class Q3DockAreaLayout; + friend class Q3MainWindow; + friend class QCEMainWindow; + friend class Q3ToolBar; + friend class QWindowsXPStyle; + +public: + enum Place { InDock, OutsideDock }; + enum CloseMode { Never = 0, Docked = 1, Undocked = 2, Always = Docked | Undocked }; + + Q3DockWindow(Place p = InDock, QWidget* parent=0, const char* name=0, Qt::WindowFlags f = 0); + Q3DockWindow(QWidget* parent, const char* name=0, Qt::WindowFlags f = 0); + ~Q3DockWindow(); + + virtual void setWidget(QWidget *w); + QWidget *widget() const; + + Place place() const { return curPlace; } + + Q3DockArea *area() const; + + virtual void setCloseMode(int m); + bool isCloseEnabled() const; + int closeMode() const; + + virtual void setResizeEnabled(bool b); + virtual void setMovingEnabled(bool b); + bool isResizeEnabled() const; + bool isMovingEnabled() const; + + virtual void setHorizontallyStretchable(bool b); + virtual void setVerticallyStretchable(bool b); + bool isHorizontallyStretchable() const; + bool isVerticallyStretchable() const; + void setHorizontalStretchable(bool b) { setHorizontallyStretchable(b); } + void setVerticalStretchable(bool b) { setVerticallyStretchable(b); } + bool isHorizontalStretchable() const { return isHorizontallyStretchable(); } + bool isVerticalStretchable() const { return isVerticallyStretchable(); } + bool isStretchable() const; + + virtual void setOffset(int o); + int offset() const; + + virtual void setFixedExtentWidth(int w); + virtual void setFixedExtentHeight(int h); + QSize fixedExtent() const; + + virtual void setNewLine(bool b); + bool newLine() const; + + Qt::Orientation orientation() const; + + QSize sizeHint() const; + QSize minimumSize() const; + QSize minimumSizeHint() const; + + QBoxLayout *boxLayout(); + + virtual void setOpaqueMoving(bool b); + bool opaqueMoving() const; + + bool eventFilter(QObject *o, QEvent *e); + + QString windowTitle() const; + +Q_SIGNALS: + void orientationChanged(Qt::Orientation o); + void placeChanged(Q3DockWindow::Place p); + void visibilityChanged(bool); + +public Q_SLOTS: + virtual void undock(QWidget *w); + virtual void undock() { undock(0); } + virtual void dock(); + virtual void setOrientation(Qt::Orientation o); + +protected: + void resizeEvent(QResizeEvent *e); + void showEvent(QShowEvent *e); + void hideEvent(QHideEvent *e); + void contextMenuEvent(QContextMenuEvent *e); + + void drawFrame(QPainter *); + void drawContents(QPainter *); + + bool event(QEvent *e); + +private Q_SLOTS: + void toggleVisible() { setVisible(!isVisible()); } + +private: + Q3DockWindow(Place p, QWidget* parent, const char* name, Qt::WindowFlags f, bool toolbar); + + void handleMove(const QPoint &pos, const QPoint &gp, bool drawRect); + void updateGui(); + void updateSplitterVisibility(bool visible); + + void startRectDraw(const QPoint &so, bool drawRect); + void endRectDraw(bool drawRect); + void updatePosition(const QPoint &globalPos ); + QWidget *areaAt(const QPoint &gp); + void removeFromDock(bool fixNewLines = true); + void swapRect(QRect &r, Qt::Orientation o, const QPoint &offset, Q3DockArea *area); + void init(); + +private: + Q3DockWindowHandle *horHandle, *verHandle; + Q3DockWindowTitleBar *titleBar; + QWidget *wid; + QRubberBand *rubberBand; + Q3DockArea *dockArea, *tmpDockArea; + QRect currRect; + Place curPlace; + Place state; + bool resizeEnabled : 1; + bool moveEnabled : 1; + bool nl : 1; + bool opaque : 1; + bool isToolbar : 1; + bool stretchable[3]; + Qt::Orientation startOrientation; + int cMode; + QPoint startOffset; + int offs; + QSize fExtent; + Q3DockWindowResizeHandle *hHandleTop, *hHandleBottom, *vHandleLeft, *vHandleRight; + QVBoxLayout *hbox; + QHBoxLayout *vbox; + QBoxLayout *childBox; + void *dockWindowData; + QPoint lastPos; + QSize lastSize; + QWidgetResizeHandler *widgetResizeHandler; + Q3DockWindowPrivate *d; + +private: + Q_DISABLE_COPY(Q3DockWindow) +}; + +inline Q3DockArea *Q3DockWindow::area() const +{ + return dockArea; +} + +#endif // QT_NO_MAINWINDOW + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DOCKWINDOW_H diff --git a/qtinterface/qt4/Qt/q3dragobject.h b/qtinterface/qt4/Qt/q3dragobject.h new file mode 100644 index 0000000..0cc6dac --- /dev/null +++ b/qtinterface/qt4/Qt/q3dragobject.h @@ -0,0 +1,218 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DRAGOBJECT_H +#define Q3DRAGOBJECT_H + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class QWidget; +class Q3TextDragPrivate; +class Q3DragObjectPrivate; +class Q3StoredDragPrivate; +class Q3ImageDragPrivate; +class Q3ImageDrag; +class Q3TextDrag; +class Q3StrList; +class QImage; +class QPixmap; + +class Q_COMPAT_EXPORT Q3DragObject : public QObject, public QMimeSource { + Q_OBJECT + Q_DECLARE_PRIVATE(Q3DragObject) +public: + Q3DragObject(QWidget * dragSource = 0, const char *name = 0); + virtual ~Q3DragObject(); + + bool drag(); + bool dragMove(); + void dragCopy(); + void dragLink(); + + virtual void setPixmap(QPixmap); + virtual void setPixmap(QPixmap, const QPoint& hotspot); + QPixmap pixmap() const; + QPoint pixmapHotSpot() const; + + QWidget * source(); + static QWidget * target(); + + enum DragMode { DragDefault, DragCopy, DragMove, DragLink, DragCopyOrMove }; + +protected: + Q3DragObject(Q3DragObjectPrivate &, QWidget *dragSource = 0); + virtual bool drag(DragMode); + +private: + friend class QDragMime; + Q_DISABLE_COPY(Q3DragObject) +}; + +class Q_COMPAT_EXPORT Q3StoredDrag: public Q3DragObject { + Q_OBJECT + Q_DECLARE_PRIVATE(Q3StoredDrag) +public: + Q3StoredDrag(const char *mimeType, QWidget *dragSource = 0, const char *name = 0); + ~Q3StoredDrag(); + + virtual void setEncodedData(const QByteArray &); + + const char * format(int i) const; + virtual QByteArray encodedData(const char*) const; + +protected: + Q3StoredDrag(Q3StoredDragPrivate &, const char *mimeType, QWidget *dragSource = 0); + +private: + Q_DISABLE_COPY(Q3StoredDrag) +}; + +class Q_COMPAT_EXPORT Q3TextDrag: public Q3DragObject { + Q_OBJECT + Q_DECLARE_PRIVATE(Q3TextDrag) +public: + Q3TextDrag(const QString &, QWidget *dragSource = 0, const char *name = 0); + Q3TextDrag(QWidget * dragSource = 0, const char * name = 0); + ~Q3TextDrag(); + + virtual void setText(const QString &); + virtual void setSubtype(const QString &); + + const char * format(int i) const; + virtual QByteArray encodedData(const char*) const; + + static bool canDecode(const QMimeSource* e); + static bool decode(const QMimeSource* e, QString& s); + static bool decode(const QMimeSource* e, QString& s, QString& subtype); + +protected: + Q3TextDrag(Q3TextDragPrivate &, QWidget * dragSource = 0); + +private: + Q_DISABLE_COPY(Q3TextDrag) +}; + +class Q_COMPAT_EXPORT Q3ImageDrag: public Q3DragObject { + Q_OBJECT + Q_DECLARE_PRIVATE(Q3ImageDrag) +public: + Q3ImageDrag(QImage image, QWidget * dragSource = 0, const char * name = 0); + Q3ImageDrag(QWidget * dragSource = 0, const char * name = 0); + ~Q3ImageDrag(); + + virtual void setImage(QImage image); + + const char * format(int i) const; + virtual QByteArray encodedData(const char*) const; + + static bool canDecode(const QMimeSource* e); + static bool decode(const QMimeSource* e, QImage& i); + static bool decode(const QMimeSource* e, QPixmap& i); + +protected: + Q3ImageDrag(Q3ImageDragPrivate &, QWidget * dragSource = 0); + +private: + Q_DISABLE_COPY(Q3ImageDrag) +}; + + +class Q_COMPAT_EXPORT Q3UriDrag: public Q3StoredDrag { + Q_OBJECT + +public: + Q3UriDrag(const Q3StrList &uris, QWidget * dragSource = 0, const char * name = 0); + Q3UriDrag(QWidget * dragSource = 0, const char * name = 0); + ~Q3UriDrag(); + + void setFileNames(const QStringList & fnames); + inline void setFileNames(const QString & fname) { setFileNames(QStringList(fname)); } + void setFilenames(const QStringList & fnames) { setFileNames(fnames); } + inline void setFilenames(const QString & fname) { setFileNames(QStringList(fname)); } + void setUnicodeUris(const QStringList & uuris); + virtual void setUris(const QList &uris); + + static QString uriToLocalFile(const char*); + static QByteArray localFileToUri(const QString&); + static QString uriToUnicodeUri(const char*); + static QByteArray unicodeUriToUri(const QString&); + static bool canDecode(const QMimeSource* e); + static bool decode(const QMimeSource* e, Q3StrList& i); + static bool decodeToUnicodeUris(const QMimeSource* e, QStringList& i); + static bool decodeLocalFiles(const QMimeSource* e, QStringList& i); + +private: + Q_DISABLE_COPY(Q3UriDrag) +}; + +class Q_COMPAT_EXPORT Q3ColorDrag : public Q3StoredDrag +{ + Q_OBJECT + QColor color; + +public: + Q3ColorDrag(const QColor &col, QWidget *dragsource = 0, const char *name = 0); + Q3ColorDrag(QWidget * dragSource = 0, const char * name = 0); + void setColor(const QColor &col); + + static bool canDecode(QMimeSource *); + static bool decode(QMimeSource *, QColor &col); + +private: + Q_DISABLE_COPY(Q3ColorDrag) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3DRAGOBJECT_H diff --git a/qtinterface/qt4/Qt/q3dropsite.h b/qtinterface/qt4/Qt/q3dropsite.h new file mode 100644 index 0000000..cea597a --- /dev/null +++ b/qtinterface/qt4/Qt/q3dropsite.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3DROPSITE_H +#define Q3DROPSITE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class QWidget; + +class Q_COMPAT_EXPORT Q3DropSite { +public: + Q3DropSite(QWidget* parent); + virtual ~Q3DropSite(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDROPSITE_H diff --git a/qtinterface/qt4/Qt/q3editorfactory.h b/qtinterface/qt4/Qt/q3editorfactory.h new file mode 100644 index 0000000..930a3f5 --- /dev/null +++ b/qtinterface/qt4/Qt/q3editorfactory.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3EDITORFACTORY_H +#define Q3EDITORFACTORY_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL_EDIT_WIDGETS + +class Q_COMPAT_EXPORT Q3EditorFactory : public QObject +{ +public: + Q3EditorFactory (QObject * parent = 0); + ~Q3EditorFactory(); + + virtual QWidget * createEditor(QWidget * parent, const QVariant & v); + + static Q3EditorFactory * defaultFactory(); + static void installDefaultFactory(Q3EditorFactory * factory); + +private: + Q_DISABLE_COPY(Q3EditorFactory) +}; + +#endif // QT_NO_SQL_EDIT_WIDGETS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3EDITORFACTORY_H diff --git a/qtinterface/qt4/Qt/q3filedialog.h b/qtinterface/qt4/Qt/q3filedialog.h new file mode 100644 index 0000000..6515ef9 --- /dev/null +++ b/qtinterface/qt4/Qt/q3filedialog.h @@ -0,0 +1,346 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3FILEDIALOG_H +#define Q3FILEDIALOG_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class QAbstractButton; +class QPushButton; +class QLabel; +class QWidget; +class QFileDialog; +class QTimer; +class Q3NetworkOperation; +class QLineEdit; +class Q3ListViewItem; +class Q3ListBoxItem; +class Q3FileDialogPrivate; +class Q3FileDialogQFileListView; +class QUrlInfo; + +#ifndef QT_NO_FILEDIALOG + +class Q_COMPAT_EXPORT Q3FileIconProvider : public QObject +{ + Q_OBJECT +public: + Q3FileIconProvider(QObject * parent = 0, const char* name = 0); + virtual const QPixmap * pixmap(const QFileInfo &); + +private: + Q_DISABLE_COPY(Q3FileIconProvider) +}; + +class Q_COMPAT_EXPORT Q3FilePreview +{ +public: + Q3FilePreview(); + virtual ~Q3FilePreview() {} + virtual void previewUrl(const Q3Url &url) = 0; + +}; + +class Q_COMPAT_EXPORT Q3FileDialog : public QDialog +{ + Q_OBJECT + Q_ENUMS(Mode ViewMode PreviewMode) + // ##### Why are this read-only properties ? + Q_PROPERTY(QString selectedFile READ selectedFile) + Q_PROPERTY(QString selectedFilter READ selectedFilter) + Q_PROPERTY(QStringList selectedFiles READ selectedFiles) + // #### Should not we be able to set the path ? + Q_PROPERTY(QString dirPath READ dirPath) + Q_PROPERTY(bool showHiddenFiles READ showHiddenFiles WRITE setShowHiddenFiles) + Q_PROPERTY(Mode mode READ mode WRITE setMode) + Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode) + Q_PROPERTY(PreviewMode previewMode READ previewMode WRITE setPreviewMode) + Q_PROPERTY(bool infoPreview READ isInfoPreviewEnabled WRITE setInfoPreviewEnabled) + Q_PROPERTY(bool contentsPreview READ isContentsPreviewEnabled WRITE setContentsPreviewEnabled) + +public: + Q3FileDialog(const QString& dirName, const QString& filter = QString(), + QWidget* parent=0, const char* name=0, bool modal = false); + Q3FileDialog(QWidget* parent=0, const char* name=0, bool modal = false); + ~Q3FileDialog(); + + // recommended static functions + + static QString getOpenFileName(const QString &initially = QString(), + const QString &filter = QString(), + QWidget *parent = 0, const char* name = 0, + const QString &caption = QString(), + QString *selectedFilter = 0, + bool resolveSymlinks = true); + static QString getSaveFileName(const QString &initially = QString(), + const QString &filter = QString(), + QWidget *parent = 0, const char* name = 0, + const QString &caption = QString(), + QString *selectedFilter = 0, + bool resolveSymlinks = true); + static QString getExistingDirectory(const QString &dir = QString(), + QWidget *parent = 0, + const char* name = 0, + const QString &caption = QString(), + bool dirOnly = true, + bool resolveSymlinks = true); + static QStringList getOpenFileNames(const QString &filter= QString(), + const QString &dir = QString(), + QWidget *parent = 0, + const char* name = 0, + const QString &caption = QString(), + QString *selectedFilter = 0, + bool resolveSymlinks = true); + + // other static functions + + static void setIconProvider(Q3FileIconProvider *); + static Q3FileIconProvider * iconProvider(); + + // non-static function for special needs + + QString selectedFile() const; + QString selectedFilter() const; + virtual void setSelectedFilter(const QString&); + virtual void setSelectedFilter(int); + + void setSelection(const QString &); + + void selectAll(bool b); + + QStringList selectedFiles() const; + + QString dirPath() const; + + void setDir(const QDir &); + const QDir *dir() const; + + void setShowHiddenFiles(bool s); + bool showHiddenFiles() const; + + void rereadDir(); + void resortDir(); + + enum Mode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly }; + void setMode(Mode); + Mode mode() const; + + enum ViewMode { Detail, List }; + enum PreviewMode { NoPreview, Contents, Info }; + void setViewMode(ViewMode m); + ViewMode viewMode() const; + void setPreviewMode(PreviewMode m); + PreviewMode previewMode() const; + + bool eventFilter(QObject *, QEvent *); + + bool isInfoPreviewEnabled() const; + bool isContentsPreviewEnabled() const; + void setInfoPreviewEnabled(bool); + void setContentsPreviewEnabled(bool); + + void setInfoPreview(QWidget *w, Q3FilePreview *preview); + void setContentsPreview(QWidget *w, Q3FilePreview *preview); + + Q3Url url() const; + + void addFilter(const QString &filter); + +public Q_SLOTS: + void done(int); + void setDir(const QString&); + void setUrl(const Q3UrlOperator &url); + void setFilter(const QString&); + void setFilters(const QString&); + void setFilters(const char **); + void setFilters(const QStringList&); + +protected: + void resizeEvent(QResizeEvent *); + void keyPressEvent(QKeyEvent *); + + void addWidgets(QLabel *, QWidget *, QPushButton *); + void addToolButton(QAbstractButton *b, bool separator = false); + void addLeftWidget(QWidget *w); + void addRightWidget(QWidget *w); + +Q_SIGNALS: + void fileHighlighted(const QString&); + void fileSelected(const QString&); + void filesSelected(const QStringList&); + void dirEntered(const QString&); + void filterSelected(const QString&); + +private Q_SLOTS: + void detailViewSelectionChanged(); + void listBoxSelectionChanged(); + void changeMode(int); + void fileNameEditReturnPressed(); + void stopCopy(); + void removeProgressDia(); + + void fileSelected(int); + void fileHighlighted(int); + void dirSelected(int); + void pathSelected(int); + + void updateFileNameEdit(Q3ListViewItem *); + void selectDirectoryOrFile(Q3ListViewItem *); + void popupContextMenu(Q3ListViewItem *, const QPoint &, int); + void popupContextMenu(Q3ListBoxItem *, const QPoint &); + void updateFileNameEdit(Q3ListBoxItem *); + void selectDirectoryOrFile(Q3ListBoxItem *); + void fileNameEditDone(); + + void okClicked(); + void filterClicked(); // not used + void cancelClicked(); + + void cdUpClicked(); + void newFolderClicked(); + + void fixupNameEdit(); + + void doMimeTypeLookup(); + + void updateGeometries(); + void modeButtonsDestroyed(); + void urlStart(Q3NetworkOperation *op); + void urlFinished(Q3NetworkOperation *op); + void dataTransferProgress(int bytesDone, int bytesTotal, Q3NetworkOperation *); + void insertEntry(const Q3ValueList &fi, Q3NetworkOperation *op); + void removeEntry(Q3NetworkOperation *); + void createdDirectory(const QUrlInfo &info, Q3NetworkOperation *); + void itemChanged(Q3NetworkOperation *); + void goBack(); + +private: + Q_DISABLE_COPY(Q3FileDialog) + + enum PopupAction { + PA_Open = 0, + PA_Delete, + PA_Rename, + PA_SortName, + PA_SortSize, + PA_SortType, + PA_SortDate, + PA_SortUnsorted, + PA_Cancel, + PA_Reload, + PA_Hidden + }; + + void init(); + bool trySetSelection(bool isDir, const Q3UrlOperator &, bool); + void deleteFile(const QString &filename); + void popupContextMenu(const QString &filename, bool withSort, + PopupAction &action, const QPoint &p); + void updatePreviews(const Q3Url &u); + + QString fileName; + + friend class Q3FileDialogQFileListView; + friend class QFileListBox; + + Q3FileDialogPrivate *d; + Q3FileDialogQFileListView *files; + + QLineEdit *nameEdit; // also filter + QPushButton *okB; + QPushButton *cancelB; + +#if defined(Q_WS_WIN) + static QString winGetOpenFileName(const QString &initialSelection, + const QString &filter, + QString* workingDirectory, + QWidget *parent = 0, + const char* name = 0, + const QString& caption = QString(), + QString* selectedFilter = 0); + static QString winGetSaveFileName(const QString &initialSelection, + const QString &filter, + QString* workingDirectory, + QWidget *parent = 0, + const char* name = 0, + const QString& caption = QString(), + QString* selectedFilter = 0); + static QStringList winGetOpenFileNames(const QString &filter, + QString* workingDirectory, + QWidget *parent = 0, + const char* name = 0, + const QString& caption = QString(), + QString* selectedFilter = 0); + static QString winGetExistingDirectory(const QString &initialDirectory, + QWidget* parent = 0, + const char* name = 0, + const QString& caption = QString()); + static QString resolveLinkFile(const QString& linkfile); + int old_qt_ntfs_permission_lookup; +#endif +#if defined(Q_WS_MAC) + static QString macGetSaveFileName(const QString &, const QString &, + QString *, QWidget *, const char*, + const QString&, QString *); + static QStringList macGetOpenFileNames(const QString &, QString*, + QWidget *, const char *, + const QString&, QString *, + bool = true, bool = false); +#endif +}; + +#endif // QT_NO_FILEDIALOG + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3FILEDIALOG_H diff --git a/qtinterface/qt4/Qt/q3frame.h b/qtinterface/qt4/Qt/q3frame.h new file mode 100644 index 0000000..8490481 --- /dev/null +++ b/qtinterface/qt4/Qt/q3frame.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3FRAME_H +#define Q3FRAME_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3Frame : public QFrame +{ + Q_OBJECT + Q_PROPERTY(int margin READ margin WRITE setMargin) + Q_PROPERTY(QRect contentsRect READ contentsRect) + +public: + Q3Frame(QWidget* parent, const char* name = 0, Qt::WindowFlags f = 0); + ~Q3Frame(); +#ifndef qdoc + bool lineShapesOk() const { return true; } +#endif + + int margin() const { return marg; } + void setMargin(int); + + QRect contentsRect() const; + int frameWidth() const; + +protected: + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + + virtual void frameChanged(); + virtual void drawFrame(QPainter *); + virtual void drawContents(QPainter *); + +private: + Q_DISABLE_COPY(Q3Frame) + + int marg; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3FRAME_H diff --git a/qtinterface/qt4/Qt/q3ftp.h b/qtinterface/qt4/Qt/q3ftp.h new file mode 100644 index 0000000..a79ae10 --- /dev/null +++ b/qtinterface/qt4/Qt/q3ftp.h @@ -0,0 +1,204 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3FTP_H +#define Q3FTP_H + +#include // char*->QString conversion +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_NETWORKPROTOCOL_FTP + +class Q3Socket; +class Q3FtpCommand; + +class Q_COMPAT_EXPORT Q3Ftp : public Q3NetworkProtocol +{ + Q_OBJECT + +public: + Q3Ftp(); // ### Qt 4.0: get rid of this overload + Q3Ftp( QObject *parent, const char *name=0 ); + virtual ~Q3Ftp(); + + int supportedOperations() const; + + // non-Q3NetworkProtocol functions: + enum State { + Unconnected, + HostLookup, + Connecting, + Connected, + LoggedIn, + Closing + }; + enum Error { + NoError, + UnknownError, + HostNotFound, + ConnectionRefused, + NotConnected + }; + enum Command { + None, + ConnectToHost, + Login, + Close, + List, + Cd, + Get, + Put, + Remove, + Mkdir, + Rmdir, + Rename, + RawCommand + }; + + int connectToHost( const QString &host, Q_UINT16 port=21 ); + int login( const QString &user=QString(), const QString &password=QString() ); + int close(); + int list( const QString &dir=QString() ); + int cd( const QString &dir ); + int get( const QString &file, QIODevice *dev=0 ); + int put( const QByteArray &data, const QString &file ); + int put( QIODevice *dev, const QString &file ); + int remove( const QString &file ); + int mkdir( const QString &dir ); + int rmdir( const QString &dir ); + int rename( const QString &oldname, const QString &newname ); + + int rawCommand( const QString &command ); + + Q_ULONG bytesAvailable() const; + Q_LONG readBlock( char *data, Q_ULONG maxlen ); + QByteArray readAll(); + + int currentId() const; + QIODevice* currentDevice() const; + Command currentCommand() const; + bool hasPendingCommands() const; + void clearPendingCommands(); + + State state() const; + + Error error() const; + QString errorString() const; + +public Q_SLOTS: + void abort(); + +Q_SIGNALS: + void stateChanged( int ); + void listInfo( const QUrlInfo& ); + void readyRead(); + void dataTransferProgress( int, int ); + void rawCommandReply( int, const QString& ); + + void commandStarted( int ); + void commandFinished( int, bool ); + void done( bool ); + +protected: + void parseDir( const QString &buffer, QUrlInfo &info ); // ### Qt 4.0: delete this? (not public API) + void operationListChildren( Q3NetworkOperation *op ); + void operationMkDir( Q3NetworkOperation *op ); + void operationRemove( Q3NetworkOperation *op ); + void operationRename( Q3NetworkOperation *op ); + void operationGet( Q3NetworkOperation *op ); + void operationPut( Q3NetworkOperation *op ); + + // ### Qt 4.0: delete these + // unused variables: + Q3Socket *commandSocket, *dataSocket; + bool connectionReady, passiveMode; + int getTotalSize, getDoneSize; + bool startGetOnFail; + int putToWrite, putWritten; + bool errorInListChildren; + +private: + void init(); + int addCommand( Q3FtpCommand * ); + + bool checkConnection( Q3NetworkOperation *op ); + +private Q_SLOTS: + void startNextCommand(); + void piFinished( const QString& ); + void piError( int, const QString& ); + void piConnectState( int ); + void piFtpReply( int, const QString& ); + +private Q_SLOTS: + void npListInfo( const QUrlInfo & ); + void npDone( bool ); + void npStateChanged( int ); + void npDataTransferProgress( int, int ); + void npReadyRead(); + +protected Q_SLOTS: + // ### Qt 4.0: delete these + void hostFound(); + void connected(); + void closed(); + void dataHostFound(); + void dataConnected(); + void dataClosed(); + void dataReadyRead(); + void dataBytesWritten( int nbytes ); + void error( int ); +}; + +#endif // QT_NO_NETWORKPROTOCOL_FTP + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3FTP_H diff --git a/qtinterface/qt4/Qt/q3garray.h b/qtinterface/qt4/Qt/q3garray.h new file mode 100644 index 0000000..761d812 --- /dev/null +++ b/qtinterface/qt4/Qt/q3garray.h @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3GARRAY_H +#define Q3GARRAY_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3GArray // generic array +{ + friend class QBuffer; +public: + // do not use this, even though this is public + struct array_data : public Q3Shared { // shared array + array_data():data(0),len(0) +#ifdef QT_QGARRAY_SPEED_OPTIM + ,maxl(0) +#endif + {} + char *data; // actual array data + uint len; +#ifdef QT_QGARRAY_SPEED_OPTIM + uint maxl; +#endif + }; + Q3GArray(); + enum Optimization { MemOptim, SpeedOptim }; +protected: + Q3GArray(int, int); // dummy; does not alloc + Q3GArray(int size); // allocate 'size' bytes + Q3GArray(const Q3GArray &a); // shallow copy + virtual ~Q3GArray(); + + Q3GArray &operator=(const Q3GArray &a) { return assign(a); } + + virtual void detach() { duplicate(*this); } + + // ### Qt 4.0: maybe provide two versions of data(), at(), etc. + char *data() const { return shd->data; } + uint nrefs() const { return shd->count; } + uint size() const { return shd->len; } + bool isEqual(const Q3GArray &a) const; + + bool resize(uint newsize, Optimization optim); + bool resize(uint newsize); + + bool fill(const char *d, int len, uint sz); + + Q3GArray &assign(const Q3GArray &a); + Q3GArray &assign(const char *d, uint len); + Q3GArray &duplicate(const Q3GArray &a); + Q3GArray &duplicate(const char *d, uint len); + void store(const char *d, uint len); + + array_data *sharedBlock() const { return shd; } + void setSharedBlock(array_data *p) { shd=(array_data*)p; } + + Q3GArray &setRawData(const char *d, uint len); + void resetRawData(const char *d, uint len); + + int find(const char *d, uint index, uint sz) const; + int contains(const char *d, uint sz) const; + + void sort(uint sz); + int bsearch(const char *d, uint sz) const; + + char *at(uint index) const; + + bool setExpand(uint index, const char *d, uint sz); + +protected: + virtual array_data *newData(); + virtual void deleteData(array_data *p); + +private: + static void msg_index(uint); + array_data *shd; +}; + + +inline char *Q3GArray::at(uint index) const +{ +#if defined(QT_CHECK_RANGE) + if (index >= size()) { + msg_index(index); + index = 0; + } +#endif + return &shd->data[index]; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3GARRAY_H diff --git a/qtinterface/qt4/Qt/q3gcache.h b/qtinterface/qt4/Qt/q3gcache.h new file mode 100644 index 0000000..f3756a0 --- /dev/null +++ b/qtinterface/qt4/Qt/q3gcache.h @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3GCACHE_H +#define Q3GCACHE_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3CList; // internal classes +class Q3CListIt; +class Q3CDict; + +class Q_COMPAT_EXPORT Q3GCache : public Q3PtrCollection // generic LRU cache +{ +friend class Q3GCacheIterator; +protected: + enum KeyType { StringKey, AsciiKey, IntKey, PtrKey }; + // identical to Q3GDict's, but PtrKey is not used at the moment + + Q3GCache(int maxCost, uint size, KeyType kt, bool caseSensitive, + bool copyKeys); + Q3GCache(const Q3GCache &); // not allowed, calls fatal() + ~Q3GCache(); + Q3GCache &operator=(const Q3GCache &); // not allowed, calls fatal() + + uint count() const; + uint size() const; + int maxCost() const { return mCost; } + int totalCost() const { return tCost; } + void setMaxCost(int maxCost); + void clear(); + + bool insert_string(const QString &key, Q3PtrCollection::Item, + int cost, int priority); + bool insert_other(const char *key, Q3PtrCollection::Item, + int cost, int priority); + bool remove_string(const QString &key); + bool remove_other(const char *key); + Q3PtrCollection::Item take_string(const QString &key); + Q3PtrCollection::Item take_other(const char *key); + + Q3PtrCollection::Item find_string(const QString &key, bool ref=true) const; + Q3PtrCollection::Item find_other(const char *key, bool ref=true) const; + + void statistics() const; + +private: + bool makeRoomFor(int cost, int priority = -1); + KeyType keytype; + Q3CList *lruList; + Q3CDict *dict; + int mCost; + int tCost; + bool copyk; +}; + + +class Q_COMPAT_EXPORT Q3GCacheIterator // generic cache iterator +{ +protected: + Q3GCacheIterator(const Q3GCache &); + Q3GCacheIterator(const Q3GCacheIterator &); + ~Q3GCacheIterator(); + Q3GCacheIterator &operator=(const Q3GCacheIterator &); + + uint count() const; + bool atFirst() const; + bool atLast() const; + Q3PtrCollection::Item toFirst(); + Q3PtrCollection::Item toLast(); + + Q3PtrCollection::Item get() const; + QString getKeyString() const; + const char *getKeyAscii() const; + long getKeyInt() const; + + Q3PtrCollection::Item operator()(); + Q3PtrCollection::Item operator++(); + Q3PtrCollection::Item operator+=(uint); + Q3PtrCollection::Item operator--(); + Q3PtrCollection::Item operator-=(uint); + +protected: + Q3CListIt *it; // iterator on cache list +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3GCACHE_H diff --git a/qtinterface/qt4/Qt/q3gdict.h b/qtinterface/qt4/Qt/q3gdict.h new file mode 100644 index 0000000..43485a6 --- /dev/null +++ b/qtinterface/qt4/Qt/q3gdict.h @@ -0,0 +1,233 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3GDICT_H +#define Q3GDICT_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3GDictIterator; +class Q3GDItList; + + +class Q3BaseBucket // internal dict node +{ +public: + Q3PtrCollection::Item getData() { return data; } + Q3PtrCollection::Item setData( Q3PtrCollection::Item d ) { return data = d; } + Q3BaseBucket *getNext() { return next; } + void setNext( Q3BaseBucket *n) { next = n; } +protected: + Q3BaseBucket( Q3PtrCollection::Item d, Q3BaseBucket *n ) : data(d), next(n) {} + Q3PtrCollection::Item data; + Q3BaseBucket *next; +}; + +class Q3StringBucket : public Q3BaseBucket +{ +public: + Q3StringBucket( const QString &k, Q3PtrCollection::Item d, Q3BaseBucket *n ) + : Q3BaseBucket(d,n), key(k) {} + const QString &getKey() const { return key; } +private: + QString key; +}; + +class Q3AsciiBucket : public Q3BaseBucket +{ +public: + Q3AsciiBucket( const char *k, Q3PtrCollection::Item d, Q3BaseBucket *n ) + : Q3BaseBucket(d,n), key(k) {} + const char *getKey() const { return key; } +private: + const char *key; +}; + +class Q3IntBucket : public Q3BaseBucket +{ +public: + Q3IntBucket( long k, Q3PtrCollection::Item d, Q3BaseBucket *n ) + : Q3BaseBucket(d,n), key(k) {} + long getKey() const { return key; } +private: + long key; +}; + +class Q3PtrBucket : public Q3BaseBucket +{ +public: + Q3PtrBucket( void *k, Q3PtrCollection::Item d, Q3BaseBucket *n ) + : Q3BaseBucket(d,n), key(k) {} + void *getKey() const { return key; } +private: + void *key; +}; + + +class Q_COMPAT_EXPORT Q3GDict : public Q3PtrCollection // generic dictionary class +{ +public: + uint count() const { return numItems; } + uint size() const { return vlen; } + Q3PtrCollection::Item look_string( const QString& key, Q3PtrCollection::Item, + int ); + Q3PtrCollection::Item look_ascii( const char *key, Q3PtrCollection::Item, int ); + Q3PtrCollection::Item look_int( long key, Q3PtrCollection::Item, int ); + Q3PtrCollection::Item look_ptr( void *key, Q3PtrCollection::Item, int ); +#ifndef QT_NO_DATASTREAM + QDataStream &read( QDataStream & ); + QDataStream &write( QDataStream & ) const; +#endif +protected: + enum KeyType { StringKey, AsciiKey, IntKey, PtrKey }; + + Q3GDict( uint len, KeyType kt, bool cs, bool ck ); + Q3GDict( const Q3GDict & ); + ~Q3GDict(); + + Q3GDict &operator=( const Q3GDict & ); + + bool remove_string( const QString &key, Q3PtrCollection::Item item=0 ); + bool remove_ascii( const char *key, Q3PtrCollection::Item item=0 ); + bool remove_int( long key, Q3PtrCollection::Item item=0 ); + bool remove_ptr( void *key, Q3PtrCollection::Item item=0 ); + Q3PtrCollection::Item take_string( const QString &key ); + Q3PtrCollection::Item take_ascii( const char *key ); + Q3PtrCollection::Item take_int( long key ); + Q3PtrCollection::Item take_ptr( void *key ); + + void clear(); + void resize( uint ); + + int hashKeyString( const QString & ); + int hashKeyAscii( const char * ); + + void statistics() const; + +#ifndef QT_NO_DATASTREAM + virtual QDataStream &read( QDataStream &, Q3PtrCollection::Item & ); + virtual QDataStream &write( QDataStream &, Q3PtrCollection::Item ) const; +#endif +private: + Q3BaseBucket **vec; + uint vlen; + uint numItems; + uint keytype : 2; + uint cases : 1; + uint copyk : 1; + Q3GDItList *iterators; + void unlink_common( int, Q3BaseBucket *, Q3BaseBucket * ); + Q3StringBucket *unlink_string( const QString &, + Q3PtrCollection::Item item = 0 ); + Q3AsciiBucket *unlink_ascii( const char *, Q3PtrCollection::Item item = 0 ); + Q3IntBucket *unlink_int( long, Q3PtrCollection::Item item = 0 ); + Q3PtrBucket *unlink_ptr( void *, Q3PtrCollection::Item item = 0 ); + void init( uint, KeyType, bool, bool ); + friend class Q3GDictIterator; +}; + + +class Q_COMPAT_EXPORT Q3GDictIterator // generic dictionary iterator +{ +friend class Q3GDict; +public: + Q3GDictIterator( const Q3GDict & ); + Q3GDictIterator( const Q3GDictIterator & ); + Q3GDictIterator &operator=( const Q3GDictIterator & ); + ~Q3GDictIterator(); + + Q3PtrCollection::Item toFirst(); + + Q3PtrCollection::Item get() const; + QString getKeyString() const; + const char *getKeyAscii() const; + long getKeyInt() const; + void *getKeyPtr() const; + + Q3PtrCollection::Item operator()(); + Q3PtrCollection::Item operator++(); + Q3PtrCollection::Item operator+=(uint); + +protected: + Q3GDict *dict; + +private: + Q3BaseBucket *curNode; + uint curIndex; +}; + +inline Q3PtrCollection::Item Q3GDictIterator::get() const +{ + return curNode ? curNode->getData() : 0; +} + +inline QString Q3GDictIterator::getKeyString() const +{ + return curNode ? ((Q3StringBucket*)curNode)->getKey() : QString(); +} + +inline const char *Q3GDictIterator::getKeyAscii() const +{ + return curNode ? ((Q3AsciiBucket*)curNode)->getKey() : 0; +} + +inline long Q3GDictIterator::getKeyInt() const +{ + return curNode ? ((Q3IntBucket*)curNode)->getKey() : 0; +} + +inline void *Q3GDictIterator::getKeyPtr() const +{ + return curNode ? ((Q3PtrBucket*)curNode)->getKey() : 0; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3GDICT_H diff --git a/qtinterface/qt4/Qt/q3glist.h b/qtinterface/qt4/Qt/q3glist.h new file mode 100644 index 0000000..d33e0a0 --- /dev/null +++ b/qtinterface/qt4/Qt/q3glist.h @@ -0,0 +1,279 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3GLIST_H +#define Q3GLIST_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3LNode +{ +friend class Q3GList; +friend class Q3GListIterator; +friend class Q3GListStdIterator; +public: + Q3PtrCollection::Item getData() { return data; } +private: + Q3PtrCollection::Item data; + Q3LNode *prev; + Q3LNode *next; + Q3LNode( Q3PtrCollection::Item d ) { data = d; } +}; + +class Q3GListIteratorList; // internal helper class + +class Q_COMPAT_EXPORT Q3GList : public Q3PtrCollection // doubly linked generic list +{ +friend class Q3GListIterator; +friend class Q3GListIteratorList; +friend class Q3GVector; // needed by Q3GVector::toList +public: + uint count() const; // return number of nodes + +#ifndef QT_NO_DATASTREAM + QDataStream &read( QDataStream & ); // read list from stream + QDataStream &write( QDataStream & ) const; // write list to stream +#endif +protected: + Q3GList(); // create empty list + Q3GList( const Q3GList & ); // make copy of other list + virtual ~Q3GList(); + + Q3GList &operator=( const Q3GList & ); // assign from other list + bool operator==( const Q3GList& ) const; + + void inSort( Q3PtrCollection::Item ); // add item sorted in list + void append( Q3PtrCollection::Item ); // add item at end of list + bool insertAt( uint index, Q3PtrCollection::Item ); // add item at i'th position + void relinkNode( Q3LNode * ); // relink as first item + bool removeNode( Q3LNode * ); // remove node + bool remove( Q3PtrCollection::Item = 0 ); // remove item (0=current) + bool removeRef( Q3PtrCollection::Item = 0 ); // remove item (0=current) + bool removeFirst(); // remove first item + bool removeLast(); // remove last item + bool removeAt( uint ); // remove item at i'th position + bool replaceAt( uint, Q3PtrCollection::Item ); // replace item at position i with item + Q3PtrCollection::Item takeNode( Q3LNode * ); // take out node + Q3PtrCollection::Item take(); // take out current item + Q3PtrCollection::Item takeAt( uint index ); // take out item at i'th pos + Q3PtrCollection::Item takeFirst(); // take out first item + Q3PtrCollection::Item takeLast(); // take out last item + + void sort(); // sort all items; + void clear(); // remove all items + + int findRef( Q3PtrCollection::Item, bool = true ); // find exact item in list + int find( Q3PtrCollection::Item, bool = true ); // find equal item in list + + uint containsRef( Q3PtrCollection::Item ) const; // get number of exact matches + uint contains( Q3PtrCollection::Item ) const; // get number of equal matches + + Q3PtrCollection::Item at( uint index ); // access item at i'th pos + int at() const; // get current index + Q3LNode *currentNode() const; // get current node + + Q3PtrCollection::Item get() const; // get current item + + Q3PtrCollection::Item cfirst() const; // get ptr to first list item + Q3PtrCollection::Item clast() const; // get ptr to last list item + Q3PtrCollection::Item first(); // set first item in list curr + Q3PtrCollection::Item last(); // set last item in list curr + Q3PtrCollection::Item next(); // set next item in list curr + Q3PtrCollection::Item prev(); // set prev item in list curr + + void toVector( Q3GVector * ) const; // put items in vector + + virtual int compareItems( Q3PtrCollection::Item, Q3PtrCollection::Item ); + +#ifndef QT_NO_DATASTREAM + virtual QDataStream &read( QDataStream &, Q3PtrCollection::Item & ); + virtual QDataStream &write( QDataStream &, Q3PtrCollection::Item ) const; +#endif + + Q3LNode* begin() const { return firstNode; } + Q3LNode* end() const { return 0; } + Q3LNode* erase( Q3LNode* it ); + +private: + void prepend( Q3PtrCollection::Item ); // add item at start of list + + void heapSortPushDown( Q3PtrCollection::Item* heap, int first, int last ); + + Q3LNode *firstNode; // first node + Q3LNode *lastNode; // last node + Q3LNode *curNode; // current node + int curIndex; // current index + uint numNodes; // number of nodes + Q3GListIteratorList *iterators; // list of iterators + + Q3LNode *locate( uint ); // get node at i'th pos + Q3LNode *unlink(); // unlink node +}; + + +inline uint Q3GList::count() const +{ + return numNodes; +} + +inline bool Q3GList::removeFirst() +{ + first(); + return remove(); +} + +inline bool Q3GList::removeLast() +{ + last(); + return remove(); +} + +inline int Q3GList::at() const +{ + return curIndex; +} + +inline Q3PtrCollection::Item Q3GList::at( uint index ) +{ + Q3LNode *n = locate( index ); + return n ? n->data : 0; +} + +inline Q3LNode *Q3GList::currentNode() const +{ + return curNode; +} + +inline Q3PtrCollection::Item Q3GList::get() const +{ + return curNode ? curNode->data : 0; +} + +inline Q3PtrCollection::Item Q3GList::cfirst() const +{ + return firstNode ? firstNode->data : 0; +} + +inline Q3PtrCollection::Item Q3GList::clast() const +{ + return lastNode ? lastNode->data : 0; +} + + +/***************************************************************************** + Q3GList stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_COMPAT_EXPORT QDataStream &operator>>( QDataStream &, Q3GList & ); +Q_COMPAT_EXPORT QDataStream &operator<<( QDataStream &, const Q3GList & ); +#endif + +/***************************************************************************** + Q3GListIterator class + *****************************************************************************/ + +class Q_COMPAT_EXPORT Q3GListIterator // Q3GList iterator +{ +friend class Q3GList; +friend class Q3GListIteratorList; +protected: + Q3GListIterator( const Q3GList & ); + Q3GListIterator( const Q3GListIterator & ); + Q3GListIterator &operator=( const Q3GListIterator & ); + ~Q3GListIterator(); + + bool atFirst() const; // test if at first item + bool atLast() const; // test if at last item + Q3PtrCollection::Item toFirst(); // move to first item + Q3PtrCollection::Item toLast(); // move to last item + + Q3PtrCollection::Item get() const; // get current item + Q3PtrCollection::Item operator()(); // get current and move to next + Q3PtrCollection::Item operator++(); // move to next item (prefix) + Q3PtrCollection::Item operator+=(uint); // move n positions forward + Q3PtrCollection::Item operator--(); // move to prev item (prefix) + Q3PtrCollection::Item operator-=(uint); // move n positions backward + +protected: + Q3GList *list; // reference to list + +private: + Q3LNode *curNode; // current node in list +}; + + +inline bool Q3GListIterator::atFirst() const +{ + return curNode == list->firstNode; +} + +inline bool Q3GListIterator::atLast() const +{ + return curNode == list->lastNode; +} + +inline Q3PtrCollection::Item Q3GListIterator::get() const +{ + return curNode ? curNode->data : 0; +} + +class Q_COMPAT_EXPORT Q3GListStdIterator +{ +public: + inline Q3GListStdIterator( Q3LNode* n ) : node( n ){} + inline operator Q3LNode* () { return node; } +protected: + inline Q3LNode *next() { return node->next; } + Q3LNode *node; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3GLIST_H diff --git a/qtinterface/qt4/Qt/q3grid.h b/qtinterface/qt4/Qt/q3grid.h new file mode 100644 index 0000000..8cfdb66 --- /dev/null +++ b/qtinterface/qt4/Qt/q3grid.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3GRID_H +#define Q3GRID_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class QGridLayout; + +class Q_COMPAT_EXPORT Q3Grid : public Q3Frame +{ + Q_OBJECT +public: + Q3Grid(int n, QWidget* parent=0, const char* name=0, Qt::WindowFlags f = 0); + Q3Grid(int n, Qt::Orientation orient, QWidget* parent=0, const char* name=0, + Qt::WindowFlags f = 0); + + void setSpacing(int); + QSize sizeHint() const; + + typedef Qt::Orientation Direction; + +protected: + void frameChanged(); + +private: + Q_DISABLE_COPY(Q3Grid) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3GRID_H diff --git a/qtinterface/qt4/Qt/q3gridlayout.h b/qtinterface/qt4/Qt/q3gridlayout.h new file mode 100644 index 0000000..1ebb2bf --- /dev/null +++ b/qtinterface/qt4/Qt/q3gridlayout.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3GRIDLAYOUT_H +#define Q3GRIDLAYOUT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3GridLayout : public QGridLayout +{ +public: + inline explicit Q3GridLayout(QWidget *parent) + : QGridLayout(parent) { setMargin(0); setSpacing(0); } + + inline Q3GridLayout(QWidget *parent, int nRows, int nCols = 1, int margin = 0, + int spacing = -1, const char *name = 0) + : QGridLayout(parent, nRows, nCols, margin, spacing, name) {} + + inline Q3GridLayout(int nRows, int nCols = 1, int spacing = -1, const char *name = 0) + : QGridLayout(nRows, nCols, spacing, name) {} + + inline Q3GridLayout(QLayout *parentLayout, int nRows =1, int nCols = 1, int spacing = -1, + const char *name = 0) + : QGridLayout(parentLayout, nRows, nCols, spacing, name) {} + +private: + Q_DISABLE_COPY(Q3GridLayout) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3GRIDLAYOUT_H diff --git a/qtinterface/qt4/Qt/q3gridview.h b/qtinterface/qt4/Qt/q3gridview.h new file mode 100644 index 0000000..0fe79fc --- /dev/null +++ b/qtinterface/qt4/Qt/q3gridview.h @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3GRIDVIEW_H +#define Q3GRIDVIEW_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3GridViewPrivate; + +class Q_COMPAT_EXPORT Q3GridView : public Q3ScrollView +{ + Q_OBJECT + Q_PROPERTY(int numRows READ numRows WRITE setNumRows) + Q_PROPERTY(int numCols READ numCols WRITE setNumCols) + Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth) + Q_PROPERTY(int cellHeight READ cellHeight WRITE setCellHeight) +public: + + Q3GridView(QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0); + ~Q3GridView(); + + int numRows() const; + virtual void setNumRows(int); + int numCols() const; + virtual void setNumCols(int); + + int cellWidth() const; + virtual void setCellWidth(int); + int cellHeight() const; + virtual void setCellHeight(int); + + QRect cellRect() const; + QRect cellGeometry(int row, int column); + QSize gridSize() const; + + int rowAt(int y) const; + int columnAt(int x) const; + + void repaintCell(int row, int column, bool erase=true); + void updateCell(int row, int column); + void ensureCellVisible(int row, int column); + +protected: + virtual void paintCell(QPainter *, int row, int col) = 0; + virtual void paintEmptyArea(QPainter *p, int cx, int cy, int cw, int ch); + + void drawContents(QPainter *p, int cx, int cy, int cw, int ch); + + virtual void dimensionChange(int, int); + +private: + void drawContents(QPainter*); + void updateGrid(); + + int nrows; + int ncols; + int cellw; + int cellh; + Q3GridViewPrivate* d; + + Q_DISABLE_COPY(Q3GridView) +}; + +inline int Q3GridView::cellWidth() const +{ return cellw; } + +inline int Q3GridView::cellHeight() const +{ return cellh; } + +inline int Q3GridView::rowAt(int y) const +{ return y / cellh; } + +inline int Q3GridView::columnAt(int x) const +{ return x / cellw; } + +inline int Q3GridView::numRows() const +{ return nrows; } + +inline int Q3GridView::numCols() const +{return ncols; } + +inline QRect Q3GridView::cellRect() const +{ return QRect(0, 0, cellw, cellh); } + +inline QSize Q3GridView::gridSize() const +{ return QSize(ncols * cellw, nrows * cellh); } + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3GRIDVIEW_H diff --git a/qtinterface/qt4/Qt/q3groupbox.h b/qtinterface/qt4/Qt/q3groupbox.h new file mode 100644 index 0000000..06cd192 --- /dev/null +++ b/qtinterface/qt4/Qt/q3groupbox.h @@ -0,0 +1,159 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3GROUPBOX_H +#define Q3GROUPBOX_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3GroupBoxPrivate; + +class Q_COMPAT_EXPORT Q3GroupBox : public QGroupBox +{ + Q_OBJECT +public: + enum +#if defined(Q_MOC_RUN) + FrameShape +#else + DummyFrame +#endif + { Box = QFrame::Box, Sunken = QFrame::Sunken, Plain = QFrame::Plain, + Raised = QFrame::Raised, MShadow=QFrame::Shadow_Mask, NoFrame = QFrame::NoFrame, + Panel = QFrame::Panel, StyledPanel = QFrame::StyledPanel, HLine = QFrame::HLine, + VLine = QFrame::VLine, + WinPanel = QFrame::WinPanel,ToolBarPanel = QFrame::StyledPanel, + MenuBarPanel = QFrame::StyledPanel, PopupPanel = QFrame::StyledPanel, + LineEditPanel = QFrame::StyledPanel,TabWidgetPanel = QFrame::StyledPanel, + GroupBoxPanel = 0x0007, + MShape = QFrame::Shape_Mask}; + + typedef DummyFrame FrameShape; + Q_ENUMS(FrameShape) + + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation DESIGNABLE false) + Q_PROPERTY(int columns READ columns WRITE setColumns DESIGNABLE false) + + Q_PROPERTY(QRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false) + Q_PROPERTY(FrameShape frameShape READ frameShape WRITE setFrameShape) + Q_PROPERTY(FrameShape frameShadow READ frameShadow WRITE setFrameShadow) + Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth) + Q_PROPERTY(int midLineWidth READ midLineWidth WRITE setMidLineWidth) + Q_PROPERTY(int margin READ margin WRITE setMargin) + +public: + explicit Q3GroupBox(QWidget* parent=0, const char* name=0); + explicit Q3GroupBox(const QString &title, + QWidget* parent=0, const char* name=0); + Q3GroupBox(int strips, Qt::Orientation o, + QWidget* parent=0, const char* name=0); + Q3GroupBox(int strips, Qt::Orientation o, const QString &title, + QWidget* parent=0, const char* name=0); + ~Q3GroupBox(); + + virtual void setColumnLayout(int strips, Qt::Orientation o); + + int columns() const; + void setColumns(int); + + Qt::Orientation orientation() const; + void setOrientation(Qt::Orientation); + + int insideMargin() const; + int insideSpacing() const; + void setInsideMargin(int m); + void setInsideSpacing(int s); + + void addSpace(int); + + void setFrameRect(QRect); + QRect frameRect() const; +#ifdef qdoc + void setFrameShadow(FrameShape); + FrameShape frameShadow() const; + void setFrameShape(FrameShape); + FrameShape frameShape() const; +#else + void setFrameShadow(DummyFrame); + DummyFrame frameShadow() const; + void setFrameShape(DummyFrame); + DummyFrame frameShape() const; +#endif + void setFrameStyle(int); + int frameStyle() const; + int frameWidth() const; + void setLineWidth(int); + int lineWidth() const; + void setMargin(int margin) { setContentsMargins(margin, margin, margin, margin); } + int margin() const + { int margin; int dummy; getContentsMargins(&margin, &dummy, &dummy, &dummy); return margin; } + void setMidLineWidth(int); + int midLineWidth() const; + +protected: + void childEvent(QChildEvent *); + void resizeEvent(QResizeEvent *); + void changeEvent(QEvent *); + bool event(QEvent *); + +private: + void skip(); + void init(); + void calculateFrame(); + void insertWid(QWidget*); + void drawFrame(QPainter *p); + + Q3GroupBoxPrivate * d; + + Q_DISABLE_COPY(Q3GroupBox) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3GROUPBOX_H diff --git a/qtinterface/qt4/Qt/q3gvector.h b/qtinterface/qt4/Qt/q3gvector.h new file mode 100644 index 0000000..9e39eec --- /dev/null +++ b/qtinterface/qt4/Qt/q3gvector.h @@ -0,0 +1,132 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3GVECTOR_H +#define Q3GVECTOR_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3GVector : public Q3PtrCollection // generic vector +{ +friend class Q3GList; // needed by Q3GList::toVector +public: +#ifndef QT_NO_DATASTREAM + QDataStream &read( QDataStream & ); // read vector from stream + QDataStream &write( QDataStream & ) const; // write vector to stream +#endif + virtual int compareItems( Item, Item ); + +protected: + Q3GVector(); // create empty vector + Q3GVector( uint size ); // create vector with nullptrs + Q3GVector( const Q3GVector &v ); // make copy of other vector + ~Q3GVector(); + + Q3GVector &operator=( const Q3GVector &v ); // assign from other vector + bool operator==( const Q3GVector &v ) const; + + Item *data() const { return vec; } + uint size() const { return len; } + uint count() const { return numItems; } + + bool insert( uint index, Item ); // insert item at index + bool remove( uint index ); // remove item + Item take( uint index ); // take out item + + void clear(); // clear vector + bool resize( uint newsize ); // resize vector + + bool fill( Item, int flen ); // resize and fill vector + + void sort(); // sort vector + int bsearch( Item ) const; // binary search (when sorted) + + int findRef( Item, uint index ) const; // find exact item in vector + int find( Item, uint index ) const; // find equal item in vector + uint containsRef( Item ) const; // get number of exact matches + uint contains( Item ) const; // get number of equal matches + + Item at( uint index ) const // return indexed item + { +#if defined(QT_CHECK_RANGE) + if ( index >= len ) + warningIndexRange( index ); +#endif + return vec[index]; + } + + bool insertExpand( uint index, Item ); // insert, expand if necessary + + void toList( Q3GList * ) const; // put items in list + +#ifndef QT_NO_DATASTREAM + virtual QDataStream &read( QDataStream &, Item & ); + virtual QDataStream &write( QDataStream &, Item ) const; +#endif +private: + Item *vec; + uint len; + uint numItems; + + static void warningIndexRange( uint ); +}; + + +/***************************************************************************** + Q3GVector stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_COMPAT_EXPORT QDataStream &operator>>( QDataStream &, Q3GVector & ); +Q_COMPAT_EXPORT QDataStream &operator<<( QDataStream &, const Q3GVector & ); +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3GVECTOR_H diff --git a/qtinterface/qt4/Qt/q3hbox.h b/qtinterface/qt4/Qt/q3hbox.h new file mode 100644 index 0000000..727a090 --- /dev/null +++ b/qtinterface/qt4/Qt/q3hbox.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3HBOX_H +#define Q3HBOX_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class QBoxLayout; + +class Q_COMPAT_EXPORT Q3HBox : public Q3Frame +{ + Q_OBJECT +public: + Q3HBox(QWidget* parent=0, const char* name=0, Qt::WindowFlags f=0); + + void setSpacing(int); + bool setStretchFactor(QWidget*, int stretch); + QSize sizeHint() const; + +protected: + Q3HBox(bool horizontal, QWidget* parent, const char* name, Qt::WindowFlags f = 0); + void frameChanged(); + +private: + Q_DISABLE_COPY(Q3HBox) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3HBOX_H diff --git a/qtinterface/qt4/Qt/q3header.h b/qtinterface/qt4/Qt/q3header.h new file mode 100644 index 0000000..702b59b --- /dev/null +++ b/qtinterface/qt4/Qt/q3header.h @@ -0,0 +1,225 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3HEADER_H +#define Q3HEADER_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_HEADER + +class QShowEvent; +class Q3HeaderData; +class Q3Table; +class Q3ListView; + +class Q_COMPAT_EXPORT Q3Header : public QWidget +{ + friend class Q3Table; + friend class Q3TableHeader; + friend class Q3ListView; + + Q_OBJECT + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) + Q_PROPERTY(bool tracking READ tracking WRITE setTracking) + Q_PROPERTY(int count READ count) + Q_PROPERTY(int offset READ offset WRITE setOffset) + Q_PROPERTY(bool moving READ isMovingEnabled WRITE setMovingEnabled) + Q_PROPERTY(bool stretching READ isStretchEnabled WRITE setStretchEnabled) + +public: + Q3Header(QWidget* parent=0, const char* name=0); + Q3Header(int, QWidget* parent=0, const char* name=0); + ~Q3Header(); + + int addLabel(const QString &, int size = -1); + int addLabel(const QIcon&, const QString &, int size = -1); + void removeLabel(int section); + virtual void setLabel(int, const QString &, int size = -1); + virtual void setLabel(int, const QIcon&, const QString &, int size = -1); + QString label(int section) const; + QIcon* iconSet(int section) const; + + virtual void setOrientation(Qt::Orientation); + Qt::Orientation orientation() const; + virtual void setTracking(bool enable); + bool tracking() const; + + virtual void setClickEnabled(bool, int section = -1); + virtual void setResizeEnabled(bool, int section = -1); + virtual void setMovingEnabled(bool); + virtual void setStretchEnabled(bool b, int section); + void setStretchEnabled(bool b) { setStretchEnabled(b, -1); } + bool isClickEnabled(int section = -1) const; + bool isResizeEnabled(int section = -1) const; + bool isMovingEnabled() const; + bool isStretchEnabled() const; + bool isStretchEnabled(int section) const; + + void resizeSection(int section, int s); + int sectionSize(int section) const; + int sectionPos(int section) const; + int sectionAt(int pos) const; + int count() const; + int headerWidth() const; + QRect sectionRect(int section) const; + + virtual void setCellSize(int , int); // obsolete, do not use + int cellSize(int i) const { return sectionSize(mapToSection(i)); } // obsolete, do not use + int cellPos(int) const; // obsolete, do not use + int cellAt(int pos) const { return mapToIndex(sectionAt(pos + offset())); } // obsolete, do not use + + int offset() const; + + QSize sizeHint() const; + + int mapToSection(int index) const; + int mapToIndex(int section) const; + int mapToLogical(int) const; // obsolete, do not use + int mapToActual(int) const; // obsolete, do not use + + void moveSection(int section, int toIndex); + virtual void moveCell(int, int); // obsolete, do not use + + void setSortIndicator(int section, bool ascending = true); // obsolete, do not use + inline void setSortIndicator(int section, Qt::SortOrder order) + { setSortIndicator(section, (order == Qt::AscendingOrder)); } + int sortIndicatorSection() const; + Qt::SortOrder sortIndicatorOrder() const; + + void adjustHeaderSize() { adjustHeaderSize(-1); } + +public Q_SLOTS: + void setUpdatesEnabled(bool enable); + virtual void setOffset(int pos); + +Q_SIGNALS: + void clicked(int section); + void pressed(int section); + void released(int section); + void sizeChange(int section, int oldSize, int newSize); + void indexChange(int section, int fromIndex, int toIndex); + void sectionClicked(int); // obsolete, do not use + void moved(int, int); // obsolete, do not use + void sectionHandleDoubleClicked(int section); + +protected: + void paintEvent(QPaintEvent *); + void showEvent(QShowEvent *e); + void resizeEvent(QResizeEvent *e); + QRect sRect(int index); + + virtual void paintSection(QPainter *p, int index, const QRect& fr); + virtual void paintSectionLabel(QPainter* p, int index, const QRect& fr); + + void changeEvent(QEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + + void keyPressEvent(QKeyEvent *); + void keyReleaseEvent(QKeyEvent *); + +private: + void handleColumnMove(int fromIdx, int toIdx); + void adjustHeaderSize(int diff); + void init(int); + + void paintRect(int p, int s); + void markLine(int idx); + void unMarkLine(int idx); + int pPos(int i) const; + int pSize(int i) const; + int findLine(int); + int handleAt(int p); + bool reverse() const; + void calculatePositions(bool onlyVisible = false, int start = 0); + void handleColumnResize(int, int, bool, bool = true); + QSize sectionSizeHint(int section, const QFontMetrics& fm) const; + void setSectionSizeAndHeight(int section, int size); + + void resizeArrays(int size); + void setIsATableHeader(bool b); + int offs; + int handleIdx; + int oldHIdxSize; + int moveToIdx; + enum State { Idle, Sliding, Pressed, Moving, Blocked }; + State state; + int clickPos; + bool trackingIsOn; + int oldHandleIdx; + int cachedPos; // not used + Qt::Orientation orient; + + Q3HeaderData *d; + +private: + Q_DISABLE_COPY(Q3Header) +}; + + +inline Qt::Orientation Q3Header::orientation() const +{ + return orient; +} + +inline void Q3Header::setTracking(bool enable) { trackingIsOn = enable; } +inline bool Q3Header::tracking() const { return trackingIsOn; } + +extern Q_COMPAT_EXPORT bool qt_qheader_label_return_null_strings; // needed for professional edition + +#endif // QT_NO_HEADER + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3HEADER_H diff --git a/qtinterface/qt4/Qt/q3hgroupbox.h b/qtinterface/qt4/Qt/q3hgroupbox.h new file mode 100644 index 0000000..d2862b4 --- /dev/null +++ b/qtinterface/qt4/Qt/q3hgroupbox.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3HGROUPBOX_H +#define Q3HGROUPBOX_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3HGroupBox : public Q3GroupBox +{ + Q_OBJECT +public: + Q3HGroupBox( QWidget* parent=0, const char* name=0 ); + Q3HGroupBox( const QString &title, QWidget* parent=0, const char* name=0 ); + ~Q3HGroupBox(); + +private: + Q_DISABLE_COPY(Q3HGroupBox) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3HGROUPBOX_H diff --git a/qtinterface/qt4/Qt/q3http.h b/qtinterface/qt4/Qt/q3http.h new file mode 100644 index 0000000..77e971e --- /dev/null +++ b/qtinterface/qt4/Qt/q3http.h @@ -0,0 +1,277 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3HTTP_H +#define Q3HTTP_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) +#ifndef QT_NO_HTTP + +class Q3Socket; +class QTimerEvent; +class QTextStream; +class QIODevice; + +class Q3HttpPrivate; +class Q3HttpRequest; + +class Q_COMPAT_EXPORT Q3HttpHeader +{ +public: + Q3HttpHeader(); + Q3HttpHeader( const Q3HttpHeader& header ); + Q3HttpHeader( const QString& str ); + virtual ~Q3HttpHeader(); + + Q3HttpHeader& operator=( const Q3HttpHeader& h ); + + QString value( const QString& key ) const; + void setValue( const QString& key, const QString& value ); + void removeValue( const QString& key ); + + QStringList keys() const; + bool hasKey( const QString& key ) const; + + bool hasContentLength() const; + uint contentLength() const; + void setContentLength( int len ); + + bool hasContentType() const; + QString contentType() const; + void setContentType( const QString& type ); + + virtual QString toString() const; + bool isValid() const; + + virtual int majorVersion() const = 0; + virtual int minorVersion() const = 0; + +protected: + virtual bool parseLine( const QString& line, int number ); + bool parse( const QString& str ); + void setValid( bool ); + +private: + QMap values; + bool valid; +}; + +class Q_COMPAT_EXPORT Q3HttpResponseHeader : public Q3HttpHeader +{ +private: + Q3HttpResponseHeader( int code, const QString& text = QString(), int majorVer = 1, int minorVer = 1 ); + Q3HttpResponseHeader( const QString& str ); + + void setStatusLine( int code, const QString& text = QString(), int majorVer = 1, int minorVer = 1 ); + +public: + Q3HttpResponseHeader(); + Q3HttpResponseHeader( const Q3HttpResponseHeader& header ); + + int statusCode() const; + QString reasonPhrase() const; + + int majorVersion() const; + int minorVersion() const; + + QString toString() const; + +protected: + bool parseLine( const QString& line, int number ); + +private: + int statCode; + QString reasonPhr; + int majVer; + int minVer; + + friend class Q3Http; +}; + +class Q_COMPAT_EXPORT Q3HttpRequestHeader : public Q3HttpHeader +{ +public: + Q3HttpRequestHeader(); + Q3HttpRequestHeader( const QString& method, const QString& path, int majorVer = 1, int minorVer = 1 ); + Q3HttpRequestHeader( const Q3HttpRequestHeader& header ); + Q3HttpRequestHeader( const QString& str ); + + void setRequest( const QString& method, const QString& path, int majorVer = 1, int minorVer = 1 ); + + QString method() const; + QString path() const; + + int majorVersion() const; + int minorVersion() const; + + QString toString() const; + +protected: + bool parseLine( const QString& line, int number ); + +private: + QString m; + QString p; + int majVer; + int minVer; +}; + +class Q_COMPAT_EXPORT Q3Http : public Q3NetworkProtocol +{ + Q_OBJECT + +public: + Q3Http(); + Q3Http( QObject* parent, const char* name = 0 ); // ### Qt 4.0: make parent=0 and get rid of the Q3Http() constructor + Q3Http( const QString &hostname, Q_UINT16 port=80, QObject* parent=0, const char* name = 0 ); + virtual ~Q3Http(); + + int supportedOperations() const; + + enum State { Unconnected, HostLookup, Connecting, Sending, Reading, Connected, Closing }; + enum Error { + NoError, + UnknownError, + HostNotFound, + ConnectionRefused, + UnexpectedClose, + InvalidResponseHeader, + WrongContentLength, + Aborted + }; + + int setHost(const QString &hostname, Q_UINT16 port=80 ); + + int get( const QString& path, QIODevice* to=0 ); + int post( const QString& path, QIODevice* data, QIODevice* to=0 ); + int post( const QString& path, const QByteArray& data, QIODevice* to=0 ); + int head( const QString& path ); + int request( const Q3HttpRequestHeader &header, QIODevice *device=0, QIODevice *to=0 ); + int request( const Q3HttpRequestHeader &header, const QByteArray &data, QIODevice *to=0 ); + + int closeConnection(); + + Q_ULONG bytesAvailable() const; + Q_LONG readBlock( char *data, Q_ULONG maxlen ); + QByteArray readAll(); + + int currentId() const; + QIODevice* currentSourceDevice() const; + QIODevice* currentDestinationDevice() const; + Q3HttpRequestHeader currentRequest() const; + bool hasPendingRequests() const; + void clearPendingRequests(); + + State state() const; + + Error error() const; + QString errorString() const; + +public Q_SLOTS: + void abort(); + +Q_SIGNALS: + void stateChanged( int ); + void responseHeaderReceived( const Q3HttpResponseHeader& resp ); + void readyRead( const Q3HttpResponseHeader& resp ); + void dataSendProgress( int, int ); + void dataReadProgress( int, int ); + + void requestStarted( int ); + void requestFinished( int, bool ); + void done( bool ); + +protected: + void operationGet( Q3NetworkOperation *op ); + void operationPut( Q3NetworkOperation *op ); + + void timerEvent( QTimerEvent * ); + +private Q_SLOTS: + void clientReply( const Q3HttpResponseHeader &rep ); + void clientDone( bool ); + void clientStateChanged( int ); + + void startNextRequest(); + void slotReadyRead(); + void slotConnected(); + void slotError( int ); + void slotClosed(); + void slotBytesWritten( int ); + +private: + Q3HttpPrivate *d; + void *unused; // ### Qt 4.0: remove this (in for binary compatibility) + int bytesRead; + + int addRequest( Q3HttpRequest * ); + void sendRequest(); + void finishedWithSuccess(); + void finishedWithError( const QString& detail, int errorCode ); + + void killIdleTimer(); + + void init(); + void setState( int ); + void close(); + + friend class Q3HttpNormalRequest; + friend class Q3HttpSetHostRequest; + friend class Q3HttpCloseRequest; + friend class Q3HttpPGHRequest; +}; + +#endif // QT_NO_HTTP + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3HTTP_H diff --git a/qtinterface/qt4/Qt/q3iconview.h b/qtinterface/qt4/Qt/q3iconview.h new file mode 100644 index 0000000..0239d96 --- /dev/null +++ b/qtinterface/qt4/Qt/q3iconview.h @@ -0,0 +1,519 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3ICONVIEW_H +#define Q3ICONVIEW_H + +#include +#include +#include +#include +#include +#include // QString->QFont conversion +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_ICONVIEW + +class Q3IconView; +class QPainter; +class QMimeSource; +class QMouseEvent; +class QDragEnterEvent; +class QDragMoveEvent; +class QDragLeaveEvent; +class QKeyEvent; +class QFocusEvent; +class QShowEvent; +class Q3IconViewItem; +class Q3IconViewItemLineEdit; +class QStringList; +class Q3IconDragPrivate; +class QColorGroup; + +#ifndef QT_NO_DRAGANDDROP + +class Q_COMPAT_EXPORT Q3IconDragItem +{ +public: + Q3IconDragItem(); + virtual ~Q3IconDragItem(); + virtual QByteArray data() const; + virtual void setData(const QByteArray &d); + bool operator== (const Q3IconDragItem&) const; + +private: + QByteArray ba; + +}; + +class Q_COMPAT_EXPORT Q3IconDrag : public Q3DragObject +{ + Q_OBJECT +public: + Q3IconDrag(QWidget * dragSource, const char* name = 0); + virtual ~Q3IconDrag(); + + void append(const Q3IconDragItem &item, const QRect &pr, const QRect &tr); + + virtual const char* format(int i) const; + static bool canDecode(QMimeSource* e); + virtual QByteArray encodedData(const char* mime) const; + +private: + Q_DISABLE_COPY(Q3IconDrag) + + Q3IconDragPrivate *d; + QChar endMark; + + friend class Q3IconView; + friend class Q3IconViewPrivate; +}; + +#endif + +class Q3IconViewToolTip; +class Q3IconViewItemPrivate; + +class Q_COMPAT_EXPORT Q3IconViewItem +{ + friend class Q3IconView; + friend class Q3IconViewToolTip; + friend class Q3IconViewItemLineEdit; + +public: + Q3IconViewItem(Q3IconView *parent); + Q3IconViewItem(Q3IconView *parent, Q3IconViewItem *after); + Q3IconViewItem(Q3IconView *parent, const QString &text); + Q3IconViewItem(Q3IconView *parent, Q3IconViewItem *after, const QString &text); + Q3IconViewItem(Q3IconView *parent, const QString &text, const QPixmap &icon); + Q3IconViewItem(Q3IconView *parent, Q3IconViewItem *after, const QString &text, const QPixmap &icon); +#ifndef QT_NO_PICTURE + Q3IconViewItem(Q3IconView *parent, const QString &text, const QPicture &picture); + Q3IconViewItem(Q3IconView *parent, Q3IconViewItem *after, const QString &text, const QPicture &picture); +#endif + virtual ~Q3IconViewItem(); + + virtual void setRenameEnabled(bool allow); + virtual void setDragEnabled(bool allow); + virtual void setDropEnabled(bool allow); + + virtual QString text() const; + virtual QPixmap *pixmap() const; +#ifndef QT_NO_PICTURE + virtual QPicture *picture() const; +#endif + virtual QString key() const; + + bool renameEnabled() const; + bool dragEnabled() const; + bool dropEnabled() const; + + Q3IconView *iconView() const; + Q3IconViewItem *prevItem() const; + Q3IconViewItem *nextItem() const; + + int index() const; + + virtual void setSelected(bool s, bool cb); + virtual void setSelected(bool s); + virtual void setSelectable(bool s); + + bool isSelected() const; + bool isSelectable() const; + + virtual void repaint(); + + virtual bool move(int x, int y); + virtual void moveBy(int dx, int dy); + virtual bool move(const QPoint &pnt); + virtual void moveBy(const QPoint &pnt); + + QRect rect() const; + int x() const; + int y() const; + int width() const; + int height() const; + QSize size() const; + QPoint pos() const; + QRect textRect(bool relative = true) const; + QRect pixmapRect(bool relative = true) const; + bool contains(const QPoint& pnt) const; + bool intersects(const QRect& r) const; + + virtual bool acceptDrop(const QMimeSource *mime) const; + +#ifndef QT_NO_TEXTEDIT + void rename(); +#endif + + virtual int compare(Q3IconViewItem *i) const; + + virtual void setText(const QString &text); + virtual void setPixmap(const QPixmap &icon); +#ifndef QT_NO_PICTURE + virtual void setPicture(const QPicture &icon); +#endif + virtual void setText(const QString &text, bool recalc, bool redraw = true); + virtual void setPixmap(const QPixmap &icon, bool recalc, bool redraw = true); + virtual void setKey(const QString &k); + + virtual int rtti() const; + static int RTTI; + +protected: +#ifndef QT_NO_TEXTEDIT + virtual void removeRenameBox(); +#endif + virtual void calcRect(const QString &text_ = QString()); + virtual void paintItem(QPainter *p, const QColorGroup &cg); + virtual void paintFocus(QPainter *p, const QColorGroup &cg); +#ifndef QT_NO_DRAGANDDROP + virtual void dropped(QDropEvent *e, const Q3ValueList &lst); +#endif + virtual void dragEntered(); + virtual void dragLeft(); + void setItemRect(const QRect &r); + void setTextRect(const QRect &r); + void setPixmapRect(const QRect &r); + void calcTmpText(); + QString tempText() const; + +private: + void init(Q3IconViewItem *after = 0 +#ifndef QT_NO_PICTURE + , QPicture *pic = 0 +#endif + ); +#ifndef QT_NO_TEXTEDIT + void renameItem(); + void cancelRenameItem(); +#endif + void checkRect(); + + Q3IconView *view; + QString itemText, itemKey; + QString tmpText; + QPixmap *itemIcon; +#ifndef QT_NO_PICTURE + QPicture *itemPic; +#endif + Q3IconViewItem *prev, *next; + uint allow_rename : 1; + uint allow_drag : 1; + uint allow_drop : 1; + uint selected : 1; + uint selectable : 1; + uint dirty : 1; + uint wordWrapDirty : 1; + QRect itemRect, itemTextRect, itemIconRect; +#ifndef QT_NO_TEXTEDIT + Q3IconViewItemLineEdit *renameBox; +#endif + QRect oldRect; + + Q3IconViewItemPrivate *d; + +}; + +class Q3IconViewPrivate; + +class Q_COMPAT_EXPORT Q3IconView : public Q3ScrollView +{ + friend class Q3IconViewItem; + friend class Q3IconViewPrivate; + friend class Q3IconViewToolTip; + + Q_OBJECT + // #### sorting and sort direction do not work + Q_ENUMS(SelectionMode ItemTextPos Arrangement ResizeMode) + Q_PROPERTY(bool sorting READ sorting) + Q_PROPERTY(bool sortDirection READ sortDirection) + Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) + Q_PROPERTY(int gridX READ gridX WRITE setGridX) + Q_PROPERTY(int gridY READ gridY WRITE setGridY) + Q_PROPERTY(int spacing READ spacing WRITE setSpacing) + Q_PROPERTY(ItemTextPos itemTextPos READ itemTextPos WRITE setItemTextPos) + Q_PROPERTY(QBrush itemTextBackground READ itemTextBackground WRITE setItemTextBackground) + Q_PROPERTY(Arrangement arrangement READ arrangement WRITE setArrangement) + Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode) + Q_PROPERTY(int maxItemWidth READ maxItemWidth WRITE setMaxItemWidth) + Q_PROPERTY(int maxItemTextLength READ maxItemTextLength WRITE setMaxItemTextLength) + Q_PROPERTY(bool autoArrange READ autoArrange WRITE setAutoArrange) + Q_PROPERTY(bool itemsMovable READ itemsMovable WRITE setItemsMovable) + Q_PROPERTY(bool wordWrapIconText READ wordWrapIconText WRITE setWordWrapIconText) + Q_PROPERTY(bool showToolTips READ showToolTips WRITE setShowToolTips) + Q_PROPERTY(uint count READ count) + +public: + enum SelectionMode { + Single = 0, + Multi, + Extended, + NoSelection + }; + enum Arrangement { + LeftToRight = 0, + TopToBottom + }; + enum ResizeMode { + Fixed = 0, + Adjust + }; + enum ItemTextPos { + Bottom = 0, + Right + }; + + Q3IconView(QWidget* parent=0, const char* name=0, Qt::WindowFlags f = 0); + virtual ~Q3IconView(); + + virtual void insertItem(Q3IconViewItem *item, Q3IconViewItem *after = 0L); + virtual void takeItem(Q3IconViewItem *item); + + int index(const Q3IconViewItem *item) const; + + Q3IconViewItem *firstItem() const; + Q3IconViewItem *lastItem() const; + Q3IconViewItem *currentItem() const; + virtual void setCurrentItem(Q3IconViewItem *item); + virtual void setSelected(Q3IconViewItem *item, bool s, bool cb = false); + + uint count() const; + +public: + virtual void showEvent(QShowEvent *); + + virtual void setSelectionMode(SelectionMode m); + SelectionMode selectionMode() const; + + Q3IconViewItem *findItem(const QPoint &pos) const; + + enum StringComparisonMode { + CaseSensitive = 0x00001, // 0 0001 + BeginsWith = 0x00002, // 0 0010 + EndsWith = 0x00004, // 0 0100 + Contains = 0x00008, // 0 1000 + ExactMatch = 0x00010 // 1 0000 + }; + typedef uint ComparisonFlags; + Q3IconViewItem *findItem(const QString &text, ComparisonFlags = BeginsWith | Qt::CaseSensitive) const; + virtual void selectAll(bool select); + virtual void clearSelection(); + virtual void invertSelection(); + + virtual void repaintItem(Q3IconViewItem *item); + void repaintSelectedItems(); + + void ensureItemVisible(Q3IconViewItem *item); + Q3IconViewItem* findFirstVisibleItem(const QRect &r) const; + Q3IconViewItem* findLastVisibleItem(const QRect &r) const; + + virtual void clear(); + + virtual void setGridX(int rx); + virtual void setGridY(int ry); + int gridX() const; + int gridY() const; + virtual void setSpacing(int sp); + int spacing() const; + virtual void setItemTextPos(ItemTextPos pos); + ItemTextPos itemTextPos() const; + virtual void setItemTextBackground(const QBrush &b); + QBrush itemTextBackground() const; + virtual void setArrangement(Arrangement am); + Arrangement arrangement() const; + virtual void setResizeMode(ResizeMode am); + ResizeMode resizeMode() const; + virtual void setMaxItemWidth(int w); + int maxItemWidth() const; + virtual void setMaxItemTextLength(int w); + int maxItemTextLength() const; + virtual void setAutoArrange(bool b); + bool autoArrange() const; + virtual void setShowToolTips(bool b); + bool showToolTips() const; + + void setSorting(bool sort, bool ascending = true); + bool sorting() const; + bool sortDirection() const; + + virtual void setItemsMovable(bool b); + bool itemsMovable() const; + virtual void setWordWrapIconText(bool b); + bool wordWrapIconText() const; + + bool eventFilter(QObject * o, QEvent *); + + QSize minimumSizeHint() const; + QSize sizeHint() const; + + virtual void sort(bool ascending = true); + + bool isRenaming() const; + + QVariant inputMethodQuery(Qt::InputMethodQuery query) const; + +public Q_SLOTS: + virtual void arrangeItemsInGrid(const QSize &grid, bool update = true); + virtual void arrangeItemsInGrid(bool update = true); + virtual void setContentsPos(int x, int y); + virtual void updateContents(); + +Q_SIGNALS: + void selectionChanged(); + void selectionChanged(Q3IconViewItem *item); + void currentChanged(Q3IconViewItem *item); + void clicked(Q3IconViewItem *); + void clicked(Q3IconViewItem *, const QPoint &); + void pressed(Q3IconViewItem *); + void pressed(Q3IconViewItem *, const QPoint &); + + void doubleClicked(Q3IconViewItem *item); + void returnPressed(Q3IconViewItem *item); + void rightButtonClicked(Q3IconViewItem* item, const QPoint& pos); + void rightButtonPressed(Q3IconViewItem* item, const QPoint& pos); + void mouseButtonPressed(int button, Q3IconViewItem* item, const QPoint& pos); + void mouseButtonClicked(int button, Q3IconViewItem* item, const QPoint& pos); + void contextMenuRequested(Q3IconViewItem* item, const QPoint &pos); + +#ifndef QT_NO_DRAGANDDROP + void dropped(QDropEvent *e, const Q3ValueList &lst); +#endif + void moved(); + void onItem(Q3IconViewItem *item); + void onViewport(); + void itemRenamed(Q3IconViewItem *item, const QString &); + void itemRenamed(Q3IconViewItem *item); + +protected Q_SLOTS: + virtual void doAutoScroll(); + virtual void adjustItems(); + virtual void slotUpdate(); + +private Q_SLOTS: + void movedContents(int dx, int dy); + +protected: + void drawContents(QPainter *p, int cx, int cy, int cw, int ch); + void contentsMousePressEvent(QMouseEvent *e); + void contentsMouseReleaseEvent(QMouseEvent *e); + void contentsMouseMoveEvent(QMouseEvent *e); + void contentsMouseDoubleClickEvent(QMouseEvent *e); + void contentsContextMenuEvent(QContextMenuEvent *e); + +#ifndef QT_NO_DRAGANDDROP + void contentsDragEnterEvent(QDragEnterEvent *e); + void contentsDragMoveEvent(QDragMoveEvent *e); + void contentsDragLeaveEvent(QDragLeaveEvent *e); + void contentsDropEvent(QDropEvent *e); +#endif + + void resizeEvent(QResizeEvent* e); + void keyPressEvent(QKeyEvent *e); + void focusInEvent(QFocusEvent *e); + void focusOutEvent(QFocusEvent *e); + void enterEvent(QEvent *e); + + virtual void drawRubber(QPainter *p); +#ifndef QT_NO_DRAGANDDROP + virtual Q3DragObject *dragObject(); + virtual void startDrag(); +#endif + virtual void insertInGrid(Q3IconViewItem *item); + virtual void drawBackground(QPainter *p, const QRect &r); + + void emitSelectionChanged(Q3IconViewItem * i = 0); + void emitRenamed(Q3IconViewItem *item); + + Q3IconViewItem *makeRowLayout(Q3IconViewItem *begin, int &y, bool &changed); + + void changeEvent(QEvent *); + +private: + Q_DISABLE_COPY(Q3IconView) + + void contentsMousePressEventEx(QMouseEvent *e); + virtual void drawDragShapes(const QPoint &pnt); +#ifndef QT_NO_DRAGANDDROP + virtual void initDragEnter(QDropEvent *e); +#endif + Q3IconViewItem* findItemByName(Q3IconViewItem *start); + void handleItemChange(Q3IconViewItem *old, bool shift, + bool control, bool homeend = false); + + int calcGridNum(int w, int x) const; + Q3IconViewItem *rowBegin(Q3IconViewItem *item) const; + void updateItemContainer(Q3IconViewItem *item); + void appendItemContainer(); + void rebuildContainers(); + enum Direction { + DirUp = 0, + DirDown, + DirLeft, + DirRight + }; + Q3IconViewItem* findItem(Direction dir, + const QPoint &relativeTo, + const QRect &searchRect) const; + bool neighbourItem(Direction dir, + const QPoint &relativeTo, + const Q3IconViewItem *item) const; + QBitmap mask(QPixmap *pix) const; + + Q3IconViewPrivate *d; +}; + +#endif // QT_NO_ICONVIEW + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QICONVIEW_H diff --git a/qtinterface/qt4/Qt/q3intcache.h b/qtinterface/qt4/Qt/q3intcache.h new file mode 100644 index 0000000..5a851db --- /dev/null +++ b/qtinterface/qt4/Qt/q3intcache.h @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3INTCACHE_H +#define Q3INTCACHE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3IntCache +#ifdef qdoc + : public Q3PtrCollection +#else + : public Q3GCache +#endif +{ +public: + Q3IntCache( const Q3IntCache &c ) : Q3GCache(c) {} + Q3IntCache( int maxCost=100, int size=17 ) + : Q3GCache( maxCost, size, IntKey, false, false ) {} + ~Q3IntCache() { clear(); } + Q3IntCache &operator=( const Q3IntCache &c ) + { return (Q3IntCache&)Q3GCache::operator=(c); } + int maxCost() const { return Q3GCache::maxCost(); } + int totalCost() const { return Q3GCache::totalCost(); } + void setMaxCost( int m) { Q3GCache::setMaxCost(m); } + uint count() const { return Q3GCache::count(); } + uint size() const { return Q3GCache::size(); } + bool isEmpty() const { return Q3GCache::count() == 0; } + bool insert( long k, const type *d, int c=1, int p=0 ) + { return Q3GCache::insert_other((const char*)k,(Item)d,c,p); } + bool remove( long k ) + { return Q3GCache::remove_other((const char*)k); } + type *take( long k ) + { return (type *)Q3GCache::take_other((const char*)k);} + void clear() { Q3GCache::clear(); } + type *find( long k, bool ref=true ) const + { return (type *)Q3GCache::find_other( (const char*)k,ref);} + type *operator[]( long k ) const + { return (type *)Q3GCache::find_other( (const char*)k); } + void statistics() const { Q3GCache::statistics(); } +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3IntCache::deleteItem( Q3PtrCollection::Item ) +{ +} +#endif + +template inline void Q3IntCache::deleteItem( Q3PtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +template +class Q3IntCacheIterator : public Q3GCacheIterator +{ +public: + Q3IntCacheIterator( const Q3IntCache &c ) + : Q3GCacheIterator( (Q3GCache &)c ) {} + Q3IntCacheIterator( const Q3IntCacheIterator &ci ) + : Q3GCacheIterator((Q3GCacheIterator &)ci) {} + Q3IntCacheIterator &operator=( const Q3IntCacheIterator&ci ) + { return ( Q3IntCacheIterator&)Q3GCacheIterator::operator=( ci );} + uint count() const { return Q3GCacheIterator::count(); } + bool isEmpty() const { return Q3GCacheIterator::count() == 0; } + bool atFirst() const { return Q3GCacheIterator::atFirst(); } + bool atLast() const { return Q3GCacheIterator::atLast(); } + type *toFirst() { return (type *)Q3GCacheIterator::toFirst(); } + type *toLast() { return (type *)Q3GCacheIterator::toLast(); } + operator type *() const { return (type *)Q3GCacheIterator::get(); } + type *current() const { return (type *)Q3GCacheIterator::get(); } + long currentKey() const { return (long)Q3GCacheIterator::getKeyInt();} + type *operator()() { return (type *)Q3GCacheIterator::operator()();} + type *operator++() { return (type *)Q3GCacheIterator::operator++(); } + type *operator+=(uint j) { return (type *)Q3GCacheIterator::operator+=(j);} + type *operator--() { return (type *)Q3GCacheIterator::operator--(); } + type *operator-=(uint j) { return (type *)Q3GCacheIterator::operator-=(j);} +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3INTCACHE_H diff --git a/qtinterface/qt4/Qt/q3intdict.h b/qtinterface/qt4/Qt/q3intdict.h new file mode 100644 index 0000000..afd94a7 --- /dev/null +++ b/qtinterface/qt4/Qt/q3intdict.h @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3INTDICT_H +#define Q3INTDICT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3IntDict +#ifdef qdoc + : public Q3PtrCollection +#else + : public Q3GDict +#endif +{ +public: + Q3IntDict(int size=17) : Q3GDict(size,IntKey,0,0) {} + Q3IntDict( const Q3IntDict &d ) : Q3GDict(d) {} + ~Q3IntDict() { clear(); } + Q3IntDict &operator=(const Q3IntDict &d) + { return (Q3IntDict&)Q3GDict::operator=(d); } + uint count() const { return Q3GDict::count(); } + uint size() const { return Q3GDict::size(); } + bool isEmpty() const { return Q3GDict::count() == 0; } + void insert( long k, const type *d ) + { Q3GDict::look_int(k,(Item)d,1); } + void replace( long k, const type *d ) + { Q3GDict::look_int(k,(Item)d,2); } + bool remove( long k ) { return Q3GDict::remove_int(k); } + type *take( long k ) { return (type*)Q3GDict::take_int(k); } + type *find( long k ) const + { return (type *)((Q3GDict*)this)->Q3GDict::look_int(k,0,0); } + type *operator[]( long k ) const + { return (type *)((Q3GDict*)this)->Q3GDict::look_int(k,0,0); } + void clear() { Q3GDict::clear(); } + void resize( uint n ) { Q3GDict::resize(n); } + void statistics() const { Q3GDict::statistics(); } + +#ifdef qdoc +protected: + virtual QDataStream& read( QDataStream &, Q3PtrCollection::Item & ); + virtual QDataStream& write( QDataStream &, Q3PtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3IntDict::deleteItem( Q3PtrCollection::Item ) +{ +} +#endif + +template inline void Q3IntDict::deleteItem( Q3PtrCollection::Item d ) +{ + if ( del_item ) delete (type*)d; +} + +template +class Q3IntDictIterator : public Q3GDictIterator +{ +public: + Q3IntDictIterator(const Q3IntDict &d) :Q3GDictIterator((Q3GDict &)d) {} + ~Q3IntDictIterator() {} + uint count() const { return dict->count(); } + bool isEmpty() const { return dict->count() == 0; } + type *toFirst() { return (type *)Q3GDictIterator::toFirst(); } + operator type *() const { return (type *)Q3GDictIterator::get(); } + type *current() const { return (type *)Q3GDictIterator::get(); } + long currentKey() const { return Q3GDictIterator::getKeyInt(); } + type *operator()() { return (type *)Q3GDictIterator::operator()(); } + type *operator++() { return (type *)Q3GDictIterator::operator++(); } + type *operator+=(uint j) { return (type *)Q3GDictIterator::operator+=(j);} +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3INTDICT_H diff --git a/qtinterface/qt4/Qt/q3listbox.h b/qtinterface/qt4/Qt/q3listbox.h new file mode 100644 index 0000000..0378c21 --- /dev/null +++ b/qtinterface/qt4/Qt/q3listbox.h @@ -0,0 +1,429 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3LISTBOX_H +#define Q3LISTBOX_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_LISTBOX + +class Q3ListBoxPrivate; +class Q3ListBoxItem; +class QString; +class QStringList; + +class Q_COMPAT_EXPORT Q3ListBox : public Q3ScrollView +{ + friend class Q3ListBoxItem; + friend class Q3ListBoxPrivate; + + Q_OBJECT + Q_ENUMS(SelectionMode LayoutMode) + Q_PROPERTY(uint count READ count) + Q_PROPERTY(int numItemsVisible READ numItemsVisible) + Q_PROPERTY(int currentItem READ currentItem WRITE setCurrentItem USER true) + Q_PROPERTY(QString currentText READ currentText) + Q_PROPERTY(int topItem READ topItem WRITE setTopItem DESIGNABLE false) + Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) + Q_PROPERTY(bool multiSelection READ isMultiSelection WRITE setMultiSelection DESIGNABLE false) + Q_PROPERTY(LayoutMode columnMode READ columnMode WRITE setColumnMode) + Q_PROPERTY(LayoutMode rowMode READ rowMode WRITE setRowMode) + Q_PROPERTY(int numColumns READ numColumns) + Q_PROPERTY(int numRows READ numRows) + Q_PROPERTY(bool variableWidth READ variableWidth WRITE setVariableWidth) + Q_PROPERTY(bool variableHeight READ variableHeight WRITE setVariableHeight) + +public: + Q3ListBox(QWidget* parent=0, const char* name=0, Qt::WindowFlags f=0 ); + ~Q3ListBox(); + + uint count() const; + + void insertStringList(const QStringList&, int index=-1); +// ### fix before Qt 4.0 +#if 0 + void insertStrList(const QStrList *, int index=-1); + void insertStrList(const QStrList &, int index=-1); +#endif + void insertStrList(const char **, + int numStrings=-1, int index=-1); + + void insertItem(const Q3ListBoxItem *, int index=-1); + void insertItem(const Q3ListBoxItem *, const Q3ListBoxItem *after); + void insertItem(const QString &text, int index=-1); + void insertItem(const QPixmap &pixmap, int index=-1); + void insertItem(const QPixmap &pixmap, const QString &text, int index=-1); + + void removeItem(int index); + + QString text(int index) const; + const QPixmap *pixmap(int index) const; + + void changeItem(const Q3ListBoxItem *, int index); + void changeItem(const QString &text, int index); + void changeItem(const QPixmap &pixmap, int index); + void changeItem(const QPixmap &pixmap, const QString &text, int index); + + void takeItem(const Q3ListBoxItem *); + + int numItemsVisible() const; + + int currentItem() const; + QString currentText() const { return text(currentItem()); } + virtual void setCurrentItem(int index); + virtual void setCurrentItem(Q3ListBoxItem *); + void centerCurrentItem() { ensureCurrentVisible(); } + int topItem() const; + virtual void setTopItem(int index); + virtual void setBottomItem(int index); + + long maxItemWidth() const; + + enum SelectionMode { Single, Multi, Extended, NoSelection }; + virtual void setSelectionMode(SelectionMode); + SelectionMode selectionMode() const; + + void setMultiSelection(bool multi); + bool isMultiSelection() const; + + QVariant inputMethodQuery(Qt::InputMethodQuery query) const; + + virtual void setSelected(Q3ListBoxItem *, bool); + void setSelected(int, bool); + bool isSelected(int) const; + bool isSelected(const Q3ListBoxItem *) const; + Q3ListBoxItem* selectedItem() const; + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + Q3ListBoxItem *item(int index) const; + int index(const Q3ListBoxItem *) const; + + enum StringComparisonMode { + CaseSensitive = 0x00001, // 0 0001 + BeginsWith = 0x00002, // 0 0010 + EndsWith = 0x00004, // 0 0100 + Contains = 0x00008, // 0 1000 + ExactMatch = 0x00010 // 1 0000 + }; + typedef uint ComparisonFlags; + Q3ListBoxItem *findItem(const QString &text, ComparisonFlags compare = BeginsWith) const; + + void triggerUpdate(bool doLayout); + + bool itemVisible(int index); + bool itemVisible(const Q3ListBoxItem *); + + enum LayoutMode { FixedNumber, + FitToWidth, FitToHeight = FitToWidth, + Variable }; + virtual void setColumnMode(LayoutMode); + virtual void setColumnMode(int); + virtual void setRowMode(LayoutMode); + virtual void setRowMode(int); + + LayoutMode columnMode() const; + LayoutMode rowMode() const; + + int numColumns() const; + int numRows() const; + + bool variableWidth() const; + virtual void setVariableWidth(bool); + + bool variableHeight() const; + virtual void setVariableHeight(bool); + + void viewportPaintEvent(QPaintEvent *); + + bool dragSelect() const { return true; } + void setDragSelect(bool) {} + bool autoScroll() const { return true; } + void setAutoScroll(bool) {} + bool autoScrollBar() const { return vScrollBarMode() == Auto; } + void setAutoScrollBar(bool enable) { setVScrollBarMode(enable ? Auto : AlwaysOff); } + bool scrollBar() const { return vScrollBarMode() != AlwaysOff; } + void setScrollBar(bool enable) { setVScrollBarMode(enable ? AlwaysOn : AlwaysOff); } + bool autoBottomScrollBar() const { return hScrollBarMode() == Auto; } + void setAutoBottomScrollBar(bool enable) { setHScrollBarMode(enable ? Auto : AlwaysOff); } + bool bottomScrollBar() const { return hScrollBarMode() != AlwaysOff; } + void setBottomScrollBar(bool enable) { setHScrollBarMode(enable ? AlwaysOn : AlwaysOff); } + bool smoothScrolling() const { return false; } + void setSmoothScrolling(bool) {} + bool autoUpdate() const { return true; } + void setAutoUpdate(bool) {} + void setFixedVisibleLines(int lines) { setRowMode(lines); } + int inSort(const Q3ListBoxItem *); + int inSort(const QString& text); + int cellHeight(int i) const { return itemHeight(i); } + int cellHeight() const { return itemHeight(); } + int cellWidth() const { return maxItemWidth(); } + int cellWidth(int i) const { Q_ASSERT(i==0); Q_UNUSED(i) return maxItemWidth(); } + int numCols() const { return numColumns(); } + + int itemHeight(int index = 0) const; + Q3ListBoxItem * itemAt(const QPoint &) const; + + QRect itemRect(Q3ListBoxItem *item) const; + + Q3ListBoxItem *firstItem() const; + + void sort(bool ascending = true); + +public Q_SLOTS: + void clear(); + virtual void ensureCurrentVisible(); + virtual void clearSelection(); + virtual void selectAll(bool select); + virtual void invertSelection(); + +Q_SIGNALS: + void highlighted(int index); + void selected(int index); + void highlighted(const QString &); + void selected(const QString &); + void highlighted(Q3ListBoxItem *); + void selected(Q3ListBoxItem *); + + void selectionChanged(); + void selectionChanged(Q3ListBoxItem *); + void currentChanged(Q3ListBoxItem *); + void clicked(Q3ListBoxItem *); + void clicked(Q3ListBoxItem *, const QPoint &); + void pressed(Q3ListBoxItem *); + void pressed(Q3ListBoxItem *, const QPoint &); + + void doubleClicked(Q3ListBoxItem *); + void returnPressed(Q3ListBoxItem *); + void rightButtonClicked(Q3ListBoxItem *, const QPoint &); + void rightButtonPressed(Q3ListBoxItem *, const QPoint &); + void mouseButtonPressed(int, Q3ListBoxItem*, const QPoint&); + void mouseButtonClicked(int, Q3ListBoxItem*, const QPoint&); + + void contextMenuRequested(Q3ListBoxItem *, const QPoint &); + + void onItem(Q3ListBoxItem *item); + void onViewport(); + +protected: + void changeEvent(QEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void contentsContextMenuEvent(QContextMenuEvent *); + + void keyPressEvent(QKeyEvent *e); + void focusInEvent(QFocusEvent *e); + void focusOutEvent(QFocusEvent *e); + void resizeEvent(QResizeEvent *); + void showEvent(QShowEvent *); + + bool eventFilter(QObject *o, QEvent *e); + + void updateItem(int index); + void updateItem(Q3ListBoxItem *); + + void updateCellWidth() { } + int totalWidth() const { return contentsWidth(); } + int totalHeight() const { return contentsHeight(); } + + virtual void paintCell(QPainter *, int row, int col); + + void toggleCurrentItem(); + bool isRubberSelecting() const; + + void doLayout() const; + + int findItem(int yPos) const { return index(itemAt(QPoint(0,yPos))); } + +protected Q_SLOTS: + void clearInputString(); + +private Q_SLOTS: + void refreshSlot(); + void doAutoScroll(); + void adjustItems(); + +private: + Q_DISABLE_COPY(Q3ListBox) + + void mousePressEventEx(QMouseEvent *); + void tryGeometry(int, int) const; + int currentRow() const; + int currentColumn() const; + void updateSelection(); + void repaintSelection(); + void drawRubber(); + void doRubberSelection(const QRect &old, const QRect &rubber); + void handleItemChange(Q3ListBoxItem *old, bool shift, bool control); + void selectRange(Q3ListBoxItem *from, Q3ListBoxItem *to, bool invert, bool includeFirst, bool clearSel = false); + + void emitChangedSignal(bool); + + int columnAt(int) const; + int rowAt(int) const; + + Q3ListBoxPrivate * d; + + static Q3ListBox * changedListBox; +}; + + +class Q_COMPAT_EXPORT Q3ListBoxItem +{ +public: + Q3ListBoxItem(Q3ListBox* listbox = 0); + Q3ListBoxItem(Q3ListBox* listbox, Q3ListBoxItem *after); + virtual ~Q3ListBoxItem(); + + virtual QString text() const; + virtual const QPixmap *pixmap() const; + + virtual int height(const Q3ListBox *) const; + virtual int width(const Q3ListBox *) const; + + bool isSelected() const { return s; } + bool isCurrent() const; + + bool selected() const { return isSelected(); } + bool current() const { return isCurrent(); } + + Q3ListBox *listBox() const; + + void setSelectable(bool b) { selectable = b; } + bool isSelectable() const { return selectable; } + + Q3ListBoxItem *next() const; + Q3ListBoxItem *prev() const; + + virtual int rtti() const; + enum { RTTI = 0 }; + +protected: + virtual void paint(QPainter *) = 0; + virtual void setText(const QString &text) { txt = text; } + void setCustomHighlighting(bool); + +private: + Q_DISABLE_COPY(Q3ListBoxItem) + + QString txt; + uint selectable : 1; + uint s : 1; + uint dirty:1; + uint custom_highlight : 1; + uint unused : 28; + Q3ListBoxItem * p, * n; + Q3ListBox* lbox; + friend class Q3ListBox; + friend class Q3ListBoxPrivate; + friend class Q3ComboBox; + friend class Q3ComboBoxPopupItem; +}; + + +class Q_COMPAT_EXPORT Q3ListBoxText : public Q3ListBoxItem +{ +public: + Q3ListBoxText(Q3ListBox* listbox, const QString & text=QString()); + Q3ListBoxText(const QString & text=QString()); + Q3ListBoxText(Q3ListBox* listbox, const QString & text, Q3ListBoxItem *after); + ~Q3ListBoxText(); + + int height(const Q3ListBox *) const; + int width(const Q3ListBox *) const; + + int rtti() const; + enum { RTTI = 1 }; + +protected: + void paint(QPainter *); + +private: + Q_DISABLE_COPY(Q3ListBoxText) +}; + + +class Q_COMPAT_EXPORT Q3ListBoxPixmap : public Q3ListBoxItem +{ +public: + Q3ListBoxPixmap(Q3ListBox* listbox, const QPixmap &); + Q3ListBoxPixmap(const QPixmap &); + Q3ListBoxPixmap(Q3ListBox* listbox, const QPixmap & pix, Q3ListBoxItem *after); + Q3ListBoxPixmap(Q3ListBox* listbox, const QPixmap &, const QString&); + Q3ListBoxPixmap(const QPixmap &, const QString&); + Q3ListBoxPixmap(Q3ListBox* listbox, const QPixmap & pix, const QString&, Q3ListBoxItem *after); + ~Q3ListBoxPixmap(); + + const QPixmap *pixmap() const { return ± } + + int height(const Q3ListBox *) const; + int width(const Q3ListBox *) const; + + int rtti() const; + enum { RTTI = 2 }; + +protected: + void paint(QPainter *); + +private: + Q_DISABLE_COPY(Q3ListBoxPixmap) + + QPixmap pm; +}; + +#endif // QT_NO_LISTBOX + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3LISTBOX_H diff --git a/qtinterface/qt4/Qt/q3listview.h b/qtinterface/qt4/Qt/q3listview.h new file mode 100644 index 0000000..3e1070e --- /dev/null +++ b/qtinterface/qt4/Qt/q3listview.h @@ -0,0 +1,609 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3LISTVIEW_H +#define Q3LISTVIEW_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_LISTVIEW + +class QPixmap; +class QFont; +class Q3Header; +class QIcon; + +class Q3ListView; +struct Q3ListViewPrivate; +struct Q3CheckListItemPrivate; +class Q3ListViewItemIterator; +struct Q3ListViewItemIteratorPrivate; +class Q3DragObject; +class QMimeSource; +class QLineEdit; +class Q3ListViewToolTip; + +class Q_COMPAT_EXPORT Q3ListViewItem +{ + friend class Q3ListViewItemIterator; + friend class Q3ListViewToolTip; + +public: + Q3ListViewItem(Q3ListView * parent); + Q3ListViewItem(Q3ListViewItem * parent); + Q3ListViewItem(Q3ListView * parent, Q3ListViewItem * after); + Q3ListViewItem(Q3ListViewItem * parent, Q3ListViewItem * after); + + Q3ListViewItem(Q3ListView * parent, + const QString&, const QString& = QString(), + const QString& = QString(), const QString& = QString(), + const QString& = QString(), const QString& = QString(), + const QString& = QString(), const QString& = QString()); + Q3ListViewItem(Q3ListViewItem * parent, + const QString&, const QString& = QString(), + const QString& = QString(), const QString& = QString(), + const QString& = QString(), const QString& = QString(), + const QString& = QString(), const QString& = QString()); + + Q3ListViewItem(Q3ListView * parent, Q3ListViewItem * after, + const QString&, const QString& = QString(), + const QString& = QString(), const QString& = QString(), + const QString& = QString(), const QString& = QString(), + const QString& = QString(), const QString& = QString()); + Q3ListViewItem(Q3ListViewItem * parent, Q3ListViewItem * after, + const QString&, const QString& = QString(), + const QString& = QString(), const QString& = QString(), + const QString& = QString(), const QString& = QString(), + const QString& = QString(), const QString& = QString()); + virtual ~Q3ListViewItem(); + + virtual void insertItem(Q3ListViewItem *); + virtual void takeItem(Q3ListViewItem *); + virtual void removeItem(Q3ListViewItem *item) { takeItem(item); } + + int height() const; + virtual void invalidateHeight(); + int totalHeight() const; + virtual int width(const QFontMetrics&, + const Q3ListView*, int column) const; + void widthChanged(int column=-1) const; + int depth() const; + + virtual void setText(int, const QString &); + virtual QString text(int) const; + + virtual void setPixmap(int, const QPixmap &); + virtual const QPixmap * pixmap(int) const; + + virtual QString key(int, bool) const; + virtual int compare(Q3ListViewItem *i, int col, bool) const; + virtual void sortChildItems(int, bool); + + int childCount() const { return nChildren; } + + bool isOpen() const { return open; } + virtual void setOpen(bool); + virtual void setup(); + + virtual void setSelected(bool); + bool isSelected() const { return selected; } + + virtual void paintCell(QPainter *, const QColorGroup & cg, + int column, int width, int alignment); + virtual void paintBranches(QPainter * p, const QColorGroup & cg, int w, int y, int h); + virtual void paintFocus(QPainter *, const QColorGroup & cg, const QRect & r); + + Q3ListViewItem * firstChild() const; + Q3ListViewItem * nextSibling() const { return siblingItem; } + Q3ListViewItem * parent() const; + + Q3ListViewItem * itemAbove() const; + Q3ListViewItem * itemBelow() const; + + int itemPos() const; + + Q3ListView *listView() const; + + virtual void setSelectable(bool enable); + bool isSelectable() const { return selectable && enabled; } + + virtual void setExpandable(bool); + bool isExpandable() const { return expandable; } + + void repaint() const; + + virtual void sort(); + void moveItem(Q3ListViewItem *after); + + virtual void setDragEnabled(bool allow); + virtual void setDropEnabled(bool allow); + bool dragEnabled() const; + bool dropEnabled() const; + virtual bool acceptDrop(const QMimeSource *mime) const; + + void setVisible(bool b); + bool isVisible() const; + + virtual void setRenameEnabled(int col, bool b); + bool renameEnabled(int col) const; + virtual void startRename(int col); + + virtual void setEnabled(bool b); + bool isEnabled() const; + + virtual int rtti() const; + enum { RTTI = 0 }; + + virtual void setMultiLinesEnabled(bool b); + bool multiLinesEnabled() const; + +protected: + virtual void enforceSortOrder() const; + virtual void setHeight(int); + virtual void activate(); + + bool activatedPos(QPoint &); +#ifndef QT_NO_DRAGANDDROP + virtual void dropped(QDropEvent *e); +#endif + virtual void dragEntered(); + virtual void dragLeft(); + virtual void okRename(int col); + virtual void cancelRename(int col); + + void ignoreDoubleClick(); + +private: + void init(); + void moveToJustAfter(Q3ListViewItem *); + void enforceSortOrderBackToRoot(); + void removeRenameBox(); + + int ownHeight; + int maybeTotalHeight; + int nChildren; + + uint lsc: 14; + uint lso: 1; + uint open : 1; + uint selected : 1; + uint selectable: 1; + uint configured: 1; + uint expandable: 1; + uint is_root: 1; + uint allow_drag : 1; + uint allow_drop : 1; + uint visible : 1; + uint enabled : 1; + uint mlenabled : 1; + + Q3ListViewItem * parentItem; + Q3ListViewItem * siblingItem; + Q3ListViewItem * childItem; + QLineEdit *renameBox; + int renameCol; + + void * columns; + + friend class Q3ListView; +}; + +class Q3CheckListItem; + +class Q_COMPAT_EXPORT Q3ListView : public Q3ScrollView +{ + friend class Q3ListViewItemIterator; + friend class Q3ListViewItem; + friend class Q3CheckListItem; + friend class Q3ListViewToolTip; + + Q_OBJECT + Q_ENUMS(SelectionMode ResizeMode RenameAction) + Q_PROPERTY(int columns READ columns) + Q_PROPERTY(bool multiSelection READ isMultiSelection WRITE setMultiSelection DESIGNABLE false) + Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) + Q_PROPERTY(int childCount READ childCount) + Q_PROPERTY(bool allColumnsShowFocus READ allColumnsShowFocus WRITE setAllColumnsShowFocus) + Q_PROPERTY(bool showSortIndicator READ showSortIndicator WRITE setShowSortIndicator) + Q_PROPERTY(int itemMargin READ itemMargin WRITE setItemMargin) + Q_PROPERTY(bool rootIsDecorated READ rootIsDecorated WRITE setRootIsDecorated) + Q_PROPERTY(bool showToolTips READ showToolTips WRITE setShowToolTips) + Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode) + Q_PROPERTY(int treeStepSize READ treeStepSize WRITE setTreeStepSize) + Q_PROPERTY(RenameAction defaultRenameAction READ defaultRenameAction WRITE setDefaultRenameAction) + +public: + Q3ListView(QWidget* parent=0, const char* name=0, Qt::WindowFlags f = 0); + ~Q3ListView(); + + int treeStepSize() const; + virtual void setTreeStepSize(int); + + virtual void insertItem(Q3ListViewItem *); + virtual void takeItem(Q3ListViewItem *); + virtual void removeItem(Q3ListViewItem *item) { takeItem(item); } + + Q3Header * header() const; + + virtual int addColumn(const QString &label, int size = -1); + virtual int addColumn(const QIcon& icon, const QString &label, int size = -1); + virtual void removeColumn(int index); + virtual void setColumnText(int column, const QString &label); + virtual void setColumnText(int column, const QIcon& icon, const QString &label); + QString columnText(int column) const; + virtual void setColumnWidth(int column, int width); + int columnWidth(int column) const; + enum WidthMode { Manual, Maximum }; + virtual void setColumnWidthMode(int column, WidthMode); + WidthMode columnWidthMode(int column) const; + int columns() const; + + virtual void setColumnAlignment(int, int); + int columnAlignment(int) const; + + void show(); + + QVariant inputMethodQuery(Qt::InputMethodQuery query) const; + Q3ListViewItem * itemAt(const QPoint & screenPos) const; + QRect itemRect(const Q3ListViewItem *) const; + int itemPos(const Q3ListViewItem *); + + void ensureItemVisible(const Q3ListViewItem *); + + void repaintItem(const Q3ListViewItem *) const; + + virtual void setMultiSelection(bool enable); + bool isMultiSelection() const; + + enum SelectionMode { Single, Multi, Extended, NoSelection }; + void setSelectionMode(SelectionMode mode); + SelectionMode selectionMode() const; + + virtual void clearSelection(); + virtual void setSelected(Q3ListViewItem *, bool); + void setSelectionAnchor(Q3ListViewItem *); + bool isSelected(const Q3ListViewItem *) const; + Q3ListViewItem * selectedItem() const; + virtual void setOpen(Q3ListViewItem *, bool); + bool isOpen(const Q3ListViewItem *) const; + + virtual void setCurrentItem(Q3ListViewItem *); + Q3ListViewItem * currentItem() const; + + Q3ListViewItem * firstChild() const; + Q3ListViewItem * lastItem() const; + + int childCount() const; + + virtual void setAllColumnsShowFocus(bool); + bool allColumnsShowFocus() const; + + virtual void setItemMargin(int); + int itemMargin() const; + + virtual void setRootIsDecorated(bool); + bool rootIsDecorated() const; + + virtual void setSorting(int column, bool ascending = true); + int sortColumn() const; + void setSortColumn(int column); + Qt::SortOrder sortOrder() const; + void setSortOrder(Qt::SortOrder order); + virtual void sort(); + + bool eventFilter(QObject * o, QEvent *); + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + virtual void setShowSortIndicator(bool show); + bool showSortIndicator() const; + virtual void setShowToolTips(bool b); + bool showToolTips() const; + + enum ResizeMode { NoColumn, AllColumns, LastColumn }; + virtual void setResizeMode(ResizeMode m); + ResizeMode resizeMode() const; + + enum StringComparisonMode { + CaseSensitive = 0x00001, // 0 0001 + BeginsWith = 0x00002, // 0 0010 + EndsWith = 0x00004, // 0 0100 + Contains = 0x00008, // 0 1000 + ExactMatch = 0x00010 // 1 0000 + }; + typedef uint ComparisonFlags; + Q3ListViewItem * findItem(const QString& text, int column, + ComparisonFlags = ExactMatch | Qt::CaseSensitive ) const; + + enum RenameAction { Accept, Reject }; + virtual void setDefaultRenameAction(RenameAction a); + RenameAction defaultRenameAction() const; + bool isRenaming() const; + + void hideColumn(int column); + +public Q_SLOTS: + virtual void clear(); + virtual void invertSelection(); + virtual void selectAll(bool select); + void triggerUpdate(); + void setContentsPos(int x, int y); + void adjustColumn(int col); + +Q_SIGNALS: + void selectionChanged(); + void selectionChanged(Q3ListViewItem *); + void currentChanged(Q3ListViewItem *); + void clicked(Q3ListViewItem *); + void clicked(Q3ListViewItem *, const QPoint &, int); + void pressed(Q3ListViewItem *); + void pressed(Q3ListViewItem *, const QPoint &, int); + + void doubleClicked(Q3ListViewItem *); + void doubleClicked(Q3ListViewItem *, const QPoint&, int); + void returnPressed(Q3ListViewItem *); + void spacePressed(Q3ListViewItem *); + void rightButtonClicked(Q3ListViewItem *, const QPoint&, int); + void rightButtonPressed(Q3ListViewItem *, const QPoint&, int); + void mouseButtonPressed(int, Q3ListViewItem *, const QPoint& , int); + void mouseButtonClicked(int, Q3ListViewItem *, const QPoint&, int); + + void contextMenuRequested(Q3ListViewItem *, const QPoint &, int); + + void onItem(Q3ListViewItem *item); + void onViewport(); + + void expanded(Q3ListViewItem *item); + void collapsed(Q3ListViewItem *item); +#ifndef QT_NO_DRAGANDDROP + void dropped(QDropEvent *e); +#endif + void itemRenamed(Q3ListViewItem *item, int col, const QString &); + void itemRenamed(Q3ListViewItem *item, int col ); + +protected: + void contentsMousePressEvent(QMouseEvent * e); + void contentsMouseReleaseEvent(QMouseEvent * e); + void contentsMouseMoveEvent(QMouseEvent * e); + void contentsMouseDoubleClickEvent(QMouseEvent * e); + void contentsContextMenuEvent(QContextMenuEvent * e); +#ifndef QT_NO_DRAGANDDROP + void contentsDragEnterEvent(QDragEnterEvent *e); + void contentsDragMoveEvent(QDragMoveEvent *e); + void contentsDragLeaveEvent(QDragLeaveEvent *e); + void contentsDropEvent(QDropEvent *e); + virtual Q3DragObject *dragObject(); + virtual void startDrag(); +#endif + + void focusInEvent(QFocusEvent * e); + void focusOutEvent(QFocusEvent * e); + + void keyPressEvent(QKeyEvent *e); + + void resizeEvent(QResizeEvent *e); + void viewportResizeEvent(QResizeEvent *e); + + void showEvent(QShowEvent *); + + void drawContentsOffset(QPainter *, int ox, int oy, + int cx, int cy, int cw, int ch); + + virtual void paintEmptyArea(QPainter *, const QRect &); + void changeEvent(QEvent *); + +protected Q_SLOTS: + void updateContents(); + void doAutoScroll(); + +private Q_SLOTS: + void changeSortColumn(int); + void handleIndexChange(); + void updateDirtyItems(); + void makeVisible(); + void handleSizeChange(int, int, int); + void startRename(); + void openFocusItem(); + +private: + Q_DISABLE_COPY(Q3ListView) + + void contentsMousePressEventEx(QMouseEvent * e); + void contentsMouseReleaseEventEx(QMouseEvent * e); + void init(); + void updateGeometries(); + void buildDrawableList() const; + void reconfigureItems(); + void widthChanged(const Q3ListViewItem*, int c); + void handleItemChange(Q3ListViewItem *old, bool shift, bool control); + void selectRange(Q3ListViewItem *from, Q3ListViewItem *to, bool invert, bool includeFirst, bool clearSel = false); + bool selectRange(Q3ListViewItem *newItem, Q3ListViewItem *oldItem, Q3ListViewItem *anchorItem); + bool clearRange(Q3ListViewItem *from, Q3ListViewItem *to, bool includeFirst = true); + void doAutoScroll(const QPoint &cursorPos); + + Q3ListViewPrivate *d; +}; + + +class Q_COMPAT_EXPORT Q3CheckListItem : public Q3ListViewItem +{ +public: + enum Type { RadioButton, + CheckBox, + Controller, + RadioButtonController=Controller, + CheckBoxController }; + + enum ToggleState { Off, NoChange, On }; + + Q3CheckListItem(Q3CheckListItem *parent, const QString &text, + Type = RadioButtonController); + Q3CheckListItem(Q3CheckListItem *parent, Q3ListViewItem *after, + const QString &text, Type = RadioButtonController); + Q3CheckListItem(Q3ListViewItem *parent, const QString &text, + Type = RadioButtonController); + Q3CheckListItem(Q3ListViewItem *parent, Q3ListViewItem *after, + const QString &text, Type = RadioButtonController); + Q3CheckListItem(Q3ListView *parent, const QString &text, + Type = RadioButtonController); + Q3CheckListItem(Q3ListView *parent, Q3ListViewItem *after, + const QString &text, Type = RadioButtonController); + Q3CheckListItem(Q3ListViewItem *parent, const QString &text, + const QPixmap &); + Q3CheckListItem(Q3ListView *parent, const QString &text, + const QPixmap &); + ~Q3CheckListItem(); + + void paintCell(QPainter *, const QColorGroup & cg, + int column, int width, int alignment); + virtual void paintFocus(QPainter *, const QColorGroup &cg, + const QRect & r); + int width(const QFontMetrics&, const Q3ListView*, int column) const; + void setup(); + + virtual void setOn(bool); + bool isOn() const { return on; } + Type type() const { return myType; } + QString text() const { return Q3ListViewItem::text(0); } + QString text(int n) const { return Q3ListViewItem::text(n); } + + void setTristate(bool); + bool isTristate() const; + ToggleState state() const; + void setState(ToggleState s); + + int rtti() const; + enum { RTTI = 1 }; + +protected: + void activate(); + void turnOffChild(); + virtual void stateChange(bool); + +private: + void init(); + ToggleState internalState() const; + void setStoredState(ToggleState newState, Q3CheckListItem *key); + ToggleState storedState(Q3CheckListItem *key) const; + void stateChange(ToggleState s); + void restoreState(Q3CheckListItem *key, int depth = 0); + void updateController(bool update = true , bool store = false); + void updateStoredState(Q3CheckListItem *key); + void setState(ToggleState s, bool update, bool store); + void setCurrentState(ToggleState s); + + Type myType; + bool on; + Q3CheckListItemPrivate *d; +}; + +class Q_COMPAT_EXPORT Q3ListViewItemIterator +{ + friend struct Q3ListViewPrivate; + friend class Q3ListView; + friend class Q3ListViewItem; + +public: + enum IteratorFlag { + Visible = 0x00000001, + Invisible = 0x00000002, + Selected = 0x00000004, + Unselected = 0x00000008, + Selectable = 0x00000010, + NotSelectable = 0x00000020, + DragEnabled = 0x00000040, + DragDisabled = 0x00000080, + DropEnabled = 0x00000100, + DropDisabled = 0x00000200, + Expandable = 0x00000400, + NotExpandable = 0x00000800, + Checked = 0x00001000, + NotChecked = 0x00002000 + }; + + Q3ListViewItemIterator(); + Q3ListViewItemIterator(Q3ListViewItem *item); + Q3ListViewItemIterator(Q3ListViewItem *item, int iteratorFlags); + + Q3ListViewItemIterator(const Q3ListViewItemIterator &it); + Q3ListViewItemIterator(Q3ListView *lv); + Q3ListViewItemIterator(Q3ListView *lv, int iteratorFlags); + + Q3ListViewItemIterator &operator=(const Q3ListViewItemIterator &it); + + ~Q3ListViewItemIterator(); + + Q3ListViewItemIterator &operator++(); + const Q3ListViewItemIterator operator++(int); + Q3ListViewItemIterator &operator+=(int j); + + Q3ListViewItemIterator &operator--(); + const Q3ListViewItemIterator operator--(int); + Q3ListViewItemIterator &operator-=(int j); + + Q3ListViewItem* operator*(); + Q3ListViewItem *current() const; + +private: + Q3ListViewItem *curr; + Q3ListView *listView; + int flags; + + void currentRemoved(); + bool matchesFlags(const Q3ListViewItem*) const; + bool testPair(Q3ListViewItemIterator::IteratorFlag, Q3ListViewItemIterator::IteratorFlag, bool) const; + bool isChecked(const Q3ListViewItem*) const; +}; + +#endif // QT_NO_LISTVIEW + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3LISTVIEW_H diff --git a/qtinterface/qt4/Qt/q3localfs.h b/qtinterface/qt4/Qt/q3localfs.h new file mode 100644 index 0000000..f9036a1 --- /dev/null +++ b/qtinterface/qt4/Qt/q3localfs.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3LOCALFS_H +#define Q3LOCALFS_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_NETWORKPROTOCOL + +class Q_COMPAT_EXPORT Q3LocalFs : public Q3NetworkProtocol +{ + Q_OBJECT + +public: + Q3LocalFs(); + virtual int supportedOperations() const; + +protected: + virtual void operationListChildren( Q3NetworkOperation *op ); + virtual void operationMkDir( Q3NetworkOperation *op ); + virtual void operationRemove( Q3NetworkOperation *op ); + virtual void operationRename( Q3NetworkOperation *op ); + virtual void operationGet( Q3NetworkOperation *op ); + virtual void operationPut( Q3NetworkOperation *op ); + +private: + int calcBlockSize( int totalSize ) const; + QDir dir; + +}; + +#endif // QT_NO_NETWORKPROTOCOL + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3LOCALFS_H diff --git a/qtinterface/qt4/Qt/q3mainwindow.h b/qtinterface/qt4/Qt/q3mainwindow.h new file mode 100644 index 0000000..cbf33b3 --- /dev/null +++ b/qtinterface/qt4/Qt/q3mainwindow.h @@ -0,0 +1,267 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3MAINWINDOW_H +#define Q3MAINWINDOW_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_MAINWINDOW + +class QMenuBar; +class QStatusBar; +class QToolTipGroup; +class Q3MainWindowPrivate; +class Q3MainWindowLayout; +class Q3PopupMenu; +class QHideDock; +template class QList; + +class Q_COMPAT_EXPORT Q3MainWindow: public QWidget +{ + Q_OBJECT + Q_DECLARE_PRIVATE(Q3MainWindow) + + Q_PROPERTY(bool rightJustification READ rightJustification WRITE setRightJustification DESIGNABLE false) + Q_PROPERTY(bool usesBigPixmaps READ usesBigPixmaps WRITE setUsesBigPixmaps) + Q_PROPERTY(bool usesTextLabel READ usesTextLabel WRITE setUsesTextLabel) + Q_PROPERTY(bool dockWindowsMovable READ dockWindowsMovable WRITE setDockWindowsMovable) + Q_PROPERTY(bool opaqueMoving READ opaqueMoving WRITE setOpaqueMoving) + +public: + Q3MainWindow(QWidget* parent=0, const char* name=0, Qt::WindowFlags f = Qt::WType_TopLevel); + ~Q3MainWindow(); + +#ifndef QT_NO_MENUBAR + QMenuBar * menuBar() const; +#endif + QStatusBar * statusBar() const; +#if 0 + QToolTipGroup * toolTipGroup() const; +#endif + + virtual void setCentralWidget(QWidget *); + QWidget * centralWidget() const; + + virtual void setDockEnabled(Qt::Dock dock, bool enable); + bool isDockEnabled(Qt::Dock dock) const; + bool isDockEnabled(Q3DockArea *area) const; + virtual void setDockEnabled(Q3DockWindow *tb, Qt::Dock dock, bool enable); + bool isDockEnabled(Q3DockWindow *tb, Qt::Dock dock) const; + bool isDockEnabled(Q3DockWindow *tb, Q3DockArea *area) const; + + virtual void addDockWindow(Q3DockWindow *, Qt::Dock = Qt::DockTop, bool newLine = false); + virtual void addDockWindow(Q3DockWindow *, const QString &label, + Qt::Dock = Qt::DockTop, bool newLine = false); + virtual void moveDockWindow(Q3DockWindow *, Qt::Dock = Qt::DockTop); + virtual void moveDockWindow(Q3DockWindow *, Qt::Dock, bool nl, int index, int extraOffset = -1); + virtual void removeDockWindow(Q3DockWindow *); + + void setVisible(bool); + QSize sizeHint() const; + QSize minimumSizeHint() const; + + bool rightJustification() const; + bool usesBigPixmaps() const; + bool usesTextLabel() const; + bool dockWindowsMovable() const; + bool opaqueMoving() const; + + bool eventFilter(QObject*, QEvent*); + + bool getLocation(Q3DockWindow *tb, Qt::Dock &dock, int &index, bool &nl, int &extraOffset) const; + + QList dockWindows(Qt::Dock dock) const; + QList dockWindows() const; + void lineUpDockWindows(bool keepNewLines = false); + + bool isDockMenuEnabled() const; + + // compatibility stuff + bool hasDockWindow(Q3DockWindow *dw); +#ifndef QT_NO_TOOLBAR + void addToolBar(Q3DockWindow *, Qt::Dock = Qt::DockTop, bool newLine = false); + void addToolBar(Q3DockWindow *, const QString &label, + Qt::Dock = Qt::DockTop, bool newLine = false); + void moveToolBar(Q3DockWindow *, Qt::Dock = Qt::DockTop); + void moveToolBar(Q3DockWindow *, Qt::Dock, bool nl, int index, int extraOffset = -1); + void removeToolBar(Q3DockWindow *); + + bool toolBarsMovable() const; + QList toolBars(Qt::Dock dock) const; + void lineUpToolBars(bool keepNewLines = false); +#endif + + virtual Q3DockArea *dockingArea(const QPoint &p); + Q3DockArea *leftDock() const; + Q3DockArea *rightDock() const; + Q3DockArea *topDock() const; + Q3DockArea *bottomDock() const; + + virtual bool isCustomizable() const; + + bool appropriate(Q3DockWindow *dw) const; + + enum DockWindows { OnlyToolBars, NoToolBars, AllDockWindows }; + virtual Q3PopupMenu *createDockWindowMenu(DockWindows dockWindows = AllDockWindows) const; + +public Q_SLOTS: + virtual void setRightJustification(bool); + virtual void setUsesBigPixmaps(bool); + virtual void setUsesTextLabel(bool); + virtual void setDockWindowsMovable(bool); + virtual void setOpaqueMoving(bool); + virtual void setDockMenuEnabled(bool); + virtual void whatsThis(); + virtual void setAppropriate(Q3DockWindow *dw, bool a); + virtual void customize(); + + // compatibility stuff + void setToolBarsMovable(bool); + +Q_SIGNALS: + void pixmapSizeChanged(bool); + void usesTextLabelChanged(bool); + void dockWindowPositionChanged(Q3DockWindow *); + +#ifndef QT_NO_TOOLBAR + // compatibility stuff + void toolBarPositionChanged(Q3ToolBar *); +#endif + +protected Q_SLOTS: + virtual void setUpLayout(); + virtual bool showDockMenu(const QPoint &globalPos); + void menuAboutToShow(); + +protected: + void paintEvent(QPaintEvent *); + void childEvent(QChildEvent *); + bool event(QEvent *); + +private Q_SLOTS: + void slotPlaceChanged(); + void doLineUp() { lineUpDockWindows(true); } + +private: + Q_DISABLE_COPY(Q3MainWindow) + + void triggerLayout(bool deleteLayout = true); + bool dockMainWindow(QObject *dock) const; + +#ifndef QT_NO_MENUBAR + virtual void setMenuBar(QMenuBar *); +#endif + virtual void setStatusBar(QStatusBar *); +#if 0 + virtual void setToolTipGroup(QToolTipGroup *); +#endif + + friend class Q3DockWindow; + friend class QMenuBarPrivate; + friend class QHideDock; + friend class Q3ToolBar; + friend class Q3MainWindowLayout; +}; + +#ifndef QT_NO_TOOLBAR +inline void Q3MainWindow::addToolBar(Q3DockWindow *w, Qt::ToolBarDock dock, bool newLine) +{ + addDockWindow(w, dock, newLine); +} + +inline void Q3MainWindow::addToolBar(Q3DockWindow *w, const QString &label, + Qt::ToolBarDock dock, bool newLine) +{ + addDockWindow(w, label, dock, newLine); +} + +inline void Q3MainWindow::moveToolBar(Q3DockWindow *w, Qt::ToolBarDock dock) +{ + moveDockWindow(w, dock); +} + +inline void Q3MainWindow::moveToolBar(Q3DockWindow *w, Qt::ToolBarDock dock, bool nl, int index, int extraOffset) +{ + moveDockWindow(w, dock, nl, index, extraOffset); +} + +inline void Q3MainWindow::removeToolBar(Q3DockWindow *w) +{ + removeDockWindow(w); +} + +inline bool Q3MainWindow::toolBarsMovable() const +{ + return dockWindowsMovable(); +} + +inline void Q3MainWindow::lineUpToolBars(bool keepNewLines) +{ + lineUpDockWindows(keepNewLines); +} + +inline void Q3MainWindow::setToolBarsMovable(bool b) +{ + setDockWindowsMovable(b); +} +#endif + +#ifndef QT_NO_TEXTSTREAM +Q_COMPAT_EXPORT QTextStream &operator<<(QTextStream &, const Q3MainWindow &); +Q_COMPAT_EXPORT QTextStream &operator>>(QTextStream &, Q3MainWindow &); +#endif + +#endif // QT_NO_MAINWINDOW + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3MAINWINDOW_H diff --git a/qtinterface/qt4/Qt/q3memarray.h b/qtinterface/qt4/Qt/q3memarray.h new file mode 100644 index 0000000..12f8cb5 --- /dev/null +++ b/qtinterface/qt4/Qt/q3memarray.h @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3MEMARRAY_H +#define Q3MEMARRAY_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3MemArray : public Q3GArray +{ +public: + typedef type* Iterator; + typedef const type* ConstIterator; + typedef type ValueType; + +protected: + Q3MemArray(int, int) : Q3GArray(0, 0) {} + +public: + Q3MemArray() {} + Q3MemArray(int size) : Q3GArray(size*sizeof(type)) {} + Q3MemArray(const Q3MemArray &a) : Q3GArray(a) {} + Q3MemArray(const QVector &vector); + ~Q3MemArray() {} + Q3MemArray &operator=(const Q3MemArray &a) + { return (Q3MemArray&)Q3GArray::assign(a); } + type *data() const { return (type *)Q3GArray::data(); } + uint nrefs() const { return Q3GArray::nrefs(); } + uint size() const { return Q3GArray::size()/sizeof(type); } + uint count() const { return size(); } + bool isEmpty() const { return Q3GArray::size() == 0; } + bool isNull() const { return Q3GArray::data() == 0; } + bool resize(uint size) { return Q3GArray::resize(size*sizeof(type)); } + bool resize(uint size, Optimization optim) { return Q3GArray::resize(size*sizeof(type), optim); } + bool truncate(uint pos) { return Q3GArray::resize(pos*sizeof(type)); } + bool fill(const type &d, int size = -1) + { return Q3GArray::fill((char*)&d,size,sizeof(type)); } + void detach() { Q3GArray::detach(); } + Q3MemArray copy() const + { Q3MemArray tmp; return tmp.duplicate(*this); } + Q3MemArray& assign(const Q3MemArray& a) + { return (Q3MemArray&)Q3GArray::assign(a); } + Q3MemArray& assign(const type *a, uint n) + { return (Q3MemArray&)Q3GArray::assign((char*)a,n*sizeof(type)); } + Q3MemArray& duplicate(const Q3MemArray& a) + { return (Q3MemArray&)Q3GArray::duplicate(a); } + Q3MemArray& duplicate(const type *a, uint n) + { return (Q3MemArray&)Q3GArray::duplicate((char*)a,n*sizeof(type)); } + Q3MemArray& setRawData(const type *a, uint n) + { return (Q3MemArray&)Q3GArray::setRawData((char*)a, + n*sizeof(type)); } + void resetRawData(const type *a, uint n) + { Q3GArray::resetRawData((char*)a,n*sizeof(type)); } + int find(const type &d, uint i=0) const + { return Q3GArray::find((char*)&d,i,sizeof(type)); } + int contains(const type &d) const + { return Q3GArray::contains((char*)&d,sizeof(type)); } + void sort() { Q3GArray::sort(sizeof(type)); } + int bsearch(const type &d) const + { return Q3GArray::bsearch((const char*)&d,sizeof(type)); } + // ### Qt 4.0: maybe provide uint overload as work-around for MSVC bug + type& operator[](int i) const + { return (type &)(*(type *)Q3GArray::at(i*sizeof(type))); } + type& at(uint i) const + { return (type &)(*(type *)Q3GArray::at(i*sizeof(type))); } + operator const type*() const { return (const type *)Q3GArray::data(); } + bool operator==(const Q3MemArray &a) const { return isEqual(a); } + bool operator!=(const Q3MemArray &a) const { return !isEqual(a); } + Iterator begin() { return data(); } + Iterator end() { return data() + size(); } + ConstIterator begin() const { return data(); } + ConstIterator end() const { return data() + size(); } + + operator QVector() const; +}; + +template +Q_OUTOFLINE_TEMPLATE Q3MemArray::Q3MemArray(const QVector &vector) + : Q3GArray(vector.size()*sizeof(type)) +{ + for (int i = 0; i < vector.size(); ++i) + at(i) = vector.at(i); +} + +template +Q_OUTOFLINE_TEMPLATE Q3MemArray::operator QVector() const +{ + QVector vector; + for (int i = 0; i < size(); ++i) + vector.append(at(i)); + return vector; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3MEMARRAY_H diff --git a/qtinterface/qt4/Qt/q3mimefactory.h b/qtinterface/qt4/Qt/q3mimefactory.h new file mode 100644 index 0000000..1db02f2 --- /dev/null +++ b/qtinterface/qt4/Qt/q3mimefactory.h @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3MIMEFACTORY_H +#define Q3MIMEFACTORY_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_MIMEFACTORY + +class QStringList; +class QMimeSource; +class Q3MimeSourceFactoryData; + +class Q_COMPAT_EXPORT Q3MimeSourceFactory { +public: + Q3MimeSourceFactory(); + virtual ~Q3MimeSourceFactory(); + + static Q3MimeSourceFactory* defaultFactory(); + static void setDefaultFactory(Q3MimeSourceFactory*); + static Q3MimeSourceFactory* takeDefaultFactory(); + static void addFactory(Q3MimeSourceFactory *f); + static void removeFactory(Q3MimeSourceFactory *f); + + virtual const QMimeSource* data(const QString& abs_name) const; + virtual QString makeAbsolute(const QString& abs_or_rel_name, const QString& context) const; + const QMimeSource* data(const QString& abs_or_rel_name, const QString& context) const; + + virtual void setText(const QString& abs_name, const QString& text); + virtual void setImage(const QString& abs_name, const QImage& im); + virtual void setPixmap(const QString& abs_name, const QPixmap& pm); + virtual void setData(const QString& abs_name, QMimeSource* data); + virtual void setFilePath(const QStringList&); + inline void setFilePath(const QString &path) { setFilePath(QStringList(path)); } + virtual QStringList filePath() const; + void addFilePath(const QString&); + virtual void setExtensionType(const QString& ext, const char* mimetype); + +private: + QMimeSource *dataInternal(const QString& abs_name, const QMap &extensions) const; + Q3MimeSourceFactoryData* d; +}; + +Q_COMPAT_EXPORT QPixmap qPixmapFromMimeSource(const QString &abs_name); + +Q_COMPAT_EXPORT QImage qImageFromMimeSource(const QString &abs_name); + +#endif // QT_NO_MIMEFACTORY + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3MIMEFACTORY_H diff --git a/qtinterface/qt4/Qt/q3multilineedit.h b/qtinterface/qt4/Qt/q3multilineedit.h new file mode 100644 index 0000000..5d9db44 --- /dev/null +++ b/qtinterface/qt4/Qt/q3multilineedit.h @@ -0,0 +1,143 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3MULTILINEEDIT_H +#define Q3MULTILINEEDIT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_MULTILINEEDIT + +class Q3MultiLineEditCommand; +class QValidator; +class Q3MultiLineEditData; + +class Q_COMPAT_EXPORT Q3MultiLineEdit : public Q3TextEdit +{ + Q_OBJECT + Q_PROPERTY(int numLines READ numLines) + Q_PROPERTY(bool atBeginning READ atBeginning) + Q_PROPERTY(bool atEnd READ atEnd) + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) + Q_PROPERTY(bool edited READ edited WRITE setEdited DESIGNABLE false) + +public: + Q3MultiLineEdit(QWidget* parent=0, const char* name=0); + ~Q3MultiLineEdit(); + + QString textLine(int line) const; + int numLines() const; + + virtual void insertLine(const QString &s, int line = -1); + virtual void insertAt(const QString &s, int line, int col) { + insertAt(s, line, col, false); + } + virtual void insertAt(const QString &s, int line, int col, bool mark); + virtual void removeLine(int line); + virtual void setCursorPosition(int line, int col) { + setCursorPosition(line, col, false); + } + virtual void setCursorPosition(int line, int col, bool mark); + bool atBeginning() const; + bool atEnd() const; + + void setAlignment(Qt::Alignment flags); + Qt::Alignment alignment() const; + + void setEdited(bool); + bool edited() const; + + bool hasMarkedText() const; + QString markedText() const; + + void cursorWordForward(bool mark); + void cursorWordBackward(bool mark); + + // noops + bool autoUpdate() const { return true; } + virtual void setAutoUpdate(bool) {} + + int totalWidth() const { return contentsWidth(); } + int totalHeight() const { return contentsHeight(); } + + int maxLines() const { return QWIDGETSIZE_MAX; } + void setMaxLines(int) {} + +public Q_SLOTS: + void deselect() { selectAll(false); } + +protected: + QPoint cursorPoint() const; + virtual void insertAndMark(const QString&, bool mark); + virtual void newLine(); + virtual void killLine(); + virtual void pageUp(bool mark=false); + virtual void pageDown(bool mark=false); + virtual void cursorLeft(bool mark=false, bool wrap = true); + virtual void cursorRight(bool mark=false, bool wrap = true); + virtual void cursorUp(bool mark=false); + virtual void cursorDown(bool mark=false); + virtual void backspace(); + virtual void home(bool mark=false); + virtual void end(bool mark=false); + + bool getMarkedRegion(int *line1, int *col1, int *line2, int *col2) const; + int lineLength(int row) const; + +private: + Q_DISABLE_COPY(Q3MultiLineEdit) + + Q3MultiLineEditData *d; +}; + +#endif // QT_NO_MULTILINEEDIT + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3MULTILINEEDIT_H diff --git a/qtinterface/qt4/Qt/q3network.h b/qtinterface/qt4/Qt/q3network.h new file mode 100644 index 0000000..052bf24 --- /dev/null +++ b/qtinterface/qt4/Qt/q3network.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3NETWORK_H +#define Q3NETWORK_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_NETWORK + +Q_COMPAT_EXPORT void q3InitNetworkProtocols(); + +#endif // QT_NO_NETWORK + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3NETWORK_H diff --git a/qtinterface/qt4/Qt/q3networkprotocol.h b/qtinterface/qt4/Qt/q3networkprotocol.h new file mode 100644 index 0000000..c02f1e9 --- /dev/null +++ b/qtinterface/qt4/Qt/q3networkprotocol.h @@ -0,0 +1,250 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3NETWORKPROTOCOL_H +#define Q3NETWORKPROTOCOL_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_NETWORKPROTOCOL + +class Q3NetworkProtocol; +class Q3NetworkOperation; +class QTimer; +class Q3UrlOperator; +class Q3NetworkProtocolPrivate; +class QUrlInfo; +template class Q3ValueList; + +class Q_COMPAT_EXPORT Q3NetworkProtocolFactoryBase +{ +public: + virtual ~Q3NetworkProtocolFactoryBase() {} + virtual Q3NetworkProtocol *createObject() = 0; +}; + +template< class T > +class Q3NetworkProtocolFactory : public Q3NetworkProtocolFactoryBase +{ +public: + Q3NetworkProtocol *createObject() { + return new T; + } + +}; + +typedef Q3Dict< Q3NetworkProtocolFactoryBase > Q3NetworkProtocolDict; + +class Q_COMPAT_EXPORT Q3NetworkProtocol : public QObject +{ + Q_OBJECT + +public: + enum State { + StWaiting = 0, + StInProgress, + StDone, + StFailed, + StStopped + }; + + enum Operation { + OpListChildren = 1, + OpMkDir = 2, + OpMkdir = OpMkDir, // ### remove in 4.0 + OpRemove = 4, + OpRename = 8, + OpGet = 32, + OpPut = 64 + }; + + enum ConnectionState { + ConHostFound, + ConConnected, + ConClosed + }; + + enum Error { + // no error + NoError = 0, + // general errors + ErrValid, + ErrUnknownProtocol, + ErrUnsupported, + ErrParse, + // errors on connect + ErrLoginIncorrect, + ErrHostNotFound, + // protocol errors + ErrListChildren, + ErrListChlidren = ErrListChildren, // ### remove in 4.0 + ErrMkDir, + ErrMkdir = ErrMkDir, // ### remove in 4.0 + ErrRemove, + ErrRename, + ErrGet, + ErrPut, + ErrFileNotExisting, + ErrPermissionDenied + }; + + Q3NetworkProtocol(); + virtual ~Q3NetworkProtocol(); + + virtual void setUrl( Q3UrlOperator *u ); + + virtual void setAutoDelete( bool b, int i = 10000 ); + bool autoDelete() const; + + static void registerNetworkProtocol( const QString &protocol, + Q3NetworkProtocolFactoryBase *protocolFactory ); + static Q3NetworkProtocol *getNetworkProtocol( const QString &protocol ); + static bool hasOnlyLocalFileSystem(); + + virtual int supportedOperations() const; + virtual void addOperation( Q3NetworkOperation *op ); + + Q3UrlOperator *url() const; + Q3NetworkOperation *operationInProgress() const; + virtual void clearOperationQueue(); + virtual void stop(); + +Q_SIGNALS: + void data( const QByteArray &, Q3NetworkOperation *res ); + void connectionStateChanged( int state, const QString &data ); + void finished( Q3NetworkOperation *res ); + void start( Q3NetworkOperation *res ); + void newChildren( const Q3ValueList &, Q3NetworkOperation *res ); + void newChild( const QUrlInfo &, Q3NetworkOperation *res ); + void createdDirectory( const QUrlInfo &, Q3NetworkOperation *res ); + void removed( Q3NetworkOperation *res ); + void itemChanged( Q3NetworkOperation *res ); + void dataTransferProgress( int bytesDone, int bytesTotal, Q3NetworkOperation *res ); + +protected: + virtual void processOperation( Q3NetworkOperation *op ); + virtual void operationListChildren( Q3NetworkOperation *op ); + virtual void operationMkDir( Q3NetworkOperation *op ); + virtual void operationRemove( Q3NetworkOperation *op ); + virtual void operationRename( Q3NetworkOperation *op ); + virtual void operationGet( Q3NetworkOperation *op ); + virtual void operationPut( Q3NetworkOperation *op ); + virtual void operationPutChunk( Q3NetworkOperation *op ); + virtual bool checkConnection( Q3NetworkOperation *op ); + +private: + Q3NetworkProtocolPrivate *d; + +private Q_SLOTS: + void processNextOperation( Q3NetworkOperation *old ); + void startOps(); + void emitNewChildren( const QUrlInfo &i, Q3NetworkOperation *op ); + + void removeMe(); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + Q3NetworkProtocol( const Q3NetworkProtocol & ); + Q3NetworkProtocol &operator=( const Q3NetworkProtocol & ); +#endif +}; + +class Q3NetworkOperationPrivate; + +class Q_COMPAT_EXPORT Q3NetworkOperation : public QObject +{ + Q_OBJECT + friend class Q3UrlOperator; + +public: + Q3NetworkOperation( Q3NetworkProtocol::Operation operation, + const QString &arg0, const QString &arg1, + const QString &arg2 ); + Q3NetworkOperation( Q3NetworkProtocol::Operation operation, + const QByteArray &arg0, const QByteArray &arg1, + const QByteArray &arg2 ); + ~Q3NetworkOperation(); + + void setState( Q3NetworkProtocol::State state ); + void setProtocolDetail( const QString &detail ); + void setErrorCode( int ec ); + void setArg( int num, const QString &arg ); + void setRawArg( int num, const QByteArray &arg ); + + Q3NetworkProtocol::Operation operation() const; + Q3NetworkProtocol::State state() const; + QString arg( int num ) const; + QByteArray rawArg( int num ) const; + QString protocolDetail() const; + int errorCode() const; + + void free(); + +private Q_SLOTS: + void deleteMe(); + +private: + QByteArray &raw( int num ) const; + Q3NetworkOperationPrivate *d; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + Q3NetworkOperation( const Q3NetworkOperation & ); + Q3NetworkOperation &operator=( const Q3NetworkOperation & ); +#endif +}; + +#endif // QT_NO_NETWORKPROTOCOL + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3NETWORKPROTOCOL_H diff --git a/qtinterface/qt4/Qt/q3objectdict.h b/qtinterface/qt4/Qt/q3objectdict.h new file mode 100644 index 0000000..4b5bdca --- /dev/null +++ b/qtinterface/qt4/Qt/q3objectdict.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3OBJECTDICT_H +#define Q3OBJECTDICT_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +// +// The object dictionary is a collection of QMetaObjects +// + +class Q3ObjectDictionary : public Q3AsciiDict +{ +public: + Q3ObjectDictionary(int size=17,bool cs=true,bool ck=true) + : Q3AsciiDict(size,cs,ck) {} + Q3ObjectDictionary( const Q3ObjectDictionary &dict ) + : Q3AsciiDict(dict) {} + ~Q3ObjectDictionary() { clear(); } + Q3ObjectDictionary &operator=(const Q3ObjectDictionary &dict) + { return (Q3ObjectDictionary&)Q3AsciiDict::operator=(dict);} +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3OBJECTDICT_H diff --git a/qtinterface/qt4/Qt/q3paintdevicemetrics.h b/qtinterface/qt4/Qt/q3paintdevicemetrics.h new file mode 100644 index 0000000..f98ff8d --- /dev/null +++ b/qtinterface/qt4/Qt/q3paintdevicemetrics.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PAINTDEVICEMETRICS_H +#define Q3PAINTDEVICEMETRICS_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3PaintDeviceMetrics // paint device metrics +{ +public: + Q3PaintDeviceMetrics(const QPaintDevice *device) : pdev(device) {} + + int width() const { return pdev->width(); } + int height() const { return pdev->height(); } + int widthMM() const { return pdev->widthMM(); } + int heightMM() const { return pdev->heightMM(); } + int logicalDpiX() const { return pdev->logicalDpiX(); } + int logicalDpiY() const { return pdev->logicalDpiY(); } + int physicalDpiX() const { return pdev->physicalDpiX(); } + int physicalDpiY() const { return pdev->physicalDpiY(); } + int numColors() const { return pdev->colorCount(); } + int depth() const { return pdev->depth(); } + +private: + const QPaintDevice *pdev; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PAINTDEVICEMETRICS_H diff --git a/qtinterface/qt4/Qt/q3painter.h b/qtinterface/qt4/Qt/q3painter.h new file mode 100644 index 0000000..d25a634 --- /dev/null +++ b/qtinterface/qt4/Qt/q3painter.h @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PAINTER_H +#define Q3PAINTER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3Painter : public QPainter +{ +public: + Q3Painter() : QPainter() { } + Q3Painter(QPaintDevice *pdev) : QPainter(pdev) { } + + inline void drawRect(const QRect &rect); + inline void drawRect(int x1, int y1, int w, int h) + { drawRect(QRect(x1, y1, w, h)); } + + inline void drawRoundRect(const QRect &r, int xround = 25, int yround = 25); + inline void drawRoundRect(int x, int y, int w, int h, int xround = 25, int yround = 25) + { drawRoundRect(QRect(x, y, w, h), xround, yround); } + + inline void drawEllipse(const QRect &r); + inline void drawEllipse(int x, int y, int w, int h) + { drawEllipse(QRect(x, y, w, h)); } + + inline void drawArc(const QRect &r, int a, int alen); + inline void drawArc(int x, int y, int w, int h, int a, int alen) + { drawArc(QRect(x, y, w, h), a, alen); } + + inline void drawPie(const QRect &r, int a, int alen); + inline void drawPie(int x, int y, int w, int h, int a, int alen) + { drawPie(QRect(x, y, w, h), a, alen); } + + inline void drawChord(const QRect &r, int a, int alen); + inline void drawChord(int x, int y, int w, int h, int a, int alen) + { drawChord(QRect(x, y, w, h), a, alen); } + +private: + QRect adjustedRectangle(const QRect &r); + + Q_DISABLE_COPY(Q3Painter) +}; + +void inline Q3Painter::drawRect(const QRect &r) +{ + QPainter::drawRect(adjustedRectangle(r)); +} + +void inline Q3Painter::drawEllipse(const QRect &r) +{ + QPainter::drawEllipse(adjustedRectangle(r)); +} + +void inline Q3Painter::drawRoundRect(const QRect &r, int xrnd, int yrnd) +{ + QPainter::drawRoundRect(adjustedRectangle(r), xrnd, yrnd); +} + +void inline Q3Painter::drawArc(const QRect &r, int angle, int arcLength) +{ + QPainter::drawArc(adjustedRectangle(r), angle, arcLength); +} + +void inline Q3Painter::drawPie(const QRect &r, int angle, int arcLength) +{ + QPainter::drawPie(adjustedRectangle(r), angle, arcLength); +} + +void inline Q3Painter::drawChord(const QRect &r, int angle, int arcLength) +{ + QPainter::drawChord(adjustedRectangle(r), angle, arcLength); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PAINTER_H diff --git a/qtinterface/qt4/Qt/q3picture.h b/qtinterface/qt4/Qt/q3picture.h new file mode 100644 index 0000000..8cda1de --- /dev/null +++ b/qtinterface/qt4/Qt/q3picture.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PICTURE_H +#define Q3PICTURE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3Picture : public QPicture +{ +public: + Q3Picture() : QPicture(-1) { } + Q3Picture(const QPicture &pic) : QPicture(pic) { } + bool load(QIODevice *dev, const char *format = 0); + bool load(const QString &fileName, const char *format = 0); + bool save(QIODevice *dev, const char *format = 0); + bool save(const QString &fileName, const char *format = 0); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PICTURE_H diff --git a/qtinterface/qt4/Qt/q3pointarray.h b/qtinterface/qt4/Qt/q3pointarray.h new file mode 100644 index 0000000..409c84b --- /dev/null +++ b/qtinterface/qt4/Qt/q3pointarray.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3POINTARRAY_H +#define Q3POINTARRAY_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3PointArray : public QPolygon +{ +public: + inline Q3PointArray() : QPolygon() {} + inline Q3PointArray(const QRect &r, bool closed=false) : QPolygon(r, closed) {} + inline Q3PointArray(const QPolygon& a) : QPolygon(a) {} + + inline Q3PointArray copy() const { return *this; } + inline bool isNull() { return isEmpty(); } + void makeEllipse(int x, int y, int w, int h); +#ifndef QT_NO_WMATRIX + void makeArc(int x, int y, int w, int h, int a1, int a2); + void makeArc(int x, int y, int w, int h, int a1, int a2, const QMatrix &matrix); +#endif + Q3PointArray cubicBezier() const; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3POINTARRAY_H diff --git a/qtinterface/qt4/Qt/q3polygonscanner.h b/qtinterface/qt4/Qt/q3polygonscanner.h new file mode 100644 index 0000000..6293fad --- /dev/null +++ b/qtinterface/qt4/Qt/q3polygonscanner.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3POLYGONSCANNER_H +#define Q3POLYGONSCANNER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3PointArray; +class QPoint; + +class Q_COMPAT_EXPORT Q3PolygonScanner { +public: + virtual ~Q3PolygonScanner() {} + void scan(const Q3PointArray& pa, bool winding, int index=0, int npoints=-1); + void scan(const Q3PointArray& pa, bool winding, int index, int npoints, bool stitchable); + enum Edge { Left=1, Right=2, Top=4, Bottom=8 }; + void scan(const Q3PointArray& pa, bool winding, int index, int npoints, Edge edges); + virtual void processSpans(int n, QPoint* point, int* width)=0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3POLYGONSCANNER_H diff --git a/qtinterface/qt4/Qt/q3popupmenu.h b/qtinterface/qt4/Qt/q3popupmenu.h new file mode 100644 index 0000000..4e28730 --- /dev/null +++ b/qtinterface/qt4/Qt/q3popupmenu.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3POPUPMENU_H +#define Q3POPUPMENU_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3PopupMenu : public QMenu +{ + Q_OBJECT +public: + inline Q3PopupMenu(QWidget *parent = 0, const char *name = 0) : QMenu(parent) + { setObjectName(QLatin1String(name)); } + + inline int exec() { return findIdForAction(QMenu::exec()); } + inline int exec(const QPoint & pos, int indexAtPoint = 0) { + return findIdForAction(QMenu::exec(pos, actions().value(indexAtPoint))); + } + + void setFrameRect(QRect) {} + QRect frameRect() const { return QRect(); } + enum DummyFrame { Box, Sunken, Plain, Raised, MShadow, NoFrame, Panel, StyledPanel, + HLine, VLine, GroupBoxPanel, WinPanel, ToolBarPanel, MenuBarPanel, + PopupPanel, LineEditPanel, TabWidgetPanel, MShape }; + void setFrameShadow(DummyFrame) {} + DummyFrame frameShadow() const { return Plain; } + void setFrameShape(DummyFrame) {} + DummyFrame frameShape() const { return NoFrame; } + void setFrameStyle(int) {} + int frameStyle() const { return 0; } + int frameWidth() const { return 0; } + void setLineWidth(int) {} + int lineWidth() const { return 0; } + void setMargin(int margin) { setContentsMargins(margin, margin, margin, margin); } + int margin() const + { int margin; int dummy; getContentsMargins(&margin, &dummy, &dummy, &dummy); return margin; } + void setMidLineWidth(int) {} + int midLineWidth() const { return 0; } + +private: + Q_DISABLE_COPY(Q3PopupMenu) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QPOPUPMENU_H diff --git a/qtinterface/qt4/Qt/q3process.h b/qtinterface/qt4/Qt/q3process.h new file mode 100644 index 0000000..cb35343 --- /dev/null +++ b/qtinterface/qt4/Qt/q3process.h @@ -0,0 +1,186 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PROCESS_H +#define Q3PROCESS_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_PROCESS + +class Q3ProcessPrivate; +class Q3Membuf; + +class Q_COMPAT_EXPORT Q3Process : public QObject +{ + Q_OBJECT +public: + Q3Process( QObject *parent=0, const char *name=0 ); + Q3Process( const QString& arg0, QObject *parent=0, const char *name=0 ); + Q3Process( const QStringList& args, QObject *parent=0, const char *name=0 ); + ~Q3Process(); + + // set and get the arguments and working directory + QStringList arguments() const; + void clearArguments(); + virtual void setArguments( const QStringList& args ); + virtual void addArgument( const QString& arg ); +#ifndef QT_NO_DIR + QDir workingDirectory() const; + virtual void setWorkingDirectory( const QDir& dir ); +#endif + + // set and get the comms wanted + enum Communication { Stdin=0x01, Stdout=0x02, Stderr=0x04, DupStderr=0x08 }; + void setCommunication( int c ); + int communication() const; + + // start the execution + virtual bool start( QStringList *env=0 ); + virtual bool launch( const QString& buf, QStringList *env=0 ); + virtual bool launch( const QByteArray& buf, QStringList *env=0 ); + + // inquire the status + bool isRunning() const; + bool normalExit() const; + int exitStatus() const; + + // reading + virtual QByteArray readStdout(); + virtual QByteArray readStderr(); + bool canReadLineStdout() const; + bool canReadLineStderr() const; + virtual QString readLineStdout(); + virtual QString readLineStderr(); + + // get platform dependent process information +#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) + typedef void* PID; +#else + typedef Q_LONG PID; +#endif + PID processIdentifier(); + + void flushStdin(); + +Q_SIGNALS: + void readyReadStdout(); + void readyReadStderr(); + void processExited(); + void wroteToStdin(); + void launchFinished(); + +public Q_SLOTS: + // end the execution + void tryTerminate() const; + void kill() const; + + // input + virtual void writeToStdin( const QByteArray& buf ); + virtual void writeToStdin( const QString& buf ); + virtual void closeStdin(); + +protected: // ### or private? + void connectNotify( const char * signal ); + void disconnectNotify( const char * signal ); +private: + void setIoRedirection( bool value ); + void setNotifyOnExit( bool value ); + void setWroteStdinConnected( bool value ); + + void init(); + void reset(); +#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) + uint readStddev( Qt::HANDLE dev, char *buf, uint bytes ); +#endif + Q3Membuf* membufStdout(); + Q3Membuf* membufStderr(); + +private Q_SLOTS: + void socketRead( int fd ); + void socketWrite( int fd ); + void timeout(); + void closeStdinLaunch(); + +private: + Q3ProcessPrivate *d; +#ifndef QT_NO_DIR + QDir workingDir; +#endif + QStringList _arguments; + + int exitStat; // exit status + bool exitNormal; // normal exit? + bool ioRedirection; // automatically set be (dis)connectNotify + bool notifyOnExit; // automatically set be (dis)connectNotify + bool wroteToStdinConnected; // automatically set be (dis)connectNotify + + bool readStdoutCalled; + bool readStderrCalled; + int comms; + + friend class Q3ProcessPrivate; +#if defined(Q_OS_UNIX) + friend class Q3ProcessManager; + friend class QProc; +#endif + +#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= + Q3Process( const Q3Process & ); + Q3Process &operator=( const Q3Process & ); +#endif +}; + +#endif // QT_NO_PROCESS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PROCESS_H diff --git a/qtinterface/qt4/Qt/q3progressbar.h b/qtinterface/qt4/Qt/q3progressbar.h new file mode 100644 index 0000000..aafef6c --- /dev/null +++ b/qtinterface/qt4/Qt/q3progressbar.h @@ -0,0 +1,148 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PROGRESSBAR_H +#define Q3PROGRESSBAR_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_PROGRESSBAR + +class Q3ProgressBarPrivate; + +class Q_COMPAT_EXPORT Q3ProgressBar : public QFrame +{ + Q_OBJECT + Q_PROPERTY(int totalSteps READ totalSteps WRITE setTotalSteps) + Q_PROPERTY(int progress READ progress WRITE setProgress) + Q_PROPERTY(QString progressString READ progressString) + Q_PROPERTY(bool centerIndicator READ centerIndicator WRITE setCenterIndicator) + Q_PROPERTY(bool percentageVisible READ percentageVisible WRITE setPercentageVisible) + +public: + Q3ProgressBar(QWidget *parent, const char *name, Qt::WindowFlags f=0); + Q3ProgressBar(int totalSteps, QWidget *parent, const char *name, + Qt::WindowFlags f=0); + Q3ProgressBar(QWidget *parent = 0, Qt::WindowFlags f = 0); + Q3ProgressBar(int totalSteps, QWidget *parent = 0, Qt::WindowFlags f=0); + + int totalSteps() const; + int progress() const; + const QString &progressString() const; + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + void setCenterIndicator(bool on); + bool centerIndicator() const; + + bool percentageVisible() const; + void setPercentageVisible(bool); + + void setVisible(bool visible); + + void setMargin(int margin) { setContentsMargins(margin, margin, margin, margin); } + int margin() const + { int margin; int dummy; getContentsMargins(&margin, &dummy, &dummy, &dummy); return margin; } + +public Q_SLOTS: + void reset(); + virtual void setTotalSteps(int totalSteps); + virtual void setProgress(int progress); + void setProgress(int progress, int totalSteps); + +protected: + void paintEvent(QPaintEvent *); + virtual bool setIndicator(QString &progress_str, int progress, int totalSteps); + void changeEvent(QEvent *); + +private: + Q_DISABLE_COPY(Q3ProgressBar) + + int total_steps; + int progress_val; + int percentage; + QString progress_str; + bool center_indicator : 1; + bool percentage_visible : 1; + Q3ProgressBarPrivate *d; + void initFrame(); +}; + + +inline int Q3ProgressBar::totalSteps() const +{ + return total_steps; +} + +inline int Q3ProgressBar::progress() const +{ + return progress_val; +} + +inline const QString &Q3ProgressBar::progressString() const +{ + return progress_str; +} + +inline bool Q3ProgressBar::centerIndicator() const +{ + return center_indicator; +} + +inline bool Q3ProgressBar::percentageVisible() const +{ + return percentage_visible; +} + +#endif // QT_NO_PROGRESSBAR + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PROGRESSBAR_H diff --git a/qtinterface/qt4/Qt/q3progressdialog.h b/qtinterface/qt4/Qt/q3progressdialog.h new file mode 100644 index 0000000..1e68b47 --- /dev/null +++ b/qtinterface/qt4/Qt/q3progressdialog.h @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PROGRESSDIALOG_H +#define Q3PROGRESSDIALOG_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_PROGRESSDIALOG + +class Q3ProgressDialogData; +class QLabel; +class QPushButton; +class QTimer; +class Q3ProgressBar; + +class Q_COMPAT_EXPORT Q3ProgressDialog : public QDialog +{ + Q_OBJECT + Q_PROPERTY(bool wasCanceled READ wasCanceled) + Q_PROPERTY(bool wasCancelled READ wasCancelled DESIGNABLE false STORED false) + Q_PROPERTY(int totalSteps READ totalSteps WRITE setTotalSteps) + Q_PROPERTY(int progress READ progress WRITE setProgress) + Q_PROPERTY(bool autoReset READ autoReset WRITE setAutoReset) + Q_PROPERTY(bool autoClose READ autoClose WRITE setAutoClose) + Q_PROPERTY(int minimumDuration READ minimumDuration WRITE setMinimumDuration) + Q_PROPERTY(QString labelText READ labelText WRITE setLabelText) + +public: + Q3ProgressDialog(QWidget* parent, const char* name, bool modal=false, + Qt::WindowFlags f=0); + Q3ProgressDialog(const QString& labelText, + const QString &cancelButtonText, int totalSteps, + QWidget* parent=0, const char* name=0, + bool modal=false, Qt::WindowFlags f=0); + Q3ProgressDialog(QWidget* parent = 0, Qt::WindowFlags f = 0); + Q3ProgressDialog(const QString& labelText, const QString &cancelButtonText, + int totalSteps, QWidget* parent=0, Qt::WindowFlags f=0); + ~Q3ProgressDialog(); + + void setLabel(QLabel *); + void setCancelButton(QPushButton *); + void setBar(Q3ProgressBar *); + + bool wasCanceled() const; + bool wasCancelled() const; + + int totalSteps() const; + int progress() const; + + QSize sizeHint() const; + + QString labelText() const; + + void setAutoReset(bool b); + bool autoReset() const; + void setAutoClose(bool b); + bool autoClose() const; + +public Q_SLOTS: + void cancel(); + void reset(); + void setTotalSteps(int totalSteps); + void setProgress(int progress); + void setProgress(int progress, int totalSteps); + void setLabelText(const QString &); + void setCancelButtonText(const QString &); + + void setMinimumDuration(int ms); +public: + int minimumDuration() const; + +Q_SIGNALS: + void canceled(); + void cancelled(); + +protected: + void resizeEvent(QResizeEvent *); + void closeEvent(QCloseEvent *); + void changeEvent(QEvent *); + void showEvent(QShowEvent *e); + +protected Q_SLOTS: + void forceShow(); + +private: + void init(QWidget *creator, const QString& lbl, const QString &canc, + int totstps); + void layout(); + QLabel *label() const; + Q3ProgressBar *bar() const; + Q3ProgressDialogData *d; + QTimer *forceTimer; + +private: + Q_DISABLE_COPY(Q3ProgressDialog) +}; + +#endif // QT_NO_PROGRESSDIALOG + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PROGRESSDIALOG_H diff --git a/qtinterface/qt4/Qt/q3ptrcollection.h b/qtinterface/qt4/Qt/q3ptrcollection.h new file mode 100644 index 0000000..0eca656 --- /dev/null +++ b/qtinterface/qt4/Qt/q3ptrcollection.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PTRCOLLECTION_H +#define Q3PTRCOLLECTION_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3GVector; +class Q3GList; +class Q3GDict; + +class Q_COMPAT_EXPORT Q3PtrCollection // inherited by all collections +{ +public: + bool autoDelete() const { return del_item; } + void setAutoDelete(bool enable) { del_item = enable; } + + virtual uint count() const = 0; + virtual void clear() = 0; // delete all objects + + typedef void *Item; // generic collection item + +protected: + Q3PtrCollection() { del_item = false; } // no deletion of objects + Q3PtrCollection(const Q3PtrCollection &) { del_item = false; } + virtual ~Q3PtrCollection() {} + + bool del_item; // default false + + virtual Item newItem(Item); // create object + virtual void deleteItem(Item) = 0; // delete object +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PTRCOLLECTION_H diff --git a/qtinterface/qt4/Qt/q3ptrdict.h b/qtinterface/qt4/Qt/q3ptrdict.h new file mode 100644 index 0000000..c7d876f --- /dev/null +++ b/qtinterface/qt4/Qt/q3ptrdict.h @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PTRDICT_H +#define Q3PTRDICT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3PtrDict +#ifdef qdoc + : public Q3PtrCollection +#else + : public Q3GDict +#endif +{ +public: + Q3PtrDict(int size=17) : Q3GDict(size,PtrKey,0,0) {} + Q3PtrDict( const Q3PtrDict &d ) : Q3GDict(d) {} + ~Q3PtrDict() { clear(); } + Q3PtrDict &operator=(const Q3PtrDict &d) + { return (Q3PtrDict&)Q3GDict::operator=(d); } + uint count() const { return Q3GDict::count(); } + uint size() const { return Q3GDict::size(); } + bool isEmpty() const { return Q3GDict::count() == 0; } + void insert( void *k, const type *d ) + { Q3GDict::look_ptr(k,(Item)d,1); } + void replace( void *k, const type *d ) + { Q3GDict::look_ptr(k,(Item)d,2); } + bool remove( void *k ) { return Q3GDict::remove_ptr(k); } + type *take( void *k ) { return (type*)Q3GDict::take_ptr(k); } + type *find( void *k ) const + { return (type *)((Q3GDict*)this)->Q3GDict::look_ptr(k,0,0); } + type *operator[]( void *k ) const + { return (type *)((Q3GDict*)this)->Q3GDict::look_ptr(k,0,0); } + void clear() { Q3GDict::clear(); } + void resize( uint n ) { Q3GDict::resize(n); } + void statistics() const { Q3GDict::statistics(); } + +#ifdef qdoc +protected: + virtual QDataStream& read( QDataStream &, Q3PtrCollection::Item & ); + virtual QDataStream& write( QDataStream &, Q3PtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3PtrDict::deleteItem( Q3PtrCollection::Item ) +{ +} +#endif + +template +inline void Q3PtrDict::deleteItem( Q3PtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +template +class Q3PtrDictIterator : public Q3GDictIterator +{ +public: + Q3PtrDictIterator(const Q3PtrDict &d) :Q3GDictIterator((Q3GDict &)d) {} + ~Q3PtrDictIterator() {} + uint count() const { return dict->count(); } + bool isEmpty() const { return dict->count() == 0; } + type *toFirst() { return (type *)Q3GDictIterator::toFirst(); } + operator type *() const { return (type *)Q3GDictIterator::get(); } + type *current() const { return (type *)Q3GDictIterator::get(); } + void *currentKey() const { return Q3GDictIterator::getKeyPtr(); } + type *operator()() { return (type *)Q3GDictIterator::operator()(); } + type *operator++() { return (type *)Q3GDictIterator::operator++(); } + type *operator+=(uint j) { return (type *)Q3GDictIterator::operator+=(j);} +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PTRDICT_H diff --git a/qtinterface/qt4/Qt/q3ptrlist.h b/qtinterface/qt4/Qt/q3ptrlist.h new file mode 100644 index 0000000..7cffe35 --- /dev/null +++ b/qtinterface/qt4/Qt/q3ptrlist.h @@ -0,0 +1,198 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PTRLIST_H +#define Q3PTRLIST_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3PtrListStdIterator : public Q3GListStdIterator +{ +public: + inline Q3PtrListStdIterator( Q3LNode* n ): Q3GListStdIterator(n) {} + type *operator*() { return node ? (type *)node->getData() : 0; } + inline Q3PtrListStdIterator operator++() + { node = next(); return *this; } + inline Q3PtrListStdIterator operator++(int) + { Q3LNode* n = node; node = next(); return Q3PtrListStdIterator( n ); } + inline bool operator==( const Q3PtrListStdIterator& it ) const { return node == it.node; } + inline bool operator!=( const Q3PtrListStdIterator& it ) const { return node != it.node; } +}; + + +template +class Q3PtrList +#ifdef qdoc + : public Q3PtrCollection +#else + : public Q3GList +#endif +{ +public: + + Q3PtrList() {} + Q3PtrList( const Q3PtrList &l ) : Q3GList(l) {} + ~Q3PtrList() { clear(); } + Q3PtrList &operator=(const Q3PtrList &l) + { return (Q3PtrList&)Q3GList::operator=(l); } + bool operator==( const Q3PtrList &list ) const + { return Q3GList::operator==( list ); } + bool operator!=( const Q3PtrList &list ) const + { return !Q3GList::operator==( list ); } + uint count() const { return Q3GList::count(); } + bool isEmpty() const { return Q3GList::count() == 0; } + bool insert( uint i, const type *d){ return Q3GList::insertAt(i,(Q3PtrCollection::Item)d); } + void inSort( const type *d ) { Q3GList::inSort((Q3PtrCollection::Item)d); } + void prepend( const type *d ) { Q3GList::insertAt(0,(Q3PtrCollection::Item)d); } + void append( const type *d ) { Q3GList::append((Q3PtrCollection::Item)d); } + bool remove( uint i ) { return Q3GList::removeAt(i); } + bool remove() { return Q3GList::remove((Q3PtrCollection::Item)0); } + bool remove( const type *d ) { return Q3GList::remove((Q3PtrCollection::Item)d); } + bool removeRef( const type *d ) { return Q3GList::removeRef((Q3PtrCollection::Item)d); } + void removeNode( Q3LNode *n ) { Q3GList::removeNode(n); } + bool removeFirst() { return Q3GList::removeFirst(); } + bool removeLast() { return Q3GList::removeLast(); } + type *take( uint i ) { return (type *)Q3GList::takeAt(i); } + type *take() { return (type *)Q3GList::take(); } + type *takeNode( Q3LNode *n ) { return (type *)Q3GList::takeNode(n); } + void clear() { Q3GList::clear(); } + void sort() { Q3GList::sort(); } + int find( const type *d ) { return Q3GList::find((Q3PtrCollection::Item)d); } + int findNext( const type *d ) { return Q3GList::find((Q3PtrCollection::Item)d,false); } + int findRef( const type *d ) { return Q3GList::findRef((Q3PtrCollection::Item)d); } + int findNextRef( const type *d ){ return Q3GList::findRef((Q3PtrCollection::Item)d,false);} + uint contains( const type *d ) const { return Q3GList::contains((Q3PtrCollection::Item)d); } + uint containsRef( const type *d ) const + { return Q3GList::containsRef((Q3PtrCollection::Item)d); } + bool replace( uint i, const type *d ) { return Q3GList::replaceAt( i, (Q3PtrCollection::Item)d ); } + type *at( uint i ) { return (type *)Q3GList::at(i); } + int at() const { return Q3GList::at(); } + type *current() const { return (type *)Q3GList::get(); } + Q3LNode *currentNode() const { return Q3GList::currentNode(); } + type *getFirst() const { return (type *)Q3GList::cfirst(); } + type *getLast() const { return (type *)Q3GList::clast(); } + type *first() { return (type *)Q3GList::first(); } + type *last() { return (type *)Q3GList::last(); } + type *next() { return (type *)Q3GList::next(); } + type *prev() { return (type *)Q3GList::prev(); } + void toVector( Q3GVector *vec )const{ Q3GList::toVector(vec); } + + + // standard iterators + typedef Q3PtrListStdIterator Iterator; + typedef Q3PtrListStdIterator ConstIterator; + inline Iterator begin() { return Q3GList::begin(); } + inline ConstIterator begin() const { return Q3GList::begin(); } + inline ConstIterator constBegin() const { return Q3GList::begin(); } + inline Iterator end() { return Q3GList::end(); } + inline ConstIterator end() const { return Q3GList::end(); } + inline ConstIterator constEnd() const { return Q3GList::end(); } + inline Iterator erase( Iterator it ) { return Q3GList::erase( it ); } + // stl syntax compatibility + typedef Iterator iterator; + typedef ConstIterator const_iterator; + + +#ifdef qdoc +protected: + virtual int compareItems( Q3PtrCollection::Item, Q3PtrCollection::Item ); + virtual QDataStream& read( QDataStream&, Q3PtrCollection::Item& ); + virtual QDataStream& write( QDataStream&, Q3PtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3PtrList::deleteItem( Q3PtrCollection::Item ) +{ +} +#endif + +template inline void Q3PtrList::deleteItem( Q3PtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +template +class Q3PtrListIterator : public Q3GListIterator +{ +public: + Q3PtrListIterator(const Q3PtrList &l) :Q3GListIterator((Q3GList &)l) {} + ~Q3PtrListIterator() {} + uint count() const { return list->count(); } + bool isEmpty() const { return list->count() == 0; } + bool atFirst() const { return Q3GListIterator::atFirst(); } + bool atLast() const { return Q3GListIterator::atLast(); } + type *toFirst() { return (type *)Q3GListIterator::toFirst(); } + type *toLast() { return (type *)Q3GListIterator::toLast(); } + operator type *() const { return (type *)Q3GListIterator::get(); } + type *operator*() { return (type *)Q3GListIterator::get(); } + + // No good, since Q3PtrList (ie. QStrList fails... + // + // MSVC++ gives warning + // Sunpro C++ 4.1 gives error + // type *operator->() { return (type *)Q3GListIterator::get(); } + + type *current() const { return (type *)Q3GListIterator::get(); } + type *operator()() { return (type *)Q3GListIterator::operator()();} + type *operator++() { return (type *)Q3GListIterator::operator++(); } + type *operator+=(uint j) { return (type *)Q3GListIterator::operator+=(j);} + type *operator--() { return (type *)Q3GListIterator::operator--(); } + type *operator-=(uint j) { return (type *)Q3GListIterator::operator-=(j);} + Q3PtrListIterator& operator=(const Q3PtrListIterator&it) + { Q3GListIterator::operator=(it); return *this; } +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PTRLIST_H diff --git a/qtinterface/qt4/Qt/q3ptrqueue.h b/qtinterface/qt4/Qt/q3ptrqueue.h new file mode 100644 index 0000000..0f596c8 --- /dev/null +++ b/qtinterface/qt4/Qt/q3ptrqueue.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PTRQUEUE_H +#define Q3PTRQUEUE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3PtrQueue : protected Q3GList +{ +public: + Q3PtrQueue() {} + Q3PtrQueue( const Q3PtrQueue &q ) : Q3GList(q) {} + ~Q3PtrQueue() { clear(); } + Q3PtrQueue& operator=(const Q3PtrQueue &q) + { return (Q3PtrQueue&)Q3GList::operator=(q); } + bool autoDelete() const { return Q3PtrCollection::autoDelete(); } + void setAutoDelete( bool del ) { Q3PtrCollection::setAutoDelete(del); } + uint count() const { return Q3GList::count(); } + bool isEmpty() const { return Q3GList::count() == 0; } + void enqueue( const type *d ) { Q3GList::append(Item(d)); } + type *dequeue() { return (type *)Q3GList::takeFirst();} + bool remove() { return Q3GList::removeFirst(); } + void clear() { Q3GList::clear(); } + type *head() const { return (type *)Q3GList::cfirst(); } + operator type *() const { return (type *)Q3GList::cfirst(); } + type *current() const { return (type *)Q3GList::cfirst(); } + +#ifdef qdoc +protected: + virtual QDataStream& read( QDataStream&, Q3PtrCollection::Item& ); + virtual QDataStream& write( QDataStream&, Q3PtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3PtrQueue::deleteItem( Q3PtrCollection::Item ) +{ +} +#endif + +template inline void Q3PtrQueue::deleteItem( Q3PtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PTRQUEUE_H diff --git a/qtinterface/qt4/Qt/q3ptrstack.h b/qtinterface/qt4/Qt/q3ptrstack.h new file mode 100644 index 0000000..9a3091a --- /dev/null +++ b/qtinterface/qt4/Qt/q3ptrstack.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PTRSTACK_H +#define Q3PTRSTACK_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3PtrStack : protected Q3GList +{ +public: + Q3PtrStack() { } + Q3PtrStack( const Q3PtrStack &s ) : Q3GList( s ) { } + ~Q3PtrStack() { clear(); } + Q3PtrStack &operator=(const Q3PtrStack &s) + { return (Q3PtrStack&)Q3GList::operator=(s); } + bool autoDelete() const { return Q3PtrCollection::autoDelete(); } + void setAutoDelete( bool del ) { Q3PtrCollection::setAutoDelete(del); } + uint count() const { return Q3GList::count(); } + bool isEmpty() const { return Q3GList::count() == 0; } + void push( const type *d ) { Q3GList::insertAt(0,Item(d)); } + type *pop() { return (type *)Q3GList::takeFirst(); } + bool remove() { return Q3GList::removeFirst(); } + void clear() { Q3GList::clear(); } + type *top() const { return (type *)Q3GList::cfirst(); } + operator type *() const { return (type *)Q3GList::cfirst(); } + type *current() const { return (type *)Q3GList::cfirst(); } + +#ifdef qdoc +protected: + virtual QDataStream& read( QDataStream&, Q3PtrCollection::Item& ); + virtual QDataStream& write( QDataStream&, Q3PtrCollection::Item ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3PtrStack::deleteItem( Q3PtrCollection::Item ) +{ +} +#endif + +template inline void Q3PtrStack::deleteItem( Q3PtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PTRSTACK_H diff --git a/qtinterface/qt4/Qt/q3ptrvector.h b/qtinterface/qt4/Qt/q3ptrvector.h new file mode 100644 index 0000000..196fbf8 --- /dev/null +++ b/qtinterface/qt4/Qt/q3ptrvector.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3PTRVECTOR_H +#define Q3PTRVECTOR_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3PtrVector +#ifdef qdoc + : public Q3PtrCollection +#else + : public Q3GVector +#endif +{ +public: + Q3PtrVector() { } + Q3PtrVector( uint size ) : Q3GVector(size) { } + Q3PtrVector( const Q3PtrVector &v ) : Q3GVector( v ) { } + ~Q3PtrVector() { clear(); } + Q3PtrVector &operator=(const Q3PtrVector &v) + { return (Q3PtrVector&)Q3GVector::operator=(v); } + bool operator==( const Q3PtrVector &v ) const { return Q3GVector::operator==(v); } + type **data() const { return (type **)Q3GVector::data(); } + uint size() const { return Q3GVector::size(); } + uint count() const { return Q3GVector::count(); } + bool isEmpty() const { return Q3GVector::count() == 0; } + bool isNull() const { return Q3GVector::size() == 0; } + bool resize( uint size ) { return Q3GVector::resize(size); } + bool insert( uint i, const type *d){ return Q3GVector::insert(i,(Item)d); } + bool remove( uint i ) { return Q3GVector::remove(i); } + type *take( uint i ) { return (type *)Q3GVector::take(i); } + void clear() { Q3GVector::clear(); } + bool fill( const type *d, int size=-1 ) + { return Q3GVector::fill((Item)d,size);} + void sort() { Q3GVector::sort(); } + int bsearch( const type *d ) const{ return Q3GVector::bsearch((Item)d); } + int findRef( const type *d, uint i=0 ) const + { return Q3GVector::findRef((Item)d,i);} + int find( const type *d, uint i= 0 ) const + { return Q3GVector::find((Item)d,i); } + uint containsRef( const type *d ) const + { return Q3GVector::containsRef((Item)d); } + uint contains( const type *d ) const + { return Q3GVector::contains((Item)d); } + type *operator[]( int i ) const { return (type *)Q3GVector::at(i); } + type *at( uint i ) const { return (type *)Q3GVector::at(i); } + void toList( Q3GList *list ) const { Q3GVector::toList(list); } + +#ifdef qdoc +protected: + virtual int compareItems( Q3PtrCollection::Item d1, Q3PtrCollection::Item d2 ); + virtual QDataStream& read( QDataStream &s, Q3PtrCollection::Item &d ); + virtual QDataStream& write( QDataStream &s, Q3PtrCollection::Item d ) const; +#endif + +private: + void deleteItem( Item d ); +}; + +#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) +template<> inline void Q3PtrVector::deleteItem( Q3PtrCollection::Item ) +{ +} +#endif + +template inline void Q3PtrVector::deleteItem( Q3PtrCollection::Item d ) +{ + if ( del_item ) delete (type *)d; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3PTRVECTOR_H diff --git a/qtinterface/qt4/Qt/q3rangecontrol.h b/qtinterface/qt4/Qt/q3rangecontrol.h new file mode 100644 index 0000000..18dc812 --- /dev/null +++ b/qtinterface/qt4/Qt/q3rangecontrol.h @@ -0,0 +1,194 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3RANGECONTROL_H +#define Q3RANGECONTROL_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_RANGECONTROL + +class Q3RangeControlPrivate; + +class Q_COMPAT_EXPORT Q3RangeControl +{ +public: + Q3RangeControl(); + Q3RangeControl(int minValue, int maxValue, + int lineStep, int pageStep, int value); + virtual ~Q3RangeControl(); + + int value() const; + void setValue(int); + void addPage(); + void subtractPage(); + void addLine(); + void subtractLine(); + + int minValue() const; + int maxValue() const; + void setRange(int minValue, int maxValue); + void setMinValue(int minVal); + void setMaxValue(int minVal); + + int lineStep() const; + int pageStep() const; + void setSteps(int line, int page); + + int bound(int) const; + +protected: + int positionFromValue(int val, int space) const; + int valueFromPosition(int pos, int space) const; + void directSetValue(int val); + int prevValue() const; + + virtual void valueChange(); + virtual void rangeChange(); + virtual void stepChange(); + +private: + int minVal, maxVal; + int line, page; + int val, prevVal; + + Q3RangeControlPrivate * d; + +private: + Q_DISABLE_COPY(Q3RangeControl) +}; + + +inline int Q3RangeControl::value() const +{ return val; } + +inline int Q3RangeControl::prevValue() const +{ return prevVal; } + +inline int Q3RangeControl::minValue() const +{ return minVal; } + +inline int Q3RangeControl::maxValue() const +{ return maxVal; } + +inline int Q3RangeControl::lineStep() const +{ return line; } + +inline int Q3RangeControl::pageStep() const +{ return page; } + + +#endif // QT_NO_RANGECONTROL + +#ifndef QT_NO_SPINWIDGET + +class Q3SpinWidgetPrivate; +class Q_COMPAT_EXPORT Q3SpinWidget : public QWidget +{ + Q_OBJECT +public: + Q3SpinWidget(QWidget* parent=0, const char* name=0); + ~Q3SpinWidget(); + + void setEditWidget(QWidget * widget); + QWidget * editWidget(); + + QRect upRect() const; + QRect downRect() const; + + void setUpEnabled(bool on); + void setDownEnabled(bool on); + + bool isUpEnabled() const; + bool isDownEnabled() const; + + enum ButtonSymbols { UpDownArrows, PlusMinus }; + virtual void setButtonSymbols(ButtonSymbols bs); + ButtonSymbols buttonSymbols() const; + + void arrange(); + +Q_SIGNALS: + void stepUpPressed(); + void stepDownPressed(); + +public Q_SLOTS: + void stepUp(); + void stepDown(); + +protected: + void mousePressEvent(QMouseEvent *e); + void resizeEvent(QResizeEvent* ev); + void mouseReleaseEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); +#ifndef QT_NO_WHEELEVENT + void wheelEvent(QWheelEvent *); +#endif + void changeEvent(QEvent *); + void paintEvent(QPaintEvent *); + +private Q_SLOTS: + void timerDone(); + void timerDoneEx(); + +private: + Q3SpinWidgetPrivate * d; + + void updateDisplay(); + +private: + Q_DISABLE_COPY(Q3SpinWidget) +}; + +#endif // QT_NO_RANGECONTROL + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3RANGECONTROL_H diff --git a/qtinterface/qt4/Qt/q3scrollview.h b/qtinterface/qt4/Qt/q3scrollview.h new file mode 100644 index 0000000..df0d49e --- /dev/null +++ b/qtinterface/qt4/Qt/q3scrollview.h @@ -0,0 +1,253 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SCROLLVIEW_H +#define Q3SCROLLVIEW_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3ScrollViewData; + +class Q_COMPAT_EXPORT Q3ScrollView : public Q3Frame +{ + Q_OBJECT + Q_ENUMS( ResizePolicy ScrollBarMode ) + Q_PROPERTY( ResizePolicy resizePolicy READ resizePolicy WRITE setResizePolicy ) + Q_PROPERTY( ScrollBarMode vScrollBarMode READ vScrollBarMode WRITE setVScrollBarMode ) + Q_PROPERTY( ScrollBarMode hScrollBarMode READ hScrollBarMode WRITE setHScrollBarMode ) + Q_PROPERTY( int visibleWidth READ visibleWidth ) + Q_PROPERTY( int visibleHeight READ visibleHeight ) + Q_PROPERTY( int contentsWidth READ contentsWidth ) + Q_PROPERTY( int contentsHeight READ contentsHeight ) + Q_PROPERTY( int contentsX READ contentsX ) + Q_PROPERTY( int contentsY READ contentsY ) + Q_PROPERTY( bool dragAutoScroll READ dragAutoScroll WRITE setDragAutoScroll ) + +public: + Q3ScrollView(QWidget* parent=0, const char* name=0, Qt::WindowFlags f=0); + ~Q3ScrollView(); + + enum ResizePolicy { Default, Manual, AutoOne, AutoOneFit }; + virtual void setResizePolicy( ResizePolicy ); + ResizePolicy resizePolicy() const; + + void styleChange( QStyle & ); + void removeChild(QWidget* child); + virtual void addChild( QWidget* child, int x=0, int y=0 ); + virtual void moveChild( QWidget* child, int x, int y ); + int childX(QWidget* child); + int childY(QWidget* child); + bool childIsVisible(QWidget* child) { return child->isVisible(); } // obsolete functions + void showChild(QWidget* child, bool yes=true) { child->setVisible(yes); } + + enum ScrollBarMode { Auto, AlwaysOff, AlwaysOn }; + + ScrollBarMode vScrollBarMode() const; + virtual void setVScrollBarMode( ScrollBarMode ); + + ScrollBarMode hScrollBarMode() const; + virtual void setHScrollBarMode( ScrollBarMode ); + + QWidget* cornerWidget() const; + virtual void setCornerWidget(QWidget*); + + // ### 4.0: Consider providing a factory function for scrollbars + // (e.g. make the two following functions virtual) + QScrollBar* horizontalScrollBar() const; + QScrollBar* verticalScrollBar() const; + QWidget* viewport() const; + QWidget* clipper() const; + + int visibleWidth() const; + int visibleHeight() const; + + int contentsWidth() const; + int contentsHeight() const; + int contentsX() const; + int contentsY() const; + + void resize( int w, int h ); + void resize( const QSize& ); + void setVisible(bool visible); + + void updateContents( int x, int y, int w, int h ); + void updateContents( const QRect& r ); + void updateContents(); + void repaintContents( int x, int y, int w, int h, bool erase=true ); + void repaintContents( const QRect& r, bool erase=true ); + void repaintContents( bool erase=true ); + void contentsToViewport( int x, int y, int& vx, int& vy ) const; + void viewportToContents( int vx, int vy, int& x, int& y ) const; + QPoint contentsToViewport( const QPoint& ) const; + QPoint viewportToContents( const QPoint& ) const; + void enableClipper( bool y ); + + void setStaticBackground( bool y ); + bool hasStaticBackground() const; + + QSize viewportSize( int, int ) const; + QSize sizeHint() const; + QSize minimumSizeHint() const; + + void removeChild(QObject* child); + + bool isHorizontalSliderPressed(); + bool isVerticalSliderPressed(); + + virtual void setDragAutoScroll( bool b ); + bool dragAutoScroll() const; + +Q_SIGNALS: + void contentsMoving(int x, int y); + void horizontalSliderPressed(); + void horizontalSliderReleased(); + void verticalSliderPressed(); + void verticalSliderReleased(); + +public Q_SLOTS: + virtual void resizeContents( int w, int h ); + void scrollBy( int dx, int dy ); + virtual void setContentsPos( int x, int y ); + void ensureVisible(int x, int y); + void ensureVisible(int x, int y, int xmargin, int ymargin); + void center(int x, int y); + void center(int x, int y, float xmargin, float ymargin); + + void updateScrollBars(); // ### virtual in 4.0 + void setEnabled( bool enable ); + +protected: + virtual void drawContents(QPainter*, int cx, int cy, int cw, int ch); + virtual void drawContentsOffset(QPainter*, int ox, int oy, + int cx, int cy, int cw, int ch); + + + virtual void contentsMousePressEvent( QMouseEvent* ); + virtual void contentsMouseReleaseEvent( QMouseEvent* ); + virtual void contentsMouseDoubleClickEvent( QMouseEvent* ); + virtual void contentsMouseMoveEvent( QMouseEvent* ); + virtual void contentsDragEnterEvent( QDragEnterEvent * ); + virtual void contentsDragMoveEvent( QDragMoveEvent * ); + virtual void contentsDragLeaveEvent( QDragLeaveEvent * ); + virtual void contentsDropEvent( QDropEvent * ); + virtual void contentsWheelEvent( QWheelEvent * ); + virtual void contentsContextMenuEvent( QContextMenuEvent * ); + + + virtual void viewportPaintEvent( QPaintEvent* ); + virtual void viewportResizeEvent( QResizeEvent* ); + virtual void viewportMousePressEvent( QMouseEvent* ); + virtual void viewportMouseReleaseEvent( QMouseEvent* ); + virtual void viewportMouseDoubleClickEvent( QMouseEvent* ); + virtual void viewportMouseMoveEvent( QMouseEvent* ); + virtual void viewportDragEnterEvent( QDragEnterEvent * ); + virtual void viewportDragMoveEvent( QDragMoveEvent * ); + virtual void viewportDragLeaveEvent( QDragLeaveEvent * ); + virtual void viewportDropEvent( QDropEvent * ); + virtual void viewportWheelEvent( QWheelEvent * ); + virtual void viewportContextMenuEvent( QContextMenuEvent * ); + + void frameChanged(); + +public: + virtual void setMargins(int left, int top, int right, int bottom); + int leftMargin() const; + int topMargin() const; + int rightMargin() const; + int bottomMargin() const; +protected: + + bool focusNextPrevChild( bool next ); + + virtual void setHBarGeometry(QScrollBar& hbar, int x, int y, int w, int h); + virtual void setVBarGeometry(QScrollBar& vbar, int x, int y, int w, int h); + + void resizeEvent(QResizeEvent*); + void mousePressEvent( QMouseEvent * ); + void mouseReleaseEvent( QMouseEvent * ); + void mouseDoubleClickEvent( QMouseEvent * ); + void mouseMoveEvent( QMouseEvent * ); + void wheelEvent( QWheelEvent * ); + void contextMenuEvent( QContextMenuEvent * ); + bool eventFilter( QObject *, QEvent *e ); + + void setCachedSizeHint( const QSize &sh ) const; + QSize cachedSizeHint() const; + void fontChange( const QFont & ); + +private: + void drawContents( QPainter* ); + void moveContents(int x, int y); + + Q3ScrollViewData* d; + +private Q_SLOTS: + void hslide(int); + void vslide(int); + void hbarIsPressed(); + void hbarIsReleased(); + void vbarIsPressed(); + void vbarIsReleased(); + void doDragAutoScroll(); + void startDragAutoScroll(); + void stopDragAutoScroll(); + +private: // Disabled copy constructor and operator= + Q_DISABLE_COPY(Q3ScrollView) + void changeFrameRect(const QRect&); + +public: + void disableSizeHintCaching(); + +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SCROLLVIEW_H diff --git a/qtinterface/qt4/Qt/q3semaphore.h b/qtinterface/qt4/Qt/q3semaphore.h new file mode 100644 index 0000000..4c9f0f0 --- /dev/null +++ b/qtinterface/qt4/Qt/q3semaphore.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SEMAPHORE_H +#define Q3SEMAPHORE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3SemaphorePrivate; + +class Q_COMPAT_EXPORT Q3Semaphore +{ +public: + Q3Semaphore(int); + virtual ~Q3Semaphore(); + + int available() const; + int total() const; + + // postfix operators + int operator++(int); + int operator--(int); + + int operator+=(int); + int operator-=(int); + + bool tryAccess(int); + +private: + Q_DISABLE_COPY(Q3Semaphore) + + Q3SemaphorePrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SEMAPHORE_H diff --git a/qtinterface/qt4/Qt/q3serversocket.h b/qtinterface/qt4/Qt/q3serversocket.h new file mode 100644 index 0000000..c65299c --- /dev/null +++ b/qtinterface/qt4/Qt/q3serversocket.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SERVERSOCKET_H +#define Q3SERVERSOCKET_H + +#include +#include +#include // ### remove or keep for users' convenience? + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +class Q3ServerSocketPrivate; + +class Q_COMPAT_EXPORT Q3ServerSocket : public QObject +{ + Q_OBJECT +public: + Q3ServerSocket( Q_UINT16 port, int backlog = 1, + QObject *parent=0, const char *name=0 ); + Q3ServerSocket( const QHostAddress & address, Q_UINT16 port, int backlog = 1, + QObject *parent=0, const char *name=0 ); + Q3ServerSocket( QObject *parent=0, const char *name=0 ); + virtual ~Q3ServerSocket(); + + bool ok() const; + + Q_UINT16 port() const ; + + int socket() const ; + virtual void setSocket( int socket ); + + QHostAddress address() const ; + + virtual void newConnection( int socket ) = 0; + +protected: + Q3SocketDevice *socketDevice(); + +private Q_SLOTS: + void incomingConnection( int socket ); + +private: + Q3ServerSocketPrivate *d; + void init( const QHostAddress & address, Q_UINT16 port, int backlog ); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SERVERSOCKET_H diff --git a/qtinterface/qt4/Qt/q3shared.h b/qtinterface/qt4/Qt/q3shared.h new file mode 100644 index 0000000..19f0e64 --- /dev/null +++ b/qtinterface/qt4/Qt/q3shared.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SHARED_H +#define Q3SHARED_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +struct Q_COMPAT_EXPORT Q3Shared +{ + Q3Shared() : count( 1 ) { } + void ref() { count++; } + bool deref() { return !--count; } + uint count; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SHARED_H diff --git a/qtinterface/qt4/Qt/q3signal.h b/qtinterface/qt4/Qt/q3signal.h new file mode 100644 index 0000000..de57b8f --- /dev/null +++ b/qtinterface/qt4/Qt/q3signal.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SIGNAL_H +#define Q3SIGNAL_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3Signal : public QObject +{ + Q_OBJECT + +public: + Q3Signal(QObject *parent=0, const char *name=0); + ~Q3Signal(); + + bool connect(const QObject *receiver, const char *member); + bool disconnect(const QObject *receiver, const char *member=0); + + void activate(); + + bool isBlocked() const { return QObject::signalsBlocked(); } + void block(bool b) { QObject::blockSignals(b); } +#ifndef QT_NO_VARIANT + void setParameter(int value); + int parameter() const; +#endif + +#ifndef QT_NO_VARIANT + void setValue(const QVariant &value); + QVariant value() const; +#endif +Q_SIGNALS: +#ifndef QT_NO_VARIANT + void signal(const QVariant&); +#endif + void intSignal(int); + +private: + Q_DISABLE_COPY(Q3Signal) + +#ifndef QT_NO_VARIANT + QVariant val; +#endif + +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SIGNAL_H diff --git a/qtinterface/qt4/Qt/q3simplerichtext.h b/qtinterface/qt4/Qt/q3simplerichtext.h new file mode 100644 index 0000000..4074085 --- /dev/null +++ b/qtinterface/qt4/Qt/q3simplerichtext.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SIMPLERICHTEXT_H +#define Q3SIMPLERICHTEXT_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_RICHTEXT + +class QPainter; +class QWidget; +class Q3StyleSheet; +class QBrush; +class Q3MimeSourceFactory; +class Q3SimpleRichTextData; + +class Q_COMPAT_EXPORT Q3SimpleRichText +{ +public: + Q3SimpleRichText(const QString& text, const QFont& fnt, + const QString& context = QString(), const Q3StyleSheet* sheet = 0); + Q3SimpleRichText(const QString& text, const QFont& fnt, + const QString& context, const Q3StyleSheet *sheet, + const Q3MimeSourceFactory* factory, int pageBreak = -1, + const QColor& linkColor = Qt::blue, bool linkUnderline = true); + ~Q3SimpleRichText(); + + void setWidth(int); + void setWidth(QPainter*, int); + void setDefaultFont(const QFont &f); + int width() const; + int widthUsed() const; + int height() const; + void adjustSize(); + + void draw(QPainter* p, int x, int y, const QRect& clipRect, + const QColorGroup& cg, const QBrush* paper = 0) const; + + void draw(QPainter* p, int x, int y, const QRegion& clipRegion, + const QColorGroup& cg, const QBrush* paper = 0) const { + draw(p, x, y, clipRegion.boundingRect(), cg, paper); + } + + QString context() const; + QString anchorAt(const QPoint& pos) const; + + bool inText(const QPoint& pos) const; + +private: + Q_DISABLE_COPY(Q3SimpleRichText) + + Q3SimpleRichTextData* d; +}; + +#endif // QT_NO_RICHTEXT + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SIMPLERICHTEXT_H diff --git a/qtinterface/qt4/Qt/q3socket.h b/qtinterface/qt4/Qt/q3socket.h new file mode 100644 index 0000000..3354f34 --- /dev/null +++ b/qtinterface/qt4/Qt/q3socket.h @@ -0,0 +1,157 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SOCKET_H +#define Q3SOCKET_H + +#include +#include // int->QHostAddress conversion + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +class Q3SocketPrivate; +class Q3SocketDevice; + +class Q_COMPAT_EXPORT Q3Socket : public QIODevice +{ + Q_OBJECT +public: + enum Error { + ErrConnectionRefused, + ErrHostNotFound, + ErrSocketRead + }; + + Q3Socket( QObject *parent=0, const char *name=0 ); + virtual ~Q3Socket(); + + enum State { Idle, HostLookup, Connecting, + Connected, Closing, + Connection=Connected }; + State state() const; + + int socket() const; + virtual void setSocket( int ); + + Q3SocketDevice *socketDevice(); + virtual void setSocketDevice( Q3SocketDevice * ); + +#ifndef QT_NO_DNS + virtual void connectToHost( const QString &host, Q_UINT16 port ); +#endif + QString peerName() const; + + // Implementation of QIODevice abstract virtual functions + bool open( OpenMode mode ); + bool open(int mode) { return open((OpenMode)mode); } + void close(); + bool flush(); + Offset size() const; + Offset at() const; + bool at( Offset ); + bool atEnd() const; + + qint64 bytesAvailable() const; + Q_ULONG waitForMore( int msecs, bool *timeout ) const; + Q_ULONG waitForMore( int msecs ) const; // ### Qt 4.0: merge the two overloads + qint64 bytesToWrite() const; + void clearPendingData(); + + int getch(); + int putch( int ); + int ungetch(int); + + bool canReadLine() const; + + Q_UINT16 port() const; + Q_UINT16 peerPort() const; + QHostAddress address() const; + QHostAddress peerAddress() const; + + void setReadBufferSize( Q_ULONG ); + Q_ULONG readBufferSize() const; + + inline bool isSequential() const { return true; } + +Q_SIGNALS: + void hostFound(); + void connected(); + void connectionClosed(); + void delayedCloseFinished(); + void readyRead(); + void bytesWritten( int nbytes ); + void error( int ); + +protected Q_SLOTS: + virtual void sn_read( bool force=false ); + virtual void sn_write(); + +protected: + qint64 readData(char *data, qint64 maxlen); + qint64 writeData(const char *data, qint64 len); + +private Q_SLOTS: + void tryConnecting(); + void emitErrorConnectionRefused(); + +private: + Q3SocketPrivate *d; + + bool consumeWriteBuf( Q_ULONG nbytes ); + void tryConnection(); + void setSocketIntern( int socket ); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + Q3Socket( const Q3Socket & ); + Q3Socket &operator=( const Q3Socket & ); +#endif +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SOCKET_H diff --git a/qtinterface/qt4/Qt/q3socketdevice.h b/qtinterface/qt4/Qt/q3socketdevice.h new file mode 100644 index 0000000..9d0a9c0 --- /dev/null +++ b/qtinterface/qt4/Qt/q3socketdevice.h @@ -0,0 +1,177 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SOCKETDEVICE_H +#define Q3SOCKETDEVICE_H + +#include +#include // int->QHostAddress conversion + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_NETWORK + +class Q3SocketDevicePrivate; + +class Q_COMPAT_EXPORT Q3SocketDevice: public QIODevice +{ +public: + enum Type { Stream, Datagram }; + enum Protocol { IPv4, IPv6, Unknown }; + + Q3SocketDevice( Type type = Stream ); + Q3SocketDevice( Type type, Protocol protocol, int dummy ); + Q3SocketDevice( int socket, Type type ); + virtual ~Q3SocketDevice(); + + bool isValid() const; + Type type() const; + Protocol protocol() const; + + int socket() const; + virtual void setSocket( int socket, Type type ); + + bool open( OpenMode mode ); + bool open( int mode ) { return open((OpenMode)mode); } + void close(); + bool flush(); + + // Implementation of QIODevice abstract virtual functions + Offset size() const; + Offset at() const; + bool at( Offset ); + bool atEnd() const; + + bool blocking() const; + virtual void setBlocking( bool ); + + bool addressReusable() const; + virtual void setAddressReusable( bool ); + + int receiveBufferSize() const; + virtual void setReceiveBufferSize( uint ); + int sendBufferSize() const; + virtual void setSendBufferSize( uint ); + + virtual bool connect( const QHostAddress &, Q_UINT16 ); + + virtual bool bind( const QHostAddress &, Q_UINT16 ); + virtual bool listen( int backlog ); + virtual int accept(); + + qint64 bytesAvailable() const; + Q_LONG waitForMore( int msecs, bool *timeout=0 ) const; + virtual Q_LONG writeBlock( const char *data, Q_ULONG len, + const QHostAddress & host, Q_UINT16 port ); + inline Q_LONG writeBlock(const char *data, Q_ULONG len) + { return qint64(write(data, qint64(len))); } + inline qint64 readBlock(char *data, Q_ULONG maxlen) + { return qint64(read(data, qint64(maxlen))); } + + Q_UINT16 port() const; + Q_UINT16 peerPort() const; + QHostAddress address() const; + QHostAddress peerAddress() const; + + enum Error { + NoError, + AlreadyBound, + Inaccessible, + NoResources, + InternalError, + Bug = InternalError, // ### remove in 4.0? + Impossible, + NoFiles, + ConnectionRefused, + NetworkFailure, + UnknownError + }; + Error error() const; + + inline bool isSequential() const { return true; } + +protected: + void setError( Error err ); + qint64 readData(char *data, qint64 maxlen); + qint64 writeData(const char *data, qint64 len); + +private: + int fd; + Type t; + Q_UINT16 p; + QHostAddress a; + Q_UINT16 pp; + QHostAddress pa; + Q3SocketDevice::Error e; + Q3SocketDevicePrivate * d; + + enum Option { Broadcast, ReceiveBuffer, ReuseAddress, SendBuffer }; + + int option( Option ) const; + virtual void setOption( Option, int ); + + void fetchConnectionParameters(); +#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) + void fetchPeerConnectionParameters(); +#endif + + static void init(); + int createNewSocket(); + Protocol getProtocol() const; + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + Q3SocketDevice( const Q3SocketDevice & ); + Q3SocketDevice &operator=( const Q3SocketDevice & ); +#endif +}; + +#endif // QT_NO_NETWORK + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SOCKETDEVICE_H diff --git a/qtinterface/qt4/Qt/q3sortedlist.h b/qtinterface/qt4/Qt/q3sortedlist.h new file mode 100644 index 0000000..8d582c2 --- /dev/null +++ b/qtinterface/qt4/Qt/q3sortedlist.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SORTEDLIST_H +#define Q3SORTEDLIST_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3SortedList : public Q3PtrList +{ +public: + Q3SortedList() {} + Q3SortedList( const Q3SortedList &l ) : Q3PtrList(l) {} + ~Q3SortedList() { this->clear(); } + Q3SortedList &operator=(const Q3SortedList &l) + { return (Q3SortedList&)Q3PtrList::operator=(l); } + + virtual int compareItems( Q3PtrCollection::Item s1, Q3PtrCollection::Item s2 ) + { if ( *((type*)s1) == *((type*)s2) ) return 0; return ( *((type*)s1) < *((type*)s2) ? -1 : 1 ); } +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SORTEDLIST_H diff --git a/qtinterface/qt4/Qt/q3sqlcursor.h b/qtinterface/qt4/Qt/q3sqlcursor.h new file mode 100644 index 0000000..03a7fc1 --- /dev/null +++ b/qtinterface/qt4/Qt/q3sqlcursor.h @@ -0,0 +1,167 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SQLCURSOR_H +#define Q3SQLCURSOR_H + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL + +class Q3SqlCursorPrivate; +class Q3SqlFieldInfo; + +class Q_COMPAT_EXPORT Q3SqlCursor : public QSqlRecord, public QSqlQuery +{ +public: + Q3SqlCursor(const QString & name = QString(), bool autopopulate = true, + QSqlDatabase db = QSqlDatabase()); + Q3SqlCursor(const Q3SqlCursor & other); + Q3SqlCursor& operator=(const Q3SqlCursor& other); + virtual ~Q3SqlCursor(); + + enum Mode { + ReadOnly = 0, + Insert = 1, + Update = 2, + Delete = 4, + Writable = 7 + }; + + QVariant value(int i) const; + inline QVariant value(const QString &name) const { return value(indexOf(name)); } + virtual void setValue(int i, const QVariant &val); + inline void setValue(const QString &name, const QVariant &val) { setValue(indexOf(name), val); } + virtual QSqlIndex primaryIndex(bool prime = true) const; + virtual QSqlIndex index(const QStringList& fieldNames) const; + QSqlIndex index(const QString& fieldName) const; + virtual void setPrimaryIndex(const QSqlIndex& idx); + + virtual void append(const Q3SqlFieldInfo& fieldInfo); + virtual void insert(int pos, const Q3SqlFieldInfo &fieldInfo); + virtual void remove(int pos); + virtual void clear(); + virtual void setGenerated(const QString& name, bool generated); + virtual void setGenerated(int i, bool generated); + + virtual QSqlRecord* editBuffer(bool copy = false); + virtual QSqlRecord* primeInsert(); + virtual QSqlRecord* primeUpdate(); + virtual QSqlRecord* primeDelete(); + virtual int insert(bool invalidate = true); + virtual int update(bool invalidate = true); + virtual int del(bool invalidate = true); + + virtual void setMode(int flags); + int mode() const; + virtual void setCalculated(const QString& name, bool calculated); + bool isCalculated(const QString& name) const; + virtual void setTrimmed(const QString& name, bool trim); + bool isTrimmed(const QString& name) const; + + bool isReadOnly() const; + bool canInsert() const; + bool canUpdate() const; + bool canDelete() const; + + bool select(); + bool select(const QSqlIndex& sort); + bool select(const QSqlIndex & filter, const QSqlIndex & sort); + virtual bool select(const QString & filter, const QSqlIndex & sort = QSqlIndex()); + + virtual void setSort(const QSqlIndex& sort); + QSqlIndex sort() const; + virtual void setFilter(const QString& filter); + QString filter() const; + virtual void setName(const QString& name, bool autopopulate = true); + QString name() const; + QString toString(const QString& prefix = QString(), + const QString& sep = QLatin1String(",")) const; + bool isNull(int i) const; + bool isNull(const QString& name) const; + virtual bool seek(int i, bool relative = false); + virtual bool next(); + inline bool previous() { return prev(); } + virtual bool prev(); + virtual bool first(); + virtual bool last(); + +protected: + virtual bool exec(const QString & sql); + + virtual QVariant calculateField(const QString& name); + virtual int update(const QString & filter, bool invalidate = true); + virtual int del(const QString & filter, bool invalidate = true); + + virtual QString toString(const QString& prefix, QSqlField* field, const QString& fieldSep) const; + virtual QString toString(QSqlRecord* rec, const QString& prefix, const QString& fieldSep, + const QString& sep) const; + virtual QString toString(const QSqlIndex& i, QSqlRecord* rec, const QString& prefix, + const QString& fieldSep, const QString& sep) const; + +private: + void sync(); + int apply(const QString& q, bool invalidate); + int applyPrepared(const QString& q, bool invalidate); + QSqlRecord& operator=(const QSqlRecord & list); + void append(const QSqlField& field); + + Q3SqlCursorPrivate* d; +}; + +#endif // QT_NO_SQL + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SQLCURSOR_H diff --git a/qtinterface/qt4/Qt/q3sqleditorfactory.h b/qtinterface/qt4/Qt/q3sqleditorfactory.h new file mode 100644 index 0000000..ef402dc --- /dev/null +++ b/qtinterface/qt4/Qt/q3sqleditorfactory.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SQLEDITORFACTORY_H +#define Q3SQLEDITORFACTORY_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL_EDIT_WIDGETS + +class QSqlField; + +class Q_COMPAT_EXPORT Q3SqlEditorFactory : public Q3EditorFactory +{ +public: + Q3SqlEditorFactory (QObject * parent = 0); + ~Q3SqlEditorFactory(); + virtual QWidget * createEditor(QWidget * parent, const QVariant & variant); + virtual QWidget * createEditor(QWidget * parent, const QSqlField * field); + + static Q3SqlEditorFactory * defaultFactory(); + static void installDefaultFactory(Q3SqlEditorFactory * factory); + +private: + Q_DISABLE_COPY(Q3SqlEditorFactory) +}; + +#endif // QT_NO_SQL_EDIT_WIDGETS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SQLEDITORFACTORY_H diff --git a/qtinterface/qt4/Qt/q3sqlfieldinfo.h b/qtinterface/qt4/Qt/q3sqlfieldinfo.h new file mode 100644 index 0000000..d0bdb6b --- /dev/null +++ b/qtinterface/qt4/Qt/q3sqlfieldinfo.h @@ -0,0 +1,167 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SQLFIELDINFO_H +#define Q3SQLFIELDINFO_H + +#ifndef QT_NO_SQL + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +/* Q3SqlFieldInfo Class + obsoleted, use QSqlField instead +*/ + +class Q_COMPAT_EXPORT Q3SqlFieldInfo +{ + // class is obsoleted, won't change anyways, + // so no d pointer + int req, len, prec, tID; + uint gen: 1; + uint trim: 1; + uint calc: 1; + QString nm; + QVariant::Type typ; + QVariant defValue; + +public: + Q3SqlFieldInfo(const QString& name = QString(), + QVariant::Type typ = QVariant::Invalid, + int required = -1, + int len = -1, + int prec = -1, + const QVariant& defValue = QVariant(), + int sqlType = 0, + bool generated = true, + bool trim = false, + bool calculated = false) : + req(required), len(len), prec(prec), tID(sqlType), + gen(generated), trim(trim), calc(calculated), + nm(name), typ(typ), defValue(defValue) {} + + virtual ~Q3SqlFieldInfo() {} + + Q3SqlFieldInfo(const QSqlField & other) + { + nm = other.name(); + typ = other.type(); + switch (other.requiredStatus()) { + case QSqlField::Unknown: req = -1; break; + case QSqlField::Required: req = 1; break; + case QSqlField::Optional: req = 0; break; + } + len = other.length(); + prec = other.precision(); + defValue = other.defaultValue(); + tID = other.typeID(); + gen = other.isGenerated(); + calc = false; + trim = false; + } + + bool operator==(const Q3SqlFieldInfo& f) const + { + return (nm == f.nm && + typ == f.typ && + req == f.req && + len == f.len && + prec == f.prec && + defValue == f.defValue && + tID == f.tID && + gen == f.gen && + trim == f.trim && + calc == f.calc); + } + + QSqlField toField() const + { QSqlField f(nm, typ); + f.setRequiredStatus(QSqlField::RequiredStatus(req)); + f.setLength(len); + f.setPrecision(prec); + f.setDefaultValue(defValue); + f.setSqlType(tID); + f.setGenerated(gen); + return f; + } + int isRequired() const + { return req; } + QVariant::Type type() const + { return typ; } + int length() const + { return len; } + int precision() const + { return prec; } + QVariant defaultValue() const + { return defValue; } + QString name() const + { return nm; } + int typeID() const + { return tID; } + bool isGenerated() const + { return gen; } + bool isTrim() const + { return trim; } + bool isCalculated() const + { return calc; } + + virtual void setTrim(bool trim) + { this->trim = trim; } + virtual void setGenerated(bool generated) + { gen = generated; } + virtual void setCalculated(bool calculated) + { calc = calculated; } + +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QT_NO_SQL + +#endif // Q3SQLFIELDINFO_H diff --git a/qtinterface/qt4/Qt/q3sqlform.h b/qtinterface/qt4/Qt/q3sqlform.h new file mode 100644 index 0000000..dc3ba58 --- /dev/null +++ b/qtinterface/qt4/Qt/q3sqlform.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SQLFORM_H +#define Q3SQLFORM_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL_FORM + +class QSqlField; +class QSqlRecord; +class Q3SqlEditorFactory; +class Q3SqlPropertyMap; +class QWidget; +class Q3SqlFormPrivate; + +class Q_COMPAT_EXPORT Q3SqlForm : public QObject +{ + Q_OBJECT +public: + Q3SqlForm(QObject * parent = 0); + ~Q3SqlForm(); + + virtual void insert(QWidget * widget, const QString& field); + virtual void remove(const QString& field); + int count() const; + + QWidget * widget(int i) const; + QSqlField * widgetToField(QWidget * widget) const; + QWidget * fieldToWidget(QSqlField * field) const; + + void installPropertyMap(Q3SqlPropertyMap * map); + + virtual void setRecord(QSqlRecord* buf); + +public Q_SLOTS: + virtual void readField(QWidget * widget); + virtual void writeField(QWidget * widget); + virtual void readFields(); + virtual void writeFields(); + + virtual void clear(); + virtual void clearValues(); + +protected: + virtual void insert(QWidget * widget, QSqlField * field); + virtual void remove(QWidget * widget); + void clearMap(); + +private: + Q_DISABLE_COPY(Q3SqlForm) + + virtual void sync(); + Q3SqlFormPrivate* d; +}; + +#endif // QT_NO_SQL_FORM + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SQLFORM_H diff --git a/qtinterface/qt4/Qt/q3sqlpropertymap.h b/qtinterface/qt4/Qt/q3sqlpropertymap.h new file mode 100644 index 0000000..96b5aea --- /dev/null +++ b/qtinterface/qt4/Qt/q3sqlpropertymap.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SQLPROPERTYMAP_H +#define Q3SQLPROPERTYMAP_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL_FORM + +class QWidget; +class Q3SqlPropertyMapPrivate; + +class Q_COMPAT_EXPORT Q3SqlPropertyMap +{ +public: + Q3SqlPropertyMap(); + virtual ~Q3SqlPropertyMap(); + + QVariant property(QWidget * widget); + virtual void setProperty(QWidget * widget, const QVariant & value); + + void insert(const QString & classname, const QString & property); + void remove(const QString & classname); + + static Q3SqlPropertyMap * defaultMap(); + static void installDefaultMap(Q3SqlPropertyMap * map); + +private: + Q_DISABLE_COPY(Q3SqlPropertyMap) + + Q3SqlPropertyMapPrivate* d; +}; + +#endif // QT_NO_SQL_FORM + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SQLPROPERTYMAP_H diff --git a/qtinterface/qt4/Qt/q3sqlrecordinfo.h b/qtinterface/qt4/Qt/q3sqlrecordinfo.h new file mode 100644 index 0000000..5c42201 --- /dev/null +++ b/qtinterface/qt4/Qt/q3sqlrecordinfo.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SQLRECORDINFO_H +#define Q3SQLRECORDINFO_H + +#include + +#ifndef QT_NO_SQL +# include +# include +# include +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL + +/* Q3SqlRecordInfo Class + This class is obsolete, use QSqlRecord instead. +*/ + +typedef Q3ValueList Q3SqlFieldInfoList; + +class Q_COMPAT_EXPORT Q3SqlRecordInfo: public Q3SqlFieldInfoList +{ +public: + Q3SqlRecordInfo(): Q3SqlFieldInfoList() {} + Q3SqlRecordInfo(const Q3SqlFieldInfoList& other): Q3SqlFieldInfoList(other) {} + Q3SqlRecordInfo(const QSqlRecord& other) + { + for (int i = 0; i < other.count(); ++i) + push_back(Q3SqlFieldInfo(other.field(i))); + } + + size_type contains(const QString& fieldName) const; + Q3SqlFieldInfo find(const QString& fieldName) const; + QSqlRecord toRecord() const; +}; + +inline Q3SqlRecordInfo::size_type Q3SqlRecordInfo::contains(const QString& fieldName) const +{ + size_type i = 0; + QString fName = fieldName.toUpper(); + + for(const_iterator it = begin(); it != end(); ++it) { + if ((*it).name().toUpper() == fName) { + ++i; + } + } + return i; +} + +inline Q3SqlFieldInfo Q3SqlRecordInfo::find(const QString& fieldName) const +{ + QString fName = fieldName.toUpper(); + for(const_iterator it = begin(); it != end(); ++it) { + if ((*it).name().toUpper() == fName) { + return *it; + } + } + return Q3SqlFieldInfo(); +} + +inline QSqlRecord Q3SqlRecordInfo::toRecord() const +{ + QSqlRecord buf; + for(const_iterator it = begin(); it != end(); ++it) { + buf.append((*it).toField()); + } + return buf; +} + +#endif // QT_NO_SQL + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SQLRECORDINFO_H diff --git a/qtinterface/qt4/Qt/q3sqlselectcursor.h b/qtinterface/qt4/Qt/q3sqlselectcursor.h new file mode 100644 index 0000000..8165a7e --- /dev/null +++ b/qtinterface/qt4/Qt/q3sqlselectcursor.h @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SQLSELECTCURSOR_H +#define Q3SQLSELECTCURSOR_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +#ifndef QT_NO_SQL + +class Q3SqlSelectCursorPrivate; + +class Q_COMPAT_EXPORT Q3SqlSelectCursor : public Q3SqlCursor +{ +public: + Q3SqlSelectCursor(const QString& query = QString(), QSqlDatabase db = QSqlDatabase()); + Q3SqlSelectCursor(const Q3SqlSelectCursor& other); + ~Q3SqlSelectCursor(); + bool exec(const QString& query); + bool select() { return Q3SqlCursor::select(); } + +protected: + QSqlIndex primaryIndex(bool = true) const { return QSqlIndex(); } + QSqlIndex index(const QStringList&) const { return QSqlIndex(); } + QSqlIndex index(const QString&) const { return QSqlIndex(); } + QSqlIndex index(const char*) const { return QSqlIndex(); } + void setPrimaryIndex(const QSqlIndex&) {} + void append(const Q3SqlFieldInfo&) {} + void insert(int, const Q3SqlFieldInfo&) {} + void remove(int) {} + void clear() {} + void setGenerated(const QString&, bool) {} + void setGenerated(int, bool) {} + QSqlRecord* editBuffer(bool = false) { return 0; } + QSqlRecord* primeInsert() { return 0; } + QSqlRecord* primeUpdate() { return 0; } + QSqlRecord* primeDelete() { return 0; } + int insert(bool = true) { return 0; } + int update(bool = true) { return 0; } + int del(bool = true) { return 0; } + void setMode(int) {} + + void setSort(const QSqlIndex&) {} + QSqlIndex sort() const { return QSqlIndex(); } + void setFilter(const QString&) {} + QString filter() const { return QString(); } + void setName(const QString&, bool = true) {} + QString name() const { return QString(); } + QString toString(const QString& = QString(), const QString& = QLatin1String(",")) const { return QString(); } + bool select(const QString &, const QSqlIndex& = QSqlIndex()); + +private: + void populateCursor(); + + Q3SqlSelectCursorPrivate * d; + +protected: +#if !defined(Q_NO_USING_KEYWORD) + using Q3SqlCursor::update; +#else + virtual int update(const QString & filter, bool invalidate = true) { return Q3SqlCursor::update(filter, invalidate); } +#endif +}; + +#endif // QT_NO_SQL + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SQLSELECTCURSOR_H diff --git a/qtinterface/qt4/Qt/q3strlist.h b/qtinterface/qt4/Qt/q3strlist.h new file mode 100644 index 0000000..91c6a78 --- /dev/null +++ b/qtinterface/qt4/Qt/q3strlist.h @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3STRLIST_H +#define Q3STRLIST_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#if defined(qdoc) +class Q3StrListIterator : public Q3PtrListIterator +{ +}; +#else +typedef Q3PtrListIterator Q3StrListIterator; +#endif + +class Q_COMPAT_EXPORT Q3StrList : public Q3PtrList +{ +public: + Q3StrList( bool deepCopies=true ) { dc = deepCopies; del_item = deepCopies; } + Q3StrList( const Q3StrList & ); + ~Q3StrList() { clear(); } + Q3StrList& operator=( const Q3StrList & ); + Q3StrList(const QList &list) { + for (int i = 0; i < list.size(); ++i) + append(list.at(i).constData()); + } + + Q3StrList &operator =(const QList &list) { + clear(); + for (int i = 0; i < list.size(); ++i) + append(list.at(i).constData()); + return *this; + } + + operator QList() const { + QList list; + for (Q3PtrListStdIterator it = begin(); it != end(); ++it) + list.append(QByteArray(*it)); + return list; + } + +private: + Q3PtrCollection::Item newItem( Q3PtrCollection::Item d ) { return dc ? qstrdup( (const char*)d ) : d; } + void deleteItem( Q3PtrCollection::Item d ) { if ( del_item ) delete[] (char*)d; } + int compareItems( Q3PtrCollection::Item s1, Q3PtrCollection::Item s2 ) { return qstrcmp((const char*)s1, + (const char*)s2); } +#ifndef QT_NO_DATASTREAM + QDataStream &read( QDataStream &s, Q3PtrCollection::Item &d ) + { s >> (char *&)d; return s; } + QDataStream &write( QDataStream &s, Q3PtrCollection::Item d ) const + { return s << (const char *)d; } +#endif + bool dc; +}; + + +class Q_COMPAT_EXPORT Q3StrIList : public Q3StrList // case insensitive string list +{ +public: + Q3StrIList( bool deepCopies=true ) : Q3StrList( deepCopies ) {} + ~Q3StrIList() { clear(); } +private: + int compareItems( Q3PtrCollection::Item s1, Q3PtrCollection::Item s2 ) + { return qstricmp((const char*)s1, + (const char*)s2); } +}; + + +inline Q3StrList & Q3StrList::operator=( const Q3StrList &strList ) +{ + clear(); + dc = strList.dc; + del_item = dc; + Q3PtrList::operator=( strList ); + return *this; +} + +inline Q3StrList::Q3StrList( const Q3StrList &strList ) + : Q3PtrList( strList ) +{ + dc = false; + operator=( strList ); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3STRLIST_H diff --git a/qtinterface/qt4/Qt/q3strvec.h b/qtinterface/qt4/Qt/q3strvec.h new file mode 100644 index 0000000..e66b2d6 --- /dev/null +++ b/qtinterface/qt4/Qt/q3strvec.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3STRVEC_H +#define Q3STRVEC_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3StrVec : public Q3PtrVector +{ +public: + Q3StrVec() { dc = true; } + Q3StrVec( uint size, bool deepc = true ) : Q3PtrVector(size) {dc=deepc;} + ~Q3StrVec() { clear(); } +private: + Item newItem( Item d ) { return dc ? qstrdup( (const char*)d ) : d; } + void deleteItem( Item d ) { if ( dc ) delete[] (char*)d; } + int compareItems( Item s1, Item s2 ) + { return qstrcmp((const char*)s1, + (const char*)s2); } +#ifndef QT_NO_DATASTREAM + QDataStream &read( QDataStream &s, Item &d ) + { s >> (char *&)d; return s; } + QDataStream &write( QDataStream &s, Item d ) const + { return s << (const char*)d; } +#endif + bool dc; +}; + + +class Q3StrIVec : public Q3StrVec // case insensitive string vec +{ +public: + Q3StrIVec() {} + Q3StrIVec( uint size, bool dc = true ) : Q3StrVec( size, dc ) {} + ~Q3StrIVec() { clear(); } +private: + int compareItems( Item s1, Item s2 ) + { return qstricmp((const char*)s1, + (const char*)s2); } +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3STRVEC_H diff --git a/qtinterface/qt4/Qt/q3stylesheet.h b/qtinterface/qt4/Qt/q3stylesheet.h new file mode 100644 index 0000000..dbbf03b --- /dev/null +++ b/qtinterface/qt4/Qt/q3stylesheet.h @@ -0,0 +1,235 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3STYLESHEET_H +#define Q3STYLESHEET_H + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_RICHTEXT + +class Q3StyleSheet; +class Q3TextDocument; +template class QMap; +class Q3StyleSheetItemData; + +class Q_COMPAT_EXPORT Q3StyleSheetItem +{ +public: + Q3StyleSheetItem(Q3StyleSheet* parent, const QString& name); + Q3StyleSheetItem(const Q3StyleSheetItem &); + ~Q3StyleSheetItem(); + + Q3StyleSheetItem& operator=(const Q3StyleSheetItem& other); + + QString name() const; + + Q3StyleSheet* styleSheet(); + const Q3StyleSheet* styleSheet() const; + + enum AdditionalStyleValues { Undefined = -1 }; + + enum DisplayMode { + DisplayBlock, + DisplayInline, + DisplayListItem, + DisplayNone, + DisplayModeUndefined = -1 + }; + + DisplayMode displayMode() const; + void setDisplayMode(DisplayMode m); + + int alignment() const; + void setAlignment(int f); + + enum VerticalAlignment { + VAlignBaseline, + VAlignSub, + VAlignSuper + }; + + VerticalAlignment verticalAlignment() const; + void setVerticalAlignment(VerticalAlignment valign); + + int fontWeight() const; + void setFontWeight(int w); + + int logicalFontSize() const; + void setLogicalFontSize(int s); + + int logicalFontSizeStep() const; + void setLogicalFontSizeStep(int s); + + int fontSize() const; + void setFontSize(int s); + + QString fontFamily() const; + void setFontFamily(const QString&); + + int numberOfColumns() const; + void setNumberOfColumns(int ncols); + + QColor color() const; + void setColor(const QColor &); + + bool fontItalic() const; + void setFontItalic(bool); + bool definesFontItalic() const; + + bool fontUnderline() const; + void setFontUnderline(bool); + bool definesFontUnderline() const; + + bool fontStrikeOut() const; + void setFontStrikeOut(bool); + bool definesFontStrikeOut() const; + + bool isAnchor() const; + void setAnchor(bool anc); + + enum WhiteSpaceMode { + WhiteSpaceNormal, + WhiteSpacePre, + WhiteSpaceNoWrap, + WhiteSpaceModeUndefined = -1 + }; + WhiteSpaceMode whiteSpaceMode() const; + void setWhiteSpaceMode(WhiteSpaceMode m); + + enum Margin { + MarginLeft, + MarginRight, + MarginTop, + MarginBottom, + MarginFirstLine, + MarginAll, + MarginVertical, + MarginHorizontal, + MarginUndefined = -1 + }; + + int margin(Margin m) const; + void setMargin(Margin, int); + + enum ListStyle { + ListDisc, + ListCircle, + ListSquare, + ListDecimal, + ListLowerAlpha, + ListUpperAlpha, + ListStyleUndefined = -1 + }; + + ListStyle listStyle() const; + void setListStyle(ListStyle); + + QString contexts() const; + void setContexts(const QString&); + bool allowedInContext(const Q3StyleSheetItem*) const; + + bool selfNesting() const; + void setSelfNesting(bool); + + void setLineSpacing(int ls); + int lineSpacing() const; + +private: + void init(); + Q3StyleSheetItemData* d; +}; + +#ifndef QT_NO_TEXTCUSTOMITEM +class Q3TextCustomItem; +#endif + +class Q_COMPAT_EXPORT Q3StyleSheet : public QObject +{ + Q_OBJECT +public: + Q3StyleSheet(QObject *parent=0, const char *name=0); + virtual ~Q3StyleSheet(); + + static Q3StyleSheet* defaultSheet(); + static void setDefaultSheet(Q3StyleSheet*); + + + Q3StyleSheetItem* item(const QString& name); + const Q3StyleSheetItem* item(const QString& name) const; + + void insert(Q3StyleSheetItem* item); + + static QString escape(const QString&); + static QString convertFromPlainText(const QString&, + Q3StyleSheetItem::WhiteSpaceMode mode = Q3StyleSheetItem::WhiteSpacePre); + static bool mightBeRichText(const QString&); + + virtual void scaleFont(QFont& font, int logicalSize) const; + + virtual void error(const QString&) const; + +private: + Q_DISABLE_COPY(Q3StyleSheet) + + void init(); + QHash styles; + Q3StyleSheetItem* nullstyle; +}; + +#endif // QT_NO_RICHTEXT + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3STYLESHEET_H diff --git a/qtinterface/qt4/Qt/q3syntaxhighlighter.h b/qtinterface/qt4/Qt/q3syntaxhighlighter.h new file mode 100644 index 0000000..2cf5a0a --- /dev/null +++ b/qtinterface/qt4/Qt/q3syntaxhighlighter.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3SYNTAXHIGHLIGHTER_H +#define Q3SYNTAXHIGHLIGHTER_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3TextEdit; +class Q3SyntaxHighlighterInternal; +class Q3SyntaxHighlighterPrivate; +class Q3TextParagraph; + +class Q_COMPAT_EXPORT Q3SyntaxHighlighter +{ + friend class Q3SyntaxHighlighterInternal; + +public: + Q3SyntaxHighlighter(Q3TextEdit *textEdit); + virtual ~Q3SyntaxHighlighter(); + + virtual int highlightParagraph(const QString &text, int endStateOfLastPara) = 0; + + void setFormat(int start, int count, const QFont &font, const QColor &color); + void setFormat(int start, int count, const QColor &color); + void setFormat(int start, int count, const QFont &font); + Q3TextEdit *textEdit() const { return edit; } + + void rehighlight(); + + int currentParagraph() const; + +private: + Q3TextParagraph *para; + Q3TextEdit *edit; + Q3SyntaxHighlighterPrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3SYNTAXHIGHLIGHTER_H diff --git a/qtinterface/qt4/Qt/q3tabdialog.h b/qtinterface/qt4/Qt/q3tabdialog.h new file mode 100644 index 0000000..ec3011c --- /dev/null +++ b/qtinterface/qt4/Qt/q3tabdialog.h @@ -0,0 +1,143 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3TABDIALOG_H +#define Q3TABDIALOG_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class QTabBar; +class QTab; +class Q3TabDialogPrivate; + +class Q_COMPAT_EXPORT Q3TabDialog : public QDialog +{ + Q_OBJECT +public: + Q3TabDialog(QWidget* parent=0, const char* name=0, bool modal=false, Qt::WindowFlags f=0); + ~Q3TabDialog(); + + void show(); + void setFont(const QFont & font); + + void addTab(QWidget *, const QString &); + void addTab(QWidget *child, const QIcon& iconset, const QString &label); + + void insertTab(QWidget *, const QString &, int index = -1); + void insertTab(QWidget *child, const QIcon& iconset, const QString &label, int index = -1); + + void changeTab(QWidget *, const QString &); + void changeTab(QWidget *child, const QIcon& iconset, const QString &label); + + bool isTabEnabled( QWidget *) const; + void setTabEnabled(QWidget *, bool); + bool isTabEnabled(const char*) const; // compatibility + void setTabEnabled(const char*, bool); // compatibility + + void showPage(QWidget *); + void removePage(QWidget *); + QString tabLabel(QWidget *); + + QWidget * currentPage() const; + + void setDefaultButton(const QString &text); + void setDefaultButton(); + bool hasDefaultButton() const; + + void setHelpButton(const QString &text); + void setHelpButton(); + bool hasHelpButton() const; + + void setCancelButton(const QString &text); + void setCancelButton(); + bool hasCancelButton() const; + + void setApplyButton(const QString &text); + void setApplyButton(); + bool hasApplyButton() const; + +#ifndef qdoc + void setOKButton(const QString &text = QString()); +#endif + void setOkButton(const QString &text); + void setOkButton(); + bool hasOkButton() const; + +protected: + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + void showEvent(QShowEvent *); + void styleChange(QStyle&); + void setTabBar(QTabBar*); + QTabBar* tabBar() const; + +Q_SIGNALS: + void aboutToShow(); + + void applyButtonPressed(); + void cancelButtonPressed(); + void defaultButtonPressed(); + void helpButtonPressed(); + + void currentChanged(QWidget *); + void selected(const QString&); // obsolete + +private: + void setSizes(); + void setUpLayout(); + + Q3TabDialogPrivate *d; + + Q_DISABLE_COPY(Q3TabDialog) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3TABDIALOG_H diff --git a/qtinterface/qt4/Qt/q3table.h b/qtinterface/qt4/Qt/q3table.h new file mode 100644 index 0000000..70520b7 --- /dev/null +++ b/qtinterface/qt4/Qt/q3table.h @@ -0,0 +1,548 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3TABLE_H +#define Q3TABLE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3Support) + +class Q3TableHeader; +class QValidator; +class Q3Table; +class QPaintEvent; +class QTimer; +class QResizeEvent; +class Q3ComboBox; +class QCheckBox; +class Q3DragObject; +class QColorGroup; + +struct Q3TablePrivate; +struct Q3TableHeaderPrivate; + + +class Q_COMPAT_EXPORT Q3TableSelection +{ +public: + Q3TableSelection(); + Q3TableSelection(int start_row, int start_col, int end_row, int end_col); + void init(int row, int col); + void expandTo(int row, int col); + bool operator==(const Q3TableSelection &s) const; + bool operator!=(const Q3TableSelection &s) const { return !(operator==(s)); } + + int topRow() const { return tRow; } + int bottomRow() const { return bRow; } + int leftCol() const { return lCol; } + int rightCol() const { return rCol; } + int anchorRow() const { return aRow; } + int anchorCol() const { return aCol; } + int numRows() const; + int numCols() const; + + bool isActive() const { return active; } + bool isEmpty() const { return numRows() == 0; } + +private: + uint active : 1; + uint inited : 1; + int tRow, lCol, bRow, rCol; + int aRow, aCol; +}; + +class Q_COMPAT_EXPORT Q3TableItem +{ + friend class Q3Table; + +public: + enum EditType { Never, OnTyping, WhenCurrent, Always }; + + Q3TableItem(Q3Table *table, EditType et); + Q3TableItem(Q3Table *table, EditType et, const QString &text); + Q3TableItem(Q3Table *table, EditType et, const QString &text, + const QPixmap &p); + virtual ~Q3TableItem(); + + virtual QPixmap pixmap() const; + virtual QString text() const; + virtual void setPixmap(const QPixmap &p); + virtual void setText(const QString &t); + Q3Table *table() const { return t; } + + virtual int alignment() const; + virtual void setWordWrap(bool b); + bool wordWrap() const; + + EditType editType() const; + virtual QWidget *createEditor() const; + virtual void setContentFromEditor(QWidget *w); + virtual void setReplaceable(bool); + bool isReplaceable() const; + + virtual QString key() const; + virtual QSize sizeHint() const; + + virtual void setSpan(int rs, int cs); + int rowSpan() const; + int colSpan() const; + + virtual void setRow(int r); + virtual void setCol(int c); + int row() const; + int col() const; + + virtual void paint(QPainter *p, const QColorGroup &cg, + const QRect &cr, bool selected); + + void updateEditor(int oldRow, int oldCol); + + virtual void setEnabled(bool b); + bool isEnabled() const; + + virtual int rtti() const; + static int RTTI; + +private: + QString txt; + QPixmap pix; + Q3Table *t; + EditType edType; + uint wordwrap : 1; + uint tcha : 1; + uint enabled : 1; + int rw, cl; + int rowspan, colspan; +}; + +class Q_COMPAT_EXPORT Q3ComboTableItem : public Q3TableItem +{ +public: + Q3ComboTableItem(Q3Table *table, const QStringList &list, bool editable = false); + ~Q3ComboTableItem(); + virtual QWidget *createEditor() const; + virtual void setContentFromEditor(QWidget *w); + virtual void paint(QPainter *p, const QColorGroup &cg, + const QRect &cr, bool selected); + virtual void setCurrentItem(int i); + virtual void setCurrentItem(const QString &i); + int currentItem() const; + QString currentText() const; + int count() const; +#if !defined(Q_NO_USING_KEYWORD) + using Q3TableItem::text; +#else + inline QString text() const { return Q3TableItem::text(); } +#endif + QString text(int i) const; + virtual void setEditable(bool b); + bool isEditable() const; + virtual void setStringList(const QStringList &l); + + int rtti() const; + static int RTTI; + + QSize sizeHint() const; + +private: + Q3ComboBox *cb; + QStringList entries; + int current; + bool edit; + static Q3ComboBox *fakeCombo; + static QWidget *fakeComboWidget; + static int fakeRef; + +}; + +class Q_COMPAT_EXPORT Q3CheckTableItem : public Q3TableItem +{ +public: + Q3CheckTableItem(Q3Table *table, const QString &txt); + void setText(const QString &t); + virtual QWidget *createEditor() const; + virtual void setContentFromEditor(QWidget *w); + virtual void paint(QPainter *p, const QColorGroup &cg, + const QRect &cr, bool selected); + virtual void setChecked(bool b); + bool isChecked() const; + + int rtti() const; + static int RTTI; + + QSize sizeHint() const; + +private: + QCheckBox *cb; + bool checked; + +}; + +class Q_COMPAT_EXPORT Q3Table : public Q3ScrollView +{ + Q_OBJECT + Q_ENUMS(SelectionMode FocusStyle) + Q_PROPERTY(int numRows READ numRows WRITE setNumRows) + Q_PROPERTY(int numCols READ numCols WRITE setNumCols) + Q_PROPERTY(bool showGrid READ showGrid WRITE setShowGrid) + Q_PROPERTY(bool rowMovingEnabled READ rowMovingEnabled WRITE setRowMovingEnabled) + Q_PROPERTY(bool columnMovingEnabled READ columnMovingEnabled WRITE setColumnMovingEnabled) + Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) + Q_PROPERTY(bool sorting READ sorting WRITE setSorting) + Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) + Q_PROPERTY(FocusStyle focusStyle READ focusStyle WRITE setFocusStyle) + Q_PROPERTY(int numSelections READ numSelections) + + friend class Q3TableHeader; + friend class Q3ComboTableItem; + friend class Q3CheckTableItem; + friend class Q3TableItem; + +public: + Q3Table(QWidget* parent=0, const char* name=0); + Q3Table(int numRows, int numCols, + QWidget* parent=0, const char* name=0); + ~Q3Table(); + + Q3Header *horizontalHeader() const; + Q3Header *verticalHeader() const; + + enum SelectionMode { Single, Multi, SingleRow, MultiRow, NoSelection }; + virtual void setSelectionMode(SelectionMode mode); + SelectionMode selectionMode() const; + + virtual void setItem(int row, int col, Q3TableItem *item); + virtual void setText(int row, int col, const QString &text); + virtual void setPixmap(int row, int col, const QPixmap &pix); + virtual Q3TableItem *item(int row, int col) const; + virtual QString text(int row, int col) const; + virtual QPixmap pixmap(int row, int col) const; + virtual void clearCell(int row, int col); + + virtual QRect cellGeometry(int row, int col) const; + virtual int columnWidth(int col) const; + virtual int rowHeight(int row) const; + virtual int columnPos(int col) const; + virtual int rowPos(int row) const; + virtual int columnAt(int x) const; + virtual int rowAt(int y) const; + + virtual int numRows() const; + virtual int numCols() const; + + void updateCell(int row, int col); + + bool eventFilter(QObject * o, QEvent *); + + int currentRow() const { return curRow; } + int currentColumn() const { return curCol; } + void ensureCellVisible(int row, int col); + + bool isSelected(int row, int col) const; + bool isRowSelected(int row, bool full = false) const; + bool isColumnSelected(int col, bool full = false) const; + int numSelections() const; + Q3TableSelection selection(int num) const; + virtual int addSelection(const Q3TableSelection &s); + virtual void removeSelection(const Q3TableSelection &s); + virtual void removeSelection(int num); + virtual int currentSelection() const; + + void selectCells(int start_row, int start_col, int end_row, int end_col); + virtual void selectRow(int row); + virtual void selectColumn(int col); + + bool showGrid() const; + + QVariant inputMethodQuery(Qt::InputMethodQuery query) const; + + bool columnMovingEnabled() const; + bool rowMovingEnabled() const; + + virtual void sortColumn(int col, bool ascending = true, + bool wholeRows = false); + bool sorting() const; + + virtual void takeItem(Q3TableItem *i); + + virtual void setCellWidget(int row, int col, QWidget *e); + virtual QWidget *cellWidget(int row, int col) const; + virtual void clearCellWidget(int row, int col); + + virtual QRect cellRect(int row, int col) const; + + virtual void paintCell(QPainter *p, int row, int col, + const QRect &cr, bool selected); + virtual void paintCell(QPainter *p, int row, int col, + const QRect &cr, bool selected, const QColorGroup &cg); + virtual void paintFocus(QPainter *p, const QRect &r); + QSize sizeHint() const; + + bool isReadOnly() const; + bool isRowReadOnly(int row) const; + bool isColumnReadOnly(int col) const; + + void setEnabled(bool b); + + void repaintSelections(); + + enum FocusStyle { FollowStyle, SpreadSheet }; + virtual void setFocusStyle(FocusStyle fs); + FocusStyle focusStyle() const; + + void updateHeaderStates(); + + bool isRowHidden(int row) const; + bool isColumnHidden(int col) const; + bool isColumnStretchable(int col) const; + bool isRowStretchable(int row) const; + bool dragEnabled() const; + +public Q_SLOTS: + virtual void setNumRows(int r); + virtual void setNumCols(int r); + virtual void setShowGrid(bool b); + virtual void hideRow(int row); + virtual void hideColumn(int col); + virtual void showRow(int row); + virtual void showColumn(int col); + + virtual void setColumnWidth(int col, int w); + virtual void setRowHeight(int row, int h); + + virtual void adjustColumn(int col); + virtual void adjustRow(int row); + + virtual void setColumnStretchable(int col, bool stretch); + virtual void setRowStretchable(int row, bool stretch); + virtual void setSorting(bool b); + virtual void swapRows(int row1, int row2, bool swapHeader = false); + virtual void swapColumns(int col1, int col2, bool swapHeader = false); + virtual void swapCells(int row1, int col1, int row2, int col2); + + virtual void setLeftMargin(int m); + virtual void setTopMargin(int m); + virtual void setCurrentCell(int row, int col); + void clearSelection(bool repaint = true); + virtual void setColumnMovingEnabled(bool b); + virtual void setRowMovingEnabled(bool b); + + virtual void setReadOnly(bool b); + virtual void setRowReadOnly(int row, bool ro); + virtual void setColumnReadOnly(int col, bool ro); + + virtual void setDragEnabled(bool b); + + virtual void insertRows(int row, int count = 1); + virtual void insertColumns(int col, int count = 1); + virtual void removeRow(int row); + virtual void removeRows(const Q3MemArray &rows); + virtual void removeColumn(int col); + virtual void removeColumns(const Q3MemArray &cols); + + virtual void editCell(int row, int col, bool replace = false); + + void setRowLabels(const QStringList &labels); + void setColumnLabels(const QStringList &labels); + +protected: + enum EditMode { NotEditing, Editing, Replacing }; + void drawContents(QPainter *p, int cx, int cy, int cw, int ch); + void contentsMousePressEvent(QMouseEvent*); + void contentsMouseMoveEvent(QMouseEvent*); + void contentsMouseDoubleClickEvent(QMouseEvent*); + void contentsMouseReleaseEvent(QMouseEvent*); + void contentsContextMenuEvent(QContextMenuEvent * e); + void keyPressEvent(QKeyEvent*); + void focusInEvent(QFocusEvent*); + void focusOutEvent(QFocusEvent*); + void viewportResizeEvent(QResizeEvent *); + void showEvent(QShowEvent *e); + void paintEvent(QPaintEvent *e); + void setEditMode(EditMode mode, int row, int col); +#ifndef QT_NO_DRAGANDDROP + virtual void contentsDragEnterEvent(QDragEnterEvent *e); + virtual void contentsDragMoveEvent(QDragMoveEvent *e); + virtual void contentsDragLeaveEvent(QDragLeaveEvent *e); + virtual void contentsDropEvent(QDropEvent *e); + virtual Q3DragObject *dragObject(); + virtual void startDrag(); +#endif + + virtual void paintEmptyArea(QPainter *p, int cx, int cy, int cw, int ch); + virtual void activateNextCell(); + virtual QWidget *createEditor(int row, int col, bool initFromCell) const; + virtual void setCellContentFromEditor(int row, int col); + virtual QWidget *beginEdit(int row, int col, bool replace); + virtual void endEdit(int row, int col, bool accept, bool replace); + + virtual void resizeData(int len); + virtual void insertWidget(int row, int col, QWidget *w); + int indexOf(int row, int col) const; + + void windowActivationChange(bool); + bool isEditing() const; + EditMode editMode() const; + int currEditRow() const; + int currEditCol() const; + +protected Q_SLOTS: + virtual void columnWidthChanged(int col); + virtual void rowHeightChanged(int row); + virtual void columnIndexChanged(int section, int fromIndex, int toIndex); + virtual void rowIndexChanged(int section, int fromIndex, int toIndex); + virtual void columnClicked(int col); + +Q_SIGNALS: + void currentChanged(int row, int col); + void clicked(int row, int col, int button, const QPoint &mousePos); + void doubleClicked(int row, int col, int button, const QPoint &mousePos); + void pressed(int row, int col, int button, const QPoint &mousePos); + void selectionChanged(); + void valueChanged(int row, int col); + void contextMenuRequested(int row, int col, const QPoint &pos); +#ifndef QT_NO_DRAGANDDROP + void dropped(QDropEvent *e); +#endif + +private Q_SLOTS: + void doAutoScroll(); + void doValueChanged(); + void updateGeometriesSlot(); + +private: + void contentsMousePressEventEx(QMouseEvent*); + void drawContents(QPainter*); + void updateGeometries(); + void repaintSelections(Q3TableSelection *oldSelection, + Q3TableSelection *newSelection, + bool updateVertical = true, + bool updateHorizontal = true); + QRect rangeGeometry(int topRow, int leftCol, + int bottomRow, int rightCol, bool &optimize); + void fixRow(int &row, int y); + void fixCol(int &col, int x); + + void init(int numRows, int numCols); + QSize tableSize() const; + void repaintCell(int row, int col); + void contentsToViewport2(int x, int y, int& vx, int& vy); + QPoint contentsToViewport2(const QPoint &p); + void viewportToContents2(int vx, int vy, int& x, int& y); + QPoint viewportToContents2(const QPoint &p); + + void updateRowWidgets(int row); + void updateColWidgets(int col); + bool isSelected(int row, int col, bool includeCurrent) const; + void setCurrentCell(int row, int col, bool updateSelections, bool ensureVisible = false); + void fixCell(int &row, int &col, int key); + void delayedUpdateGeometries(); + struct TableWidget + { + TableWidget(QWidget *w, int r, int c) : wid(w), row(r), col (c) {} + QWidget *wid; + int row, col; + }; + void saveContents(Q3PtrVector &tmp, + Q3PtrVector &tmp2); + void updateHeaderAndResizeContents(Q3TableHeader *header, + int num, int colRow, + int width, bool &updateBefore); + void restoreContents(Q3PtrVector &tmp, + Q3PtrVector &tmp2); + void finishContentsResze(bool updateBefore); + +private: + Q3PtrVector contents; + Q3PtrVector widgets; + int curRow; + int curCol; + Q3TableHeader *leftHeader, *topHeader; + EditMode edMode; + int editCol, editRow; + Q3PtrList selections; + Q3TableSelection *currentSel; + QTimer *autoScrollTimer; + int lastSortCol; + bool sGrid : 1; + bool mRows : 1; + bool mCols : 1; + bool asc : 1; + bool doSort : 1; + bool unused : 1; + bool readOnly : 1; + bool shouldClearSelection : 1; + bool dEnabled : 1; + bool context_menu : 1; + bool drawActiveSelection : 1; + bool was_visible : 1; + SelectionMode selMode; + int pressedRow, pressedCol; + Q3TablePrivate *d; + Q3IntDict roRows; + Q3IntDict roCols; + int startDragRow; + int startDragCol; + QPoint dragStartPos; + int oldCurrentRow, oldCurrentCol; + FocusStyle focusStl; + + Q_DISABLE_COPY(Q3Table) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3TABLE_H diff --git a/qtinterface/qt4/Qt/q3textbrowser.h b/qtinterface/qt4/Qt/q3textbrowser.h new file mode 100644 index 0000000..d6c015d --- /dev/null +++ b/qtinterface/qt4/Qt/q3textbrowser.h @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3TEXTBROWSER_H +#define Q3TEXTBROWSER_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_TEXTBROWSER + +class Q3TextBrowserData; + +class Q_COMPAT_EXPORT Q3TextBrowser : public Q3TextEdit +{ + Q_OBJECT + Q_PROPERTY(QString source READ source WRITE setSource) + + friend class Q3TextEdit; + +public: + Q3TextBrowser(QWidget* parent=0, const char* name=0); + ~Q3TextBrowser(); + + QString source() const; + +public Q_SLOTS: + virtual void setSource(const QString& name); + virtual void backward(); + virtual void forward(); + virtual void home(); + virtual void reload(); + void setText(const QString &txt) { setText(txt, QString()); } + virtual void setText(const QString &txt, const QString &context); + +Q_SIGNALS: + void backwardAvailable(bool); + void forwardAvailable(bool); + void sourceChanged(const QString&); + void highlighted(const QString&); + void linkClicked(const QString&); + void anchorClicked(const QString&, const QString&); + +protected: + void keyPressEvent(QKeyEvent * e); + +private: + Q_DISABLE_COPY(Q3TextBrowser) + + void popupDetail(const QString& contents, const QPoint& pos); + bool linksEnabled() const { return true; } + void emitHighlighted(const QString &s); + void emitLinkClicked(const QString &s); + Q3TextBrowserData *d; +}; + +#endif // QT_NO_TEXTBROWSER + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3TEXTBROWSER_H diff --git a/qtinterface/qt4/Qt/q3textedit.h b/qtinterface/qt4/Qt/q3textedit.h new file mode 100644 index 0000000..2f1cc4c --- /dev/null +++ b/qtinterface/qt4/Qt/q3textedit.h @@ -0,0 +1,613 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3TEXTEDIT_H +#define Q3TEXTEDIT_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_TEXTEDIT +// uncomment below to enable optimization mode - also uncomment the +// optimDoAutoScroll() private slot since moc ignores #ifdefs.. +#define QT_TEXTEDIT_OPTIMIZATION + +class QPainter; +class Q3TextDocument; +class Q3TextCursor; +class QKeyEvent; +class QResizeEvent; +class QMouseEvent; +class QTimer; +class Q3TextString; +class QTextCommand; +class Q3TextParagraph; +class Q3TextFormat; +class QFont; +class QColor; +class Q3TextEdit; +class QTextBrowser; +class Q3TextString; +struct QUndoRedoInfoPrivate; +class Q3PopupMenu; +class Q3TextEditPrivate; +class Q3SyntaxHighlighter; +class Q3TextDrag; + +#ifdef QT_TEXTEDIT_OPTIMIZATION +class Q3TextEditOptimPrivate +{ +public: + // Note: no left-tag has any value for leftTag or parent, and + // no right-tag has any formatting flags set. + enum TagType { Color = 0, Format = 1 }; + struct Tag { + TagType type:2; + bool bold:1; + bool italic:1; + bool underline:1; + int line; + int index; + Tag * leftTag; // ptr to left-tag in a left-right tag pair + Tag * parent; // ptr to parent left-tag in a nested tag + Tag * prev; + Tag * next; + QString tag; + }; + Q3TextEditOptimPrivate() + { + len = numLines = maxLineWidth = 0; + selStart.line = selStart.index = -1; + selEnd.line = selEnd.index = -1; + search.line = search.index = 0; + tags = lastTag = 0; + } + void clearTags() + { + Tag * itr = tags; + while (tags) { + itr = tags; + tags = tags->next; + delete itr; + } + tags = lastTag = 0; + tagIndex.clear(); + } + ~Q3TextEditOptimPrivate() + { + clearTags(); + } + int len; + int numLines; + int maxLineWidth; + struct Selection { + int line; + int index; + }; + Selection selStart, selEnd, search; + Tag * tags, * lastTag; + QMap lines; + QMap tagIndex; +}; +#endif + +class Q_COMPAT_EXPORT Q3TextEdit : public Q3ScrollView +{ + friend class Q3TextBrowser; + friend class Q3SyntaxHighlighter; + + Q_OBJECT + Q_ENUMS(WordWrap WrapPolicy) + Q_FLAGS(AutoFormattingFlag) + Q_PROPERTY(Qt::TextFormat textFormat READ textFormat WRITE setTextFormat) + Q_PROPERTY(QString text READ text WRITE setText) + Q_PROPERTY(QBrush paper READ paper WRITE setPaper) + Q_PROPERTY(bool linkUnderline READ linkUnderline WRITE setLinkUnderline) + Q_PROPERTY(QString documentTitle READ documentTitle) + Q_PROPERTY(int length READ length) + Q_PROPERTY(WordWrap wordWrap READ wordWrap WRITE setWordWrap) + Q_PROPERTY(int wrapColumnOrWidth READ wrapColumnOrWidth WRITE setWrapColumnOrWidth) + Q_PROPERTY(WrapPolicy wrapPolicy READ wrapPolicy WRITE setWrapPolicy) + Q_PROPERTY(bool hasSelectedText READ hasSelectedText) + Q_PROPERTY(QString selectedText READ selectedText) + Q_PROPERTY(int undoDepth READ undoDepth WRITE setUndoDepth) + Q_PROPERTY(bool overwriteMode READ isOverwriteMode WRITE setOverwriteMode) + Q_PROPERTY(bool modified READ isModified WRITE setModified DESIGNABLE false) + Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) + Q_PROPERTY(bool undoRedoEnabled READ isUndoRedoEnabled WRITE setUndoRedoEnabled) + Q_PROPERTY(int tabStopWidth READ tabStopWidth WRITE setTabStopWidth) + Q_PROPERTY(bool tabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus) + Q_PROPERTY(AutoFormattingFlag autoFormatting READ autoFormatting WRITE setAutoFormatting) + +public: + enum WordWrap { + NoWrap, + WidgetWidth, + FixedPixelWidth, + FixedColumnWidth + }; + + enum WrapPolicy { + AtWordBoundary, + AtWhiteSpace = AtWordBoundary, // AtWhiteSpace is deprecated + Anywhere, + AtWordOrDocumentBoundary + }; + + enum AutoFormattingFlag { + AutoNone = 0, + AutoBulletList = 0x00000001, + AutoAll = 0xffffffff + }; + + Q_DECLARE_FLAGS(AutoFormatting, AutoFormattingFlag) + + enum KeyboardAction { + ActionBackspace, + ActionDelete, + ActionReturn, + ActionKill, + ActionWordBackspace, + ActionWordDelete + }; + + enum CursorAction { + MoveBackward, + MoveForward, + MoveWordBackward, + MoveWordForward, + MoveUp, + MoveDown, + MoveLineStart, + MoveLineEnd, + MoveHome, + MoveEnd, + MovePgUp, + MovePgDown + }; + + enum VerticalAlignment { + AlignNormal, + AlignSuperScript, + AlignSubScript + }; + + enum TextInsertionFlags { + RedoIndentation = 0x0001, + CheckNewLines = 0x0002, + RemoveSelected = 0x0004 + }; + + Q3TextEdit(const QString& text, const QString& context = QString(), + QWidget* parent=0, const char* name=0); + Q3TextEdit(QWidget* parent=0, const char* name=0); + virtual ~Q3TextEdit(); + + QString text() const; + QString text(int para) const; + Qt::TextFormat textFormat() const; + QString context() const; + QString documentTitle() const; + + void getSelection(int *paraFrom, int *indexFrom, + int *paraTo, int *indexTo, int selNum = 0) const; + virtual bool find(const QString &expr, bool cs, bool wo, bool forward = true, + int *para = 0, int *index = 0); + + int paragraphs() const; + int lines() const; + int linesOfParagraph(int para) const; + int lineOfChar(int para, int chr); + int length() const; + QRect paragraphRect(int para) const; + int paragraphAt(const QPoint &pos) const; + int charAt(const QPoint &pos, int *para) const; + int paragraphLength(int para) const; + + Q3StyleSheet* styleSheet() const; +#ifndef QT_NO_MIME + Q3MimeSourceFactory* mimeSourceFactory() const; +#endif + QBrush paper() const; + bool linkUnderline() const; + + int heightForWidth(int w) const; + + bool hasSelectedText() const; + QString selectedText() const; + bool isUndoAvailable() const; + bool isRedoAvailable() const; + + WordWrap wordWrap() const; + int wrapColumnOrWidth() const; + WrapPolicy wrapPolicy() const; + + int tabStopWidth() const; + + QString anchorAt(const QPoint& pos, Qt::AnchorAttribute a = Qt::AnchorHref); + + QSize sizeHint() const; + + bool isReadOnly() const { return readonly; } + + void getCursorPosition(int *parag, int *index) const; + + bool isModified() const; + bool italic() const; + bool bold() const; + bool underline() const; + QString family() const; + int pointSize() const; + QColor color() const; + QFont font() const; + QFont currentFont() const; + int alignment() const; + VerticalAlignment verticalAlignment() const; + int undoDepth() const; + + // do not use, will go away + virtual bool getFormat(int para, int index, QFont *font, QColor *color, VerticalAlignment *verticalAlignment); + // do not use, will go away + virtual bool getParagraphFormat(int para, QFont *font, QColor *color, + VerticalAlignment *verticalAlignment, int *alignment, + Q3StyleSheetItem::DisplayMode *displayMode, + Q3StyleSheetItem::ListStyle *listStyle, + int *listDepth); + + + bool isOverwriteMode() const { return overWrite; } + QColor paragraphBackgroundColor(int para) const; + + bool isUndoRedoEnabled() const; + bool eventFilter(QObject *o, QEvent *e); + bool tabChangesFocus() const; + + void setAutoFormatting(AutoFormatting); + AutoFormatting autoFormatting() const; + Q3SyntaxHighlighter *syntaxHighlighter() const; + +public Q_SLOTS: +#ifndef QT_NO_MIME + virtual void setMimeSourceFactory(Q3MimeSourceFactory* factory); +#endif + virtual void setStyleSheet(Q3StyleSheet* styleSheet); + virtual void scrollToAnchor(const QString& name); + virtual void setPaper(const QBrush& pap); + virtual void setLinkUnderline(bool); + + virtual void setWordWrap(Q3TextEdit::WordWrap mode); + virtual void setWrapColumnOrWidth(int); + virtual void setWrapPolicy(Q3TextEdit::WrapPolicy policy); + + virtual void copy(); + virtual void append(const QString& text); + + void setText(const QString &txt) { setText(txt, QString()); } + virtual void setText(const QString &txt, const QString &context); + virtual void setTextFormat(Qt::TextFormat f); + + virtual void selectAll(bool select = true); + virtual void setTabStopWidth(int ts); + virtual void zoomIn(int range); + virtual void zoomIn() { zoomIn(1); } + virtual void zoomOut(int range); + virtual void zoomOut() { zoomOut(1); } + virtual void zoomTo(int size); + + virtual void sync(); + virtual void setReadOnly(bool b); + + virtual void undo(); + virtual void redo(); + virtual void cut(); + virtual void paste(); +#ifndef QT_NO_CLIPBOARD + virtual void pasteSubType(const QByteArray &subtype); +#endif + virtual void clear(); + virtual void del(); + virtual void indent(); + virtual void setItalic(bool b); + virtual void setBold(bool b); + virtual void setUnderline(bool b); + virtual void setFamily(const QString &f); + virtual void setPointSize(int s); + virtual void setColor(const QColor &c); + virtual void setVerticalAlignment(Q3TextEdit::VerticalAlignment a); + virtual void setAlignment(int a); + + // do not use, will go away + virtual void setParagType(Q3StyleSheetItem::DisplayMode dm, Q3StyleSheetItem::ListStyle listStyle); + + virtual void setCursorPosition(int parag, int index); + virtual void setSelection(int parag_from, int index_from, int parag_to, int index_to, int selNum = 0); + virtual void setSelectionAttributes(int selNum, const QColor &back, bool invertText); + virtual void setModified(bool m); + virtual void resetFormat(); + virtual void setUndoDepth(int d); + virtual void setFormat(Q3TextFormat *f, int flags); + virtual void ensureCursorVisible(); + virtual void placeCursor(const QPoint &pos, Q3TextCursor *c = 0); + virtual void moveCursor(Q3TextEdit::CursorAction action, bool select); + virtual void doKeyboardAction(Q3TextEdit::KeyboardAction action); + virtual void removeSelectedText(int selNum = 0); + virtual void removeSelection(int selNum = 0); + virtual void setCurrentFont(const QFont &f); + virtual void setOverwriteMode(bool b) { overWrite = b; } + + virtual void scrollToBottom(); + + virtual void insert(const QString &text, uint insertionFlags = CheckNewLines | RemoveSelected); + + // obsolete + virtual void insert(const QString &text, bool, bool = true, bool = true); + + virtual void insertAt(const QString &text, int para, int index); + virtual void removeParagraph(int para); + virtual void insertParagraph(const QString &text, int para); + + virtual void setParagraphBackgroundColor(int para, const QColor &bg); + virtual void clearParagraphBackground(int para); + + virtual void setUndoRedoEnabled(bool b); + virtual void setTabChangesFocus(bool b); + +#ifdef QT_TEXTEDIT_OPTIMIZATION + void polishEvent(QEvent*); + void setMaxLogLines(int numLines); + int maxLogLines() const; +#endif + +Q_SIGNALS: + void textChanged(); + void selectionChanged(); + void copyAvailable(bool); + void undoAvailable(bool yes); + void redoAvailable(bool yes); + void currentFontChanged(const QFont &f); + void currentColorChanged(const QColor &c); + void currentAlignmentChanged(int a); + void currentVerticalAlignmentChanged(Q3TextEdit::VerticalAlignment a); + void cursorPositionChanged(Q3TextCursor *c); + void cursorPositionChanged(int para, int pos); + void returnPressed(); + void modificationChanged(bool m); + void clicked(int parag, int index); + void doubleClicked(int parag, int index); + +protected: + void repaintChanged(); + void updateStyles(); + void drawContents(QPainter *p, int cx, int cy, int cw, int ch); + bool event(QEvent *e); + void changeEvent(QEvent *); + void keyPressEvent(QKeyEvent *e); + void resizeEvent(QResizeEvent *e); + void viewportResizeEvent(QResizeEvent*); + void contentsMousePressEvent(QMouseEvent *e); + void contentsMouseMoveEvent(QMouseEvent *e); + void contentsMouseReleaseEvent(QMouseEvent *e); + void contentsMouseDoubleClickEvent(QMouseEvent *e); +#ifndef QT_NO_WHEELEVENT + void contentsWheelEvent(QWheelEvent *e); +#endif + void inputMethodEvent(QInputMethodEvent *); +#ifndef QT_NO_DRAGANDDROP + void contentsDragEnterEvent(QDragEnterEvent *e); + void contentsDragMoveEvent(QDragMoveEvent *e); + void contentsDragLeaveEvent(QDragLeaveEvent *e); + void contentsDropEvent(QDropEvent *e); +#endif + void contentsContextMenuEvent(QContextMenuEvent *e); + bool focusNextPrevChild(bool next); + Q3TextDocument *document() const; + Q3TextCursor *textCursor() const; + void setDocument(Q3TextDocument *doc); + virtual Q3PopupMenu *createPopupMenu(const QPoint& pos); + virtual Q3PopupMenu *createPopupMenu(); + void drawCursor(bool visible); + +protected Q_SLOTS: + virtual void doChangeInterval(); + virtual void sliderReleased(); + +private Q_SLOTS: + void formatMore(); + void doResize(); + void autoScrollTimerDone(); + void blinkCursor(); + void setModified(); + void startDrag(); + void documentWidthChanged(int w); + void clipboardChanged(); + +private: + struct Q_COMPAT_EXPORT UndoRedoInfo { + enum Type { Invalid, Insert, Delete, Backspace, Return, RemoveSelected, Format, Style, IME }; + + UndoRedoInfo(Q3TextDocument *dc); + ~UndoRedoInfo(); + void clear(); + bool valid() const; + + QUndoRedoInfoPrivate *d; + int id; + int index; + int eid; + int eindex; + Q3TextFormat *format; + int flags; + Type type; + Q3TextDocument *doc; + QByteArray styleInformation; + }; + +private: + void updateCursor(const QPoint & pos); + void handleMouseMove(const QPoint& pos); + void drawContents(QPainter *); + virtual bool linksEnabled() const { return false; } + void init(); + void checkUndoRedoInfo(UndoRedoInfo::Type t); + void updateCurrentFormat(); + bool handleReadOnlyKeyEvent(QKeyEvent *e); + void makeParagVisible(Q3TextParagraph *p); + void normalCopy(); + void copyToClipboard(); +#ifndef QT_NO_MIME + QByteArray pickSpecial(QMimeSource* ms, bool always_ask, const QPoint&); + Q3TextDrag *dragObject(QWidget *parent = 0) const; +#endif +#ifndef QT_NO_MIMECLIPBOARD + void pasteSpecial(const QPoint&); +#endif + void setFontInternal(const QFont &f); + + virtual void emitHighlighted(const QString &) {} + virtual void emitLinkClicked(const QString &) {} + + void readFormats(Q3TextCursor &c1, Q3TextCursor &c2, Q3TextString &text, bool fillStyles = false); + void clearUndoRedo(); + void paintDocument(bool drawAll, QPainter *p, int cx = -1, int cy = -1, int cw = -1, int ch = -1); + void moveCursor(CursorAction action); + void ensureFormatted(Q3TextParagraph *p); + void placeCursor(const QPoint &pos, Q3TextCursor *c, bool link); + QVariant inputMethodQuery(Qt::InputMethodQuery query) const; + +#ifdef QT_TEXTEDIT_OPTIMIZATION + bool checkOptimMode(); + QString optimText() const; + void optimSetText(const QString &str); + void optimAppend(const QString &str); + void optimInsert(const QString &str, int line, int index); + void optimDrawContents(QPainter * p, int cx, int cy, int cw, int ch); + void optimMousePressEvent(QMouseEvent * e); + void optimMouseReleaseEvent(QMouseEvent * e); + void optimMouseMoveEvent(QMouseEvent * e); + int optimCharIndex(const QString &str, int mx) const; + void optimSelectAll(); + void optimRemoveSelection(); + void optimSetSelection(int startLine, int startIdx, int endLine, + int endIdx); + bool optimHasSelection() const; + QString optimSelectedText() const; + bool optimFind(const QString & str, bool, bool, bool, int *, int *); + void optimParseTags(QString * str, int lineNo = -1, int indexOffset = 0); + Q3TextEditOptimPrivate::Tag * optimPreviousLeftTag(int line); + void optimSetTextFormat(Q3TextDocument *, Q3TextCursor *, Q3TextFormat * f, + int, int, Q3TextEditOptimPrivate::Tag * t); + Q3TextEditOptimPrivate::Tag * optimAppendTag(int index, const QString & tag); + Q3TextEditOptimPrivate::Tag * optimInsertTag(int line, int index, const QString & tag); + void optimCheckLimit(const QString& str); + bool optimHasBoldMetrics(int line); + +private Q_SLOTS: + void optimDoAutoScroll(); +#endif // QT_TEXTEDIT_OPTIMIZATION + +private: +#ifndef QT_NO_CLIPBOARD + void pasteSubType(const QByteArray &subtype, QMimeSource *m); +#endif + +private: + Q_DISABLE_COPY(Q3TextEdit) + + Q3TextDocument *doc; + Q3TextCursor *cursor; + QTimer *formatTimer, *scrollTimer, *changeIntervalTimer, *blinkTimer, *dragStartTimer; + Q3TextParagraph *lastFormatted; + int interval; + UndoRedoInfo undoRedoInfo; + Q3TextFormat *currentFormat; + int currentAlignment; + QPoint oldMousePos, mousePos; + QPoint dragStartPos; + QString onLink; + WordWrap wrapMode; + WrapPolicy wPolicy; + int wrapWidth; + QString pressedLink; + Q3TextEditPrivate *d; + bool inDoubleClick : 1; + bool mousePressed : 1; + bool cursorVisible : 1; + bool blinkCursorVisible : 1; + bool modified : 1; + bool mightStartDrag : 1; + bool inDnD : 1; + bool readonly : 1; + bool undoEnabled : 1; + bool overWrite : 1; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(Q3TextEdit::AutoFormatting) + +inline Q3TextDocument *Q3TextEdit::document() const +{ + return doc; +} + +inline Q3TextCursor *Q3TextEdit::textCursor() const +{ + return cursor; +} + +inline void Q3TextEdit::setCurrentFont(const QFont &f) +{ + Q3TextEdit::setFontInternal(f); +} + +#endif // QT_NO_TEXTEDIT + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3TEXTEDIT_H diff --git a/qtinterface/qt4/Qt/q3textstream.h b/qtinterface/qt4/Qt/q3textstream.h new file mode 100644 index 0000000..6e83559 --- /dev/null +++ b/qtinterface/qt4/Qt/q3textstream.h @@ -0,0 +1,297 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3TEXTSTREAM_H +#define Q3TEXTSTREAM_H + +#include +#include +#ifndef QT_NO_TEXTCODEC +#include +#endif +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3TextStreamPrivate; + +class Q_COMPAT_EXPORT Q3TextStream // text stream class +{ +public: + enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder, + UnicodeReverse, RawUnicode, UnicodeUTF8 }; + + void setEncoding( Encoding ); +#ifndef QT_NO_TEXTCODEC + void setCodec( QTextCodec* ); + QTextCodec *codec(); +#endif + + Q3TextStream(); + Q3TextStream( QIODevice * ); + Q3TextStream( QString*, int mode ); + Q3TextStream( QString&, int mode ); // obsolete + Q3TextStream( QByteArray&, int mode ); + Q3TextStream( FILE *, int mode ); + virtual ~Q3TextStream(); + + QIODevice *device() const; + void setDevice( QIODevice * ); + void unsetDevice(); + + bool atEnd() const; + bool eof() const; + + Q3TextStream &operator>>( QChar & ); + Q3TextStream &operator>>( char & ); + Q3TextStream &operator>>( signed short & ); + Q3TextStream &operator>>( unsigned short & ); + Q3TextStream &operator>>( signed int & ); + Q3TextStream &operator>>( unsigned int & ); + Q3TextStream &operator>>( signed long & ); + Q3TextStream &operator>>( unsigned long & ); + Q3TextStream &operator>>( float & ); + Q3TextStream &operator>>( double & ); + Q3TextStream &operator>>( char * ); + Q3TextStream &operator>>( QString & ); + Q3TextStream &operator>>( Q3CString & ); + + Q3TextStream &operator<<( QChar ); + Q3TextStream &operator<<( char ); + Q3TextStream &operator<<( signed short ); + Q3TextStream &operator<<( unsigned short ); + Q3TextStream &operator<<( signed int ); + Q3TextStream &operator<<( unsigned int ); + Q3TextStream &operator<<( signed long ); + Q3TextStream &operator<<( unsigned long ); + Q3TextStream &operator<<( float ); + Q3TextStream &operator<<( double ); + Q3TextStream &operator<<( const char* ); + Q3TextStream &operator<<( const QString & ); + Q3TextStream &operator<<( const Q3CString & ); + Q3TextStream &operator<<( void * ); // any pointer + + Q3TextStream &readRawBytes( char *, uint len ); + Q3TextStream &writeRawBytes( const char* , uint len ); + + QString readLine(); + QString read(); + void skipWhiteSpace(); + + enum { + skipws = 0x0001, // skip whitespace on input + left = 0x0002, // left-adjust output + right = 0x0004, // right-adjust output + internal = 0x0008, // pad after sign + bin = 0x0010, // binary format integer + oct = 0x0020, // octal format integer + dec = 0x0040, // decimal format integer + hex = 0x0080, // hex format integer + showbase = 0x0100, // show base indicator + showpoint = 0x0200, // force decimal point (float) + uppercase = 0x0400, // upper-case hex output + showpos = 0x0800, // add '+' to positive integers + scientific= 0x1000, // scientific float output + fixed = 0x2000 // fixed float output + }; + + static const int basefield; // bin | oct | dec | hex + static const int adjustfield; // left | right | internal + static const int floatfield; // scientific | fixed + + int flags() const; + int flags( int f ); + int setf( int bits ); + int setf( int bits, int mask ); + int unsetf( int bits ); + + void reset(); + + int width() const; + int width( int ); + int fill() const; + int fill( int ); + int precision() const; + int precision( int ); + +private: + long input_int(); + void init(); + Q3TextStream &output_int( int, ulong, bool ); + QIODevice *dev; + + int fflags; + int fwidth; + int fillchar; + int fprec; + bool doUnicodeHeader; + bool owndev; + QTextCodec *mapper; + QTextCodec::ConverterState mapperReadState; + QTextCodec::ConverterState mapperWriteState; + Q3TextStreamPrivate * d; + QChar unused1; // ### remove in Qt 4.0 + bool latin1; + bool internalOrder; + bool networkOrder; + void *unused2; // ### remove in Qt 4.0 + + QChar eat_ws(); + uint ts_getline( QChar* ); + void ts_ungetc( QChar ); + QChar ts_getc(); + uint ts_getbuf( QChar*, uint ); + void ts_putc(int); + void ts_putc(QChar); + bool ts_isspace(QChar); + bool ts_isdigit(QChar); + ulong input_bin(); + ulong input_oct(); + ulong input_dec(); + ulong input_hex(); + double input_double(); + Q3TextStream &writeBlock( const char* p, uint len ); + Q3TextStream &writeBlock( const QChar* p, uint len ); + +private: // Disabled copy constructor and operator= +#if defined(Q_DISABLE_COPY) + Q3TextStream( const Q3TextStream & ); + Q3TextStream &operator=( const Q3TextStream & ); +#endif +}; + +/***************************************************************************** + Q3TextStream inline functions + *****************************************************************************/ + +inline QIODevice *Q3TextStream::device() const +{ return dev; } + +inline bool Q3TextStream::atEnd() const +{ return dev ? dev->atEnd() : FALSE; } + +inline bool Q3TextStream::eof() const +{ return atEnd(); } + +inline int Q3TextStream::flags() const +{ return fflags; } + +inline int Q3TextStream::flags( int f ) +{ int oldf = fflags; fflags = f; return oldf; } + +inline int Q3TextStream::setf( int bits ) +{ int oldf = fflags; fflags |= bits; return oldf; } + +inline int Q3TextStream::setf( int bits, int mask ) +{ int oldf = fflags; fflags = (fflags & ~mask) | (bits & mask); return oldf; } + +inline int Q3TextStream::unsetf( int bits ) +{ int oldf = fflags; fflags &= ~bits; return oldf; } + +inline int Q3TextStream::width() const +{ return fwidth; } + +inline int Q3TextStream::width( int w ) +{ int oldw = fwidth; fwidth = w; return oldw; } + +inline int Q3TextStream::fill() const +{ return fillchar; } + +inline int Q3TextStream::fill( int f ) +{ int oldc = fillchar; fillchar = f; return oldc; } + +inline int Q3TextStream::precision() const +{ return fprec; } + +inline int Q3TextStream::precision( int p ) +{ int oldp = fprec; fprec = p; return oldp; } + +/*! + Returns one character from the stream, or EOF. +*/ +inline QChar Q3TextStream::ts_getc() +{ QChar r; return ( ts_getbuf( &r,1 ) == 1 ? r : QChar((ushort)0xffff) ); } + +/***************************************************************************** + Q3TextStream manipulators + *****************************************************************************/ + +typedef Q3TextStream & (*Q3TSFUNC)(Q3TextStream &);// manipulator function +typedef int (Q3TextStream::*Q3TSMFI)(int); // manipulator w/int argument + +class Q_COMPAT_EXPORT Q3TSManip { // text stream manipulator +public: + Q3TSManip( Q3TSMFI m, int a ) { mf=m; arg=a; } + void exec( Q3TextStream &s ) { (s.*mf)(arg); } +private: + Q3TSMFI mf; // Q3TextStream member function + int arg; // member function argument +}; + +Q_COMPAT_EXPORT inline Q3TextStream &operator>>( Q3TextStream &s, Q3TSFUNC f ) +{ return (*f)( s ); } + +Q_COMPAT_EXPORT inline Q3TextStream &operator<<( Q3TextStream &s, Q3TSFUNC f ) +{ return (*f)( s ); } + +Q_COMPAT_EXPORT inline Q3TextStream &operator<<( Q3TextStream &s, Q3TSManip m ) +{ m.exec(s); return s; } + +Q_COMPAT_EXPORT Q3TextStream &bin( Q3TextStream &s ); // set bin notation +Q_COMPAT_EXPORT Q3TextStream &oct( Q3TextStream &s ); // set oct notation +Q_COMPAT_EXPORT Q3TextStream &dec( Q3TextStream &s ); // set dec notation +Q_COMPAT_EXPORT Q3TextStream &hex( Q3TextStream &s ); // set hex notation +Q_COMPAT_EXPORT Q3TextStream &endl( Q3TextStream &s ); // insert EOL ('\n') +Q_COMPAT_EXPORT Q3TextStream &flush( Q3TextStream &s ); // flush output +Q_COMPAT_EXPORT Q3TextStream &ws( Q3TextStream &s ); // eat whitespace on input +Q_COMPAT_EXPORT Q3TextStream &reset( Q3TextStream &s ); // set default flags + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3TEXTSTREAM_H diff --git a/qtinterface/qt4/Qt/q3textview.h b/qtinterface/qt4/Qt/q3textview.h new file mode 100644 index 0000000..5edd0d2 --- /dev/null +++ b/qtinterface/qt4/Qt/q3textview.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3TEXTVIEW_H +#define Q3TEXTVIEW_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_TEXTVIEW + +class Q_COMPAT_EXPORT Q3TextView : public Q3TextEdit +{ + Q_OBJECT + +public: + Q3TextView(const QString& text, const QString& context = QString(), + QWidget* parent=0, const char* name=0); + Q3TextView(QWidget* parent=0, const char* name=0); + + virtual ~Q3TextView(); + +private: + Q_DISABLE_COPY(Q3TextView) +}; + +#endif // QT_NO_TEXTVIEW + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3TEXTVIEW_H diff --git a/qtinterface/qt4/Qt/q3tl.h b/qtinterface/qt4/Qt/q3tl.h new file mode 100644 index 0000000..9d800bd --- /dev/null +++ b/qtinterface/qt4/Qt/q3tl.h @@ -0,0 +1,212 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3TL_H +#define Q3TL_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +Q_OUTOFLINE_TEMPLATE void qHeapSortPushDown(T *heap, int first, int last, LessThan lessThan) +{ + int r = first; + while (r <= last / 2) { + if (last == 2 * r) { + // node r has only one child + if (lessThan(heap[2 * r], heap[r])) + qSwap(heap[r], heap[2 * r]); + r = last; + } else { + // node r has two children + if (lessThan(heap[2 * r], heap[r]) && !lessThan(heap[2 * r + 1], heap[2 * r])) { + // swap with left child + qSwap(heap[r], heap[2 * r]); + r *= 2; + } else if (lessThan(heap[2 * r + 1], heap[r]) + && lessThan(heap[2 * r + 1], heap[2 * r])) { + // swap with right child + qSwap(heap[r], heap[2 * r + 1]); + r = 2 * r + 1; + } else { + r = last; + } + } + } +} + +template +Q_OUTOFLINE_TEMPLATE void qHeapSortHelper(BiIterator begin, BiIterator end, const T & /* dummy */, LessThan lessThan) +{ + BiIterator it = begin; + uint n = 0; + while (it != end) { + ++n; + ++it; + } + if (n == 0) + return; + + // Create the heap + BiIterator insert = begin; + T *realheap = new T[n]; + T *heap = realheap - 1; + int size = 0; + for(; insert != end; ++insert) { + heap[++size] = *insert; + int i = size; + while (i > 1 && lessThan(heap[i], heap[i / 2])) { + qSwap(heap[i], heap[i / 2]); + i /= 2; + } + } + + // Now do the sorting + for (int i = n; i > 0; i--) { + *begin++ = heap[1]; + if (i > 1) { + heap[1] = heap[i]; + qHeapSortPushDown(heap, 1, i - 1, lessThan); + } + } + + delete[] realheap; +} + +template +inline void qHeapSortHelper(BiIterator begin, BiIterator end, const T &dummy) +{ + qHeapSortHelper(begin, end, dummy, qLess()); +} + +template +inline void qHeapSort(BiIterator begin, BiIterator end, LessThan lessThan) +{ + if (begin != end) + qHeapSortHelper(begin, end, *begin, lessThan); +} + +template +inline void qHeapSort(BiIterator begin, BiIterator end) +{ + if (begin != end) + qHeapSortHelper(begin, end, *begin); +} + +template +inline void qHeapSort(Container &c) +{ +#ifdef Q_CC_BOR + // Work around Borland 5.5 optimizer bug + c.detach(); +#endif + if (!c.empty()) + qHeapSortHelper(c.begin(), c.end(), *c.begin()); +} + + +template +void qBubbleSort(BiIterator begin, BiIterator end, LessThan lessThan) +{ + // Goto last element; + BiIterator last = end; + + // empty list + if (begin == end) + return; + + --last; + // only one element ? + if (last == begin) + return; + + // So we have at least two elements in here + while (begin != last) { + bool swapped = false; + BiIterator swapPos = begin; + BiIterator x = end; + BiIterator y = x; + y--; + do { + --x; + --y; + if (lessThan(*x, *y)) { + swapped = true; + qSwap(*x, *y); + swapPos = y; + } + } while (y != begin); + if (!swapped) + return; + begin = swapPos; + ++begin; + } +} + +template +void qBubbleSortHelper(BiIterator begin, BiIterator end, T) +{ + qBubbleSort(begin, end, qLess()); +} + +template +void qBubbleSort(BiIterator begin, BiIterator end) +{ + if (begin != end) + qBubbleSortHelper(begin, end, *begin); +} + +template +inline void qBubbleSort(Container &c) +{ + qBubbleSort(c.begin(), c.end()); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3TL_H diff --git a/qtinterface/qt4/Qt/q3toolbar.h b/qtinterface/qt4/Qt/q3toolbar.h new file mode 100644 index 0000000..096149c --- /dev/null +++ b/qtinterface/qt4/Qt/q3toolbar.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3TOOLBAR_H +#define Q3TOOLBAR_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_TOOLBAR + +class Q3MainWindow; +class Q3ToolBarPrivate; + +class Q_COMPAT_EXPORT Q3ToolBar: public Q3DockWindow +{ + Q_OBJECT + Q_PROPERTY(QString label READ label WRITE setLabel) + +public: + Q3ToolBar(const QString &label, + Q3MainWindow *, Qt::ToolBarDock = Qt::DockTop, + bool newLine = false, const char* name=0); + Q3ToolBar(const QString &label, Q3MainWindow *, QWidget *, + bool newLine = false, const char* name=0, Qt::WindowFlags f = 0); + Q3ToolBar(Q3MainWindow* parent=0, const char* name=0); + ~Q3ToolBar(); + + void addSeparator(); + + void setVisible(bool visible); + + Q3MainWindow * mainWindow() const; + + virtual void setStretchableWidget(QWidget *); + + bool event(QEvent * e); + + virtual void setLabel(const QString &); + QString label() const; + + virtual void clear(); + + QSize minimumSize() const; + QSize minimumSizeHint() const; + + void setOrientation(Qt::Orientation o); + void setMinimumSize(int minw, int minh); + +protected: + void resizeEvent(QResizeEvent *e); + void styleChange(QStyle &); + void actionEvent(QActionEvent *); + +private Q_SLOTS: + void createPopup(); + +private: + void init(); + void checkForExtension(const QSize &sz); + Q3ToolBarPrivate * d; + Q3MainWindow * mw; + QWidget * sw; + QString l; + + friend class Q3MainWindow; + friend class Q3DockAreaLayout; + +private: + Q_DISABLE_COPY(Q3ToolBar) +}; + +#endif // QT_NO_TOOLBAR + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3TOOLBAR_H diff --git a/qtinterface/qt4/Qt/q3url.h b/qtinterface/qt4/Qt/q3url.h new file mode 100644 index 0000000..5fd6dae --- /dev/null +++ b/qtinterface/qt4/Qt/q3url.h @@ -0,0 +1,139 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3URL_H +#define Q3URL_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_URL + +class Q3UrlPrivate; + +class Q_COMPAT_EXPORT Q3Url +{ +public: + Q3Url(); + Q3Url( const QString& url ); + Q3Url( const Q3Url& url ); + Q3Url( const Q3Url& url, const QString& relUrl, bool checkSlash = false ); + virtual ~Q3Url(); + + QString protocol() const; + virtual void setProtocol( const QString& protocol ); + + QString user() const; + virtual void setUser( const QString& user ); + bool hasUser() const; + + QString password() const; + virtual void setPassword( const QString& pass ); + bool hasPassword() const; + + QString host() const; + virtual void setHost( const QString& user ); + bool hasHost() const; + + int port() const; + virtual void setPort( int port ); + bool hasPort() const; + + QString path( bool correct = true ) const; + virtual void setPath( const QString& path ); + bool hasPath() const; + + virtual void setEncodedPathAndQuery( const QString& enc ); + QString encodedPathAndQuery(); + + virtual void setQuery( const QString& txt ); + QString query() const; + + QString ref() const; + virtual void setRef( const QString& txt ); + bool hasRef() const; + + bool isValid() const; + bool isLocalFile() const; + + virtual void addPath( const QString& path ); + virtual void setFileName( const QString& txt ); + + QString fileName() const; + QString dirPath() const; + + Q3Url& operator=( const Q3Url& url ); + Q3Url& operator=( const QString& url ); + + bool operator==( const Q3Url& url ) const; + bool operator==( const QString& url ) const; + + static void decode( QString& url ); + static void encode( QString& url ); + + operator QString() const; + virtual QString toString( bool encodedPath = false, bool forcePrependProtocol = true ) const; + + virtual bool cdUp(); + + static bool isRelativeUrl( const QString &url ); + +protected: + virtual void reset(); + virtual bool parse( const QString& url ); + +private: + Q3UrlPrivate *d; + +}; + +#endif // QT_NO_URL + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3URL_H diff --git a/qtinterface/qt4/Qt/q3urloperator.h b/qtinterface/qt4/Qt/q3urloperator.h new file mode 100644 index 0000000..f108f75 --- /dev/null +++ b/qtinterface/qt4/Qt/q3urloperator.h @@ -0,0 +1,138 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3URLOPERATOR_H +#define Q3URLOPERATOR_H + +#include +#include +#include +#include +#include // QString->QStringList conversion + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_NETWORKPROTOCOL + +class QUrlInfo; +class Q3UrlOperatorPrivate; +class Q3NetworkProtocol; + +class Q_COMPAT_EXPORT Q3UrlOperator : public QObject, public Q3Url +{ + Q_OBJECT + friend class Q3NetworkProtocol; + +public: + Q3UrlOperator(); + Q3UrlOperator( const QString &urL ); + Q3UrlOperator( const Q3UrlOperator& url ); + Q3UrlOperator( const Q3UrlOperator& url, const QString& relUrl, bool checkSlash = false ); + virtual ~Q3UrlOperator(); + + virtual void setPath( const QString& path ); + virtual bool cdUp(); + + virtual const Q3NetworkOperation *listChildren(); + virtual const Q3NetworkOperation *mkdir( const QString &dirname ); + virtual const Q3NetworkOperation *remove( const QString &filename ); + virtual const Q3NetworkOperation *rename( const QString &oldname, const QString &newname ); + virtual const Q3NetworkOperation *get( const QString &location = QString() ); + virtual const Q3NetworkOperation *put( const QByteArray &data, const QString &location = QString() ); + virtual Q3PtrList copy( const QString &from, const QString &to, bool move = false, bool toPath = true ); + virtual void copy( const QStringList &files, const QString &dest, bool move = false ); + virtual bool isDir( bool *ok = 0 ); + + virtual void setNameFilter( const QString &nameFilter ); + QString nameFilter() const; + + virtual QUrlInfo info( const QString &entry ) const; + + Q3UrlOperator& operator=( const Q3UrlOperator &url ); + Q3UrlOperator& operator=( const QString &url ); + + virtual void stop(); + +Q_SIGNALS: + void newChildren( const Q3ValueList &, Q3NetworkOperation *res ); + void finished( Q3NetworkOperation *res ); + void start( Q3NetworkOperation *res ); + void createdDirectory( const QUrlInfo &, Q3NetworkOperation *res ); + void removed( Q3NetworkOperation *res ); + void itemChanged( Q3NetworkOperation *res ); + void data( const QByteArray &, Q3NetworkOperation *res ); + void dataTransferProgress( int bytesDone, int bytesTotal, Q3NetworkOperation *res ); + void startedNextCopy( const Q3PtrList &lst ); + void connectionStateChanged( int state, const QString &data ); + +protected: + void reset(); + bool parse( const QString& url ); + virtual bool checkValid(); + virtual void clearEntries(); + void getNetworkProtocol(); + void deleteNetworkProtocol(); + +private Q_SLOTS: + const Q3NetworkOperation *startOperation( Q3NetworkOperation *op ); + void copyGotData( const QByteArray &data, Q3NetworkOperation *op ); + void continueCopy( Q3NetworkOperation *op ); + void finishedCopy(); + void addEntry( const Q3ValueList &i ); + void slotItemChanged( Q3NetworkOperation *op ); + +private: + void deleteOperation( Q3NetworkOperation *op ); + + Q3UrlOperatorPrivate *d; +}; + +#endif // QT_NO_NETWORKPROTOCOL + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3URLOPERATOR_H diff --git a/qtinterface/qt4/Qt/q3valuelist.h b/qtinterface/qt4/Qt/q3valuelist.h new file mode 100644 index 0000000..f004145 --- /dev/null +++ b/qtinterface/qt4/Qt/q3valuelist.h @@ -0,0 +1,238 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3VALUELIST_H +#define Q3VALUELIST_H + +#include +#include +#include +#include + +#ifndef QT_NO_STL +#include +#include +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3ValueListIterator : public QLinkedList::iterator +{ +public: + inline Q3ValueListIterator() : + QLinkedList::iterator() {} + inline Q3ValueListIterator(const Q3ValueListIterator &o) : + QLinkedList::iterator(o) {} + inline Q3ValueListIterator(const typename QLinkedList::iterator &o) : + QLinkedList::iterator(o) {} +}; + +template +class Q3ValueListConstIterator : public QLinkedList::const_iterator +{ +public: + inline Q3ValueListConstIterator() {} + inline Q3ValueListConstIterator(const Q3ValueListConstIterator &o) : + QLinkedList::const_iterator(o) {} + inline Q3ValueListConstIterator(const typename QLinkedList::const_iterator &o) : + QLinkedList::const_iterator(o) {} + inline Q3ValueListConstIterator(const typename QLinkedList::iterator &o) : + QLinkedList::const_iterator(o) {} +}; + +template +class Q3ValueList : public QLinkedList +{ +public: + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; +#ifndef QT_NO_STL + typedef ptrdiff_t difference_type; +#else + typedef int difference_type; +#endif + + typedef Q3ValueListIterator Iterator; + typedef Q3ValueListConstIterator ConstIterator; + typedef Q3ValueListIterator iterator; + typedef Q3ValueListConstIterator const_iterator; + typedef typename QLinkedList::size_type size_type; + + /** + * API + */ + Q3ValueList() {} + Q3ValueList(const Q3ValueList& l) : QLinkedList(l) {} + Q3ValueList(const QLinkedList& l) : QLinkedList(l) {} + Q3ValueList(const QList& l) + { + for (int i = 0; i < l.size(); ++i) append(l.at(i)); + } +#ifndef QT_NO_STL + Q3ValueList(const std::list& l) + { + qCopy(l.begin(), l.end(), std::back_inserter(*this)); + } +#endif + ~Q3ValueList() {} + + Q3ValueList& operator= (const Q3ValueList& l) + { + QLinkedList::operator=(l); + return *this; + } + Q3ValueList& operator= (const QList& l) + { + this->clear(); + for (int i = 0; i < l.size(); ++i) append(l.at(i)); + return *this; + } +#ifndef QT_NO_STL + Q3ValueList& operator= (const std::list& l) + { + this->detach(); + qCopy(l.begin(), l.end(), std::back_inserter(*this)); + return *this; + } + bool operator== (const std::list& l) const + { + if (this->size() != l.size()) + return false; + typename Q3ValueList::const_iterator it2 = this->begin(); +#if !defined(Q_CC_MIPS) + typename +#endif + std::list::const_iterator it = l.begin(); + for (; it2 != this->end(); ++it2, ++it) + if (!((*it2) == (*it))) + return false; + return true; + } +#endif + bool operator== (const Q3ValueList& l) const { return QLinkedList::operator==(l); } + bool operator!= (const Q3ValueList& l) const { return QLinkedList::operator!=(l); } + + operator QList() const { + QList list; + for (typename Q3ValueList::const_iterator it = QLinkedList::constBegin(); + it != QLinkedList::constEnd(); ++it) + list.append(*it); + return list; + } + + inline Q3ValueList& operator<< (const T& x) { append(x); return *this; } + + void insert(typename Q3ValueList::Iterator pos, + typename Q3ValueList::size_type n, + const T& x); + + typename Q3ValueList::Iterator insert(typename Q3ValueList::Iterator pos, + const T& x) + { return QLinkedList::insert(pos, x); } + typename Q3ValueList::Iterator remove(typename Q3ValueList::Iterator pos) + { return QLinkedList::erase(pos); } + int remove(const T &value) + { return QLinkedList::removeAll(value); } + + inline Q3ValueList operator+ (const Q3ValueList& l) const + { return static_cast >(QLinkedList::operator+(l)); } + inline Q3ValueList& operator+= (const Q3ValueList& l) + { QLinkedList::operator+=(l); return *this; } + + typename Q3ValueList::Iterator fromLast() + { return (this->isEmpty() ? this->end() : --this->end()); } + typename Q3ValueList::ConstIterator fromLast() const + { return (this->isEmpty() ? this->end() : --this->end()); } + + typename Q3ValueList::Iterator append(const T& x) + { QLinkedList::append(x); return --this->end(); } + typename Q3ValueList::Iterator prepend(const T& x) + { QLinkedList::prepend(x); return this->begin(); } + + typename Q3ValueList::Iterator at(typename Q3ValueList::size_type i) + { Q_ASSERT(i < this->size()); this->detach(); return this->begin()+i; } + typename Q3ValueList::ConstIterator at(typename Q3ValueList::size_type i) const + { Q_ASSERT(i < this->size()); return this->begin()+i; } + typename Q3ValueList::size_type contains(const T& x) const + { return QLinkedList::count(x); } + + Q3ValueList& operator+= (const T& x) { append(x); return *this; } + + T& operator[] (typename Q3ValueList::size_type i) { return *at(i); } + const T& operator[] (typename Q3ValueList::size_type i) const { return *at(i); } + +}; + +template +Q_OUTOFLINE_TEMPLATE void Q3ValueList::insert(typename Q3ValueList::Iterator pos, + typename Q3ValueList::size_type n, const T& x) +{ + for (; n > 0; --n) + this->insert(pos, x); +} + +#ifndef QT_NO_DATASTREAM +template +Q_OUTOFLINE_TEMPLATE QDataStream& operator>>(QDataStream& s, Q3ValueList& l) +{ + return operator>>(s, static_cast &>(l)); +} + +template +Q_OUTOFLINE_TEMPLATE QDataStream& operator<<(QDataStream& s, const Q3ValueList& l) +{ + return operator<<(s, static_cast &>(l)); +} +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3VALUELIST_H diff --git a/qtinterface/qt4/Qt/q3valuestack.h b/qtinterface/qt4/Qt/q3valuestack.h new file mode 100644 index 0000000..caa2564 --- /dev/null +++ b/qtinterface/qt4/Qt/q3valuestack.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3VALUESTACK_H +#define Q3VALUESTACK_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3ValueStack : public Q3ValueList +{ +public: + Q3ValueStack() {} + ~Q3ValueStack() {} + void push(const T& val) { this->append(val); } + T pop() + { + T elem(this->last()); + if (!this->isEmpty()) + this->remove(this->fromLast()); + return elem; + } + T& top() { return this->last(); } + const T& top() const { return this->last(); } +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3VALUESTACK_H diff --git a/qtinterface/qt4/Qt/q3valuevector.h b/qtinterface/qt4/Qt/q3valuevector.h new file mode 100644 index 0000000..3ca6420 --- /dev/null +++ b/qtinterface/qt4/Qt/q3valuevector.h @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3VALUEVECTOR_H +#define Q3VALUEVECTOR_H + +#include + +#ifndef QT_NO_STL +#include +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +template +class Q3ValueVector : public QVector +{ +public: + inline Q3ValueVector() : QVector() {} + inline Q3ValueVector(const Q3ValueVector& v) : QVector(v) {} + inline Q3ValueVector(typename QVector::size_type n, + const T& val = T()) : QVector(n, val) {} + +#ifndef QT_NO_STL + inline Q3ValueVector(const std::vector& v) : QVector() + { this->resize(v.size()); qCopy(v.begin(), v.end(), this->begin()); } +#endif + + Q3ValueVector& operator= (const Q3ValueVector& v) + { QVector::operator=(v); return *this; } + +#ifndef QT_NO_STL + Q3ValueVector& operator= (const std::vector& v) + { + this->clear(); + this->resize(v.size()); + qCopy(v.begin(), v.end(), this->begin()); + return *this; + } +#endif + + void resize(int n, const T& val = T()) + { + if (n < this->size()) + erase(this->begin() + n, this->end()); + else + insert(this->end(), n - this->size(), val); + } + + + T& at(int i, bool* ok = 0) + { + this->detach(); + if (ok) + *ok = (i >= 0 && i < this->size()); + return *(this->begin() + i); + } + + const T&at(int i, bool* ok = 0) const + { + if (ok) + *ok = (i >= 0 && i < this->size()); + return *(this->begin() + i); + } +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3VALUEVECTOR_H diff --git a/qtinterface/qt4/Qt/q3vbox.h b/qtinterface/qt4/Qt/q3vbox.h new file mode 100644 index 0000000..11c5afc --- /dev/null +++ b/qtinterface/qt4/Qt/q3vbox.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3VBOX_H +#define Q3VBOX_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3VBox : public Q3HBox +{ + Q_OBJECT +public: + Q3VBox(QWidget* parent=0, const char* name=0, Qt::WindowFlags f=0); + +private: + Q_DISABLE_COPY(Q3VBox) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3VBOX_H diff --git a/qtinterface/qt4/Qt/q3vgroupbox.h b/qtinterface/qt4/Qt/q3vgroupbox.h new file mode 100644 index 0000000..20551f0 --- /dev/null +++ b/qtinterface/qt4/Qt/q3vgroupbox.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3VGROUPBOX_H +#define Q3VGROUPBOX_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q_COMPAT_EXPORT Q3VGroupBox : public Q3GroupBox +{ + Q_OBJECT +public: + Q3VGroupBox( QWidget* parent=0, const char* name=0 ); + Q3VGroupBox( const QString &title, QWidget* parent=0, const char* name=0 ); + ~Q3VGroupBox(); + +private: + Q_DISABLE_COPY(Q3VGroupBox) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3VGROUPBOX_H diff --git a/qtinterface/qt4/Qt/q3whatsthis.h b/qtinterface/qt4/Qt/q3whatsthis.h new file mode 100644 index 0000000..f95bb9e --- /dev/null +++ b/qtinterface/qt4/Qt/q3whatsthis.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3WHATSTHIS_H +#define Q3WHATSTHIS_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +#ifndef QT_NO_WHATSTHIS + +class QToolButton; + +class Q_COMPAT_EXPORT Q3WhatsThis: public QObject +{ + Q_OBJECT +public: + Q3WhatsThis(QWidget *); + ~Q3WhatsThis(); + bool eventFilter(QObject *, QEvent *); + + static inline void enterWhatsThisMode() { QWhatsThis::enterWhatsThisMode(); } + static inline bool inWhatsThisMode() { return QWhatsThis::inWhatsThisMode(); } + + static inline void add(QWidget *w, const QString &s) { w->setWhatsThis(s); } + static inline void remove(QWidget *w) { w->setWhatsThis(QString()); } + static QToolButton * whatsThisButton(QWidget * parent); + static inline void leaveWhatsThisMode(const QString& text = QString(), const QPoint& pos = QCursor::pos(), QWidget* w = 0) + { QWhatsThis::showText(pos, text, w); } + static inline void display(const QString& text, const QPoint& pos = QCursor::pos(), QWidget* w = 0) + { QWhatsThis::showText(pos, text, w); } + + virtual QString text(const QPoint &); + virtual bool clicked(const QString& href); + +}; + +#endif // QT_NO_WHATSTHIS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3WHATSTHIS_H diff --git a/qtinterface/qt4/Qt/q3widgetstack.h b/qtinterface/qt4/Qt/q3widgetstack.h new file mode 100644 index 0000000..836f3de --- /dev/null +++ b/qtinterface/qt4/Qt/q3widgetstack.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3WIDGETSTACK_H +#define Q3WIDGETSTACK_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class Q3WidgetStackPrivate; + + +class Q_COMPAT_EXPORT Q3WidgetStack: public Q3Frame +{ + Q_OBJECT +public: + Q3WidgetStack(QWidget* parent, const char* name=0, Qt::WindowFlags f=0); + + ~Q3WidgetStack(); + + int addWidget(QWidget *, int = -1); + void removeWidget(QWidget *); + + QSize sizeHint() const; + QSize minimumSizeHint() const; + void setVisible(bool visible); + + QWidget * widget(int) const; + int id(QWidget *) const; + + QWidget * visibleWidget() const; + + void setFrameRect(const QRect &); + +Q_SIGNALS: + void aboutToShow(int); + void aboutToShow(QWidget *); + +public Q_SLOTS: + void raiseWidget(int); + void raiseWidget(QWidget *); + +protected: + void frameChanged(); + void resizeEvent(QResizeEvent *); + bool event(QEvent* e); + + virtual void setChildGeometries(); + void childEvent(QChildEvent *); + +private: + void init(); + + Q3WidgetStackPrivate * d; + Q3IntDict * dict; + Q3PtrDict * focusWidgets; + QWidget * topWidget; + QWidget * invisible; + + Q_DISABLE_COPY(Q3WidgetStack) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3WIDGETSTACK_H diff --git a/qtinterface/qt4/Qt/q3wizard.h b/qtinterface/qt4/Qt/q3wizard.h new file mode 100644 index 0000000..134777c --- /dev/null +++ b/qtinterface/qt4/Qt/q3wizard.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt3Support module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q3WIZARD_H +#define Q3WIZARD_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Qt3SupportLight) + +class QHBoxLayout; +class Q3WizardPrivate; + +class Q_COMPAT_EXPORT Q3Wizard : public QDialog +{ + Q_OBJECT + Q_PROPERTY( QFont titleFont READ titleFont WRITE setTitleFont ) + +public: + Q3Wizard( QWidget* parent=0, const char* name=0, bool modal=false, Qt::WindowFlags f=0 ); + ~Q3Wizard(); + + void setVisible(bool); + + void setFont( const QFont & font ); + + virtual void addPage( QWidget *, const QString & ); + virtual void insertPage( QWidget*, const QString&, int ); + virtual void removePage( QWidget * ); + + QString title( QWidget * ) const; + void setTitle( QWidget *, const QString & ); + QFont titleFont() const; + void setTitleFont( const QFont & ); + + virtual void showPage( QWidget * ); + + QWidget * currentPage() const; + + QWidget* page( int ) const; + int pageCount() const; + int indexOf( QWidget* ) const; + + virtual bool appropriate( QWidget * ) const; + virtual void setAppropriate( QWidget *, bool ); + + QPushButton * backButton() const; + QPushButton * nextButton() const; + QPushButton * finishButton() const; + QPushButton * cancelButton() const; + QPushButton * helpButton() const; + + bool eventFilter( QObject *, QEvent * ); + +public Q_SLOTS: + virtual void setBackEnabled( QWidget *, bool ); + virtual void setNextEnabled( QWidget *, bool ); + virtual void setFinishEnabled( QWidget *, bool ); + + virtual void setHelpEnabled( QWidget *, bool ); + + // obsolete + virtual void setFinish( QWidget *, bool ) {} + +protected Q_SLOTS: + virtual void back(); + virtual void next(); + virtual void help(); + +Q_SIGNALS: + void helpClicked(); + void selected( const QString& ); + +protected: + virtual void layOutButtonRow( QHBoxLayout * ); + virtual void layOutTitleRow( QHBoxLayout *, const QString & ); + +private: + void setBackEnabled( bool ); + void setNextEnabled( bool ); + + void setHelpEnabled( bool ); + + void setNextPage( QWidget * ); + + void updateButtons(); + + void layOut(); + + Q3WizardPrivate *d; + + Q_DISABLE_COPY(Q3Wizard) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q3WIZARD_H diff --git a/qtinterface/qt4/Qt/qabstractanimation.h b/qtinterface/qt4/Qt/qabstractanimation.h new file mode 100644 index 0000000..fe40ff1 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractanimation.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTANIMATION_H +#define QABSTRACTANIMATION_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +#ifndef QT_NO_ANIMATION + +class QAnimationGroup; +class QSequentialAnimationGroup; + +class QAbstractAnimationPrivate; +class Q_CORE_EXPORT QAbstractAnimation : public QObject +{ + Q_OBJECT + Q_ENUMS(State) + Q_ENUMS(Direction) + Q_PROPERTY(State state READ state NOTIFY stateChanged) + Q_PROPERTY(int loopCount READ loopCount WRITE setLoopCount) + Q_PROPERTY(int currentTime READ currentTime WRITE setCurrentTime) + Q_PROPERTY(int currentLoop READ currentLoop NOTIFY currentLoopChanged) + Q_PROPERTY(Direction direction READ direction WRITE setDirection NOTIFY directionChanged) + Q_PROPERTY(int duration READ duration) + +public: + enum Direction { + Forward, + Backward + }; + + enum State { + Stopped, + Paused, + Running + }; + + enum DeletionPolicy { + KeepWhenStopped = 0, + DeleteWhenStopped + }; + + QAbstractAnimation(QObject *parent = 0); + virtual ~QAbstractAnimation(); + + State state() const; + + QAnimationGroup *group() const; + + Direction direction() const; + void setDirection(Direction direction); + + int currentTime() const; + int currentLoopTime() const; + + int loopCount() const; + void setLoopCount(int loopCount); + int currentLoop() const; + + virtual int duration() const = 0; + int totalDuration() const; + +Q_SIGNALS: + void finished(); + void stateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); + void currentLoopChanged(int currentLoop); + void directionChanged(QAbstractAnimation::Direction); + +public Q_SLOTS: + void start(QAbstractAnimation::DeletionPolicy policy = KeepWhenStopped); + void pause(); + void resume(); + void setPaused(bool); + void stop(); + void setCurrentTime(int msecs); + +protected: + QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = 0); + bool event(QEvent *event); + + virtual void updateCurrentTime(int currentTime) = 0; + virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); + virtual void updateDirection(QAbstractAnimation::Direction direction); + +private: + Q_DISABLE_COPY(QAbstractAnimation) + Q_DECLARE_PRIVATE(QAbstractAnimation) +}; + +#endif //QT_NO_ANIMATION + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTANIMATION_H diff --git a/qtinterface/qt4/Qt/qabstractbutton.h b/qtinterface/qt4/Qt/qabstractbutton.h new file mode 100644 index 0000000..b092cf7 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractbutton.h @@ -0,0 +1,180 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTBUTTON_H +#define QABSTRACTBUTTON_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QButtonGroup; +class QAbstractButtonPrivate; + +class Q_GUI_EXPORT QAbstractButton : public QWidget +{ + Q_OBJECT + + Q_PROPERTY(QString text READ text WRITE setText) + Q_PROPERTY(QIcon icon READ icon WRITE setIcon) + Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) +#ifndef QT_NO_SHORTCUT + Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut) +#endif + Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable) + Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled USER true) + Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat) + Q_PROPERTY(bool autoExclusive READ autoExclusive WRITE setAutoExclusive) + Q_PROPERTY(int autoRepeatDelay READ autoRepeatDelay WRITE setAutoRepeatDelay) + Q_PROPERTY(int autoRepeatInterval READ autoRepeatInterval WRITE setAutoRepeatInterval) + Q_PROPERTY(bool down READ isDown WRITE setDown DESIGNABLE false) + +public: + explicit QAbstractButton(QWidget* parent=0); + ~QAbstractButton(); + + void setText(const QString &text); + QString text() const; + + void setIcon(const QIcon &icon); + QIcon icon() const; + + QSize iconSize() const; + +#ifndef QT_NO_SHORTCUT + void setShortcut(const QKeySequence &key); + QKeySequence shortcut() const; +#endif + + void setCheckable(bool); + bool isCheckable() const; + + bool isChecked() const; + + void setDown(bool); + bool isDown() const; + + void setAutoRepeat(bool); + bool autoRepeat() const; + + void setAutoRepeatDelay(int); + int autoRepeatDelay() const; + + void setAutoRepeatInterval(int); + int autoRepeatInterval() const; + + void setAutoExclusive(bool); + bool autoExclusive() const; + +#ifndef QT_NO_BUTTONGROUP + QButtonGroup *group() const; +#endif + +public Q_SLOTS: + void setIconSize(const QSize &size); + void animateClick(int msec = 100); + void click(); + void toggle(); + void setChecked(bool); + +Q_SIGNALS: + void pressed(); + void released(); + void clicked(bool checked = false); + void toggled(bool checked); + +protected: + virtual void paintEvent(QPaintEvent *e) = 0; + virtual bool hitButton(const QPoint &pos) const; + virtual void checkStateSet(); + virtual void nextCheckState(); + + bool event(QEvent *e); + void keyPressEvent(QKeyEvent *e); + void keyReleaseEvent(QKeyEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void focusInEvent(QFocusEvent *e); + void focusOutEvent(QFocusEvent *e); + void changeEvent(QEvent *e); + void timerEvent(QTimerEvent *e); + +#ifdef QT3_SUPPORT +public: + QT3_SUPPORT_CONSTRUCTOR QAbstractButton(QWidget *parent, const char *name, Qt::WindowFlags f=0); + inline QT3_SUPPORT bool isOn() const { return isChecked(); } + inline QT3_SUPPORT const QPixmap *pixmap() const { return 0; } // help styles compile + inline QT3_SUPPORT void setPixmap( const QPixmap &p ) { + setIcon(QIcon(p)); + setIconSize(p.size()); + } + QT3_SUPPORT QIcon *iconSet() const; + inline QT3_SUPPORT void setIconSet(const QIcon &icon) { setIcon(icon); } + inline QT3_SUPPORT bool isToggleButton() const { return isCheckable(); } + inline QT3_SUPPORT void setToggleButton(bool b) { setCheckable(b); } + inline QT3_SUPPORT void setAccel(const QKeySequence &key) { setShortcut(key); } + inline QT3_SUPPORT QKeySequence accel() const { return shortcut(); } + +public Q_SLOTS: + inline QT_MOC_COMPAT void setOn(bool b) { setChecked(b); } +#endif + +protected: + QAbstractButton(QAbstractButtonPrivate &dd, QWidget* parent = 0); + +private: + Q_DECLARE_PRIVATE(QAbstractButton) + Q_DISABLE_COPY(QAbstractButton) + friend class QButtonGroup; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTBUTTON_H diff --git a/qtinterface/qt4/Qt/qabstracteventdispatcher.h b/qtinterface/qt4/Qt/qabstracteventdispatcher.h new file mode 100644 index 0000000..c0bec2b --- /dev/null +++ b/qtinterface/qt4/Qt/qabstracteventdispatcher.h @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTEVENTDISPATCHER_H +#define QABSTRACTEVENTDISPATCHER_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QAbstractEventDispatcherPrivate; +class QSocketNotifier; +template struct QPair; + +class Q_CORE_EXPORT QAbstractEventDispatcher : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QAbstractEventDispatcher) + +public: + typedef QPair TimerInfo; + + explicit QAbstractEventDispatcher(QObject *parent = 0); + ~QAbstractEventDispatcher(); + + static QAbstractEventDispatcher *instance(QThread *thread = 0); + + virtual bool processEvents(QEventLoop::ProcessEventsFlags flags) = 0; + virtual bool hasPendingEvents() = 0; + + virtual void registerSocketNotifier(QSocketNotifier *notifier) = 0; + virtual void unregisterSocketNotifier(QSocketNotifier *notifier) = 0; + + int registerTimer(int interval, QObject *object); + virtual void registerTimer(int timerId, int interval, QObject *object) = 0; + virtual bool unregisterTimer(int timerId) = 0; + virtual bool unregisterTimers(QObject *object) = 0; + virtual QList registeredTimers(QObject *object) const = 0; + + virtual void wakeUp() = 0; + virtual void interrupt() = 0; + virtual void flush() = 0; + + virtual void startingUp(); + virtual void closingDown(); + + typedef bool(*EventFilter)(void *message); + EventFilter setEventFilter(EventFilter filter); + bool filterEvent(void *message); + +Q_SIGNALS: + void aboutToBlock(); + void awake(); + +protected: + QAbstractEventDispatcher(QAbstractEventDispatcherPrivate &, + QObject *parent); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTEVENTDISPATCHER_H diff --git a/qtinterface/qt4/Qt/qabstractfileengine.h b/qtinterface/qt4/Qt/qabstractfileengine.h new file mode 100644 index 0000000..3d41151 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractfileengine.h @@ -0,0 +1,248 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTFILEENGINE_H +#define QABSTRACTFILEENGINE_H + +#include + +#ifdef open +#error qabstractfileengine.h must be included before any header file that defines open +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QFileExtension; +class QFileExtensionResult; +class QVariant; +class QAbstractFileEngineIterator; +class QAbstractFileEnginePrivate; + +class Q_CORE_EXPORT QAbstractFileEngine +{ +public: + enum FileFlag { + //perms (overlaps the QFile::Permission) + ReadOwnerPerm = 0x4000, WriteOwnerPerm = 0x2000, ExeOwnerPerm = 0x1000, + ReadUserPerm = 0x0400, WriteUserPerm = 0x0200, ExeUserPerm = 0x0100, + ReadGroupPerm = 0x0040, WriteGroupPerm = 0x0020, ExeGroupPerm = 0x0010, + ReadOtherPerm = 0x0004, WriteOtherPerm = 0x0002, ExeOtherPerm = 0x0001, + + //types + LinkType = 0x10000, + FileType = 0x20000, + DirectoryType = 0x40000, + BundleType = 0x80000, + + //flags + HiddenFlag = 0x0100000, + LocalDiskFlag = 0x0200000, + ExistsFlag = 0x0400000, + RootFlag = 0x0800000, + Refresh = 0x1000000, + + //masks + PermsMask = 0x0000FFFF, + TypesMask = 0x000F0000, + FlagsMask = 0x0FF00000, + FileInfoAll = FlagsMask | PermsMask | TypesMask + }; + Q_DECLARE_FLAGS(FileFlags, FileFlag) + + enum FileName { + DefaultName, + BaseName, + PathName, + AbsoluteName, + AbsolutePathName, + LinkName, + CanonicalName, + CanonicalPathName, + BundleName, + NFileNames = 9 + }; + enum FileOwner { + OwnerUser, + OwnerGroup + }; + enum FileTime { + CreationTime, + ModificationTime, + AccessTime + }; + + virtual ~QAbstractFileEngine(); + + virtual bool open(QIODevice::OpenMode openMode); + virtual bool close(); + virtual bool flush(); + virtual qint64 size() const; + virtual qint64 pos() const; + virtual bool seek(qint64 pos); + virtual bool isSequential() const; + virtual bool remove(); + virtual bool copy(const QString &newName); + virtual bool rename(const QString &newName); + virtual bool link(const QString &newName); + virtual bool mkdir(const QString &dirName, bool createParentDirectories) const; + virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const; + virtual bool setSize(qint64 size); + virtual bool caseSensitive() const; + virtual bool isRelativePath() const; + virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const; + virtual FileFlags fileFlags(FileFlags type=FileInfoAll) const; + virtual bool setPermissions(uint perms); + virtual QString fileName(FileName file=DefaultName) const; + virtual uint ownerId(FileOwner) const; + virtual QString owner(FileOwner) const; + virtual QDateTime fileTime(FileTime time) const; + virtual void setFileName(const QString &file); + virtual int handle() const; + bool atEnd() const; + uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags); + bool unmap(uchar *ptr); + + typedef QAbstractFileEngineIterator Iterator; + virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames); + virtual Iterator *endEntryList(); + + virtual qint64 read(char *data, qint64 maxlen); + virtual qint64 readLine(char *data, qint64 maxlen); + virtual qint64 write(const char *data, qint64 len); + + QFile::FileError error() const; + QString errorString() const; + + enum Extension { + AtEndExtension, + FastReadLineExtension, + MapExtension, + UnMapExtension + }; + class ExtensionOption + {}; + class ExtensionReturn + {}; + + class MapExtensionOption : public ExtensionOption { + public: + qint64 offset; + qint64 size; + QFile::MemoryMapFlags flags; + }; + class MapExtensionReturn : public ExtensionReturn { + public: + uchar *address; + }; + + class UnMapExtensionOption : public ExtensionOption { + public: + uchar *address; + }; + + virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0); + virtual bool supportsExtension(Extension extension) const; + + // Factory + static QAbstractFileEngine *create(const QString &fileName); + +protected: + void setError(QFile::FileError error, const QString &str); + + QAbstractFileEngine(); + QAbstractFileEngine(QAbstractFileEnginePrivate &); + + QScopedPointer d_ptr; +private: + Q_DECLARE_PRIVATE(QAbstractFileEngine) + Q_DISABLE_COPY(QAbstractFileEngine) +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractFileEngine::FileFlags) + +class Q_CORE_EXPORT QAbstractFileEngineHandler +{ +public: + QAbstractFileEngineHandler(); + virtual ~QAbstractFileEngineHandler(); + virtual QAbstractFileEngine *create(const QString &fileName) const = 0; +}; + +class QAbstractFileEngineIteratorPrivate; +class Q_CORE_EXPORT QAbstractFileEngineIterator +{ +public: + QAbstractFileEngineIterator(QDir::Filters filters, const QStringList &nameFilters); + virtual ~QAbstractFileEngineIterator(); + + virtual QString next() = 0; + virtual bool hasNext() const = 0; + + QString path() const; + QStringList nameFilters() const; + QDir::Filters filters() const; + + virtual QString currentFileName() const = 0; + virtual QFileInfo currentFileInfo() const; + QString currentFilePath() const; + +protected: + enum EntryInfoType { + }; + virtual QVariant entryInfo(EntryInfoType type) const; + +private: + Q_DISABLE_COPY(QAbstractFileEngineIterator) + friend class QDirIterator; + friend class QDirIteratorPrivate; + void setPath(const QString &path); + QScopedPointer d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTFILEENGINE_H diff --git a/qtinterface/qt4/Qt/qabstractfontengine_qws.h b/qtinterface/qt4/Qt/qabstractfontengine_qws.h new file mode 100644 index 0000000..dffb39d --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractfontengine_qws.h @@ -0,0 +1,221 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTFONTENGINE_QWS_H +#define QABSTRACTFONTENGINE_QWS_H + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QFontEngineInfoPrivate; + +class Q_GUI_EXPORT QFontEngineInfo +{ +public: + QDOC_PROPERTY(QString family READ family WRITE setFamily) + QDOC_PROPERTY(qreal pixelSize READ pixelSize WRITE setPixelSize) + QDOC_PROPERTY(int weight READ weight WRITE setWeight) + QDOC_PROPERTY(QFont::Style style READ style WRITE setStyle) + QDOC_PROPERTY(QList writingSystems READ writingSystems WRITE setWritingSystems) + + QFontEngineInfo(); + explicit QFontEngineInfo(const QString &family); + QFontEngineInfo(const QFontEngineInfo &other); + QFontEngineInfo &operator=(const QFontEngineInfo &other); + ~QFontEngineInfo(); + + void setFamily(const QString &name); + QString family() const; + + void setPixelSize(qreal size); + qreal pixelSize() const; + + void setWeight(int weight); + int weight() const; + + void setStyle(QFont::Style style); + QFont::Style style() const; + + QList writingSystems() const; + void setWritingSystems(const QList &writingSystems); + +private: + QFontEngineInfoPrivate *d; +}; + +class QAbstractFontEngine; + +struct Q_GUI_EXPORT QFontEngineFactoryInterface : public QFactoryInterface +{ + virtual QAbstractFontEngine *create(const QFontEngineInfo &info) = 0; + virtual QList availableFontEngines() const = 0; +}; + +#define QFontEngineFactoryInterface_iid "com.trolltech.Qt.QFontEngineFactoryInterface" +Q_DECLARE_INTERFACE(QFontEngineFactoryInterface, QFontEngineFactoryInterface_iid) + +class QFontEnginePluginPrivate; + +class Q_GUI_EXPORT QFontEnginePlugin : public QObject, public QFontEngineFactoryInterface +{ + Q_OBJECT + Q_INTERFACES(QFontEngineFactoryInterface:QFactoryInterface) +public: + QFontEnginePlugin(const QString &foundry, QObject *parent = 0); + ~QFontEnginePlugin(); + + virtual QStringList keys() const; + + virtual QAbstractFontEngine *create(const QFontEngineInfo &info) = 0; + virtual QList availableFontEngines() const = 0; + +private: + Q_DECLARE_PRIVATE(QFontEnginePlugin) + Q_DISABLE_COPY(QFontEnginePlugin) +}; + +class QAbstractFontEnginePrivate; + +class Q_GUI_EXPORT QAbstractFontEngine : public QObject +{ + Q_OBJECT +public: + enum Capability { + CanOutlineGlyphs = 1, + CanRenderGlyphs_Mono = 2, + CanRenderGlyphs_Gray = 4, + CanRenderGlyphs = CanRenderGlyphs_Mono | CanRenderGlyphs_Gray + }; + Q_DECLARE_FLAGS(Capabilities, Capability) + + explicit QAbstractFontEngine(QObject *parent = 0); + ~QAbstractFontEngine(); + + typedef int Fixed; // 26.6 + + struct FixedPoint + { + Fixed x; + Fixed y; + }; + + struct GlyphMetrics + { + inline GlyphMetrics() + : x(0), y(0), width(0), height(0), + advance(0) {} + Fixed x; + Fixed y; + Fixed width; + Fixed height; + Fixed advance; + }; + + enum FontProperty { + Ascent, + Descent, + Leading, + XHeight, + AverageCharWidth, + LineThickness, + UnderlinePosition, + MaxCharWidth, + MinLeftBearing, + MinRightBearing, + GlyphCount, + + // hints + CacheGlyphsHint, + OutlineGlyphsHint + }; + + // keep in sync with QTextEngine::ShaperFlag!! + enum TextShapingFlag { + RightToLeft = 0x0001, + ReturnDesignMetrics = 0x0002 + }; + Q_DECLARE_FLAGS(TextShapingFlags, TextShapingFlag) + + virtual Capabilities capabilities() const = 0; + virtual QVariant fontProperty(FontProperty property) const = 0; + + virtual bool convertStringToGlyphIndices(const QChar *string, int length, uint *glyphs, int *numGlyphs, TextShapingFlags flags) const = 0; + + virtual void getGlyphAdvances(const uint *glyphs, int numGlyphs, Fixed *advances, TextShapingFlags flags) const = 0; + + virtual GlyphMetrics glyphMetrics(uint glyph) const = 0; + + virtual bool renderGlyph(uint glyph, int depth, int bytesPerLine, int height, uchar *buffer); + + virtual void addGlyphOutlinesToPath(uint *glyphs, int numGlyphs, FixedPoint *positions, QPainterPath *path); + + /* + enum Extension { + GetTrueTypeTable + }; + + virtual bool supportsExtension(Extension extension) const; + virtual QVariant extension(Extension extension, const QVariant &argument = QVariant()); + */ + +private: + Q_DECLARE_PRIVATE(QAbstractFontEngine) + Q_DISABLE_COPY(QAbstractFontEngine) +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractFontEngine::Capabilities) +Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractFontEngine::TextShapingFlags) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qabstractitemdelegate.h b/qtinterface/qt4/Qt/qabstractitemdelegate.h new file mode 100644 index 0000000..ed17575 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractitemdelegate.h @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTITEMDELEGATE_H +#define QABSTRACTITEMDELEGATE_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ITEMVIEWS + +class QPainter; +class QModelIndex; +class QAbstractItemModel; +class QAbstractItemView; +class QHelpEvent; + +class Q_GUI_EXPORT QAbstractItemDelegate : public QObject +{ + Q_OBJECT + +public: + + enum EndEditHint { + NoHint, + EditNextItem, + EditPreviousItem, + SubmitModelCache, + RevertModelCache + }; + + explicit QAbstractItemDelegate(QObject *parent = 0); + virtual ~QAbstractItemDelegate(); + + // painting + virtual void paint(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const = 0; + + virtual QSize sizeHint(const QStyleOptionViewItem &option, + const QModelIndex &index) const = 0; + + // editing + virtual QWidget *createEditor(QWidget *parent, + const QStyleOptionViewItem &option, + const QModelIndex &index) const; + + virtual void setEditorData(QWidget *editor, const QModelIndex &index) const; + + virtual void setModelData(QWidget *editor, + QAbstractItemModel *model, + const QModelIndex &index) const; + + virtual void updateEditorGeometry(QWidget *editor, + const QStyleOptionViewItem &option, + const QModelIndex &index) const; + + // for non-widget editors + virtual bool editorEvent(QEvent *event, + QAbstractItemModel *model, + const QStyleOptionViewItem &option, + const QModelIndex &index); + + static QString elidedText(const QFontMetrics &fontMetrics, int width, + Qt::TextElideMode mode, const QString &text); + +public Q_SLOTS: + bool helpEvent(QHelpEvent *event, + QAbstractItemView *view, + const QStyleOptionViewItem &option, + const QModelIndex &index); + +Q_SIGNALS: + void commitData(QWidget *editor); + void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint = NoHint); + void sizeHintChanged(const QModelIndex &); + +protected: + QAbstractItemDelegate(QObjectPrivate &, QObject *parent = 0); +private: + Q_DISABLE_COPY(QAbstractItemDelegate) +}; + +#endif // QT_NO_ITEMVIEWS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTITEMDELEGATE_H diff --git a/qtinterface/qt4/Qt/qabstractitemmodel.h b/qtinterface/qt4/Qt/qabstractitemmodel.h new file mode 100644 index 0000000..3ac41b3 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractitemmodel.h @@ -0,0 +1,410 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTITEMMODEL_H +#define QABSTRACTITEMMODEL_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QAbstractItemModel; +class QPersistentModelIndex; + +class Q_CORE_EXPORT QModelIndex +{ + friend class QAbstractItemModel; + friend class QProxyModel; +public: + inline QModelIndex() : r(-1), c(-1), p(0), m(0) {} + inline QModelIndex(const QModelIndex &other) + : r(other.r), c(other.c), p(other.p), m(other.m) {} + inline ~QModelIndex() { p = 0; m = 0; } + inline int row() const { return r; } + inline int column() const { return c; } + inline void *internalPointer() const { return p; } + inline qint64 internalId() const { return reinterpret_cast(p); } + inline QModelIndex parent() const; + inline QModelIndex sibling(int row, int column) const; + inline QModelIndex child(int row, int column) const; + inline QVariant data(int role = Qt::DisplayRole) const; + inline Qt::ItemFlags flags() const; + inline const QAbstractItemModel *model() const { return m; } + inline bool isValid() const { return (r >= 0) && (c >= 0) && (m != 0); } + inline bool operator==(const QModelIndex &other) const + { return (other.r == r) && (other.p == p) && (other.c == c) && (other.m == m); } + inline bool operator!=(const QModelIndex &other) const + { return !(*this == other); } + inline bool operator<(const QModelIndex &other) const + { + if (r < other.r) return true; + if (r == other.r) { + if (c < other.c) return true; + if (c == other.c) { + if (p < other.p) return true; + if (p == other.p) return m < other.m; + } + } + return false; } +private: + inline QModelIndex(int row, int column, void *ptr, const QAbstractItemModel *model); + int r, c; + void *p; + const QAbstractItemModel *m; +}; +Q_DECLARE_TYPEINFO(QModelIndex, Q_MOVABLE_TYPE); + +#ifndef QT_NO_DEBUG_STREAM +Q_CORE_EXPORT QDebug operator<<(QDebug, const QModelIndex &); +#endif + +class QPersistentModelIndexData; + +class Q_CORE_EXPORT QPersistentModelIndex +{ +public: + QPersistentModelIndex(); + QPersistentModelIndex(const QModelIndex &index); + QPersistentModelIndex(const QPersistentModelIndex &other); + ~QPersistentModelIndex(); + bool operator<(const QPersistentModelIndex &other) const; + bool operator==(const QPersistentModelIndex &other) const; + inline bool operator!=(const QPersistentModelIndex &other) const + { return !operator==(other); } + QPersistentModelIndex &operator=(const QPersistentModelIndex &other); + bool operator==(const QModelIndex &other) const; + bool operator!=(const QModelIndex &other) const; + QPersistentModelIndex &operator=(const QModelIndex &other); + operator const QModelIndex&() const; + int row() const; + int column() const; + void *internalPointer() const; + qint64 internalId() const; + QModelIndex parent() const; + QModelIndex sibling(int row, int column) const; + QModelIndex child(int row, int column) const; + QVariant data(int role = Qt::DisplayRole) const; + Qt::ItemFlags flags() const; + const QAbstractItemModel *model() const; + bool isValid() const; +private: + QPersistentModelIndexData *d; + friend uint qHash(const QPersistentModelIndex &); +#ifndef QT_NO_DEBUG_STREAM + friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QPersistentModelIndex &); +#endif +}; +Q_DECLARE_TYPEINFO(QPersistentModelIndex, Q_MOVABLE_TYPE); + +inline uint qHash(const QPersistentModelIndex &index) +{ return qHash(index.d); } + + +#ifndef QT_NO_DEBUG_STREAM +Q_CORE_EXPORT QDebug operator<<(QDebug, const QPersistentModelIndex &); +#endif + +template class QList; +typedef QList QModelIndexList; + +class QMimeData; +class QAbstractItemModelPrivate; +template class QMap; + + +class Q_CORE_EXPORT QAbstractItemModel : public QObject +{ + Q_OBJECT + + friend class QPersistentModelIndexData; + friend class QAbstractItemViewPrivate; +public: + + explicit QAbstractItemModel(QObject *parent = 0); + virtual ~QAbstractItemModel(); + + bool hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const; + virtual QModelIndex index(int row, int column, + const QModelIndex &parent = QModelIndex()) const = 0; + virtual QModelIndex parent(const QModelIndex &child) const = 0; + + inline QModelIndex sibling(int row, int column, const QModelIndex &idx) const + { return index(row, column, parent(idx)); } + + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const = 0; + virtual int columnCount(const QModelIndex &parent = QModelIndex()) const = 0; + virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const; + + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const = 0; + virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + + virtual QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const; + virtual bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, + int role = Qt::EditRole); + + virtual QMap itemData(const QModelIndex &index) const; + virtual bool setItemData(const QModelIndex &index, const QMap &roles); + + virtual QStringList mimeTypes() const; + virtual QMimeData *mimeData(const QModelIndexList &indexes) const; + virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, + int row, int column, const QModelIndex &parent); + virtual Qt::DropActions supportedDropActions() const; + + Qt::DropActions supportedDragActions() const; + void setSupportedDragActions(Qt::DropActions); + + virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()); + virtual bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()); + virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); + virtual bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()); + + inline bool insertRow(int row, const QModelIndex &parent = QModelIndex()); + inline bool insertColumn(int column, const QModelIndex &parent = QModelIndex()); + inline bool removeRow(int row, const QModelIndex &parent = QModelIndex()); + inline bool removeColumn(int column, const QModelIndex &parent = QModelIndex()); + + virtual void fetchMore(const QModelIndex &parent); + virtual bool canFetchMore(const QModelIndex &parent) const; + virtual Qt::ItemFlags flags(const QModelIndex &index) const; + virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); + virtual QModelIndex buddy(const QModelIndex &index) const; + virtual QModelIndexList match(const QModelIndex &start, int role, + const QVariant &value, int hits = 1, + Qt::MatchFlags flags = + Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const; + virtual QSize span(const QModelIndex &index) const; + + const QHash &roleNames() const; + +#ifdef Q_NO_USING_KEYWORD + inline QObject *parent() const { return QObject::parent(); } +#else + using QObject::parent; +#endif + +Q_SIGNALS: + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void headerDataChanged(Qt::Orientation orientation, int first, int last); + void layoutChanged(); + void layoutAboutToBeChanged(); + +#if !defined(Q_MOC_RUN) && !defined(qdoc) +private: // can only be emitted by QAbstractItemModel +#endif + void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last); + void rowsInserted(const QModelIndex &parent, int first, int last); + + void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last); + void rowsRemoved(const QModelIndex &parent, int first, int last); + + void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last); + void columnsInserted(const QModelIndex &parent, int first, int last); + + void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last); + void columnsRemoved(const QModelIndex &parent, int first, int last); + + void modelAboutToBeReset(); + void modelReset(); + + void rowsAboutToBeMoved( const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow ); + void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row ); + + void columnsAboutToBeMoved( const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn ); + void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column ); + + +public Q_SLOTS: + virtual bool submit(); + virtual void revert(); + +protected: + QAbstractItemModel(QAbstractItemModelPrivate &dd, QObject *parent = 0); + + inline QModelIndex createIndex(int row, int column, void *data = 0) const; + inline QModelIndex createIndex(int row, int column, int id) const; + inline QModelIndex createIndex(int row, int column, quint32 id) const; + + void encodeData(const QModelIndexList &indexes, QDataStream &stream) const; + bool decodeData(int row, int column, const QModelIndex &parent, QDataStream &stream); + + void beginInsertRows(const QModelIndex &parent, int first, int last); + void endInsertRows(); + + void beginRemoveRows(const QModelIndex &parent, int first, int last); + void endRemoveRows(); + + bool beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow); + void endMoveRows(); + + void beginInsertColumns(const QModelIndex &parent, int first, int last); + void endInsertColumns(); + + void beginRemoveColumns(const QModelIndex &parent, int first, int last); + void endRemoveColumns(); + + bool beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn); + void endMoveColumns(); + + void reset(); + + void beginResetModel(); + void endResetModel(); + + void changePersistentIndex(const QModelIndex &from, const QModelIndex &to); + void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to); + QModelIndexList persistentIndexList() const; + + void setRoleNames(const QHash &roleNames); + +private: + Q_DECLARE_PRIVATE(QAbstractItemModel) + Q_DISABLE_COPY(QAbstractItemModel) +}; + +inline bool QAbstractItemModel::insertRow(int arow, const QModelIndex &aparent) +{ return insertRows(arow, 1, aparent); } +inline bool QAbstractItemModel::insertColumn(int acolumn, const QModelIndex &aparent) +{ return insertColumns(acolumn, 1, aparent); } +inline bool QAbstractItemModel::removeRow(int arow, const QModelIndex &aparent) +{ return removeRows(arow, 1, aparent); } +inline bool QAbstractItemModel::removeColumn(int acolumn, const QModelIndex &aparent) +{ return removeColumns(acolumn, 1, aparent); } + +inline QModelIndex QAbstractItemModel::createIndex(int arow, int acolumn, void *adata) const +{ return QModelIndex(arow, acolumn, adata, this); } +inline QModelIndex QAbstractItemModel::createIndex(int arow, int acolumn, int aid) const +#if defined(Q_CC_MSVC) +#pragma warning( push ) +#pragma warning( disable : 4312 ) // avoid conversion warning on 64-bit +#endif +{ return QModelIndex(arow, acolumn, reinterpret_cast(aid), this); } +#if defined(Q_CC_MSVC) +#pragma warning( pop ) +#endif +inline QModelIndex QAbstractItemModel::createIndex(int arow, int acolumn, quint32 aid) const +#if defined(Q_CC_MSVC) +#pragma warning( push ) +#pragma warning( disable : 4312 ) // avoid conversion warning on 64-bit +#endif +{ return QModelIndex(arow, acolumn, reinterpret_cast(aid), this); } +#if defined(Q_CC_MSVC) +#pragma warning( pop ) +#endif + + +class Q_CORE_EXPORT QAbstractTableModel : public QAbstractItemModel +{ + Q_OBJECT + +public: + explicit QAbstractTableModel(QObject *parent = 0); + ~QAbstractTableModel(); + + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, + int row, int column, const QModelIndex &parent); +protected: + QAbstractTableModel(QAbstractItemModelPrivate &dd, QObject *parent); + +private: + Q_DISABLE_COPY(QAbstractTableModel) + QModelIndex parent(const QModelIndex &child) const; + bool hasChildren(const QModelIndex &parent) const; +}; + +class Q_CORE_EXPORT QAbstractListModel : public QAbstractItemModel +{ + Q_OBJECT + +public: + explicit QAbstractListModel(QObject *parent = 0); + ~QAbstractListModel(); + + QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, + int row, int column, const QModelIndex &parent); +protected: + QAbstractListModel(QAbstractItemModelPrivate &dd, QObject *parent); + +private: + Q_DISABLE_COPY(QAbstractListModel) + QModelIndex parent(const QModelIndex &child) const; + int columnCount(const QModelIndex &parent) const; + bool hasChildren(const QModelIndex &parent) const; +}; + +// inline implementations + +inline QModelIndex::QModelIndex(int arow, int acolumn, void *adata, + const QAbstractItemModel *amodel) + : r(arow), c(acolumn), p(adata), m(amodel) {} + +inline QModelIndex QModelIndex::parent() const +{ return m ? m->parent(*this) : QModelIndex(); } + +inline QModelIndex QModelIndex::sibling(int arow, int acolumn) const +{ return m ? (r == arow && c == acolumn) ? *this : m->index(arow, acolumn, m->parent(*this)) : QModelIndex(); } + +inline QModelIndex QModelIndex::child(int arow, int acolumn) const +{ return m ? m->index(arow, acolumn, *this) : QModelIndex(); } + +inline QVariant QModelIndex::data(int arole) const +{ return m ? m->data(*this, arole) : QVariant(); } + +inline Qt::ItemFlags QModelIndex::flags() const +{ return m ? m->flags(*this) : Qt::ItemFlags(0); } + +inline uint qHash(const QModelIndex &index) +{ return uint((index.row() << 4) + index.column() + index.internalId()); } + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTITEMMODEL_H diff --git a/qtinterface/qt4/Qt/qabstractitemview.h b/qtinterface/qt4/Qt/qabstractitemview.h new file mode 100644 index 0000000..00677d9 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractitemview.h @@ -0,0 +1,377 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTITEMVIEW_H +#define QABSTRACTITEMVIEW_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ITEMVIEWS + +class QMenu; +class QDrag; +class QEvent; +class QAbstractItemViewPrivate; + +class Q_GUI_EXPORT QAbstractItemView : public QAbstractScrollArea +{ + Q_OBJECT + Q_ENUMS(SelectionMode SelectionBehavior ScrollHint ScrollMode DragDropMode) + Q_FLAGS(EditTriggers) + Q_PROPERTY(bool autoScroll READ hasAutoScroll WRITE setAutoScroll) + Q_PROPERTY(int autoScrollMargin READ autoScrollMargin WRITE setAutoScrollMargin) + Q_PROPERTY(EditTriggers editTriggers READ editTriggers WRITE setEditTriggers) + Q_PROPERTY(bool tabKeyNavigation READ tabKeyNavigation WRITE setTabKeyNavigation) +#ifndef QT_NO_DRAGANDDROP + Q_PROPERTY(bool showDropIndicator READ showDropIndicator WRITE setDropIndicatorShown) + Q_PROPERTY(bool dragEnabled READ dragEnabled WRITE setDragEnabled) + Q_PROPERTY(bool dragDropOverwriteMode READ dragDropOverwriteMode WRITE setDragDropOverwriteMode) + Q_PROPERTY(DragDropMode dragDropMode READ dragDropMode WRITE setDragDropMode) + Q_PROPERTY(Qt::DropAction defaultDropAction READ defaultDropAction WRITE setDefaultDropAction) +#endif + Q_PROPERTY(bool alternatingRowColors READ alternatingRowColors WRITE setAlternatingRowColors) + Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) + Q_PROPERTY(SelectionBehavior selectionBehavior READ selectionBehavior WRITE setSelectionBehavior) + Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) + Q_PROPERTY(Qt::TextElideMode textElideMode READ textElideMode WRITE setTextElideMode) + Q_PROPERTY(ScrollMode verticalScrollMode READ verticalScrollMode WRITE setVerticalScrollMode) + Q_PROPERTY(ScrollMode horizontalScrollMode READ horizontalScrollMode WRITE setHorizontalScrollMode) + +public: + enum SelectionMode { + NoSelection, + SingleSelection, + MultiSelection, + ExtendedSelection, + ContiguousSelection + }; + + enum SelectionBehavior { + SelectItems, + SelectRows, + SelectColumns + }; + + enum ScrollHint { + EnsureVisible, + PositionAtTop, + PositionAtBottom, + PositionAtCenter + }; + + enum EditTrigger { + NoEditTriggers = 0, + CurrentChanged = 1, + DoubleClicked = 2, + SelectedClicked = 4, + EditKeyPressed = 8, + AnyKeyPressed = 16, + AllEditTriggers = 31 + }; + + Q_DECLARE_FLAGS(EditTriggers, EditTrigger) + + enum ScrollMode { + ScrollPerItem, + ScrollPerPixel + }; + + explicit QAbstractItemView(QWidget *parent = 0); + ~QAbstractItemView(); + + virtual void setModel(QAbstractItemModel *model); + QAbstractItemModel *model() const; + + virtual void setSelectionModel(QItemSelectionModel *selectionModel); + QItemSelectionModel *selectionModel() const; + + void setItemDelegate(QAbstractItemDelegate *delegate); + QAbstractItemDelegate *itemDelegate() const; + + void setSelectionMode(QAbstractItemView::SelectionMode mode); + QAbstractItemView::SelectionMode selectionMode() const; + + void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior); + QAbstractItemView::SelectionBehavior selectionBehavior() const; + + QModelIndex currentIndex() const; + QModelIndex rootIndex() const; + + void setEditTriggers(EditTriggers triggers); + EditTriggers editTriggers() const; + + void setVerticalScrollMode(ScrollMode mode); + ScrollMode verticalScrollMode() const; + + void setHorizontalScrollMode(ScrollMode mode); + ScrollMode horizontalScrollMode() const; + + void setAutoScroll(bool enable); + bool hasAutoScroll() const; + + void setAutoScrollMargin(int margin); + int autoScrollMargin() const; + + void setTabKeyNavigation(bool enable); + bool tabKeyNavigation() const; + +#ifndef QT_NO_DRAGANDDROP + void setDropIndicatorShown(bool enable); + bool showDropIndicator() const; + + void setDragEnabled(bool enable); + bool dragEnabled() const; + + void setDragDropOverwriteMode(bool overwrite); + bool dragDropOverwriteMode() const; + + enum DragDropMode { + NoDragDrop, + DragOnly, + DropOnly, + DragDrop, + InternalMove + }; + + void setDragDropMode(DragDropMode behavior); + DragDropMode dragDropMode() const; + + void setDefaultDropAction(Qt::DropAction dropAction); + Qt::DropAction defaultDropAction() const; +#endif + + void setAlternatingRowColors(bool enable); + bool alternatingRowColors() const; + + void setIconSize(const QSize &size); + QSize iconSize() const; + + void setTextElideMode(Qt::TextElideMode mode); + Qt::TextElideMode textElideMode() const; + + virtual void keyboardSearch(const QString &search); + + virtual QRect visualRect(const QModelIndex &index) const = 0; + virtual void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) = 0; + virtual QModelIndex indexAt(const QPoint &point) const = 0; + + QSize sizeHintForIndex(const QModelIndex &index) const; + virtual int sizeHintForRow(int row) const; + virtual int sizeHintForColumn(int column) const; + + void openPersistentEditor(const QModelIndex &index); + void closePersistentEditor(const QModelIndex &index); + + void setIndexWidget(const QModelIndex &index, QWidget *widget); + QWidget *indexWidget(const QModelIndex &index) const; + + void setItemDelegateForRow(int row, QAbstractItemDelegate *delegate); + QAbstractItemDelegate *itemDelegateForRow(int row) const; + + void setItemDelegateForColumn(int column, QAbstractItemDelegate *delegate); + QAbstractItemDelegate *itemDelegateForColumn(int column) const; + + QAbstractItemDelegate *itemDelegate(const QModelIndex &index) const; + + virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const; + +#ifdef Q_NO_USING_KEYWORD + inline void update() { QAbstractScrollArea::update(); } +#else + using QAbstractScrollArea::update; +#endif + +public Q_SLOTS: + virtual void reset(); + virtual void setRootIndex(const QModelIndex &index); + virtual void doItemsLayout(); + virtual void selectAll(); + void edit(const QModelIndex &index); + void clearSelection(); + void setCurrentIndex(const QModelIndex &index); + void scrollToTop(); + void scrollToBottom(); + void update(const QModelIndex &index); + +protected Q_SLOTS: + virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); + virtual void rowsInserted(const QModelIndex &parent, int start, int end); + virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); + virtual void updateEditorData(); + virtual void updateEditorGeometries(); + virtual void updateGeometries(); + virtual void verticalScrollbarAction(int action); + virtual void horizontalScrollbarAction(int action); + virtual void verticalScrollbarValueChanged(int value); + virtual void horizontalScrollbarValueChanged(int value); + virtual void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint); + virtual void commitData(QWidget *editor); + virtual void editorDestroyed(QObject *editor); + +Q_SIGNALS: + void pressed(const QModelIndex &index); + void clicked(const QModelIndex &index); + void doubleClicked(const QModelIndex &index); + + void activated(const QModelIndex &index); + void entered(const QModelIndex &index); + void viewportEntered(); + +protected: + QAbstractItemView(QAbstractItemViewPrivate &, QWidget *parent = 0); + + void setHorizontalStepsPerItem(int steps); + int horizontalStepsPerItem() const; + void setVerticalStepsPerItem(int steps); + int verticalStepsPerItem() const; + + enum CursorAction { MoveUp, MoveDown, MoveLeft, MoveRight, + MoveHome, MoveEnd, MovePageUp, MovePageDown, + MoveNext, MovePrevious }; + virtual QModelIndex moveCursor(CursorAction cursorAction, + Qt::KeyboardModifiers modifiers) = 0; + + virtual int horizontalOffset() const = 0; + virtual int verticalOffset() const = 0; + + virtual bool isIndexHidden(const QModelIndex &index) const = 0; + + virtual void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) = 0; + virtual QRegion visualRegionForSelection(const QItemSelection &selection) const = 0; + virtual QModelIndexList selectedIndexes() const; + + virtual bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event); + + virtual QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex &index, + const QEvent *event = 0) const; + +#ifndef QT_NO_DRAGANDDROP + virtual void startDrag(Qt::DropActions supportedActions); +#endif + + virtual QStyleOptionViewItem viewOptions() const; + + enum State { + NoState, + DraggingState, + DragSelectingState, + EditingState, + ExpandingState, + CollapsingState, + AnimatingState + }; + + State state() const; + void setState(State state); + + void scheduleDelayedItemsLayout(); + void executeDelayedItemsLayout(); + + void setDirtyRegion(const QRegion ®ion); + void scrollDirtyRegion(int dx, int dy); + QPoint dirtyRegionOffset() const; + + void startAutoScroll(); + void stopAutoScroll(); + void doAutoScroll(); + + bool focusNextPrevChild(bool next); + bool event(QEvent *event); + bool viewportEvent(QEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void mouseDoubleClickEvent(QMouseEvent *event); +#ifndef QT_NO_DRAGANDDROP + void dragEnterEvent(QDragEnterEvent *event); + void dragMoveEvent(QDragMoveEvent *event); + void dragLeaveEvent(QDragLeaveEvent *event); + void dropEvent(QDropEvent *event); +#endif + void focusInEvent(QFocusEvent *event); + void focusOutEvent(QFocusEvent *event); + void keyPressEvent(QKeyEvent *event); + void resizeEvent(QResizeEvent *event); + void timerEvent(QTimerEvent *event); + void inputMethodEvent(QInputMethodEvent *event); + +#ifndef QT_NO_DRAGANDDROP + enum DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport }; + DropIndicatorPosition dropIndicatorPosition() const; +#endif + +private: + Q_DECLARE_PRIVATE(QAbstractItemView) + Q_DISABLE_COPY(QAbstractItemView) + Q_PRIVATE_SLOT(d_func(), void _q_columnsAboutToBeRemoved(const QModelIndex&, int, int)) + Q_PRIVATE_SLOT(d_func(), void _q_columnsRemoved(const QModelIndex&, int, int)) + Q_PRIVATE_SLOT(d_func(), void _q_columnsInserted(const QModelIndex&, int, int)) + Q_PRIVATE_SLOT(d_func(), void _q_rowsRemoved(const QModelIndex&, int, int)) + Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed()) + Q_PRIVATE_SLOT(d_func(), void _q_layoutChanged()) + Q_PRIVATE_SLOT(d_func(), void _q_headerDataChanged()) + + friend class QTreeViewPrivate; // needed to compile with MSVC + friend class QAccessibleItemRow; + friend class QListModeViewBase; + friend class QListViewPrivate; // needed to compile for Symbian emulator +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractItemView::EditTriggers) + +#endif // QT_NO_ITEMVIEWS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTITEMVIEW_H diff --git a/qtinterface/qt4/Qt/qabstractmessagehandler.h b/qtinterface/qt4/Qt/qabstractmessagehandler.h new file mode 100644 index 0000000..8de57d4 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractmessagehandler.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtXmlPatterns module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTMESSAGEHANDLER_H +#define QABSTRACTMESSAGEHANDLER_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(XmlPatterns) + +class QAbstractMessageHandlerPrivate; +class Q_XMLPATTERNS_EXPORT QAbstractMessageHandler : public QObject +{ + Q_OBJECT +public: + QAbstractMessageHandler(QObject *parent = 0); + virtual ~QAbstractMessageHandler(); + + void message(QtMsgType type, + const QString &description, + const QUrl &identifier = QUrl(), + const QSourceLocation &sourceLocation = QSourceLocation()); + +protected: + virtual void handleMessage(QtMsgType type, + const QString &description, + const QUrl &identifier, + const QSourceLocation &sourceLocation) = 0; +private: + Q_DECLARE_PRIVATE(QAbstractMessageHandler) + Q_DISABLE_COPY(QAbstractMessageHandler) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qabstractnetworkcache.h b/qtinterface/qt4/Qt/qabstractnetworkcache.h new file mode 100644 index 0000000..2960aba --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractnetworkcache.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtNetwork module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTNETWORKCACHE_H +#define QABSTRACTNETWORKCACHE_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Network) + +class QIODevice; +class QDateTime; +class QUrl; +template class QList; + +class QNetworkCacheMetaDataPrivate; +class Q_NETWORK_EXPORT QNetworkCacheMetaData +{ + +public: + typedef QPair RawHeader; + typedef QList RawHeaderList; + typedef QHash AttributesMap; + + QNetworkCacheMetaData(); + QNetworkCacheMetaData(const QNetworkCacheMetaData &other); + ~QNetworkCacheMetaData(); + + QNetworkCacheMetaData &operator=(const QNetworkCacheMetaData &other); + bool operator==(const QNetworkCacheMetaData &other) const; + inline bool operator!=(const QNetworkCacheMetaData &other) const + { return !(*this == other); } + + bool isValid() const; + + QUrl url() const; + void setUrl(const QUrl &url); + + RawHeaderList rawHeaders() const; + void setRawHeaders(const RawHeaderList &headers); + + QDateTime lastModified() const; + void setLastModified(const QDateTime &dateTime); + + QDateTime expirationDate() const; + void setExpirationDate(const QDateTime &dateTime); + + bool saveToDisk() const; + void setSaveToDisk(bool allow); + + AttributesMap attributes() const; + void setAttributes(const AttributesMap &attributes); + +private: + friend class QNetworkCacheMetaDataPrivate; + QSharedDataPointer d; +}; + +Q_NETWORK_EXPORT QDataStream &operator<<(QDataStream &, const QNetworkCacheMetaData &); +Q_NETWORK_EXPORT QDataStream &operator>>(QDataStream &, QNetworkCacheMetaData &); + + +class QAbstractNetworkCachePrivate; +class Q_NETWORK_EXPORT QAbstractNetworkCache : public QObject +{ + Q_OBJECT + +public: + virtual ~QAbstractNetworkCache(); + + virtual QNetworkCacheMetaData metaData(const QUrl &url) = 0; + virtual void updateMetaData(const QNetworkCacheMetaData &metaData) = 0; + virtual QIODevice *data(const QUrl &url) = 0; + virtual bool remove(const QUrl &url) = 0; + virtual qint64 cacheSize() const = 0; + + virtual QIODevice *prepare(const QNetworkCacheMetaData &metaData) = 0; + virtual void insert(QIODevice *device) = 0; + +public Q_SLOTS: + virtual void clear() = 0; + +protected: + explicit QAbstractNetworkCache(QObject *parent = 0); + QAbstractNetworkCache(QAbstractNetworkCachePrivate &dd, QObject *parent); + +private: + Q_DECLARE_PRIVATE(QAbstractNetworkCache) + Q_DISABLE_COPY(QAbstractNetworkCache) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qabstractpagesetupdialog.h b/qtinterface/qt4/Qt/qabstractpagesetupdialog.h new file mode 100644 index 0000000..c37d33e --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractpagesetupdialog.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTPAGESETUPDIALOG_H +#define QABSTRACTPAGESETUPDIALOG_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_PRINTDIALOG + +class QAbstractPageSetupDialogPrivate; +class QPrinter; + +// ### Qt 5: Remove this class +class Q_GUI_EXPORT QAbstractPageSetupDialog : public QDialog +{ + Q_DECLARE_PRIVATE(QAbstractPageSetupDialog) + Q_OBJECT + +public: + explicit QAbstractPageSetupDialog(QPrinter *printer, QWidget *parent = 0); + QAbstractPageSetupDialog(QAbstractPageSetupDialogPrivate &ptr, + QPrinter *printer, QWidget *parent = 0); + ~QAbstractPageSetupDialog(); + + virtual int exec() = 0; + void done(int result); + + QPrinter *printer(); +}; + +#endif // QT_NO_PRINTDIALOG + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTPAGESETUPDIALOG_H diff --git a/qtinterface/qt4/Qt/qabstractprintdialog.h b/qtinterface/qt4/Qt/qabstractprintdialog.h new file mode 100644 index 0000000..1c73eda --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractprintdialog.h @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTPRINTDIALOG_H +#define QABSTRACTPRINTDIALOG_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_PRINTER + +class QAbstractPrintDialogPrivate; +class QPrinter; + +// ### Qt 5: remove this class +class Q_GUI_EXPORT QAbstractPrintDialog : public QDialog +{ + Q_DECLARE_PRIVATE(QAbstractPrintDialog) + Q_OBJECT + +public: + enum PrintRange { + AllPages, + Selection, + PageRange + }; + + enum PrintDialogOption { + None = 0x0000, // obsolete + PrintToFile = 0x0001, + PrintSelection = 0x0002, + PrintPageRange = 0x0004, + PrintShowPageSize = 0x0008, + PrintCollateCopies = 0x0010, + DontUseSheet = 0x0020 + }; + + Q_DECLARE_FLAGS(PrintDialogOptions, PrintDialogOption) + +#ifndef QT_NO_PRINTDIALOG + explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = 0); + ~QAbstractPrintDialog(); + + virtual int exec() = 0; + + // obsolete + void addEnabledOption(PrintDialogOption option); + void setEnabledOptions(PrintDialogOptions options); + PrintDialogOptions enabledOptions() const; + bool isOptionEnabled(PrintDialogOption option) const; + + void setOptionTabs(const QList &tabs); + + void setPrintRange(PrintRange range); + PrintRange printRange() const; + + void setMinMax(int min, int max); + int minPage() const; + int maxPage() const; + + void setFromTo(int fromPage, int toPage); + int fromPage() const; + int toPage() const; + + QPrinter *printer() const; + +protected: + QAbstractPrintDialog(QAbstractPrintDialogPrivate &ptr, QPrinter *printer, QWidget *parent = 0); + +private: + Q_DISABLE_COPY(QAbstractPrintDialog) + +#endif // QT_NO_PRINTDIALOG +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractPrintDialog::PrintDialogOptions) + +#endif // QT_NO_PRINTER + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTPRINTDIALOG_H diff --git a/qtinterface/qt4/Qt/qabstractproxymodel.h b/qtinterface/qt4/Qt/qabstractproxymodel.h new file mode 100644 index 0000000..ef1c29a --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractproxymodel.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTPROXYMODEL_H +#define QABSTRACTPROXYMODEL_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_PROXYMODEL + +class QAbstractProxyModelPrivate; +class QItemSelection; + +class Q_GUI_EXPORT QAbstractProxyModel : public QAbstractItemModel +{ + Q_OBJECT + +public: + QAbstractProxyModel(QObject *parent = 0); + ~QAbstractProxyModel(); + + virtual void setSourceModel(QAbstractItemModel *sourceModel); + QAbstractItemModel *sourceModel() const; + + virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const = 0; + virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const = 0; + + virtual QItemSelection mapSelectionToSource(const QItemSelection &selection) const; + virtual QItemSelection mapSelectionFromSource(const QItemSelection &selection) const; + + bool submit(); + void revert(); + + QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const; + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + QMap itemData(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const; + + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole); + +protected: + QAbstractProxyModel(QAbstractProxyModelPrivate &, QObject *parent); + +private: + Q_DECLARE_PRIVATE(QAbstractProxyModel) + Q_DISABLE_COPY(QAbstractProxyModel) + Q_PRIVATE_SLOT(d_func(), void _q_sourceModelDestroyed()) +}; + +#endif // QT_NO_PROXYMODEL + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTPROXYMODEL_H diff --git a/qtinterface/qt4/Qt/qabstractscrollarea.h b/qtinterface/qt4/Qt/qabstractscrollarea.h new file mode 100644 index 0000000..526f6ef --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractscrollarea.h @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTSCROLLAREA_H +#define QABSTRACTSCROLLAREA_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_SCROLLAREA + +class QMargins; +class QScrollBar; +class QAbstractScrollAreaPrivate; + +class Q_GUI_EXPORT QAbstractScrollArea : public QFrame +{ + Q_OBJECT + Q_PROPERTY(Qt::ScrollBarPolicy verticalScrollBarPolicy READ verticalScrollBarPolicy WRITE setVerticalScrollBarPolicy) + Q_PROPERTY(Qt::ScrollBarPolicy horizontalScrollBarPolicy READ horizontalScrollBarPolicy WRITE setHorizontalScrollBarPolicy) + +public: + explicit QAbstractScrollArea(QWidget* parent=0); + ~QAbstractScrollArea(); + + Qt::ScrollBarPolicy verticalScrollBarPolicy() const; + void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy); + QScrollBar *verticalScrollBar() const; + void setVerticalScrollBar(QScrollBar *scrollbar); + + Qt::ScrollBarPolicy horizontalScrollBarPolicy() const; + void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy); + QScrollBar *horizontalScrollBar() const; + void setHorizontalScrollBar(QScrollBar *scrollbar); + + QWidget *cornerWidget() const; + void setCornerWidget(QWidget *widget); + + void addScrollBarWidget(QWidget *widget, Qt::Alignment alignment); + QWidgetList scrollBarWidgets(Qt::Alignment alignment); + + QWidget *viewport() const; + void setViewport(QWidget *widget); + QSize maximumViewportSize() const; + + QSize minimumSizeHint() const; + + QSize sizeHint() const; + +protected Q_SLOTS: + void setupViewport(QWidget *viewport); + +protected: + QAbstractScrollArea(QAbstractScrollAreaPrivate &dd, QWidget *parent = 0); + void setViewportMargins(int left, int top, int right, int bottom); + void setViewportMargins(const QMargins &margins); + + bool event(QEvent *); + virtual bool viewportEvent(QEvent *); + + void resizeEvent(QResizeEvent *); + void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); +#ifndef QT_NO_WHEELEVENT + void wheelEvent(QWheelEvent *); +#endif +#ifndef QT_NO_CONTEXTMENU + void contextMenuEvent(QContextMenuEvent *); +#endif +#ifndef QT_NO_DRAGANDDROP + void dragEnterEvent(QDragEnterEvent *); + void dragMoveEvent(QDragMoveEvent *); + void dragLeaveEvent(QDragLeaveEvent *); + void dropEvent(QDropEvent *); +#endif + + void keyPressEvent(QKeyEvent *); + + virtual void scrollContentsBy(int dx, int dy); + +private: + Q_DECLARE_PRIVATE(QAbstractScrollArea) + Q_DISABLE_COPY(QAbstractScrollArea) + Q_PRIVATE_SLOT(d_func(), void _q_hslide(int)) + Q_PRIVATE_SLOT(d_func(), void _q_vslide(int)) + Q_PRIVATE_SLOT(d_func(), void _q_showOrHideScrollBars()) + + friend class QStyleSheetStyle; + friend class QWidgetPrivate; +}; + +#endif // QT_NO_SCROLLAREA + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTSCROLLAREA_H diff --git a/qtinterface/qt4/Qt/qabstractslider.h b/qtinterface/qt4/Qt/qabstractslider.h new file mode 100644 index 0000000..c46c60e --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractslider.h @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTSLIDER_H +#define QABSTRACTSLIDER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QAbstractSliderPrivate; + +class Q_GUI_EXPORT QAbstractSlider : public QWidget +{ + Q_OBJECT + + Q_PROPERTY(int minimum READ minimum WRITE setMinimum) + Q_PROPERTY(int maximum READ maximum WRITE setMaximum) + Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep) + Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep) + Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged USER true) + Q_PROPERTY(int sliderPosition READ sliderPosition WRITE setSliderPosition NOTIFY sliderMoved) + Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking) + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) + Q_PROPERTY(bool invertedAppearance READ invertedAppearance WRITE setInvertedAppearance) + Q_PROPERTY(bool invertedControls READ invertedControls WRITE setInvertedControls) + Q_PROPERTY(bool sliderDown READ isSliderDown WRITE setSliderDown DESIGNABLE false) + +public: + explicit QAbstractSlider(QWidget *parent=0); + ~QAbstractSlider(); + + Qt::Orientation orientation() const; + + void setMinimum(int); + int minimum() const; + + void setMaximum(int); + int maximum() const; + + void setRange(int min, int max); + + void setSingleStep(int); + int singleStep() const; + + void setPageStep(int); + int pageStep() const; + + void setTracking(bool enable); + bool hasTracking() const; + + void setSliderDown(bool); + bool isSliderDown() const; + + void setSliderPosition(int); + int sliderPosition() const; + + void setInvertedAppearance(bool); + bool invertedAppearance() const; + + void setInvertedControls(bool); + bool invertedControls() const; + + enum SliderAction { + SliderNoAction, + SliderSingleStepAdd, + SliderSingleStepSub, + SliderPageStepAdd, + SliderPageStepSub, + SliderToMinimum, + SliderToMaximum, + SliderMove + }; + + int value() const; + + void triggerAction(SliderAction action); + +public Q_SLOTS: + void setValue(int); + void setOrientation(Qt::Orientation); + +Q_SIGNALS: + void valueChanged(int value); + + void sliderPressed(); + void sliderMoved(int position); + void sliderReleased(); + + void rangeChanged(int min, int max); + + void actionTriggered(int action); + +protected: + bool event(QEvent *e); + + void setRepeatAction(SliderAction action, int thresholdTime = 500, int repeatTime = 50); + SliderAction repeatAction() const; + + enum SliderChange { + SliderRangeChange, + SliderOrientationChange, + SliderStepsChange, + SliderValueChange + }; + virtual void sliderChange(SliderChange change); + + void keyPressEvent(QKeyEvent *ev); + void timerEvent(QTimerEvent *); +#ifndef QT_NO_WHEELEVENT + void wheelEvent(QWheelEvent *e); +#endif + void changeEvent(QEvent *e); + +#ifdef QT3_SUPPORT +public: + inline QT3_SUPPORT int minValue() const { return minimum(); } + inline QT3_SUPPORT int maxValue() const { return maximum(); } + inline QT3_SUPPORT int lineStep() const { return singleStep(); } + inline QT3_SUPPORT void setMinValue(int v) { setMinimum(v); } + inline QT3_SUPPORT void setMaxValue(int v) { setMaximum(v); } + inline QT3_SUPPORT void setLineStep(int v) { setSingleStep(v); } + inline QT3_SUPPORT void setSteps(int single, int page) { setSingleStep(single); setPageStep(page); } + inline QT3_SUPPORT void addPage() { triggerAction(SliderPageStepAdd); } + inline QT3_SUPPORT void subtractPage() { triggerAction(SliderPageStepSub); } + inline QT3_SUPPORT void addLine() { triggerAction(SliderSingleStepAdd); } + inline QT3_SUPPORT void subtractLine() { triggerAction(SliderSingleStepSub); } +#endif + +protected: + QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent=0); + +private: + Q_DISABLE_COPY(QAbstractSlider) + Q_DECLARE_PRIVATE(QAbstractSlider) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTSLIDER_H diff --git a/qtinterface/qt4/Qt/qabstractsocket.h b/qtinterface/qt4/Qt/qabstractsocket.h new file mode 100644 index 0000000..5d29e1f --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractsocket.h @@ -0,0 +1,257 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtNetwork module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTSOCKET_H +#define QABSTRACTSOCKET_H + +#include +#include +#ifndef QT_NO_DEBUG_STREAM +#include +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Network) + +class QHostAddress; +#ifndef QT_NO_NETWORKPROXY +class QNetworkProxy; +#endif +class QAbstractSocketPrivate; +class QAuthenticator; + +class Q_NETWORK_EXPORT QAbstractSocket : public QIODevice +{ + Q_OBJECT +public: + enum SocketType { + TcpSocket, + UdpSocket, + UnknownSocketType = -1 + }; + enum NetworkLayerProtocol { + IPv4Protocol, + IPv6Protocol, + UnknownNetworkLayerProtocol = -1 + }; + enum SocketError { + ConnectionRefusedError, + RemoteHostClosedError, + HostNotFoundError, + SocketAccessError, + SocketResourceError, + SocketTimeoutError, /* 5 */ + DatagramTooLargeError, + NetworkError, + AddressInUseError, + SocketAddressNotAvailableError, + UnsupportedSocketOperationError, /* 10 */ + UnfinishedSocketOperationError, + ProxyAuthenticationRequiredError, + SslHandshakeFailedError, + ProxyConnectionRefusedError, + ProxyConnectionClosedError, /* 15 */ + ProxyConnectionTimeoutError, + ProxyNotFoundError, + ProxyProtocolError, + + UnknownSocketError = -1 + }; + enum SocketState { + UnconnectedState, + HostLookupState, + ConnectingState, + ConnectedState, + BoundState, + ListeningState, + ClosingState +#ifdef QT3_SUPPORT + , + Idle = UnconnectedState, + HostLookup = HostLookupState, + Connecting = ConnectingState, + Connected = ConnectedState, + Closing = ClosingState, + Connection = ConnectedState +#endif + }; + enum SocketOption { + LowDelayOption, // TCP_NODELAY + KeepAliveOption // SO_KEEPALIVE + }; + + QAbstractSocket(SocketType socketType, QObject *parent); + virtual ~QAbstractSocket(); + + // ### Qt 5: Make connectToHost() and disconnectFromHost() virtual. + void connectToHost(const QString &hostName, quint16 port, OpenMode mode = ReadWrite); + void connectToHost(const QHostAddress &address, quint16 port, OpenMode mode = ReadWrite); + void disconnectFromHost(); + + bool isValid() const; + + qint64 bytesAvailable() const; + qint64 bytesToWrite() const; + + bool canReadLine() const; + + quint16 localPort() const; + QHostAddress localAddress() const; + quint16 peerPort() const; + QHostAddress peerAddress() const; + QString peerName() const; + + // ### Qt 5: Make setReadBufferSize() virtual + qint64 readBufferSize() const; + void setReadBufferSize(qint64 size); + + void abort(); + + // ### Qt 5: Make socketDescriptor() and setSocketDescriptor() virtual. + int socketDescriptor() const; + bool setSocketDescriptor(int socketDescriptor, SocketState state = ConnectedState, + OpenMode openMode = ReadWrite); + + // ### Qt 5: Make virtual? + void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value); + QVariant socketOption(QAbstractSocket::SocketOption option); + + SocketType socketType() const; + SocketState state() const; + SocketError error() const; + + // from QIODevice + void close(); + bool isSequential() const; + bool atEnd() const; + bool flush(); + + // for synchronous access + // ### Qt 5: Make waitForConnected() and waitForDisconnected() virtual. + bool waitForConnected(int msecs = 30000); + bool waitForReadyRead(int msecs = 30000); + bool waitForBytesWritten(int msecs = 30000); + bool waitForDisconnected(int msecs = 30000); + +#ifndef QT_NO_NETWORKPROXY + void setProxy(const QNetworkProxy &networkProxy); + QNetworkProxy proxy() const; +#endif + +Q_SIGNALS: + void hostFound(); + void connected(); + void disconnected(); + void stateChanged(QAbstractSocket::SocketState); + void error(QAbstractSocket::SocketError); +#ifndef QT_NO_NETWORKPROXY + void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator); +#endif + +protected Q_SLOTS: + void connectToHostImplementation(const QString &hostName, quint16 port, OpenMode mode = ReadWrite); + void disconnectFromHostImplementation(); + +protected: + qint64 readData(char *data, qint64 maxlen); + qint64 readLineData(char *data, qint64 maxlen); + qint64 writeData(const char *data, qint64 len); + + void setSocketState(SocketState state); + void setSocketError(SocketError socketError); + void setLocalPort(quint16 port); + void setLocalAddress(const QHostAddress &address); + void setPeerPort(quint16 port); + void setPeerAddress(const QHostAddress &address); + void setPeerName(const QString &name); + + QAbstractSocket(SocketType socketType, QAbstractSocketPrivate &dd, QObject *parent = 0); + +private: + Q_DECLARE_PRIVATE(QAbstractSocket) + Q_DISABLE_COPY(QAbstractSocket) + + Q_PRIVATE_SLOT(d_func(), void _q_connectToNextAddress()) + Q_PRIVATE_SLOT(d_func(), void _q_startConnecting(const QHostInfo &)) + Q_PRIVATE_SLOT(d_func(), void _q_abortConnectionAttempt()) + Q_PRIVATE_SLOT(d_func(), void _q_testConnection()) + Q_PRIVATE_SLOT(d_func(), void _q_forceDisconnect()) + +#ifdef QT3_SUPPORT +public: + enum Error { + ErrConnectionRefused = ConnectionRefusedError, + ErrHostNotFound = HostNotFoundError, + ErrSocketRead = UnknownSocketError + }; + inline QT3_SUPPORT int socket() const { return socketDescriptor(); } + inline QT3_SUPPORT void setSocket(int socket) { setSocketDescriptor(socket); } + inline QT3_SUPPORT qulonglong waitForMore(int msecs, bool *timeout = 0) const + { + QAbstractSocket *that = const_cast(this); + if (that->waitForReadyRead(msecs)) + return qulonglong(bytesAvailable()); + if (error() == SocketTimeoutError && timeout) + *timeout = true; + return 0; + } + typedef SocketState State; +Q_SIGNALS: + QT_MOC_COMPAT void connectionClosed(); // same as disconnected() + QT_MOC_COMPAT void delayedCloseFinished(); // same as disconnected() + + +#endif +}; + +#ifndef QT_NO_DEBUG_STREAM +Q_NETWORK_EXPORT QDebug operator<<(QDebug, QAbstractSocket::SocketError); +Q_NETWORK_EXPORT QDebug operator<<(QDebug, QAbstractSocket::SocketState); +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTSOCKET_H diff --git a/qtinterface/qt4/Qt/qabstractspinbox.h b/qtinterface/qt4/Qt/qabstractspinbox.h new file mode 100644 index 0000000..2831206 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractspinbox.h @@ -0,0 +1,179 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTSPINBOX_H +#define QABSTRACTSPINBOX_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_SPINBOX + +class QLineEdit; + +class QAbstractSpinBoxPrivate; +class QStyleOptionSpinBox; + +class Q_GUI_EXPORT QAbstractSpinBox : public QWidget +{ + Q_OBJECT + + Q_ENUMS(ButtonSymbols) + Q_ENUMS(CorrectionMode) + Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping) + Q_PROPERTY(bool frame READ hasFrame WRITE setFrame) + Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) + Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) + Q_PROPERTY(ButtonSymbols buttonSymbols READ buttonSymbols WRITE setButtonSymbols) + Q_PROPERTY(QString specialValueText READ specialValueText WRITE setSpecialValueText) + Q_PROPERTY(QString text READ text) + Q_PROPERTY(bool accelerated READ isAccelerated WRITE setAccelerated) + Q_PROPERTY(CorrectionMode correctionMode READ correctionMode WRITE setCorrectionMode) + Q_PROPERTY(bool acceptableInput READ hasAcceptableInput) + Q_PROPERTY(bool keyboardTracking READ keyboardTracking WRITE setKeyboardTracking) +public: + explicit QAbstractSpinBox(QWidget *parent = 0); + ~QAbstractSpinBox(); + + enum StepEnabledFlag { StepNone = 0x00, StepUpEnabled = 0x01, + StepDownEnabled = 0x02 }; + Q_DECLARE_FLAGS(StepEnabled, StepEnabledFlag) + + enum ButtonSymbols { UpDownArrows, PlusMinus, NoButtons }; + + ButtonSymbols buttonSymbols() const; + void setButtonSymbols(ButtonSymbols bs); + + enum CorrectionMode { CorrectToPreviousValue, CorrectToNearestValue }; + + void setCorrectionMode(CorrectionMode cm); + CorrectionMode correctionMode() const; + + bool hasAcceptableInput() const; + QString text() const; + + QString specialValueText() const; + void setSpecialValueText(const QString &txt); + + bool wrapping() const; + void setWrapping(bool w); + + void setReadOnly(bool r); + bool isReadOnly() const; + + void setKeyboardTracking(bool kt); + bool keyboardTracking() const; + + void setAlignment(Qt::Alignment flag); + Qt::Alignment alignment() const; + + void setFrame(bool); + bool hasFrame() const; + + void setAccelerated(bool on); + bool isAccelerated() const; + + QSize sizeHint() const; + QSize minimumSizeHint() const; + void interpretText(); + bool event(QEvent *event); + + QVariant inputMethodQuery(Qt::InputMethodQuery) const; + + virtual QValidator::State validate(QString &input, int &pos) const; + virtual void fixup(QString &input) const; + + virtual void stepBy(int steps); +public Q_SLOTS: + void stepUp(); + void stepDown(); + void selectAll(); + virtual void clear(); +protected: + void resizeEvent(QResizeEvent *event); + void keyPressEvent(QKeyEvent *event); + void keyReleaseEvent(QKeyEvent *event); + void wheelEvent(QWheelEvent *event); + void focusInEvent(QFocusEvent *event); + void focusOutEvent(QFocusEvent *event); + void contextMenuEvent(QContextMenuEvent *event); + void changeEvent(QEvent *event); + void closeEvent(QCloseEvent *event); + void hideEvent(QHideEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void timerEvent(QTimerEvent *event); + void paintEvent(QPaintEvent *event); + void showEvent(QShowEvent *event); + void initStyleOption(QStyleOptionSpinBox *option) const; + + QLineEdit *lineEdit() const; + void setLineEdit(QLineEdit *edit); + + virtual StepEnabled stepEnabled() const; +Q_SIGNALS: + void editingFinished(); +protected: + QAbstractSpinBox(QAbstractSpinBoxPrivate &dd, QWidget *parent = 0); + +private: + Q_PRIVATE_SLOT(d_func(), void _q_editorTextChanged(const QString &)) + Q_PRIVATE_SLOT(d_func(), void _q_editorCursorPositionChanged(int, int)) + + Q_DECLARE_PRIVATE(QAbstractSpinBox) + Q_DISABLE_COPY(QAbstractSpinBox) +}; +Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractSpinBox::StepEnabled) + +#endif // QT_NO_SPINBOX + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTSPINBOX_H diff --git a/qtinterface/qt4/Qt/qabstractstate.h b/qtinterface/qt4/Qt/qabstractstate.h new file mode 100644 index 0000000..e32cf5a --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractstate.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTSTATE_H +#define QABSTRACTSTATE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +#ifndef QT_NO_STATEMACHINE + +class QState; +class QStateMachine; + +class QAbstractStatePrivate; +class Q_CORE_EXPORT QAbstractState : public QObject +{ + Q_OBJECT +public: + ~QAbstractState(); + + QState *parentState() const; + QStateMachine *machine() const; + +Q_SIGNALS: +#if !defined(Q_MOC_RUN) && !defined(qdoc) +private: // can only be emitted by QAbstractState +#endif + void entered(); + void exited(); + +protected: + QAbstractState(QState *parent = 0); + + virtual void onEntry(QEvent *event) = 0; + virtual void onExit(QEvent *event) = 0; + + bool event(QEvent *e); + +protected: + QAbstractState(QAbstractStatePrivate &dd, QState *parent); + +private: + Q_DISABLE_COPY(QAbstractState) + Q_DECLARE_PRIVATE(QAbstractState) +}; + +#endif //QT_NO_STATEMACHINE + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qabstracttextdocumentlayout.h b/qtinterface/qt4/Qt/qabstracttextdocumentlayout.h new file mode 100644 index 0000000..080dcdf --- /dev/null +++ b/qtinterface/qt4/Qt/qabstracttextdocumentlayout.h @@ -0,0 +1,150 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTTEXTDOCUMENTLAYOUT_H +#define QABSTRACTTEXTDOCUMENTLAYOUT_H + +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QAbstractTextDocumentLayoutPrivate; +class QTextBlock; +class QTextObjectInterface; +class QTextFrame; + +class Q_GUI_EXPORT QAbstractTextDocumentLayout : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QAbstractTextDocumentLayout) + +public: + explicit QAbstractTextDocumentLayout(QTextDocument *doc); + ~QAbstractTextDocumentLayout(); + + struct Selection + { + QTextCursor cursor; + QTextCharFormat format; + }; + + struct PaintContext + { + PaintContext() + : cursorPosition(-1) + {} + int cursorPosition; + QPalette palette; + QRectF clip; + QVector selections; + }; + + virtual void draw(QPainter *painter, const PaintContext &context) = 0; + virtual int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const = 0; + QString anchorAt(const QPointF& pos) const; + + virtual int pageCount() const = 0; + virtual QSizeF documentSize() const = 0; + + virtual QRectF frameBoundingRect(QTextFrame *frame) const = 0; + virtual QRectF blockBoundingRect(const QTextBlock &block) const = 0; + + void setPaintDevice(QPaintDevice *device); + QPaintDevice *paintDevice() const; + + QTextDocument *document() const; + + void registerHandler(int objectType, QObject *component); + QTextObjectInterface *handlerForObject(int objectType) const; + +Q_SIGNALS: + void update(const QRectF & = QRectF(0., 0., 1000000000., 1000000000.)); + void updateBlock(const QTextBlock &block); + void documentSizeChanged(const QSizeF &newSize); + void pageCountChanged(int newPages); + +protected: + QAbstractTextDocumentLayout(QAbstractTextDocumentLayoutPrivate &, QTextDocument *); + + virtual void documentChanged(int from, int charsRemoved, int charsAdded) = 0; + + virtual void resizeInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format); + virtual void positionInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format); + virtual void drawInlineObject(QPainter *painter, const QRectF &rect, QTextInlineObject object, int posInDocument, const QTextFormat &format); + + int formatIndex(int pos); + QTextCharFormat format(int pos); + +private: + friend class QTextControl; + friend class QTextDocument; + friend class QTextDocumentPrivate; + friend class QTextEngine; + friend class QTextLayout; + friend class QTextLine; + Q_PRIVATE_SLOT(d_func(), void _q_handlerDestroyed(QObject *obj)) + Q_PRIVATE_SLOT(d_func(), int _q_dynamicPageCountSlot()) + Q_PRIVATE_SLOT(d_func(), QSizeF _q_dynamicDocumentSizeSlot()) +}; + +class Q_GUI_EXPORT QTextObjectInterface +{ +public: + virtual ~QTextObjectInterface() {} + virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0; + virtual void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0; +}; + +Q_DECLARE_INTERFACE(QTextObjectInterface, "com.trolltech.Qt.QTextObjectInterface") + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QABSTRACTTEXTDOCUMENTLAYOUT_H diff --git a/qtinterface/qt4/Qt/qabstracttransition.h b/qtinterface/qt4/Qt/qabstracttransition.h new file mode 100644 index 0000000..e3ba940 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstracttransition.h @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTTRANSITION_H +#define QABSTRACTTRANSITION_H + +#include + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +#ifndef QT_NO_STATEMACHINE + +class QEvent; +class QAbstractState; +class QState; +class QStateMachine; + +#ifndef QT_NO_ANIMATION +class QAbstractAnimation; +#endif + +class QAbstractTransitionPrivate; +class Q_CORE_EXPORT QAbstractTransition : public QObject +{ + Q_OBJECT + Q_PROPERTY(QState* sourceState READ sourceState) + Q_PROPERTY(QAbstractState* targetState READ targetState WRITE setTargetState) + Q_PROPERTY(QList targetStates READ targetStates WRITE setTargetStates) +public: + QAbstractTransition(QState *sourceState = 0); + virtual ~QAbstractTransition(); + + QState *sourceState() const; + QAbstractState *targetState() const; + void setTargetState(QAbstractState* target); + QList targetStates() const; + void setTargetStates(const QList &targets); + + QStateMachine *machine() const; + +#ifndef QT_NO_ANIMATION + void addAnimation(QAbstractAnimation *animation); + void removeAnimation(QAbstractAnimation *animation); + QList animations() const; +#endif + +Q_SIGNALS: +#if !defined(Q_MOC_RUN) && !defined(qdoc) +private: // can only be emitted by QAbstractTransition +#endif + void triggered(); + +protected: + virtual bool eventTest(QEvent *event) = 0; + + virtual void onTransition(QEvent *event) = 0; + + bool event(QEvent *e); + +protected: + QAbstractTransition(QAbstractTransitionPrivate &dd, QState *parent); + +private: + Q_DISABLE_COPY(QAbstractTransition) + Q_DECLARE_PRIVATE(QAbstractTransition) +}; + +#endif //QT_NO_STATEMACHINE + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qabstracturiresolver.h b/qtinterface/qt4/Qt/qabstracturiresolver.h new file mode 100644 index 0000000..4c7de72 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstracturiresolver.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtXmlPatterns module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTURIRESOLVER_H +#define QABSTRACTURIRESOLVER_H + +#include + +QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + +QT_MODULE(XmlPatterns) + +class QUrl; +class QAbstractUriResolverPrivate; + +class Q_XMLPATTERNS_EXPORT QAbstractUriResolver : public QObject +{ + Q_OBJECT +public: + QAbstractUriResolver(QObject *parent = 0); + virtual ~QAbstractUriResolver(); + + virtual QUrl resolve(const QUrl &relative, + const QUrl &baseURI) const = 0; + +private: + Q_DISABLE_COPY(QAbstractUriResolver) + Q_DECLARE_PRIVATE(QAbstractUriResolver) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qabstractvideobuffer.h b/qtinterface/qt4/Qt/qabstractvideobuffer.h new file mode 100644 index 0000000..3182696 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractvideobuffer.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTVIDEOBUFFER_H +#define QABSTRACTVIDEOBUFFER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QVariant; + +class QAbstractVideoBufferPrivate; + +class Q_MULTIMEDIA_EXPORT QAbstractVideoBuffer +{ +public: + enum HandleType + { + NoHandle, + GLTextureHandle, + UserHandle = 1000 + }; + + enum MapMode + { + NotMapped = 0x00, + ReadOnly = 0x01, + WriteOnly = 0x02, + ReadWrite = ReadOnly | WriteOnly + }; + + QAbstractVideoBuffer(HandleType type); + virtual ~QAbstractVideoBuffer(); + + HandleType handleType() const; + + virtual MapMode mapMode() const = 0; + + virtual uchar *map(MapMode mode, int *numBytes, int *bytesPerLine) = 0; + virtual void unmap() = 0; + + virtual QVariant handle() const; + +protected: + QAbstractVideoBuffer(QAbstractVideoBufferPrivate &dd, HandleType type); + + QAbstractVideoBufferPrivate *d_ptr; + +private: + Q_DECLARE_PRIVATE(QAbstractVideoBuffer) + Q_DISABLE_COPY(QAbstractVideoBuffer) +}; + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QAbstractVideoBuffer::HandleType) +Q_DECLARE_METATYPE(QAbstractVideoBuffer::MapMode) + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qabstractvideosurface.h b/qtinterface/qt4/Qt/qabstractvideosurface.h new file mode 100644 index 0000000..927df3f --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractvideosurface.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTVIDEOSURFACE_H +#define QABSTRACTVIDEOSURFACE_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QRectF; +class QVideoSurfaceFormat; + +class QAbstractVideoSurfacePrivate; + +class Q_MULTIMEDIA_EXPORT QAbstractVideoSurface : public QObject +{ + Q_OBJECT + +public: + enum Error + { + NoError, + UnsupportedFormatError, + IncorrectFormatError, + StoppedError, + ResourceError + }; + + explicit QAbstractVideoSurface(QObject *parent = 0); + ~QAbstractVideoSurface(); + + virtual QList supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const = 0; + virtual bool isFormatSupported(const QVideoSurfaceFormat &format) const; + virtual QVideoSurfaceFormat nearestFormat(const QVideoSurfaceFormat &format) const; + + QVideoSurfaceFormat surfaceFormat() const; + + virtual bool start(const QVideoSurfaceFormat &format); + virtual void stop(); + + bool isActive() const; + + virtual bool present(const QVideoFrame &frame) = 0; + + Error error() const; + +Q_SIGNALS: + void activeChanged(bool active); + void surfaceFormatChanged(const QVideoSurfaceFormat &format); + void supportedFormatsChanged(); + +protected: + QAbstractVideoSurface(QAbstractVideoSurfacePrivate &dd, QObject *parent); + + void setError(Error error); + +private: + Q_DECLARE_PRIVATE(QAbstractVideoSurface) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qabstractxmlnodemodel.h b/qtinterface/qt4/Qt/qabstractxmlnodemodel.h new file mode 100644 index 0000000..702c3c7 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractxmlnodemodel.h @@ -0,0 +1,429 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtXmlPatterns module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTXMLNODEMODEL_H +#define QABSTRACTXMLNODEMODEL_H + +#include +#include +#include + +QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + +QT_MODULE(XmlPatterns) + +/* This file contains the classes QXmlNodeModelIndex, QAbstractXmlNodeModel, + * QXmlItem and QPatternist::NodeIndexStorage. */ + +class QAbstractXmlNodeModel; +class QAbstractXmlNodeModelPrivate; +class QAbstractXmlReceiver; +class QSourceLocation; +class QUrl; +class QXmlName; +class QXmlNodeModelIndex; +template class QAbstractXmlForwardIterator; +template class QVector; + +/* The members in the namespace QPatternist are internal, not part of the public API, and + * unsupported. Using them leads to undefined behavior. */ +namespace QPatternist +{ + class DynamicContext; + class Item; + class ItemType; + class XsdValidatedXmlNodeModel; + template class ItemMappingIterator; + template class SequenceMappingIterator; + typedef QExplicitlySharedDataPointer ItemTypePtr; + typedef QExplicitlySharedDataPointer > ItemIteratorPtr; + typedef QVector QXmlNameVector; + + class NodeIndexStorage + { + public: + typedef qint64 Data; + + /*! + \note Changing merely the order of these two members, ptr and data, + is a binary incompatible change on Mac Power PC. + */ + union + { + void *ptr; // Do not use ptr directy, use pointer() instead. + Data data; + }; + void *pointer() const + { + /* Constructing to qptrdiff means we avoid the warning "cast to pointer + * from integer of different size." + */ + return (void *)qptrdiff(data); + } + + Data additionalData; + const QAbstractXmlNodeModel *model; + + /* Implementation is in qabstractxmlnodemodel.cpp. */ + inline bool operator!=(const NodeIndexStorage &other) const; + }; +} + +class Q_XMLPATTERNS_EXPORT QXmlNodeModelIndex +{ + enum Constants + { + ForwardAxis = 8192, + ReverseAxis = 16384 + }; + +public: + inline QXmlNodeModelIndex() + { + reset(); + } + + inline QXmlNodeModelIndex(const QXmlNodeModelIndex &other) : m_storage(other.m_storage) + { + } + + bool operator==(const QXmlNodeModelIndex &other) const; + bool operator!=(const QXmlNodeModelIndex &other) const; + + typedef QAbstractXmlForwardIterator Iterator; + typedef QList List; + + enum NodeKind + { + Attribute = 1, + Comment = 2, + Document = 4, + Element = 8, + Namespace = 16, + ProcessingInstruction = 32, + Text = 64 + }; + + enum DocumentOrder + { + Precedes = -1, + Is = 0, + Follows = 1 + }; + + enum Axis + { + AxisChild = 1 | ForwardAxis, + AxisDescendant = 2 | ForwardAxis, + AxisAttribute = 4 | ForwardAxis, + AxisSelf = 8 | ForwardAxis, + AxisDescendantOrSelf = 16 | ForwardAxis, + AxisFollowingSibling = 32 | ForwardAxis, + AxisNamespace = 64 | ForwardAxis, + AxisFollowing = 128 | ReverseAxis, + AxisParent = 256 | ReverseAxis, + AxisAncestor = 512 | ReverseAxis, + AxisPrecedingSibling = 1024 | ReverseAxis, + AxisPreceding = 2048 | ReverseAxis, + AxisAncestorOrSelf = 4096 | ReverseAxis, + /* Note that we cannot clash with the values of ForwardAxis and + * ReverseAxis. */ + AxisChildOrTop = 32768 | ForwardAxis, + AxisAttributeOrTop = 65536 | ForwardAxis + }; + + inline qint64 data() const + { + return m_storage.data; + } + + inline void *internalPointer() const + { + return m_storage.pointer(); + } + + inline const QAbstractXmlNodeModel *model() const + { + return m_storage.model; + } + + inline qint64 additionalData() const + { + return m_storage.additionalData; + } + + inline bool isNull() const + { + return !m_storage.model; + } + + /* The members below are internal, not part of the public API, and + * unsupported. Using them leads to undefined behavior. */ + + inline QXmlName name() const; + inline QXmlNodeModelIndex root() const; + inline QExplicitlySharedDataPointer > iterate(const Axis axis) const; + inline QExplicitlySharedDataPointer > sequencedTypedValue() const; + inline QUrl documentUri() const; + inline QUrl baseUri() const; + inline NodeKind kind() const; + inline bool isDeepEqual(const QXmlNodeModelIndex &other) const; + inline DocumentOrder compareOrder(const QXmlNodeModelIndex &other) const; + inline void sendNamespaces(QAbstractXmlReceiver *const receiver) const; + inline QVector namespaceBindings() const; + inline QXmlName::NamespaceCode namespaceForPrefix(const QXmlName::PrefixCode prefix) const; + inline QString stringValue() const; + inline QPatternist::ItemTypePtr type() const; + inline bool is(const QXmlNodeModelIndex &other) const; + + inline void reset() + { + m_storage.data = 0; + m_storage.additionalData = 0; + m_storage.model = 0; + } + +private: + static inline QXmlNodeModelIndex create(const qint64 d, + const QAbstractXmlNodeModel *const nm) + { + QXmlNodeModelIndex n; + n.m_storage.data = d; + n.m_storage.model = nm; + n.m_storage.additionalData = 0; + return n; + } + + static inline QXmlNodeModelIndex create(const qint64 data, + const QAbstractXmlNodeModel *const nm, + const qint64 addData) + { + QXmlNodeModelIndex n; + n.m_storage.data = data; + n.m_storage.model = nm; + n.m_storage.additionalData = addData; + return n; + } + + inline QXmlNodeModelIndex(const QPatternist::NodeIndexStorage &storage) : m_storage(storage) + { + } + + friend class QAbstractXmlNodeModel; + friend class QPatternist::Item; + friend class QXmlItem; + inline operator int() const; // Disable + + QPatternist::NodeIndexStorage m_storage; +}; + +Q_XMLPATTERNS_EXPORT uint qHash(const QXmlNodeModelIndex &index); + +inline bool qIsForwardIteratorEnd(const QXmlNodeModelIndex &item) +{ + return item.isNull(); +} + +class Q_XMLPATTERNS_EXPORT QAbstractXmlNodeModel : public QSharedData +{ +public: + enum SimpleAxis + { + Parent, + FirstChild, + PreviousSibling, + NextSibling + }; + + typedef QExplicitlySharedDataPointer Ptr; + typedef QList List; + + QAbstractXmlNodeModel(); + virtual ~QAbstractXmlNodeModel(); + + virtual QUrl baseUri(const QXmlNodeModelIndex &ni) const = 0; + virtual QUrl documentUri(const QXmlNodeModelIndex &ni) const = 0; + virtual QXmlNodeModelIndex::NodeKind kind(const QXmlNodeModelIndex &ni) const = 0; + virtual QXmlNodeModelIndex::DocumentOrder compareOrder(const QXmlNodeModelIndex &ni1, + const QXmlNodeModelIndex &ni2) const = 0; + virtual QXmlNodeModelIndex root(const QXmlNodeModelIndex &n) const = 0; + virtual QXmlName name(const QXmlNodeModelIndex &ni) const = 0; + virtual QString stringValue(const QXmlNodeModelIndex &n) const = 0; + virtual QVariant typedValue(const QXmlNodeModelIndex &n) const = 0; + + /* The members below are internal, not part of the public API, and + * unsupported. Using them leads to undefined behavior. */ + virtual QExplicitlySharedDataPointer > iterate(const QXmlNodeModelIndex &ni, QXmlNodeModelIndex::Axis axis) const; + virtual QPatternist::ItemIteratorPtr sequencedTypedValue(const QXmlNodeModelIndex &ni) const; + virtual QPatternist::ItemTypePtr type(const QXmlNodeModelIndex &ni) const; + virtual QXmlName::NamespaceCode namespaceForPrefix(const QXmlNodeModelIndex &ni, + const QXmlName::PrefixCode prefix) const; + virtual bool isDeepEqual(const QXmlNodeModelIndex &ni1, + const QXmlNodeModelIndex &ni2) const; + virtual void sendNamespaces(const QXmlNodeModelIndex &n, + QAbstractXmlReceiver *const receiver) const; + virtual QVector namespaceBindings(const QXmlNodeModelIndex &n) const = 0; + + + virtual QXmlNodeModelIndex elementById(const QXmlName &NCName) const = 0; + virtual QVector nodesByIdref(const QXmlName &NCName) const = 0; + + enum NodeCopySetting + { + InheritNamespaces = 0x1, + PreserveNamespaces = 0x2 + }; + + typedef QFlags NodeCopySettings; + virtual void copyNodeTo(const QXmlNodeModelIndex &node, + QAbstractXmlReceiver *const receiver, + const NodeCopySettings &) const; + + QSourceLocation sourceLocation(const QXmlNodeModelIndex &index) const; + +protected: + + virtual QXmlNodeModelIndex nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &origin) const = 0; + virtual QVector attributes(const QXmlNodeModelIndex &element) const = 0; + + QAbstractXmlNodeModel(QAbstractXmlNodeModelPrivate *d); + + inline QXmlNodeModelIndex createIndex(qint64 data) const + { + return QXmlNodeModelIndex::create(data, this); + } + + inline QXmlNodeModelIndex createIndex(void * pointer, + qint64 additionalData = 0) const + { + return QXmlNodeModelIndex::create(qptrdiff(pointer), this, additionalData); + } + + inline QXmlNodeModelIndex createIndex(qint64 data, + qint64 additionalData) const + { + return QXmlNodeModelIndex::create(data, this, additionalData); + } + + QScopedPointer d_ptr; +private: + friend class QPatternist::ItemMappingIterator >; + friend class QPatternist::SequenceMappingIterator; + friend class QPatternist::XsdValidatedXmlNodeModel; + + inline QExplicitlySharedDataPointer > mapToSequence(const QXmlNodeModelIndex &ni, + const QExplicitlySharedDataPointer &) const; + + static inline bool isIgnorableInDeepEqual(const QXmlNodeModelIndex &n); + Q_DISABLE_COPY(QAbstractXmlNodeModel) +}; + +Q_DECLARE_TYPEINFO(QXmlNodeModelIndex, Q_MOVABLE_TYPE); + +template class QAbstractXmlForwardIterator; +class QVariant; +class QXmlItemPrivate; + +namespace QPatternist +{ + class AtomicValue; + class VariableLoader; + class IteratorBridge; + class ToQXmlItemMapper; + class ToItemMapper; +} + +class Q_XMLPATTERNS_EXPORT QXmlItem +{ +public: + typedef QAbstractXmlForwardIterator Iterator; + + QXmlItem(); + QXmlItem(const QXmlItem &other); + QXmlItem(const QXmlNodeModelIndex &node); + QXmlItem(const QVariant &atomicValue); + ~QXmlItem(); + QXmlItem &operator=(const QXmlItem &other); + + bool isNull() const; + bool isNode() const; + bool isAtomicValue() const; + + QVariant toAtomicValue() const; + QXmlNodeModelIndex toNodeModelIndex() const; + +private: + friend class QPatternist::IteratorBridge; + friend class QPatternist::VariableLoader; + friend class QPatternist::ToQXmlItemMapper; + friend class QPatternist::ToItemMapper; + friend class QPatternist::Item; + + inline bool internalIsAtomicValue() const; + + inline QXmlItem(const QPatternist::Item &i); + + union + { + QPatternist::NodeIndexStorage m_node; + + /* These two sits at the position of NodeIndexStorage::data. + * NodeIndexStorage::{additionalData,model} are free. */ + const QPatternist::AtomicValue *m_atomicValue; + QXmlItemPrivate * m_ptr; /* Not currently used. */ + }; +}; + +inline bool qIsForwardIteratorEnd(const QXmlItem &item) +{ + return item.isNull(); +} + +Q_DECLARE_TYPEINFO(QXmlItem, Q_MOVABLE_TYPE); + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(QXmlItem) /* This macro must appear after QT_END_NAMESPACE. */ + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qabstractxmlreceiver.h b/qtinterface/qt4/Qt/qabstractxmlreceiver.h new file mode 100644 index 0000000..477fb17 --- /dev/null +++ b/qtinterface/qt4/Qt/qabstractxmlreceiver.h @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtXmlPatterns module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QABSTRACTXMLRECEIVER_H +#define QABSTRACTXMLRECEIVER_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(XmlPatterns) + +class QAbstractXmlReceiverPrivate; +class QXmlName; + +namespace QPatternist +{ + class Item; +} + +class Q_XMLPATTERNS_EXPORT QAbstractXmlReceiver +{ +public: + QAbstractXmlReceiver(); + + virtual ~QAbstractXmlReceiver(); + + virtual void startElement(const QXmlName &name) = 0; + virtual void endElement() = 0; + virtual void attribute(const QXmlName &name, + const QStringRef &value) = 0; + virtual void comment(const QString &value) = 0; + virtual void characters(const QStringRef &value) = 0; + virtual void startDocument() = 0; + virtual void endDocument() = 0; + + virtual void processingInstruction(const QXmlName &target, + const QString &value) = 0; + + virtual void atomicValue(const QVariant &value) = 0; + virtual void namespaceBinding(const QXmlName &name) = 0; + virtual void startOfSequence() = 0; + virtual void endOfSequence() = 0; + + /* The members below are internal, not part of the public API, and + * unsupported. Using them leads to undefined behavior. */ + virtual void whitespaceOnly(const QStringRef &value); + virtual void item(const QPatternist::Item &item); + +protected: + QAbstractXmlReceiver(QAbstractXmlReceiverPrivate *d); + QScopedPointer d_ptr; + + void sendAsNode(const QPatternist::Item &outputItem); +private: + template + void sendFromAxis(const QXmlNodeModelIndex &node); + Q_DISABLE_COPY(QAbstractXmlReceiver) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qaccessible.h b/qtinterface/qt4/Qt/qaccessible.h new file mode 100644 index 0000000..c3f8c7a --- /dev/null +++ b/qtinterface/qt4/Qt/qaccessible.h @@ -0,0 +1,428 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QACCESSIBLE_H +#define QACCESSIBLE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ACCESSIBILITY + +class QAccessibleInterface; + +class Q_GUI_EXPORT QAccessible +{ +public: + enum Event { + SoundPlayed = 0x0001, + Alert = 0x0002, + ForegroundChanged = 0x0003, + MenuStart = 0x0004, + MenuEnd = 0x0005, + PopupMenuStart = 0x0006, + PopupMenuEnd = 0x0007, + ContextHelpStart = 0x000C, + ContextHelpEnd = 0x000D, + DragDropStart = 0x000E, + DragDropEnd = 0x000F, + DialogStart = 0x0010, + DialogEnd = 0x0011, + ScrollingStart = 0x0012, + ScrollingEnd = 0x0013, + + MenuCommand = 0x0018, + + ObjectCreated = 0x8000, + ObjectDestroyed = 0x8001, + ObjectShow = 0x8002, + ObjectHide = 0x8003, + ObjectReorder = 0x8004, + Focus = 0x8005, + Selection = 0x8006, + SelectionAdd = 0x8007, + SelectionRemove = 0x8008, + SelectionWithin = 0x8009, + StateChanged = 0x800A, + LocationChanged = 0x800B, + NameChanged = 0x800C, + DescriptionChanged = 0x800D, + ValueChanged = 0x800E, + ParentChanged = 0x800F, + HelpChanged = 0x80A0, + DefaultActionChanged = 0x80B0, + AcceleratorChanged = 0x80C0 + }; + + enum StateFlag { + Normal = 0x00000000, + Unavailable = 0x00000001, + Selected = 0x00000002, + Focused = 0x00000004, + Pressed = 0x00000008, + Checked = 0x00000010, + Mixed = 0x00000020, + ReadOnly = 0x00000040, + HotTracked = 0x00000080, + DefaultButton = 0x00000100, + Expanded = 0x00000200, + Collapsed = 0x00000400, + Busy = 0x00000800, + // Floating = 0x00001000, + Marqueed = 0x00002000, + Animated = 0x00004000, + Invisible = 0x00008000, + Offscreen = 0x00010000, + Sizeable = 0x00020000, + Movable = 0x00040000, +#ifdef QT3_SUPPORT + Moveable = Movable, +#endif + SelfVoicing = 0x00080000, + Focusable = 0x00100000, + Selectable = 0x00200000, + Linked = 0x00400000, + Traversed = 0x00800000, + MultiSelectable = 0x01000000, + ExtSelectable = 0x02000000, + //AlertLow = 0x04000000, + //AlertMedium = 0x08000000, + //AlertHigh = 0x10000000, /* reused for HasInvokeExtension */ + Protected = 0x20000000, + HasPopup = 0x40000000, + Modal = 0x80000000, + + HasInvokeExtension = 0x10000000 // internal + }; + Q_DECLARE_FLAGS(State, StateFlag) + + enum Role { + NoRole = 0x00000000, + TitleBar = 0x00000001, + MenuBar = 0x00000002, + ScrollBar = 0x00000003, + Grip = 0x00000004, + Sound = 0x00000005, + Cursor = 0x00000006, + Caret = 0x00000007, + AlertMessage = 0x00000008, + Window = 0x00000009, + Client = 0x0000000A, + PopupMenu = 0x0000000B, + MenuItem = 0x0000000C, + ToolTip = 0x0000000D, + Application = 0x0000000E, + Document = 0x0000000F, + Pane = 0x00000010, + Chart = 0x00000011, + Dialog = 0x00000012, + Border = 0x00000013, + Grouping = 0x00000014, + Separator = 0x00000015, + ToolBar = 0x00000016, + StatusBar = 0x00000017, + Table = 0x00000018, + ColumnHeader = 0x00000019, + RowHeader = 0x0000001A, + Column = 0x0000001B, + Row = 0x0000001C, + Cell = 0x0000001D, + Link = 0x0000001E, + HelpBalloon = 0x0000001F, + Assistant = 0x00000020, + List = 0x00000021, + ListItem = 0x00000022, + Tree = 0x00000023, + TreeItem = 0x00000024, + PageTab = 0x00000025, + PropertyPage = 0x00000026, + Indicator = 0x00000027, + Graphic = 0x00000028, + StaticText = 0x00000029, + EditableText = 0x0000002A, // Editable, selectable, etc. + PushButton = 0x0000002B, + CheckBox = 0x0000002C, + RadioButton = 0x0000002D, + ComboBox = 0x0000002E, + // DropList = 0x0000002F, + ProgressBar = 0x00000030, + Dial = 0x00000031, + HotkeyField = 0x00000032, + Slider = 0x00000033, + SpinBox = 0x00000034, + Canvas = 0x00000035, + Animation = 0x00000036, + Equation = 0x00000037, + ButtonDropDown = 0x00000038, + ButtonMenu = 0x00000039, + ButtonDropGrid = 0x0000003A, + Whitespace = 0x0000003B, + PageTabList = 0x0000003C, + Clock = 0x0000003D, + Splitter = 0x0000003E, + // Additional Qt roles where enum value does not map directly to MSAA: + LayeredPane = 0x0000003F, + UserRole = 0x0000ffff + }; + + enum Text { + Name = 0, + Description, + Value, + Help, + Accelerator, + UserText = 0x0000ffff + }; + + enum RelationFlag { + Unrelated = 0x00000000, + Self = 0x00000001, + Ancestor = 0x00000002, + Child = 0x00000004, + Descendent = 0x00000008, + Sibling = 0x00000010, + HierarchyMask = 0x000000ff, + + Up = 0x00000100, + Down = 0x00000200, + Left = 0x00000400, + Right = 0x00000800, + Covers = 0x00001000, + Covered = 0x00002000, + GeometryMask = 0x0000ff00, + + FocusChild = 0x00010000, + Label = 0x00020000, + Labelled = 0x00040000, + Controller = 0x00080000, + Controlled = 0x00100000, + LogicalMask = 0x00ff0000 + }; + Q_DECLARE_FLAGS(Relation, RelationFlag) + + enum Action { + DefaultAction = 0, + Press = -1, + FirstStandardAction = Press, + SetFocus = -2, + Increase = -3, + Decrease = -4, + Accept = -5, + Cancel = -6, + Select = -7, + ClearSelection = -8, + RemoveSelection = -9, + ExtendSelection = -10, + AddToSelection = -11, + LastStandardAction = AddToSelection + }; + + enum Method { + ListSupportedMethods = 0, + SetCursorPosition = 1, + GetCursorPosition = 2, + ForegroundColor = 3, + BackgroundColor = 4 + }; + + typedef QAccessibleInterface*(*InterfaceFactory)(const QString &key, QObject*); + typedef void(*UpdateHandler)(QObject*, int who, Event reason); + typedef void(*RootObjectHandler)(QObject*); + + static void installFactory(InterfaceFactory); + static void removeFactory(InterfaceFactory); + static UpdateHandler installUpdateHandler(UpdateHandler); + static RootObjectHandler installRootObjectHandler(RootObjectHandler); + + static QAccessibleInterface *queryAccessibleInterface(QObject *); + static void updateAccessibility(QObject *, int who, Event reason); + static bool isActive(); + static void setRootObject(QObject*); + + static void initialize(); + static void cleanup(); + +private: + static UpdateHandler updateHandler; + static RootObjectHandler rootObjectHandler; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::State) +Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::Relation) +QT_END_NAMESPACE +Q_DECLARE_METATYPE(QSet) +QT_BEGIN_NAMESPACE + +namespace QAccessible2 +{ + enum InterfaceType + { + TextInterface, + EditableTextInterface, + ValueInterface, + TableInterface, + ActionInterface, + ImageInterface + }; +} + +class QAccessible2Interface; +class QAccessibleTextInterface; +class QAccessibleEditableTextInterface; +class QAccessibleValueInterface; +class QAccessibleTableInterface; +class QAccessibleActionInterface; +class QAccessibleImageInterface; + +class Q_GUI_EXPORT QAccessibleInterface : public QAccessible +{ +public: + virtual ~QAccessibleInterface() {} + // check for valid pointers + virtual bool isValid() const = 0; + virtual QObject *object() const = 0; + + // hierarchy + virtual int childCount() const = 0; + virtual int indexOfChild(const QAccessibleInterface *) const = 0; + + // relations + virtual Relation relationTo(int child, const QAccessibleInterface *other, + int otherChild) const = 0; + virtual int childAt(int x, int y) const = 0; + + // navigation + virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const = 0; + + // properties and state + virtual QString text(Text t, int child) const = 0; + virtual void setText(Text t, int child, const QString &text) = 0; + virtual QRect rect(int child) const = 0; + virtual Role role(int child) const = 0; + virtual State state(int child) const = 0; + + // action + virtual int userActionCount(int child) const = 0; + virtual QString actionText(int action, Text t, int child) const = 0; + virtual bool doAction(int action, int child, const QVariantList ¶ms = QVariantList()) = 0; + + QVariant invokeMethod(Method method, int child = 0, + const QVariantList ¶ms = QVariantList()); + + inline QSet supportedMethods() + { return qvariant_cast >(invokeMethod(ListSupportedMethods)); } + + inline QColor foregroundColor() + { return qvariant_cast(invokeMethod(ForegroundColor)); } + + inline QColor backgroundColor() + { return qvariant_cast(invokeMethod(BackgroundColor)); } + + inline QAccessibleTextInterface *textInterface() + { return reinterpret_cast(cast_helper(QAccessible2::TextInterface)); } + + inline QAccessibleEditableTextInterface *editableTextInterface() + { return reinterpret_cast(cast_helper(QAccessible2::EditableTextInterface)); } + + inline QAccessibleValueInterface *valueInterface() + { return reinterpret_cast(cast_helper(QAccessible2::ValueInterface)); } + + inline QAccessibleTableInterface *tableInterface() + { return reinterpret_cast(cast_helper(QAccessible2::TableInterface)); } + + inline QAccessibleActionInterface *actionInterface() + { return reinterpret_cast(cast_helper(QAccessible2::ActionInterface)); } + + inline QAccessibleImageInterface *imageInterface() + { return reinterpret_cast(cast_helper(QAccessible2::ImageInterface)); } + +private: + QAccessible2Interface *cast_helper(QAccessible2::InterfaceType); +}; + +class Q_GUI_EXPORT QAccessibleInterfaceEx: public QAccessibleInterface +{ +public: + virtual QVariant invokeMethodEx(Method method, int child, const QVariantList ¶ms) = 0; + virtual QVariant virtual_hook(const QVariant &data); + virtual QAccessible2Interface *interface_cast(QAccessible2::InterfaceType) + { return 0; } +}; + + +class Q_GUI_EXPORT QAccessibleEvent : public QEvent +{ +public: + inline QAccessibleEvent(Type type, int child); + inline int child() const { return c; } + inline QString value() const { return val; } + inline void setValue(const QString &aText) { val = aText; } + +private: + int c; + QString val; +}; + +inline QAccessibleEvent::QAccessibleEvent(Type atype, int achild) + : QEvent(atype), c(achild) {} + +#define QAccessibleInterface_iid "com.trolltech.Qt.QAccessibleInterface" +Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid) + +#endif // QT_NO_ACCESSIBILITY + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QACCESSIBLE_H diff --git a/qtinterface/qt4/Qt/qaccessible2.h b/qtinterface/qt4/Qt/qaccessible2.h new file mode 100644 index 0000000..297aea4 --- /dev/null +++ b/qtinterface/qt4/Qt/qaccessible2.h @@ -0,0 +1,246 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QACCESSIBLE2_H +#define QACCESSIBLE2_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ACCESSIBILITY + +namespace QAccessible2 +{ + enum CoordinateType + { + RelativeToScreen = 0, + RelativeToParent = 1 + }; + + enum BoundaryType { + CharBoundary, + WordBoundary, + SentenceBoundary, + ParagraphBoundary, + LineBoundary, + NoBoundary + }; +} + +class Q_GUI_EXPORT QAccessible2Interface +{ +public: + virtual ~QAccessible2Interface() {} +}; + +// catch-all functions. If an accessible class doesn't implement interface T, return 0 +inline QAccessible2Interface *qAccessibleValueCastHelper() { return 0; } +inline QAccessible2Interface *qAccessibleTextCastHelper() { return 0; } +inline QAccessible2Interface *qAccessibleEditableTextCastHelper() { return 0; } +inline QAccessible2Interface *qAccessibleTableCastHelper() { return 0; } +inline QAccessible2Interface *qAccessibleActionCastHelper() { return 0; } +inline QAccessible2Interface *qAccessibleImageCastHelper() { return 0; } + +#define Q_ACCESSIBLE_OBJECT \ + public: \ + QAccessible2Interface *interface_cast(QAccessible2::InterfaceType t) \ + { \ + switch (t) { \ + case QAccessible2::TextInterface: \ + return qAccessibleTextCastHelper(); \ + case QAccessible2::EditableTextInterface: \ + return qAccessibleEditableTextCastHelper(); \ + case QAccessible2::ValueInterface: \ + return qAccessibleValueCastHelper(); \ + case QAccessible2::TableInterface: \ + return qAccessibleTableCastHelper(); \ + case QAccessible2::ActionInterface: \ + return qAccessibleActionCastHelper(); \ + case QAccessible2::ImageInterface: \ + return qAccessibleImageCastHelper(); \ + } \ + return 0; \ + } \ + private: + +class Q_GUI_EXPORT QAccessibleTextInterface: public QAccessible2Interface +{ +public: + inline QAccessible2Interface *qAccessibleTextCastHelper() { return this; } + + virtual ~QAccessibleTextInterface() {} + + virtual void addSelection(int startOffset, int endOffset) = 0; + virtual QString attributes(int offset, int *startOffset, int *endOffset) = 0; + virtual int cursorPosition() = 0; + virtual QRect characterRect(int offset, QAccessible2::CoordinateType coordType) = 0; + virtual int selectionCount() = 0; + virtual int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType) = 0; + virtual void selection(int selectionIndex, int *startOffset, int *endOffset) = 0; + virtual QString text(int startOffset, int endOffset) = 0; + virtual QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType, + int *startOffset, int *endOffset) = 0; + virtual QString textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType, + int *startOffset, int *endOffset) = 0; + virtual QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType, + int *startOffset, int *endOffset) = 0; + virtual void removeSelection(int selectionIndex) = 0; + virtual void setCursorPosition(int position) = 0; + virtual void setSelection(int selectionIndex, int startOffset, int endOffset) = 0; + virtual int characterCount() = 0; + virtual void scrollToSubstring(int startIndex, int endIndex) = 0; +}; + +class Q_GUI_EXPORT QAccessibleEditableTextInterface: public QAccessible2Interface +{ +public: + inline QAccessible2Interface *qAccessibleEditableTextCastHelper() { return this; } + + virtual ~QAccessibleEditableTextInterface() {} + + virtual void copyText(int startOffset, int endOffset) = 0; + virtual void deleteText(int startOffset, int endOffset) = 0; + virtual void insertText(int offset, const QString &text) = 0; + virtual void cutText(int startOffset, int endOffset) = 0; + virtual void pasteText(int offset) = 0; + virtual void replaceText(int startOffset, int endOffset, const QString &text) = 0; + virtual void setAttributes(int startOffset, int endOffset, const QString &attributes) = 0; +}; + +class Q_GUI_EXPORT QAccessibleSimpleEditableTextInterface: public QAccessibleEditableTextInterface +{ +public: + QAccessibleSimpleEditableTextInterface(QAccessibleInterface *accessibleInterface); + + void copyText(int startOffset, int endOffset); + void deleteText(int startOffset, int endOffset); + void insertText(int offset, const QString &text); + void cutText(int startOffset, int endOffset); + void pasteText(int offset); + void replaceText(int startOffset, int endOffset, const QString &text); + inline void setAttributes(int, int, const QString &) {} + +private: + QAccessibleInterface *iface; +}; + +class Q_GUI_EXPORT QAccessibleValueInterface: public QAccessible2Interface +{ +public: + inline QAccessible2Interface *qAccessibleValueCastHelper() { return this; } + + virtual ~QAccessibleValueInterface() {} + + virtual QVariant currentValue() = 0; + virtual void setCurrentValue(const QVariant &value) = 0; + virtual QVariant maximumValue() = 0; + virtual QVariant minimumValue() = 0; +}; + +class Q_GUI_EXPORT QAccessibleTableInterface: public QAccessible2Interface +{ +public: + inline QAccessible2Interface *qAccessibleTableCastHelper() { return this; } + + virtual QAccessibleInterface *accessibleAt(int row, int column) = 0; + virtual QAccessibleInterface *caption() = 0; + virtual int childIndex(int rowIndex, int columnIndex) = 0; + virtual QString columnDescription(int column) = 0; + virtual int columnSpan(int row, int column) = 0; + virtual QAccessibleInterface *columnHeader() = 0; + virtual int columnIndex(int childIndex) = 0; + virtual int columnCount() = 0; + virtual int rowCount() = 0; + virtual int selectedColumnCount() = 0; + virtual int selectedRowCount() = 0; + virtual QString rowDescription(int row) = 0; + virtual int rowSpan(int row, int column) = 0; + virtual QAccessibleInterface *rowHeader() = 0; + virtual int rowIndex(int childIndex) = 0; + virtual int selectedRows(int maxRows, QList *rows) = 0; + virtual int selectedColumns(int maxColumns, QList *columns) = 0; + virtual QAccessibleInterface *summary() = 0; + virtual bool isColumnSelected(int column) = 0; + virtual bool isRowSelected(int row) = 0; + virtual bool isSelected(int row, int column) = 0; + virtual void selectRow(int row) = 0; + virtual void selectColumn(int column) = 0; + virtual void unselectRow(int row) = 0; + virtual void unselectColumn(int column) = 0; + virtual void cellAtIndex(int index, int *row, int *column, int *rowSpan, + int *columnSpan, bool *isSelected) = 0; +}; + +class Q_GUI_EXPORT QAccessibleActionInterface : public QAccessible2Interface +{ +public: + inline QAccessible2Interface *qAccessibleActionCastHelper() { return this; } + + virtual int actionCount() = 0; + virtual void doAction(int actionIndex) = 0; + virtual QString description(int actionIndex) = 0; + virtual QString name(int actionIndex) = 0; + virtual QString localizedName(int actionIndex) = 0; + virtual QStringList keyBindings(int actionIndex) = 0; +}; + +class Q_GUI_EXPORT QAccessibleImageInterface : public QAccessible2Interface +{ +public: + inline QAccessible2Interface *qAccessibleImageCastHelper() { return this; } + + virtual QString imageDescription() = 0; + virtual QSize imageSize() = 0; + virtual QRect imagePosition(QAccessible2::CoordinateType coordType) = 0; +}; + +#endif // QT_NO_ACCESSIBILITY + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qaccessiblebridge.h b/qtinterface/qt4/Qt/qaccessiblebridge.h new file mode 100644 index 0000000..171e9d5 --- /dev/null +++ b/qtinterface/qt4/Qt/qaccessiblebridge.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QACCESSIBLEBRIDGE_H +#define QACCESSIBLEBRIDGE_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ACCESSIBILITY + +class QAccessibleInterface; + +class QAccessibleBridge +{ +public: + virtual ~QAccessibleBridge() {} + virtual void setRootObject(QAccessibleInterface *) = 0; + virtual void notifyAccessibilityUpdate(int, QAccessibleInterface*, int) = 0; +}; + +struct Q_GUI_EXPORT QAccessibleBridgeFactoryInterface : public QFactoryInterface +{ + virtual QAccessibleBridge *create(const QString& name) = 0; +}; + +#define QAccessibleBridgeFactoryInterface_iid "com.trolltech.Qt.QAccessibleBridgeFactoryInterface" +Q_DECLARE_INTERFACE(QAccessibleBridgeFactoryInterface, QAccessibleBridgeFactoryInterface_iid) + +class Q_GUI_EXPORT QAccessibleBridgePlugin : public QObject, public QAccessibleBridgeFactoryInterface +{ + Q_OBJECT + Q_INTERFACES(QAccessibleBridgeFactoryInterface:QFactoryInterface) +public: + explicit QAccessibleBridgePlugin(QObject *parent = 0); + ~QAccessibleBridgePlugin(); + + virtual QStringList keys() const = 0; + virtual QAccessibleBridge *create(const QString &key) = 0; +}; + +#endif // QT_NO_ACCESSIBILITY + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QACCESSIBLEBRIDGE_H diff --git a/qtinterface/qt4/Qt/qaccessibleobject.h b/qtinterface/qt4/Qt/qaccessibleobject.h new file mode 100644 index 0000000..fcc716f --- /dev/null +++ b/qtinterface/qt4/Qt/qaccessibleobject.h @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QACCESSIBLEOBJECT_H +#define QACCESSIBLEOBJECT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ACCESSIBILITY + +class QAccessibleObjectPrivate; +class QObject; + +class Q_GUI_EXPORT QAccessibleObject : public QAccessibleInterface +{ +public: + explicit QAccessibleObject(QObject *object); + + bool isValid() const; + QObject *object() const; + + // properties + QRect rect(int child) const; + void setText(Text t, int child, const QString &text); + + // actions + int userActionCount(int child) const; + bool doAction(int action, int child, const QVariantList ¶ms); + QString actionText(int action, Text t, int child) const; + +protected: + virtual ~QAccessibleObject(); + +private: + friend class QAccessibleObjectEx; + QAccessibleObjectPrivate *d; + Q_DISABLE_COPY(QAccessibleObject) +}; + +class Q_GUI_EXPORT QAccessibleObjectEx : public QAccessibleInterfaceEx +{ +public: + explicit QAccessibleObjectEx(QObject *object); + + bool isValid() const; + QObject *object() const; + + // properties + QRect rect(int child) const; + void setText(Text t, int child, const QString &text); + + // actions + int userActionCount(int child) const; + bool doAction(int action, int child, const QVariantList ¶ms); + QString actionText(int action, Text t, int child) const; + +protected: + virtual ~QAccessibleObjectEx(); + +private: + QAccessibleObjectPrivate *d; + Q_DISABLE_COPY(QAccessibleObjectEx) +}; + +class Q_GUI_EXPORT QAccessibleApplication : public QAccessibleObject +{ +public: + QAccessibleApplication(); + + // relations + int childCount() const; + int indexOfChild(const QAccessibleInterface*) const; + Relation relationTo(int, const QAccessibleInterface *, int) const; + + // navigation + int childAt(int x, int y) const; + int navigate(RelationFlag, int, QAccessibleInterface **) const; + + // properties and state + QString text(Text t, int child) const; + Role role(int child) const; + State state(int child) const; + + // actions + int userActionCount(int child) const; + bool doAction(int action, int child, const QVariantList ¶ms); + QString actionText(int action, Text t, int child) const; +}; + +#endif // QT_NO_ACCESSIBILITY + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QACCESSIBLEOBJECT_H diff --git a/qtinterface/qt4/Qt/qaccessibleplugin.h b/qtinterface/qt4/Qt/qaccessibleplugin.h new file mode 100644 index 0000000..556757f --- /dev/null +++ b/qtinterface/qt4/Qt/qaccessibleplugin.h @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QACCESSIBLEPLUGIN_H +#define QACCESSIBLEPLUGIN_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ACCESSIBILITY + +class QStringList; +class QAccessibleInterface; + +struct Q_GUI_EXPORT QAccessibleFactoryInterface : public QAccessible, public QFactoryInterface +{ + virtual QAccessibleInterface* create(const QString &key, QObject *object) = 0; +}; + +#define QAccessibleFactoryInterface_iid "com.trolltech.Qt.QAccessibleFactoryInterface" +Q_DECLARE_INTERFACE(QAccessibleFactoryInterface, QAccessibleFactoryInterface_iid) + +class QAccessiblePluginPrivate; + +class Q_GUI_EXPORT QAccessiblePlugin : public QObject, public QAccessibleFactoryInterface +{ + Q_OBJECT + Q_INTERFACES(QAccessibleFactoryInterface:QFactoryInterface) +public: + explicit QAccessiblePlugin(QObject *parent = 0); + ~QAccessiblePlugin(); + + virtual QStringList keys() const = 0; + virtual QAccessibleInterface *create(const QString &key, QObject *object) = 0; +}; + +#endif // QT_NO_ACCESSIBILITY + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QACCESSIBLEPLUGIN_H diff --git a/qtinterface/qt4/Qt/qaccessiblewidget.h b/qtinterface/qt4/Qt/qaccessiblewidget.h new file mode 100644 index 0000000..abf96a6 --- /dev/null +++ b/qtinterface/qt4/Qt/qaccessiblewidget.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QACCESSIBLEWIDGET_H +#define QACCESSIBLEWIDGET_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ACCESSIBILITY + +class QAccessibleWidgetPrivate; + +class Q_GUI_EXPORT QAccessibleWidget : public QAccessibleObject +{ +public: + explicit QAccessibleWidget(QWidget *o, Role r = Client, const QString& name = QString()); + + int childCount() const; + int indexOfChild(const QAccessibleInterface *child) const; + Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const; + + int childAt(int x, int y) const; + QRect rect(int child) const; + int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const; + + QString text(Text t, int child) const; + Role role(int child) const; + State state(int child) const; + +#ifndef QT_NO_ACTION + int userActionCount(int child) const; + QString actionText(int action, Text t, int child) const; + bool doAction(int action, int child, const QVariantList ¶ms); +#endif + +protected: + ~QAccessibleWidget(); + QWidget *widget() const; + QObject *parentObject() const; + + void addControllingSignal(const QString &signal); + void setValue(const QString &value); + void setDescription(const QString &desc); + void setHelp(const QString &help); + void setAccelerator(const QString &accel); + +private: + friend class QAccessibleWidgetEx; + QAccessibleWidgetPrivate *d; + Q_DISABLE_COPY(QAccessibleWidget) +}; + +class Q_GUI_EXPORT QAccessibleWidgetEx : public QAccessibleObjectEx +{ +public: + explicit QAccessibleWidgetEx(QWidget *o, Role r = Client, const QString& name = QString()); + + int childCount() const; + int indexOfChild(const QAccessibleInterface *child) const; + Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const; + + int childAt(int x, int y) const; + QRect rect(int child) const; + int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const; + + QString text(Text t, int child) const; + Role role(int child) const; + State state(int child) const; + + QString actionText(int action, Text t, int child) const; + bool doAction(int action, int child, const QVariantList ¶ms); + + QVariant invokeMethodEx(Method method, int child, const QVariantList ¶ms); + +protected: + ~QAccessibleWidgetEx(); + QWidget *widget() const; + QObject *parentObject() const; + + void addControllingSignal(const QString &signal); + void setValue(const QString &value); + void setDescription(const QString &desc); + void setHelp(const QString &help); + void setAccelerator(const QString &accel); + +private: + QAccessibleWidgetPrivate *d; + Q_DISABLE_COPY(QAccessibleWidgetEx) +}; + +#endif // QT_NO_ACCESSIBILITY + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QACCESSIBLEWIDGET_H diff --git a/qtinterface/qt4/Qt/qaction.h b/qtinterface/qt4/Qt/qaction.h new file mode 100644 index 0000000..fca03cc --- /dev/null +++ b/qtinterface/qt4/Qt/qaction.h @@ -0,0 +1,261 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QACTION_H +#define QACTION_H + +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ACTION + +class QMenu; +class QActionGroup; +class QActionPrivate; +class QGraphicsWidget; + +class Q_GUI_EXPORT QAction : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QAction) + + Q_ENUMS(MenuRole) + Q_ENUMS(SoftKeyRole) + Q_ENUMS(Priority) + Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY changed) + Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY changed) + Q_PROPERTY(QIcon icon READ icon WRITE setIcon NOTIFY changed) + Q_PROPERTY(QString text READ text WRITE setText NOTIFY changed) + Q_PROPERTY(QString iconText READ iconText WRITE setIconText NOTIFY changed) + Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip NOTIFY changed) + Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip NOTIFY changed) + Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis NOTIFY changed) + Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed) +#ifndef QT_NO_SHORTCUT + Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut NOTIFY changed) + Q_PROPERTY(Qt::ShortcutContext shortcutContext READ shortcutContext WRITE setShortcutContext NOTIFY changed) + Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat NOTIFY changed) +#endif + Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY changed) + Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole NOTIFY changed) + Q_PROPERTY(SoftKeyRole softKeyRole READ softKeyRole WRITE setSoftKeyRole NOTIFY changed) + Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu NOTIFY changed) + Q_PROPERTY(Priority priority READ priority WRITE setPriority) + +public: + enum MenuRole { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole, + AboutRole, PreferencesRole, QuitRole }; + enum SoftKeyRole { + NoSoftKey, PositiveSoftKey, NegativeSoftKey, SelectSoftKey }; + enum Priority { LowPriority = 0, + NormalPriority = 128, + HighPriority = 256}; + explicit QAction(QObject* parent); + QAction(const QString &text, QObject* parent); + QAction(const QIcon &icon, const QString &text, QObject* parent); + +#ifdef QT3_SUPPORT + QT3_SUPPORT_CONSTRUCTOR QAction(QObject* parent, const char* name); + QT3_SUPPORT_CONSTRUCTOR QAction(const QString &text, const QKeySequence &shortcut, + QObject* parent, const char* name); + QT3_SUPPORT_CONSTRUCTOR QAction(const QIcon &icon, const QString &text, + const QKeySequence &shortcut, + QObject* parent, const char* name); +#endif + ~QAction(); + + void setActionGroup(QActionGroup *group); + QActionGroup *actionGroup() const; + void setIcon(const QIcon &icon); + QIcon icon() const; + + void setText(const QString &text); + QString text() const; + + void setIconText(const QString &text); + QString iconText() const; + + void setToolTip(const QString &tip); + QString toolTip() const; + + void setStatusTip(const QString &statusTip); + QString statusTip() const; + + void setWhatsThis(const QString &what); + QString whatsThis() const; + + void setPriority(Priority priority); + Priority priority() const; + +#ifndef QT_NO_MENU + QMenu *menu() const; + void setMenu(QMenu *menu); +#endif + + void setSeparator(bool b); + bool isSeparator() const; + +#ifndef QT_NO_SHORTCUT + void setShortcut(const QKeySequence &shortcut); + QKeySequence shortcut() const; + + void setShortcuts(const QList &shortcuts); + void setShortcuts(QKeySequence::StandardKey); + QList shortcuts() const; + + void setShortcutContext(Qt::ShortcutContext context); + Qt::ShortcutContext shortcutContext() const; + + void setAutoRepeat(bool); + bool autoRepeat() const; +#endif + + void setFont(const QFont &font); + QFont font() const; + + void setCheckable(bool); + bool isCheckable() const; + + QVariant data() const; + void setData(const QVariant &var); + + bool isChecked() const; + + bool isEnabled() const; + + bool isVisible() const; + + enum ActionEvent { Trigger, Hover }; + void activate(ActionEvent event); + bool showStatusText(QWidget *widget=0); + + void setMenuRole(MenuRole menuRole); + MenuRole menuRole() const; + + void setSoftKeyRole(SoftKeyRole softKeyRole); + SoftKeyRole softKeyRole() const; + + void setIconVisibleInMenu(bool visible); + bool isIconVisibleInMenu() const; + +#ifdef QT3_SUPPORT + inline QT3_SUPPORT void setMenuText(const QString &text) { setText(text); } + inline QT3_SUPPORT QString menuText() const { return text(); } + inline QT3_SUPPORT bool isOn() const { return isChecked(); } + inline QT3_SUPPORT bool isToggleAction() const { return isCheckable(); } + inline QT3_SUPPORT void setToggleAction(bool b) { setCheckable(b); } + inline QT3_SUPPORT void setIconSet(const QIcon &i) { setIcon(i); } + inline QT3_SUPPORT QIcon iconSet() const { return icon(); } + inline QT3_SUPPORT bool addTo(QWidget *w) { w->addAction(this); return true; } + inline QT3_SUPPORT bool removeFrom(QWidget *w) { w->removeAction(this); return true; } + inline QT3_SUPPORT void setAccel(const QKeySequence &shortcut) { setShortcut(shortcut); } + inline QT3_SUPPORT QKeySequence accel() const { return shortcut(); } +#endif + + QWidget *parentWidget() const; + + QList associatedWidgets() const; +#ifndef QT_NO_GRAPHICSVIEW + QList associatedGraphicsWidgets() const; // ### suboptimal +#endif + +protected: + bool event(QEvent *); + QAction(QActionPrivate &dd, QObject *parent); + +public Q_SLOTS: +#ifdef QT3_SUPPORT + inline QT_MOC_COMPAT void setOn(bool b) { setChecked(b); } +#endif + void trigger() { activate(Trigger); } + void hover() { activate(Hover); } + void setChecked(bool); + void toggle(); + void setEnabled(bool); + inline void setDisabled(bool b) { setEnabled(!b); } + void setVisible(bool); + +Q_SIGNALS: + void changed(); + void triggered(bool checked = false); + void hovered(); + void toggled(bool); +#ifdef QT3_SUPPORT + QT_MOC_COMPAT void activated(int = 0); +#endif + +private: + Q_DISABLE_COPY(QAction) + +#ifdef QT3_SUPPORT + friend class QMenuItem; +#endif + friend class QGraphicsWidget; + friend class QWidget; + friend class QActionGroup; + friend class QMenu; + friend class QMenuPrivate; + friend class QMenuBar; + friend class QShortcutMap; + friend class QToolButton; +}; + +QT_BEGIN_INCLUDE_NAMESPACE +#include +QT_END_INCLUDE_NAMESPACE + +#endif // QT_NO_ACTION + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QACTION_H diff --git a/qtinterface/qt4/Qt/qactiongroup.h b/qtinterface/qt4/Qt/qactiongroup.h new file mode 100644 index 0000000..fa6370a --- /dev/null +++ b/qtinterface/qt4/Qt/qactiongroup.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QACTIONGROUP_H +#define QACTIONGROUP_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_ACTION + +class QActionGroupPrivate; + +class Q_GUI_EXPORT QActionGroup : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QActionGroup) + + Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) + Q_PROPERTY(bool visible READ isVisible WRITE setVisible) + +public: + explicit QActionGroup(QObject* parent); + ~QActionGroup(); + + QAction *addAction(QAction* a); + QAction *addAction(const QString &text); + QAction *addAction(const QIcon &icon, const QString &text); + void removeAction(QAction *a); + QList actions() const; + + QAction *checkedAction() const; + bool isExclusive() const; + bool isEnabled() const; + bool isVisible() const; + +#ifdef QT3_SUPPORT + inline QT3_SUPPORT void add(QAction* a) { addAction(a); } + inline QT3_SUPPORT void addSeparator() + { QAction *act = new QAction(this); act->setSeparator(true); addAction(act); } + inline QT3_SUPPORT bool addTo(QWidget *w) { w->addActions(actions()); return true; } +#endif + +public Q_SLOTS: + void setEnabled(bool); + inline void setDisabled(bool b) { setEnabled(!b); } + void setVisible(bool); + void setExclusive(bool); + +Q_SIGNALS: + void triggered(QAction *); + QT_MOC_COMPAT void selected(QAction *); + void hovered(QAction *); + +private: + Q_DISABLE_COPY(QActionGroup) + Q_PRIVATE_SLOT(d_func(), void _q_actionTriggered()) + Q_PRIVATE_SLOT(d_func(), void _q_actionChanged()) + Q_PRIVATE_SLOT(d_func(), void _q_actionHovered()) +}; + +#endif // QT_NO_ACTION + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QACTIONGROUP_H diff --git a/qtinterface/qt4/Qt/qalgorithms.h b/qtinterface/qt4/Qt/qalgorithms.h new file mode 100644 index 0000000..4207315 --- /dev/null +++ b/qtinterface/qt4/Qt/qalgorithms.h @@ -0,0 +1,526 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QALGORITHMS_H +#define QALGORITHMS_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +/* + Warning: The contents of QAlgorithmsPrivate is not a part of the public Qt API + and may be changed from version to version or even be completely removed. +*/ +namespace QAlgorithmsPrivate { + +template +Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan); +template +inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy); + +template +Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan); +template +inline void qStableSortHelper(RandomAccessIterator, RandomAccessIterator, const T &); + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan); +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan); +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan); + +} + +template +inline OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest) +{ + while (begin != end) + *dest++ = *begin++; + return dest; +} + +template +inline BiIterator2 qCopyBackward(BiIterator1 begin, BiIterator1 end, BiIterator2 dest) +{ + while (begin != end) + *--dest = *--end; + return dest; +} + +template +inline bool qEqual(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) +{ + for (; first1 != last1; ++first1, ++first2) + if (!(*first1 == *first2)) + return false; + return true; +} + +template +inline void qFill(ForwardIterator first, ForwardIterator last, const T &val) +{ + for (; first != last; ++first) + *first = val; +} + +template +inline void qFill(Container &container, const T &val) +{ + qFill(container.begin(), container.end(), val); +} + +template +inline InputIterator qFind(InputIterator first, InputIterator last, const T &val) +{ + while (first != last && !(*first == val)) + ++first; + return first; +} + +template +inline typename Container::const_iterator qFind(const Container &container, const T &val) +{ + return qFind(container.constBegin(), container.constEnd(), val); +} + +template +inline void qCount(InputIterator first, InputIterator last, const T &value, Size &n) +{ + for (; first != last; ++first) + if (*first == value) + ++n; +} + +template +inline void qCount(const Container &container, const T &value, Size &n) +{ + qCount(container.constBegin(), container.constEnd(), value, n); +} + +#ifdef qdoc +template +LessThan qLess() +{ +} + +template +LessThan qGreater() +{ +} +#else +template +class qLess +{ +public: + inline bool operator()(const T &t1, const T &t2) const + { + return (t1 < t2); + } +}; + +template +class qGreater +{ +public: + inline bool operator()(const T &t1, const T &t2) const + { + return (t2 < t1); + } +}; +#endif + +template +inline void qSort(RandomAccessIterator start, RandomAccessIterator end) +{ + if (start != end) + QAlgorithmsPrivate::qSortHelper(start, end, *start); +} + +template +inline void qSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan) +{ + if (start != end) + QAlgorithmsPrivate::qSortHelper(start, end, *start, lessThan); +} + +template +inline void qSort(Container &c) +{ +#ifdef Q_CC_BOR + // Work around Borland 5.5 optimizer bug + c.detach(); +#endif + if (!c.empty()) + QAlgorithmsPrivate::qSortHelper(c.begin(), c.end(), *c.begin()); +} + +template +inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end) +{ + if (start != end) + QAlgorithmsPrivate::qStableSortHelper(start, end, *start); +} + +template +inline void qStableSort(RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan) +{ + if (start != end) + QAlgorithmsPrivate::qStableSortHelper(start, end, *start, lessThan); +} + +template +inline void qStableSort(Container &c) +{ +#ifdef Q_CC_BOR + // Work around Borland 5.5 optimizer bug + c.detach(); +#endif + if (!c.empty()) + QAlgorithmsPrivate::qStableSortHelper(c.begin(), c.end(), *c.begin()); +} + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value) +{ + // Implementation is duplicated from QAlgorithmsPrivate to keep existing code + // compiling. We have to allow using *begin and value with different types, + // and then implementing operator< for those types. + RandomAccessIterator middle; + int n = end - begin; + int half; + + while (n > 0) { + half = n >> 1; + middle = begin + half; + if (*middle < value) { + begin = middle + 1; + n -= half + 1; + } else { + n = half; + } + } + return begin; +} + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +{ + return QAlgorithmsPrivate::qLowerBoundHelper(begin, end, value, lessThan); +} + +template +Q_OUTOFLINE_TEMPLATE typename Container::const_iterator qLowerBound(const Container &container, const T &value) +{ + return QAlgorithmsPrivate::qLowerBoundHelper(container.constBegin(), container.constEnd(), value, qLess()); +} + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value) +{ + // Implementation is duplicated from QAlgorithmsPrivate. + RandomAccessIterator middle; + int n = end - begin; + int half; + + while (n > 0) { + half = n >> 1; + middle = begin + half; + if (value < *middle) { + n = half; + } else { + begin = middle + 1; + n -= half + 1; + } + } + return begin; +} + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +{ + return QAlgorithmsPrivate::qUpperBoundHelper(begin, end, value, lessThan); +} + +template +Q_OUTOFLINE_TEMPLATE typename Container::const_iterator qUpperBound(const Container &container, const T &value) +{ + return QAlgorithmsPrivate::qUpperBoundHelper(container.constBegin(), container.constEnd(), value, qLess()); +} + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value) +{ + // Implementation is duplicated from QAlgorithmsPrivate. + RandomAccessIterator it = qLowerBound(begin, end, value); + + if (it == end || value < *it) + return end; + + return it; +} + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +{ + return QAlgorithmsPrivate::qBinaryFindHelper(begin, end, value, lessThan); +} + +template +Q_OUTOFLINE_TEMPLATE typename Container::const_iterator qBinaryFind(const Container &container, const T &value) +{ + return QAlgorithmsPrivate::qBinaryFindHelper(container.constBegin(), container.constEnd(), value, qLess()); +} + +template +Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end) +{ + while (begin != end) { + delete *begin; + ++begin; + } +} + +template +inline void qDeleteAll(const Container &c) +{ + qDeleteAll(c.begin(), c.end()); +} + +/* + Warning: The contents of QAlgorithmsPrivate is not a part of the public Qt API + and may be changed from version to version or even be completely removed. +*/ +namespace QAlgorithmsPrivate { + +template +Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan) +{ +top: + int span = int(end - start); + if (span < 2) + return; + + --end; + RandomAccessIterator low = start, high = end - 1; + RandomAccessIterator pivot = start + span / 2; + + if (lessThan(*end, *start)) + qSwap(*end, *start); + if (span == 2) + return; + + if (lessThan(*pivot, *start)) + qSwap(*pivot, *start); + if (lessThan(*end, *pivot)) + qSwap(*end, *pivot); + if (span == 3) + return; + + qSwap(*pivot, *end); + + while (low < high) { + while (low < high && lessThan(*low, *end)) + ++low; + + while (high > low && lessThan(*end, *high)) + --high; + + if (low < high) { + qSwap(*low, *high); + ++low; + --high; + } else { + break; + } + } + + if (lessThan(*low, *end)) + ++low; + + qSwap(*end, *low); + qSortHelper(start, low, t, lessThan); + + start = low + 1; + ++end; + goto top; +} + +template +inline void qSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy) +{ + qSortHelper(begin, end, dummy, qLess()); +} + +template +Q_OUTOFLINE_TEMPLATE void qReverse(RandomAccessIterator begin, RandomAccessIterator end) +{ + --end; + while (begin < end) + qSwap(*begin++, *end--); +} + +template +Q_OUTOFLINE_TEMPLATE void qRotate(RandomAccessIterator begin, RandomAccessIterator middle, RandomAccessIterator end) +{ + qReverse(begin, middle); + qReverse(middle, end); + qReverse(begin, end); +} + +template +Q_OUTOFLINE_TEMPLATE void qMerge(RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, T &t, LessThan lessThan) +{ + const int len1 = pivot - begin; + const int len2 = end - pivot; + + if (len1 == 0 || len2 == 0) + return; + + if (len1 + len2 == 2) { + if (lessThan(*(begin + 1), *(begin))) + qSwap(*begin, *(begin + 1)); + return; + } + + RandomAccessIterator firstCut; + RandomAccessIterator secondCut; + int len2Half; + if (len1 > len2) { + const int len1Half = len1 / 2; + firstCut = begin + len1Half; + secondCut = qLowerBound(pivot, end, *firstCut, lessThan); + len2Half = secondCut - pivot; + } else { + len2Half = len2 / 2; + secondCut = pivot + len2Half; + firstCut = qUpperBound(begin, pivot, *secondCut, lessThan); + } + + qRotate(firstCut, pivot, secondCut); + const RandomAccessIterator newPivot = firstCut + len2Half; + qMerge(begin, firstCut, newPivot, t, lessThan); + qMerge(newPivot, secondCut, end, t, lessThan); +} + +template +Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &t, LessThan lessThan) +{ + const int span = end - begin; + if (span < 2) + return; + + const RandomAccessIterator middle = begin + span / 2; + qStableSortHelper(begin, middle, t, lessThan); + qStableSortHelper(middle, end, t, lessThan); + qMerge(begin, middle, end, t, lessThan); +} + +template +inline void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &dummy) +{ + qStableSortHelper(begin, end, dummy, qLess()); +} + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +{ + RandomAccessIterator middle; + int n = int(end - begin); + int half; + + while (n > 0) { + half = n >> 1; + middle = begin + half; + if (lessThan(*middle, value)) { + begin = middle + 1; + n -= half + 1; + } else { + n = half; + } + } + return begin; +} + + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +{ + RandomAccessIterator middle; + int n = end - begin; + int half; + + while (n > 0) { + half = n >> 1; + middle = begin + half; + if (lessThan(value, *middle)) { + n = half; + } else { + begin = middle + 1; + n -= half + 1; + } + } + return begin; +} + +template +Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) +{ + RandomAccessIterator it = qLowerBoundHelper(begin, end, value, lessThan); + + if (it == end || lessThan(value, *it)) + return end; + + return it; +} + +} //namespace QAlgorithmsPrivate + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QALGORITHMS_H diff --git a/qtinterface/qt4/Qt/qanimationgroup.h b/qtinterface/qt4/Qt/qanimationgroup.h new file mode 100644 index 0000000..7e78d95 --- /dev/null +++ b/qtinterface/qt4/Qt/qanimationgroup.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QANIMATIONGROUP_H +#define QANIMATIONGROUP_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +#ifndef QT_NO_ANIMATION + +class QAnimationGroupPrivate; +class Q_CORE_EXPORT QAnimationGroup : public QAbstractAnimation +{ + Q_OBJECT + +public: + QAnimationGroup(QObject *parent = 0); + ~QAnimationGroup(); + + QAbstractAnimation *animationAt(int index) const; + int animationCount() const; + int indexOfAnimation(QAbstractAnimation *animation) const; + void addAnimation(QAbstractAnimation *animation); + void insertAnimation(int index, QAbstractAnimation *animation); + void removeAnimation(QAbstractAnimation *animation); + QAbstractAnimation *takeAnimation(int index); + void clear(); + +protected: + QAnimationGroup(QAnimationGroupPrivate &dd, QObject *parent); + bool event(QEvent *event); + +private: + Q_DISABLE_COPY(QAnimationGroup) + Q_DECLARE_PRIVATE(QAnimationGroup) +}; + +#endif //QT_NO_ANIMATION + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif //QANIMATIONGROUP_H diff --git a/qtinterface/qt4/Qt/qapplication.h b/qtinterface/qt4/Qt/qapplication.h new file mode 100644 index 0000000..37b010c --- /dev/null +++ b/qtinterface/qt4/Qt/qapplication.h @@ -0,0 +1,415 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QAPPLICATION_H +#define QAPPLICATION_H + +#include +#include +#include +#include +#include +#ifdef QT_INCLUDE_COMPAT +# include +#endif +#ifdef QT3_SUPPORT +# include +# include +#endif +#ifdef Q_WS_QWS +# include +# include +#endif + +QT_BEGIN_HEADER + +#if defined(Q_WS_S60) +class CApaApplication; +#endif + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QSessionManager; +class QDesktopWidget; +class QStyle; +class QEventLoop; +class QIcon; +class QInputContext; +template class QList; +class QLocale; +#if defined(Q_WS_QWS) +class QDecoration; +#endif +#if defined(Q_OS_SYMBIAN) +class QSymbianEvent; +#endif + +class QApplication; +class QApplicationPrivate; +#if defined(qApp) +#undef qApp +#endif +#define qApp (static_cast(QCoreApplication::instance())) + + +class Q_GUI_EXPORT QApplication : public QCoreApplication +{ + Q_OBJECT + Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection) + Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon) + Q_PROPERTY(int cursorFlashTime READ cursorFlashTime WRITE setCursorFlashTime) + Q_PROPERTY(int doubleClickInterval READ doubleClickInterval WRITE setDoubleClickInterval) + Q_PROPERTY(int keyboardInputInterval READ keyboardInputInterval WRITE setKeyboardInputInterval) +#ifndef QT_NO_WHEELEVENT + Q_PROPERTY(int wheelScrollLines READ wheelScrollLines WRITE setWheelScrollLines) +#endif + Q_PROPERTY(QSize globalStrut READ globalStrut WRITE setGlobalStrut) + Q_PROPERTY(int startDragTime READ startDragTime WRITE setStartDragTime) + Q_PROPERTY(int startDragDistance READ startDragDistance WRITE setStartDragDistance) + Q_PROPERTY(bool quitOnLastWindowClosed READ quitOnLastWindowClosed WRITE setQuitOnLastWindowClosed) +#ifndef QT_NO_STYLE_STYLESHEET + Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) +#endif +#ifdef Q_WS_WINCE + Q_PROPERTY(int autoMaximizeThreshold READ autoMaximizeThreshold WRITE setAutoMaximizeThreshold) +#endif + Q_PROPERTY(bool autoSipEnabled READ autoSipEnabled WRITE setAutoSipEnabled) + +public: + enum Type { Tty, GuiClient, GuiServer }; + +#ifdef Q_WS_S60 + typedef CApaApplication * (*QS60MainApplicationFactory)(); +#endif + +#ifndef qdoc + QApplication(int &argc, char **argv, int = QT_VERSION); + QApplication(int &argc, char **argv, bool GUIenabled, int = QT_VERSION); + QApplication(int &argc, char **argv, Type, int = QT_VERSION); +#if defined(Q_WS_X11) + QApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0, int = QT_VERSION); + QApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0, int = QT_VERSION); +#endif +#if defined(Q_WS_S60) + QApplication(QApplication::QS60MainApplicationFactory factory, int &argc, char **argv, int = QT_VERSION); +#endif +#endif + virtual ~QApplication(); + + static Type type(); + + static QStyle *style(); + static void setStyle(QStyle*); + static QStyle *setStyle(const QString&); + enum ColorSpec { NormalColor=0, CustomColor=1, ManyColor=2 }; + static int colorSpec(); + static void setColorSpec(int); + static void setGraphicsSystem(const QString &); + +#ifndef QT_NO_CURSOR + static QCursor *overrideCursor(); + static void setOverrideCursor(const QCursor &); + static void changeOverrideCursor(const QCursor &); + static void restoreOverrideCursor(); +#endif + static QPalette palette(); + static QPalette palette(const QWidget *); + static QPalette palette(const char *className); + static void setPalette(const QPalette &, const char* className = 0); + static QFont font(); + static QFont font(const QWidget*); + static QFont font(const char *className); + static void setFont(const QFont &, const char* className = 0); + static QFontMetrics fontMetrics(); + + static void setWindowIcon(const QIcon &icon); + static QIcon windowIcon(); + + +#ifdef QT3_SUPPORT + static QT3_SUPPORT QWidget *mainWidget(); + static QT3_SUPPORT void setMainWidget(QWidget *); +#endif + + static QWidgetList allWidgets(); + static QWidgetList topLevelWidgets(); + + static QDesktopWidget *desktop(); + + static QWidget *activePopupWidget(); + static QWidget *activeModalWidget(); +#ifndef QT_NO_CLIPBOARD + static QClipboard *clipboard(); +#endif + static QWidget *focusWidget(); + + static QWidget *activeWindow(); + static void setActiveWindow(QWidget* act); + + static QWidget *widgetAt(const QPoint &p); + static inline QWidget *widgetAt(int x, int y) { return widgetAt(QPoint(x, y)); } + static QWidget *topLevelAt(const QPoint &p); + static inline QWidget *topLevelAt(int x, int y) { return topLevelAt(QPoint(x, y)); } + + static void syncX(); + static void beep(); + static void alert(QWidget *widget, int duration = 0); + + static Qt::KeyboardModifiers keyboardModifiers(); + static Qt::MouseButtons mouseButtons(); + + static void setDesktopSettingsAware(bool); + static bool desktopSettingsAware(); + + static void setCursorFlashTime(int); + static int cursorFlashTime(); + + static void setDoubleClickInterval(int); + static int doubleClickInterval(); + + static void setKeyboardInputInterval(int); + static int keyboardInputInterval(); + +#ifndef QT_NO_WHEELEVENT + static void setWheelScrollLines(int); + static int wheelScrollLines(); +#endif + static void setGlobalStrut(const QSize &); + static QSize globalStrut(); + + static void setStartDragTime(int ms); + static int startDragTime(); + static void setStartDragDistance(int l); + static int startDragDistance(); + + static void setLayoutDirection(Qt::LayoutDirection direction); + static Qt::LayoutDirection layoutDirection(); + + static inline bool isRightToLeft() { return layoutDirection() == Qt::RightToLeft; } + static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; } + + static bool isEffectEnabled(Qt::UIEffect); + static void setEffectEnabled(Qt::UIEffect, bool enable = true); + +#if defined(Q_WS_MAC) + virtual bool macEventFilter(EventHandlerCallRef, EventRef); +#endif +#if defined(Q_WS_X11) + virtual bool x11EventFilter(XEvent *); + virtual int x11ClientMessage(QWidget*, XEvent*, bool passive_only); + int x11ProcessEvent(XEvent*); +#endif +#if defined(Q_OS_SYMBIAN) + int symbianProcessEvent(const QSymbianEvent *event); + virtual bool symbianEventFilter(const QSymbianEvent *event); +#endif +#if defined(Q_WS_QWS) + virtual bool qwsEventFilter(QWSEvent *); + int qwsProcessEvent(QWSEvent*); + void qwsSetCustomColors(QRgb *colortable, int start, int numColors); +#ifndef QT_NO_QWS_MANAGER + static QDecoration &qwsDecoration(); + static void qwsSetDecoration(QDecoration *); + static QDecoration *qwsSetDecoration(const QString &decoration); +#endif +#endif + + +#if defined(Q_WS_WIN) + void winFocus(QWidget *, bool); + static void winMouseButtonUp(); +#endif +#ifndef QT_NO_SESSIONMANAGER + // session management + bool isSessionRestored() const; + QString sessionId() const; + QString sessionKey() const; + virtual void commitData(QSessionManager& sm); + virtual void saveState(QSessionManager& sm); +#endif + void setInputContext(QInputContext *); + QInputContext *inputContext() const; + + static QLocale keyboardInputLocale(); + static Qt::LayoutDirection keyboardInputDirection(); + + static int exec(); + bool notify(QObject *, QEvent *); + + + static void setQuitOnLastWindowClosed(bool quit); + static bool quitOnLastWindowClosed(); + +#ifdef QT_KEYPAD_NAVIGATION + static Q_DECL_DEPRECATED void setKeypadNavigationEnabled(bool); + static bool keypadNavigationEnabled(); + static void setNavigationMode(Qt::NavigationMode mode); + static Qt::NavigationMode navigationMode(); +#endif + +Q_SIGNALS: + void lastWindowClosed(); + void focusChanged(QWidget *old, QWidget *now); + void fontDatabaseChanged(); +#ifndef QT_NO_SESSIONMANAGER + void commitDataRequest(QSessionManager &sessionManager); + void saveStateRequest(QSessionManager &sessionManager); +#endif + +public: + QString styleSheet() const; +public Q_SLOTS: +#ifndef QT_NO_STYLE_STYLESHEET + void setStyleSheet(const QString& sheet); +#endif +#ifdef Q_WS_WINCE + void setAutoMaximizeThreshold(const int threshold); + int autoMaximizeThreshold() const; +#endif + void setAutoSipEnabled(const bool enabled); + bool autoSipEnabled() const; + static void closeAllWindows(); + static void aboutQt(); + +protected: +#if defined(Q_WS_QWS) + void setArgs(int, char **); +#endif + bool event(QEvent *); + bool compressEvent(QEvent *, QObject *receiver, QPostEventList *); + +#ifdef QT3_SUPPORT +public: + static inline QT3_SUPPORT void setReverseLayout(bool b) { setLayoutDirection(b?Qt::RightToLeft:Qt::LeftToRight); } + static inline bool QT3_SUPPORT reverseLayout() { return layoutDirection() == Qt::RightToLeft; } + static QT3_SUPPORT Qt::Alignment horizontalAlignment(Qt::Alignment align); + typedef int ColorMode; + enum { NormalColors = NormalColor, CustomColors = CustomColor }; + static inline QT3_SUPPORT ColorMode colorMode() { return static_cast(colorSpec()); } + static inline QT3_SUPPORT void setColorMode(ColorMode mode) { setColorSpec(int(mode)); } +#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) + static QT3_SUPPORT Qt::WindowsVersion winVersion() { return (Qt::WindowsVersion)QSysInfo::WindowsVersion; } +#endif +#if defined(Q_OS_MAC) + static QT3_SUPPORT Qt::MacintoshVersion macVersion() { return (Qt::MacintoshVersion)QSysInfo::MacintoshVersion; } +#endif +# ifndef QT_NO_CURSOR + inline static QT3_SUPPORT void setOverrideCursor(const QCursor &cursor, bool replace) + { if (replace) changeOverrideCursor(cursor); else setOverrideCursor(cursor); } +# endif + inline static QT3_SUPPORT bool hasGlobalMouseTracking() {return true;} + inline static QT3_SUPPORT void setGlobalMouseTracking(bool) {} + inline static QT3_SUPPORT void flushX() { flush(); } + static inline QT3_SUPPORT void setWinStyleHighlightColor(const QColor &c) { + QPalette p(palette()); + p.setColor(QPalette::Highlight, c); + setPalette(p); + } + static inline QT3_SUPPORT const QColor &winStyleHighlightColor() + { return palette().color(QPalette::Active, QPalette::Highlight); } + static inline QT3_SUPPORT void setPalette(const QPalette &pal, bool, const char* className = 0) + { setPalette(pal, className); } + static inline QT3_SUPPORT void setFont(const QFont &font, bool, const char* className = 0) + { setFont(font, className); } + + static inline QT3_SUPPORT QWidget *widgetAt(int x, int y, bool child) + { QWidget *w = widgetAt(x, y); return child ? w : (w ? w->window() : 0); } + static inline QT3_SUPPORT QWidget *widgetAt(const QPoint &p, bool child) + { QWidget *w = widgetAt(p); return child ? w : (w ? w->window() : 0); } +#endif // QT3_SUPPORT + +#if defined(Q_INTERNAL_QAPP_SRC) || defined(qdoc) + QApplication(int &argc, char **argv); + QApplication(int &argc, char **argv, bool GUIenabled); + QApplication(int &argc, char **argv, Type); +#if defined(Q_WS_X11) + QApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0); + QApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0); +#endif +#if defined(Q_WS_S60) || defined(qdoc) + QApplication(QApplication::QS60MainApplicationFactory factory, int &argc, char **argv); +#endif +#endif + +private: + Q_DISABLE_COPY(QApplication) + Q_DECLARE_PRIVATE(QApplication) + + friend class QGraphicsWidget; + friend class QGraphicsScene; + friend class QGraphicsScenePrivate; + friend class QWidget; + friend class QWidgetPrivate; + friend class QETWidget; + friend class Q3AccelManager; + friend class QTranslator; + friend class QWidgetAnimator; +#ifndef QT_NO_SHORTCUT + friend class QShortcut; + friend class QLineEdit; + friend class QTextControl; +#endif + friend class QAction; + friend class QFontDatabasePrivate; + +#if defined(Q_WS_QWS) + friend class QInputContext; + friend class QWSDirectPainterSurface; + friend class QDirectPainter; + friend class QDirectPainterPrivate; +#endif + friend class QGestureManager; + +#if defined(Q_WS_MAC) || defined(Q_WS_X11) + Q_PRIVATE_SLOT(d_func(), void _q_alertTimeOut()) +#endif +#if defined(QT_RX71_MULTITOUCH) + Q_PRIVATE_SLOT(d_func(), void _q_readRX71MultiTouchEvents()) +#endif +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAPPLICATION_H diff --git a/qtinterface/qt4/Qt/qatomic.h b/qtinterface/qt4/Qt/qatomic.h new file mode 100644 index 0000000..e9e4703 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic.h @@ -0,0 +1,227 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_H +#define QATOMIC_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +// High-level atomic integer operations +class Q_CORE_EXPORT QAtomicInt : public QBasicAtomicInt +{ +public: + inline QAtomicInt(int value = 0) + { +#ifdef QT_ARCH_PARISC + this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; +#endif + _q_value = value; + } + inline QAtomicInt(const QAtomicInt &other) + { +#ifdef QT_ARCH_PARISC + this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; +#endif + _q_value = other._q_value; + } + + inline QAtomicInt &operator=(int value) + { + (void) QBasicAtomicInt::operator=(value); + return *this; + } + + inline QAtomicInt &operator=(const QAtomicInt &other) + { + (void) QBasicAtomicInt::operator=(other); + return *this; + } + +#ifdef qdoc + bool operator==(int value) const; + bool operator!=(int value) const; + bool operator!() const; + operator int() const; + + static bool isReferenceCountingNative(); + static bool isReferenceCountingWaitFree(); + + bool ref(); + bool deref(); + + static bool isTestAndSetNative(); + static bool isTestAndSetWaitFree(); + + bool testAndSetRelaxed(int expectedValue, int newValue); + bool testAndSetAcquire(int expectedValue, int newValue); + bool testAndSetRelease(int expectedValue, int newValue); + bool testAndSetOrdered(int expectedValue, int newValue); + + static bool isFetchAndStoreNative(); + static bool isFetchAndStoreWaitFree(); + + int fetchAndStoreRelaxed(int newValue); + int fetchAndStoreAcquire(int newValue); + int fetchAndStoreRelease(int newValue); + int fetchAndStoreOrdered(int newValue); + + static bool isFetchAndAddNative(); + static bool isFetchAndAddWaitFree(); + + int fetchAndAddRelaxed(int valueToAdd); + int fetchAndAddAcquire(int valueToAdd); + int fetchAndAddRelease(int valueToAdd); + int fetchAndAddOrdered(int valueToAdd); +#endif +}; + +// High-level atomic pointer operations +template +class QAtomicPointer : public QBasicAtomicPointer +{ +public: + inline QAtomicPointer(T *value = 0) + { +#ifdef QT_ARCH_PARISC + this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; +#endif + QBasicAtomicPointer::_q_value = value; + } + inline QAtomicPointer(const QAtomicPointer &other) + { +#ifdef QT_ARCH_PARISC + this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; +#endif + QBasicAtomicPointer::_q_value = other._q_value; + } + + inline QAtomicPointer &operator=(T *value) + { + (void) QBasicAtomicPointer::operator=(value); + return *this; + } + + inline QAtomicPointer &operator=(const QAtomicPointer &other) + { + (void) QBasicAtomicPointer::operator=(other); + return *this; + } + +#ifdef qdoc + bool operator==(T *value) const; + bool operator!=(T *value) const; + bool operator!() const; + operator T *() const; + T *operator->() const; + + static bool isTestAndSetNative(); + static bool isTestAndSetWaitFree(); + + bool testAndSetRelaxed(T *expectedValue, T *newValue); + bool testAndSetAcquire(T *expectedValue, T *newValue); + bool testAndSetRelease(T *expectedValue, T *newValue); + bool testAndSetOrdered(T *expectedValue, T *newValue); + + static bool isFetchAndStoreNative(); + static bool isFetchAndStoreWaitFree(); + + T *fetchAndStoreRelaxed(T *newValue); + T *fetchAndStoreAcquire(T *newValue); + T *fetchAndStoreRelease(T *newValue); + T *fetchAndStoreOrdered(T *newValue); + + static bool isFetchAndAddNative(); + static bool isFetchAndAddWaitFree(); + + T *fetchAndAddRelaxed(qptrdiff valueToAdd); + T *fetchAndAddAcquire(qptrdiff valueToAdd); + T *fetchAndAddRelease(qptrdiff valueToAdd); + T *fetchAndAddOrdered(qptrdiff valueToAdd); +#endif +}; + +/*! + This is a helper for the assignment operators of implicitly + shared classes. Your assignment operator should look like this: + + \snippet doc/src/snippets/code/src.corelib.thread.qatomic.h 0 +*/ +template +inline void qAtomicAssign(T *&d, T *x) +{ + if (d == x) + return; + x->ref.ref(); + if (!d->ref.deref()) + delete d; + d = x; +} + +/*! + This is a helper for the detach method of implicitly shared + classes. Your private class needs a copy constructor which copies + the members and sets the refcount to 1. After that, your detach + function should look like this: + + \snippet doc/src/snippets/code/src.corelib.thread.qatomic.h 1 +*/ +template +inline void qAtomicDetach(T *&d) +{ + if (d->ref == 1) + return; + T *x = d; + d = new T(*d); + if (!x->ref.deref()) + delete x; +} + +QT_END_NAMESPACE +QT_END_HEADER + +#endif // QATOMIC_H diff --git a/qtinterface/qt4/Qt/qatomic_alpha.h b/qtinterface/qt4/Qt/qatomic_alpha.h new file mode 100644 index 0000000..deb358d --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_alpha.h @@ -0,0 +1,642 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_ALPHA_H +#define QATOMIC_ALPHA_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +#if defined(Q_CC_GNU) + +inline bool QBasicAtomicInt::ref() +{ + register int old, tmp; + asm volatile("1:\n" + "ldl_l %0,%2\n" /* old=*ptr; */ + "addl %0,1,%1\n" /* tmp=old+1; */ + "stl_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp == 0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m"(_q_value) + : + : "memory"); + return old != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + register int old, tmp; + asm volatile("1:\n" + "ldl_l %0,%2\n" /* old=*ptr; */ + "subl %0,1,%1\n" /* tmp=old-1; */ + "stl_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m"(_q_value) + : + : "memory"); + return old != 1; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + register int ret; + asm volatile("1:\n" + "ldl_l %0,%1\n" /* ret=*ptr; */ + "cmpeq %0,%2,%0\n"/* if (ret==expected) ret=0; else ret=1; */ + "beq %0,3f\n" /* if (ret==0) goto 3; */ + "mov %3,%0\n" /* ret=newval; */ + "stl_c %0,%1\n" /* if ((*ptr=ret)!=ret) ret=0; else ret=1; */ + "beq %0,2f\n" /* if (ret==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret != 0; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + register int ret; + asm volatile("1:\n" + "ldl_l %0,%1\n" /* ret=*ptr; */ + "cmpeq %0,%2,%0\n"/* if (ret==expected) ret=0; else ret=1; */ + "beq %0,3f\n" /* if (ret==0) goto 3; */ + "mov %3,%0\n" /* ret=newval; */ + "stl_c %0,%1\n" /* if ((*ptr=ret)!=ret) ret=0; else ret=1; */ + "beq %0,2f\n" /* if (ret==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + "mb\n" + : "=&r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + register int ret; + asm volatile("mb\n" + "1:\n" + "ldl_l %0,%1\n" /* ret=*ptr; */ + "cmpeq %0,%2,%0\n"/* if (ret==expected) ret=0; else ret=1; */ + "beq %0,3f\n" /* if (ret==0) goto 3; */ + "mov %3,%0\n" /* ret=newval; */ + "stl_c %0,%1\n" /* if ((*ptr=ret)!=ret) ret=0; else ret=1; */ + "beq %0,2f\n" /* if (ret==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret != 0; +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + register int old, tmp; + asm volatile("1:\n" + "ldl_l %0,%2\n" /* old=*ptr; */ + "mov %3,%1\n" /* tmp=newval; */ + "stl_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return old; +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + register int old, tmp; + asm volatile("1:\n" + "ldl_l %0,%2\n" /* old=*ptr; */ + "mov %3,%1\n" /* tmp=newval; */ + "stl_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + "mb\n" + : "=&r" (old), "=&r" (tmp), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return old; +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + register int old, tmp; + asm volatile("mb\n" + "1:\n" + "ldl_l %0,%2\n" /* old=*ptr; */ + "mov %3,%1\n" /* tmp=newval; */ + "stl_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return old; +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + register int old, tmp; + asm volatile("1:\n" + "ldl_l %0,%2\n" /* old=*ptr; */ + "addl %0,%3,%1\n"/* tmp=old+value; */ + "stl_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp == 0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m"(_q_value) + : "r" (valueToAdd) + : "memory"); + return old; +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + register int old, tmp; + asm volatile("1:\n" + "ldl_l %0,%2\n" /* old=*ptr; */ + "addl %0,%3,%1\n"/* tmp=old+value; */ + "stl_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp == 0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + "mb\n" + : "=&r" (old), "=&r" (tmp), "+m"(_q_value) + : "r" (valueToAdd) + : "memory"); + return old; +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + register int old, tmp; + asm volatile("mb\n" + "1:\n" + "ldl_l %0,%2\n" /* old=*ptr; */ + "addl %0,%3,%1\n"/* tmp=old+value; */ + "stl_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp == 0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m"(_q_value) + : "r" (valueToAdd) + : "memory"); + return old; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + register void *ret; + asm volatile("1:\n" + "ldq_l %0,%1\n" /* ret=*ptr; */ + "cmpeq %0,%2,%0\n"/* if (ret==expected) tmp=0; else tmp=1; */ + "beq %0,3f\n" /* if (tmp==0) goto 3; */ + "mov %3,%0\n" /* tmp=newval; */ + "stq_c %0,%1\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %0,2f\n" /* if (ret==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + register void *ret; + asm volatile("1:\n" + "ldq_l %0,%1\n" /* ret=*ptr; */ + "cmpeq %0,%2,%0\n"/* if (ret==expected) tmp=0; else tmp=1; */ + "beq %0,3f\n" /* if (tmp==0) goto 3; */ + "mov %3,%0\n" /* tmp=newval; */ + "stq_c %0,%1\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %0,2f\n" /* if (ret==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + "mb\n" + : "=&r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + register void *ret; + asm volatile("mb\n" + "1:\n" + "ldq_l %0,%1\n" /* ret=*ptr; */ + "cmpeq %0,%2,%0\n"/* if (ret==expected) tmp=0; else tmp=1; */ + "beq %0,3f\n" /* if (tmp==0) goto 3; */ + "mov %3,%0\n" /* tmp=newval; */ + "stq_c %0,%1\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %0,2f\n" /* if (ret==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret != 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + register void *old, *tmp; + asm volatile("1:\n" + "ldq_l %0,%2\n" /* old=*ptr; */ + "mov %3,%1\n" /* tmp=newval; */ + "stq_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return old; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + register void *old, *tmp; + asm volatile("1:\n" + "ldq_l %0,%2\n" /* old=*ptr; */ + "mov %3,%1\n" /* tmp=newval; */ + "stq_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + "mb\n" + : "=&r" (old), "=&r" (tmp), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return old; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + register void *old, *tmp; + asm volatile("mb\n" + "1:\n" + "ldq_l %0,%2\n" /* old=*ptr; */ + "mov %3,%1\n" /* tmp=newval; */ + "stq_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp==0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return old; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + register void *old, *tmp; + asm volatile("1:\n" + "ldq_l %0,%2\n" /* old=*ptr; */ + "addq %0,%3,%1\n"/* tmp=old+value; */ + "stq_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp == 0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m"(_q_value) + : "r" (valueToAdd) + : "memory"); + return reinterpret_cast(old); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + register void *old, *tmp; + asm volatile("1:\n" + "ldq_l %0,%2\n" /* old=*ptr; */ + "addq %0,%3,%1\n"/* tmp=old+value; */ + "stq_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp == 0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + "mb\n" + : "=&r" (old), "=&r" (tmp), "+m"(_q_value) + : "r" (valueToAdd) + : "memory"); + return reinterpret_cast(old); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + register void *old, *tmp; + asm volatile("mb\n" + "1:\n" + "ldq_l %0,%2\n" /* old=*ptr; */ + "addq %0,%3,%1\n"/* tmp=old+value; */ + "stq_c %1,%2\n" /* if ((*ptr=tmp)!=tmp) tmp=0; else tmp=1; */ + "beq %1,2f\n" /* if (tmp == 0) goto 2; */ + "br 3f\n" /* goto 3; */ + "2: br 1b\n" /* goto 1; */ + "3:\n" + : "=&r" (old), "=&r" (tmp), "+m"(_q_value) + : "r" (valueToAdd) + : "memory"); + return reinterpret_cast(old); +} + +#else // !Q_CC_GNU + +extern "C" { + Q_CORE_EXPORT int q_atomic_test_and_set_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_acquire_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_release_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_ptr(volatile void *ptr, void *expected, void *newval); + Q_CORE_EXPORT int q_atomic_increment(volatile int *ptr); + Q_CORE_EXPORT int q_atomic_decrement(volatile int *ptr); + Q_CORE_EXPORT int q_atomic_set_int(volatile int *ptr, int newval); + Q_CORE_EXPORT void *q_atomic_set_ptr(volatile void *ptr, void *newval); + Q_CORE_EXPORT int q_atomic_fetch_and_add_int(volatile int *ptr, int value); + Q_CORE_EXPORT int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int value); + Q_CORE_EXPORT int q_atomic_fetch_and_add_release_int(volatile int *ptr, int value); +} // extern "C" + +inline bool QBasicAtomicInt::ref() +{ + return q_atomic_increment(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + return q_atomic_decrement(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_acquire_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_release_int(&_q_value, expectedValue, newValue) != 0; +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return q_atomic_set_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return q_atomic_fetch_and_store_acquire_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return q_atomic_fetch_and_store_release_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return q_atomic_fetch_and_add_int(&_q_value, valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return q_atomic_fetch_and_add_acquire_int(&_q_value, valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return q_atomic_fetch_and_add_release_int(&_q_value, valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_acquire_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_release_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return reinterpret_cast(q_atomic_set_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return reinterpret_cast(q_atomic_fetch_and_store_acquire_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return reinterpret_cast(q_atomic_fetch_and_store_release_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_ptr(&_q_value, newValue)); +} +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_acquire_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_release_ptr(&_q_value, newValue)); +} + +#endif // Q_CC_GNU + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_ALPHA_H diff --git a/qtinterface/qt4/Qt/qatomic_arch.h b/qtinterface/qt4/Qt/qatomic_arch.h new file mode 100644 index 0000000..344b053 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_arch.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_ARCH_H +#define QATOMIC_ARCH_H + +QT_BEGIN_HEADER + +#include "QtCore/qglobal.h" + +#if defined(QT_ARCH_VXWORKS) +# include "QtCore/qatomic_vxworks.h" +#elif defined(QT_ARCH_ALPHA) +# include "QtCore/qatomic_alpha.h" +#elif defined(QT_ARCH_ARM) +# include "QtCore/qatomic_arm.h" +#elif defined(QT_ARCH_ARMV6) +# include "QtCore/qatomic_armv6.h" +#elif defined(QT_ARCH_AVR32) +# include "QtCore/qatomic_avr32.h" +#elif defined(QT_ARCH_BFIN) +# include "QtCore/qatomic_bfin.h" +#elif defined(QT_ARCH_GENERIC) +# include "QtCore/qatomic_generic.h" +#elif defined(QT_ARCH_I386) +# include "QtCore/qatomic_i386.h" +#elif defined(QT_ARCH_IA64) +# include "QtCore/qatomic_ia64.h" +#elif defined(QT_ARCH_MACOSX) +# include "QtCore/qatomic_macosx.h" +#elif defined(QT_ARCH_MIPS) +# include "QtCore/qatomic_mips.h" +#elif defined(QT_ARCH_PARISC) +# include "QtCore/qatomic_parisc.h" +#elif defined(QT_ARCH_POWERPC) +# include "QtCore/qatomic_powerpc.h" +#elif defined(QT_ARCH_S390) +# include "QtCore/qatomic_s390.h" +#elif defined(QT_ARCH_SPARC) +# include "QtCore/qatomic_sparc.h" +#elif defined(QT_ARCH_WINDOWS) +# include "QtCore/qatomic_windows.h" +#elif defined(QT_ARCH_WINDOWSCE) +# include "QtCore/qatomic_windowsce.h" +#elif defined(QT_ARCH_X86_64) +# include "QtCore/qatomic_x86_64.h" +#elif defined(QT_ARCH_SYMBIAN) +# include "QtCore/qatomic_symbian.h" +#elif defined(QT_ARCH_SH) +# include "QtCore/qatomic_sh.h" +#elif defined(QT_ARCH_SH4A) +# include "QtCore/qatomic_sh4a.h" +#else +# error "Qt has not been ported to this architecture" +#endif + +QT_END_HEADER + +#endif // QATOMIC_ARCH_H diff --git a/qtinterface/qt4/Qt/qatomic_arm.h b/qtinterface/qt4/Qt/qatomic_arm.h new file mode 100644 index 0000000..d6e2292 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_arm.h @@ -0,0 +1,431 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_ARM_H +#define QATOMIC_ARM_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return false; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return false; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +#ifndef QT_NO_ARM_EABI + +// kernel places a restartable cmpxchg implementation at a fixed address +extern "C" typedef int (qt_atomic_eabi_cmpxchg_int_t)(int oldval, int newval, volatile int *ptr); +extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(void *oldval, void *newval, volatile void *ptr); +#define qt_atomic_eabi_cmpxchg_int (*(qt_atomic_eabi_cmpxchg_int_t *)0xffff0fc0) +#define qt_atomic_eabi_cmpxchg_ptr (*(qt_atomic_eabi_cmpxchg_ptr_t *)0xffff0fc0) + +#else + +extern Q_CORE_EXPORT char q_atomic_lock; +Q_CORE_EXPORT void qt_atomic_yield(int *); + +#ifdef Q_CC_RVCT + +Q_CORE_EXPORT __asm char q_atomic_swp(volatile char *ptr, char newval); + +#else + +inline char q_atomic_swp(volatile char *ptr, char newval) +{ + register char ret; + asm volatile("swpb %0,%2,[%3]" + : "=&r"(ret), "=m" (*ptr) + : "r"(newval), "r"(ptr) + : "cc", "memory"); + return ret; +} + +#endif // Q_CC_RVCT + +#endif // QT_NO_ARM_EABI + +// Reference counting + +inline bool QBasicAtomicInt::ref() +{ +#ifndef QT_NO_ARM_EABI + register int originalValue; + register int newValue; + do { + originalValue = _q_value; + newValue = originalValue + 1; + } while (qt_atomic_eabi_cmpxchg_int(originalValue, newValue, &_q_value) != 0); + return newValue != 0; +#else + int count = 0; + while (q_atomic_swp(&q_atomic_lock, ~0) != 0) + qt_atomic_yield(&count); + int originalValue = _q_value++; + q_atomic_swp(&q_atomic_lock, 0); + return originalValue != -1; +#endif +} + +inline bool QBasicAtomicInt::deref() +{ +#ifndef QT_NO_ARM_EABI + register int originalValue; + register int newValue; + do { + originalValue = _q_value; + newValue = originalValue - 1; + } while (qt_atomic_eabi_cmpxchg_int(originalValue, newValue, &_q_value) != 0); + return newValue != 0; +#else + int count = 0; + while (q_atomic_swp(&q_atomic_lock, ~0) != 0) + qt_atomic_yield(&count); + int originalValue = _q_value--; + q_atomic_swp(&q_atomic_lock, 0); + return originalValue != 1; +#endif +} + +// Test and set for integers + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ +#ifndef QT_NO_ARM_EABI + register int originalValue; + do { + originalValue = _q_value; + if (originalValue != expectedValue) + return false; + } while (qt_atomic_eabi_cmpxchg_int(expectedValue, newValue, &_q_value) != 0); + return true; +#else + bool returnValue = false; + int count = 0; + while (q_atomic_swp(&q_atomic_lock, ~0) != 0) + qt_atomic_yield(&count); + if (_q_value == expectedValue) { + _q_value = newValue; + returnValue = true; + } + q_atomic_swp(&q_atomic_lock, 0); + return returnValue; +#endif +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for integers + +#ifndef Q_CC_RVCT + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + int originalValue; + asm volatile("swp %0,%2,[%3]" + : "=&r"(originalValue), "=m" (_q_value) + : "r"(newValue), "r"(&_q_value) + : "cc", "memory"); + return originalValue; +} + +#endif + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for integers + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ +#ifndef QT_NO_ARM_EABI + register int originalValue; + register int newValue; + do { + originalValue = _q_value; + newValue = originalValue + valueToAdd; + } while (qt_atomic_eabi_cmpxchg_int(originalValue, newValue, &_q_value) != 0); + return originalValue; +#else + int count = 0; + while (q_atomic_swp(&q_atomic_lock, ~0) != 0) + qt_atomic_yield(&count); + int originalValue = _q_value; + _q_value += valueToAdd; + q_atomic_swp(&q_atomic_lock, 0); + return originalValue; +#endif +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +// Test and set for pointers + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ +#ifndef QT_NO_ARM_EABI + register T *originalValue; + do { + originalValue = _q_value; + if (originalValue != expectedValue) + return false; + } while (qt_atomic_eabi_cmpxchg_ptr(expectedValue, newValue, &_q_value) != 0); + return true; +#else + bool returnValue = false; + int count = 0; + while (q_atomic_swp(&q_atomic_lock, ~0) != 0) + qt_atomic_yield(&count); + if (_q_value == expectedValue) { + _q_value = newValue; + returnValue = true; + } + q_atomic_swp(&q_atomic_lock, 0); + return returnValue; +#endif +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for pointers + +#ifdef Q_CC_RVCT + +template +__asm T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + add r2, pc, #0 + bx r2 + arm + swp r2,r1,[r0] + mov r0, r2 + bx lr + thumb +} + +#else + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + T *originalValue; + asm volatile("swp %0,%2,[%3]" + : "=&r"(originalValue), "=m" (_q_value) + : "r"(newValue), "r"(&_q_value) + : "cc", "memory"); + return originalValue; +} + +#endif // Q_CC_RVCT + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ +#ifndef QT_NO_ARM_EABI + register T *originalValue; + register T *newValue; + do { + originalValue = _q_value; + newValue = originalValue + valueToAdd; + } while (qt_atomic_eabi_cmpxchg_ptr(originalValue, newValue, &_q_value) != 0); + return originalValue; +#else + int count = 0; + while (q_atomic_swp(&q_atomic_lock, ~0) != 0) + qt_atomic_yield(&count); + T *originalValue = (_q_value); + _q_value += valueToAdd; + q_atomic_swp(&q_atomic_lock, 0); + return originalValue; +#endif +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_ARM_H diff --git a/qtinterface/qt4/Qt/qatomic_armv6.h b/qtinterface/qt4/Qt/qatomic_armv6.h new file mode 100644 index 0000000..063aa56 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_armv6.h @@ -0,0 +1,500 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_ARMV6_H +#define QATOMIC_ARMV6_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +#ifndef Q_CC_RVCT + +inline bool QBasicAtomicInt::ref() +{ + register int newValue; + register int result; + asm volatile("0:\n" + "ldrex %[newValue], [%[_q_value]]\n" + "add %[newValue], %[newValue], #1\n" + "strex %[result], %[newValue], [%[_q_value]]\n" + "teq %[result], #0\n" + "bne 0b\n" + : [newValue] "=&r" (newValue), + [result] "=&r" (result), + "+m" (_q_value) + : [_q_value] "r" (&_q_value) + : "cc", "memory"); + return newValue != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + register int newValue; + register int result; + asm volatile("0:\n" + "ldrex %[newValue], [%[_q_value]]\n" + "sub %[newValue], %[newValue], #1\n" + "strex %[result], %[newValue], [%[_q_value]]\n" + "teq %[result], #0\n" + "bne 0b\n" + : [newValue] "=&r" (newValue), + [result] "=&r" (result), + "+m" (_q_value) + : [_q_value] "r" (&_q_value) + : "cc", "memory"); + return newValue != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + register int result; + asm volatile("0:\n" + "ldrex %[result], [%[_q_value]]\n" + "eors %[result], %[result], %[expectedValue]\n" + "strexeq %[result], %[newValue], [%[_q_value]]\n" + "teqeq %[result], #1\n" + "beq 0b\n" + : [result] "=&r" (result), + "+m" (_q_value) + : [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue), + [_q_value] "r" (&_q_value) + : "cc", "memory"); + return result == 0; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + register int originalValue; + register int result; + asm volatile("0:\n" + "ldrex %[originalValue], [%[_q_value]]\n" + "strex %[result], %[newValue], [%[_q_value]]\n" + "teq %[result], #0\n" + "bne 0b\n" + : [originalValue] "=&r" (originalValue), + [result] "=&r" (result), + "+m" (_q_value) + : [newValue] "r" (newValue), + [_q_value] "r" (&_q_value) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + register int originalValue; + register int newValue; + register int result; + asm volatile("0:\n" + "ldrex %[originalValue], [%[_q_value]]\n" + "add %[newValue], %[originalValue], %[valueToAdd]\n" + "strex %[result], %[newValue], [%[_q_value]]\n" + "teq %[result], #0\n" + "bne 0b\n" + : [originalValue] "=&r" (originalValue), + [newValue] "=&r" (newValue), + [result] "=&r" (result), + "+m" (_q_value) + : [valueToAdd] "r" (valueToAdd), + [_q_value] "r" (&_q_value) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + register T *result; + asm volatile("0:\n" + "ldrex %[result], [%[_q_value]]\n" + "eors %[result], %[result], %[expectedValue]\n" + "strexeq %[result], %[newValue], [%[_q_value]]\n" + "teqeq %[result], #1\n" + "beq 0b\n" + : [result] "=&r" (result), + "+m" (_q_value) + : [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue), + [_q_value] "r" (&_q_value) + : "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + register T *originalValue; + register int result; + asm volatile("0:\n" + "ldrex %[originalValue], [%[_q_value]]\n" + "strex %[result], %[newValue], [%[_q_value]]\n" + "teq %[result], #0\n" + "bne 0b\n" + : [originalValue] "=&r" (originalValue), + [result] "=&r" (result), + "+m" (_q_value) + : [newValue] "r" (newValue), + [_q_value] "r" (&_q_value) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + register T *originalValue; + register T *newValue; + register int result; + asm volatile("0:\n" + "ldrex %[originalValue], [%[_q_value]]\n" + "add %[newValue], %[originalValue], %[valueToAdd]\n" + "strex %[result], %[newValue], [%[_q_value]]\n" + "teq %[result], #0\n" + "bne 0b\n" + : [originalValue] "=&r" (originalValue), + [newValue] "=&r" (newValue), + [result] "=&r" (result), + "+m" (_q_value) + : [valueToAdd] "r" (valueToAdd * sizeof(T)), + [_q_value] "r" (&_q_value) + : "cc", "memory"); + return originalValue; +} + +#else +// This is Q_CC_RVCT + +// RVCT inline assembly documentation: +// http://www.keil.com/support/man/docs/armcc/armcc_chdcffdb.htm +// RVCT embedded assembly documentation: +// http://www.keil.com/support/man/docs/armcc/armcc_chddbeib.htm + +// save our pragma state and switch to ARM mode +#pragma push +#pragma arm + +inline bool QBasicAtomicInt::ref() +{ + register int newValue; + register int result; + retry: + __asm { + ldrex newValue, [&_q_value] + add newValue, newValue, #1 + strex result, newValue, [&_q_value] + teq result, #0 + bne retry + } + return newValue != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + register int newValue; + register int result; + retry: + __asm { + ldrex newValue, [&_q_value] + sub newValue, newValue, #1 + strex result, newValue, [&_q_value] + teq result, #0 + bne retry + } + return newValue != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + register int result; + retry: + __asm { + ldrex result, [&_q_value] + eors result, result, expectedValue + strexeq result, newValue, [&_q_value] + teqeq result, #1 + beq retry + } + return result == 0; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + register int originalValue; + register int result; + retry: + __asm { + ldrex originalValue, [&_q_value] + strex result, newValue, [&_q_value] + teq result, #0 + bne retry + } + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + register int originalValue; + register int newValue; + register int result; + retry: + __asm { + ldrex originalValue, [&_q_value] + add newValue, originalValue, valueToAdd + strex result, newValue, [&_q_value] + teq result, #0 + bne retry + } + return originalValue; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + register T *result; + retry: + __asm { + ldrex result, [&_q_value] + eors result, result, expectedValue + strexeq result, newValue, [&_q_value] + teqeq result, #1 + beq retry + } + return result == 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + register T *originalValue; + register int result; + retry: + __asm { + ldrex originalValue, [&_q_value] + strex result, newValue, [&_q_value] + teq result, #0 + bne retry + } + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + register T *originalValue; + register T *newValue; + register int result; + retry: + __asm { + ldrex originalValue, [&_q_value] + add newValue, originalValue, valueToAdd * sizeof(T) + strex result, newValue, [&_q_value] + teq result, #0 + bne retry + } + return originalValue; +} + +// go back to the previous pragma state (probably Thumb mode) +#pragma pop +#endif + +// common code + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_ARMV6_H diff --git a/qtinterface/qt4/Qt/qatomic_avr32.h b/qtinterface/qt4/Qt/qatomic_avr32.h new file mode 100644 index 0000000..c5951f4 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_avr32.h @@ -0,0 +1,252 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_AVR32_H +#define QATOMIC_AVR32_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +inline bool QBasicAtomicInt::ref() +{ + return __sync_add_and_fetch(&_q_value, 1); +} + +inline bool QBasicAtomicInt::deref() +{ + return __sync_sub_and_fetch(&_q_value, 1); +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return __sync_bool_compare_and_swap(&_q_value, expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return __sync_lock_test_and_set(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return __sync_fetch_and_add(&_q_value, valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return __sync_bool_compare_and_swap(&_q_value, expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return __sync_lock_test_and_set(&_q_value, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + return __sync_fetch_and_add(&_q_value, valueToAdd * sizeof(T)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_AVR32_H diff --git a/qtinterface/qt4/Qt/qatomic_bfin.h b/qtinterface/qt4/Qt/qatomic_bfin.h new file mode 100644 index 0000000..2c0456a --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_bfin.h @@ -0,0 +1,343 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_BFIN_H +#define QATOMIC_BFIN_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return false; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return false; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) + +QT_BEGIN_INCLUDE_NAMESPACE +#include +QT_END_INCLUDE_NAMESPACE + +inline bool QBasicAtomicInt::ref() +{ + int ret; + asm volatile("R0 = 1;\n\t" + "P0 = %3;\n\t" + "CALL (%2);\n\t" + "%0 = R0;" + : "=da" (ret), "=m" (_q_value) + : "a" (ATOMIC_ADD32), "da" (&_q_value), "m" (_q_value) + : "R0", "R1", "P0", "RETS", "memory"); + return ret != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + int ret; + asm volatile("R0 = 1;\n\t" + "P0 = %3;\n\t" + "CALL (%2);\n\t" + "%0 = R0;" + : "=da" (ret), "=m" (_q_value) + : "a" (ATOMIC_SUB32), "da" (&_q_value), "m" (_q_value) + : "R0", "R1", "P0", "RETS", "memory"); + return ret != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + long int readval; + asm volatile ("P0 = %2;\n\t" + "R1 = %3;\n\t" + "R2 = %4;\n\t" + "CALL (%5);\n\t" + "%0 = R0;\n\t" + : "=da" (readval), "=m" (_q_value) + : "da" (&_q_value), + "da" (expectedValue), + "da" (newValue), + "a" (ATOMIC_CAS32), + "m" (_q_value) + : "P0", "R0", "R1", "R2", "RETS", "memory", "cc"); + return readval == expectedValue; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + asm volatile("R1 = %2;\n\t" + "P0 = %4;\n\t" + "CALL (%3);\n\t" + "%0 = R0;" + : "=da" (newValue), "=m" (_q_value) + : "da" (newValue), "a" (ATOMIC_XCHG32), "da" (&_q_value), "m" (_q_value) + : "R0", "R1", "P0", "RETS", "memory"); + return newValue; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + int ret; + asm volatile("R0 = %[val];\n\t" + "P0 = %[qvalp];\n\t" + "CALL (%[addr]);\n\t" + "%[ret] = R1;" + : [ret] "=da" (ret), "=m" (_q_value) + : [addr] "a" (ATOMIC_ADD32), [qvalp] "da" (&_q_value), "m" (_q_value), [val] "da" (valueToAdd) + : "R0", "R1", "P0", "RETS", "memory"); + return ret; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + T *readval; + asm volatile ("P0 = %2;\n\t" + "R1 = %3;\n\t" + "R2 = %4;\n\t" + "CALL (%5);\n\t" + "%0 = R0;\n\t" + : "=da" (readval), "=m" (_q_value) + : "da" (&_q_value), + "da" (expectedValue), + "da" (newValue), + "a" (ATOMIC_CAS32), + "m" (_q_value) + : "P0", "R0", "R1", "R2", "RETS", "memory", "cc"); + return readval == expectedValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + asm volatile("R1 = %2;\n\t" + "P0 = %4;\n\t" + "CALL (%3);\n\t" + "%0 = R0;" + : "=da" (newValue), "=m" (_q_value) + : "da" (newValue), "a" (ATOMIC_XCHG32), "da" (&_q_value), "m" (_q_value) + : "R0", "R1", "P0", "RETS", "memory"); + return newValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + T* ret; + asm volatile("R0 = %[val];\n\t" + "P0 = %[qvalp];\n\t" + "CALL (%[addr]);\n\t" + "%[ret] = R1;" + : [ret] "=da" (ret), "=m" (_q_value) + : [addr] "a" (ATOMIC_ADD32), [qvalp] "da" (&_q_value), "m" (_q_value), [val] "da" (valueToAdd * sizeof(T)) + : "R0", "R1", "P0", "RETS", "memory"); + return ret; +} + + +#endif // Q_OS_LINUX && Q_CC_GNU + +// Test and set for integers + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for integers + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for integers + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +// Test and set for pointers + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_BFIN_H diff --git a/qtinterface/qt4/Qt/qatomic_bootstrap.h b/qtinterface/qt4/Qt/qatomic_bootstrap.h new file mode 100644 index 0000000..4e3fc82 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_bootstrap.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_BOOTSTRAP_H +#define QATOMIC_BOOTSTRAP_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +inline bool QBasicAtomicInt::ref() +{ + return ++_q_value != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + return --_q_value != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + if (_q_value == expectedValue) { + _q_value = newValue; + return true; + } + return false; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + int returnValue = _q_value; + _q_value += valueToAdd; + return returnValue; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + if (_q_value == expectedValue) { + _q_value = newValue; + return true; + } + return false; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_BOOTSTRAP_H diff --git a/qtinterface/qt4/Qt/qatomic_generic.h b/qtinterface/qt4/Qt/qatomic_generic.h new file mode 100644 index 0000000..336d446 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_generic.h @@ -0,0 +1,282 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_GENERIC_H +#define QATOMIC_GENERIC_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return false; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return false; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +Q_CORE_EXPORT bool QBasicAtomicInt_testAndSetOrdered(volatile int *, int, int); +Q_CORE_EXPORT int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *, int); +Q_CORE_EXPORT int QBasicAtomicInt_fetchAndAddOrdered(volatile int *, int); + +Q_CORE_EXPORT bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *, void *, void *); +Q_CORE_EXPORT void *QBasicAtomicPointer_fetchAndStoreOrdered(void * volatile *, void *); +Q_CORE_EXPORT void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *, qptrdiff); + +// Reference counting + +inline bool QBasicAtomicInt::ref() +{ + return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, 1) != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, -1) != 1; +} + +// Test and set for integers + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return QBasicAtomicInt_testAndSetOrdered(&_q_value, expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for integers + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return QBasicAtomicInt_fetchAndStoreOrdered(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for integers + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +// Test and set for pointers + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + union { T * volatile * typed; void * volatile * voidp; } pointer; + pointer.typed = &_q_value; + return QBasicAtomicPointer_testAndSetOrdered(pointer.voidp, expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + union { T * volatile * typed; void * volatile * voidp; } pointer; + union { T *typed; void *voidp; } returnValue; + pointer.typed = &_q_value; + returnValue.voidp = QBasicAtomicPointer_fetchAndStoreOrdered(pointer.voidp, newValue); + return returnValue.typed; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + union { T * volatile *typed; void * volatile *voidp; } pointer; + union { T *typed; void *voidp; } returnValue; + pointer.typed = &_q_value; + returnValue.voidp = QBasicAtomicPointer_fetchAndAddOrdered(pointer.voidp, valueToAdd * sizeof(T)); + return returnValue.typed; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_GENERIC_H diff --git a/qtinterface/qt4/Qt/qatomic_i386.h b/qtinterface/qt4/Qt/qatomic_i386.h new file mode 100644 index 0000000..473b178 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_i386.h @@ -0,0 +1,361 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_I386_H +#define QATOMIC_I386_H + +QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_TEST_AND_SET_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return true; } + +#if defined(Q_CC_GNU) || defined(Q_CC_INTEL) + +inline bool QBasicAtomicInt::ref() +{ + unsigned char ret; + asm volatile("lock\n" + "incl %0\n" + "setne %1" + : "=m" (_q_value), "=qm" (ret) + : "m" (_q_value) + : "memory"); + return ret != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + unsigned char ret; + asm volatile("lock\n" + "decl %0\n" + "setne %1" + : "=m" (_q_value), "=qm" (ret) + : "m" (_q_value) + : "memory"); + return ret != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + unsigned char ret; + asm volatile("lock\n" + "cmpxchgl %3,%2\n" + "sete %1\n" + : "=a" (newValue), "=qm" (ret), "+m" (_q_value) + : "r" (newValue), "0" (expectedValue) + : "memory"); + return ret != 0; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + asm volatile("xchgl %0,%1" + : "=r" (newValue), "+m" (_q_value) + : "0" (newValue) + : "memory"); + return newValue; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + asm volatile("lock\n" + "xaddl %0,%1" + : "=r" (valueToAdd), "+m" (_q_value) + : "0" (valueToAdd) + : "memory"); + return valueToAdd; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + unsigned char ret; + asm volatile("lock\n" + "cmpxchgl %3,%2\n" + "sete %1\n" + : "=a" (newValue), "=qm" (ret), "+m" (_q_value) + : "r" (newValue), "0" (expectedValue) + : "memory"); + return ret != 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + asm volatile("xchgl %0,%1" + : "=r" (newValue), "+m" (_q_value) + : "0" (newValue) + : "memory"); + return newValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + asm volatile("lock\n" + "xaddl %0,%1" + : "=r" (valueToAdd), "+m" (_q_value) + : "0" (valueToAdd * sizeof(T)) + : "memory"); + return reinterpret_cast(valueToAdd); +} + +#else + +extern "C" { + Q_CORE_EXPORT int q_atomic_test_and_set_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_ptr(volatile void *ptr, void *expected, void *newval); + Q_CORE_EXPORT int q_atomic_increment(volatile int *ptr); + Q_CORE_EXPORT int q_atomic_decrement(volatile int *ptr); + Q_CORE_EXPORT int q_atomic_set_int(volatile int *ptr, int newval); + Q_CORE_EXPORT void *q_atomic_set_ptr(volatile void *ptr, void *newval); + Q_CORE_EXPORT int q_atomic_fetch_and_add_int(volatile int *ptr, int value); + Q_CORE_EXPORT void *q_atomic_fetch_and_add_ptr(volatile void *ptr, int value); +} // extern "C" + +inline bool QBasicAtomicInt::ref() +{ + return q_atomic_increment(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + return q_atomic_decrement(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_int(&_q_value, expectedValue, newValue) != 0; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return q_atomic_set_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return q_atomic_fetch_and_add_int(&_q_value, valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_ptr(&_q_value, expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return reinterpret_cast(q_atomic_set_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_ptr(&_q_value, valueToAdd * sizeof(T))); +} + +#endif + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE +QT_END_HEADER + +#endif // QATOMIC_I386_H diff --git a/qtinterface/qt4/Qt/qatomic_ia64.h b/qtinterface/qt4/Qt/qatomic_ia64.h new file mode 100644 index 0000000..fd71657 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_ia64.h @@ -0,0 +1,813 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_IA64_H +#define QATOMIC_IA64_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_TEST_AND_SET_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +inline bool _q_ia64_fetchadd_immediate(register int value) +{ + return value == 1 || value == -1 + || value == 4 || value == -4 + || value == 8 || value == -8 + || value == 16 || value == -16; +} + +#if defined(Q_CC_INTEL) + +// intrinsics provided by the Intel C++ Compiler +#include + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return static_cast(_InterlockedExchange(&_q_value, newValue)); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + __memory_barrier(); + return static_cast(_InterlockedExchange(&_q_value, newValue)); +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + register int expectedValueCopy = expectedValue; + return (static_cast(_InterlockedCompareExchange(&_q_value, + newValue, + expectedValueCopy)) + == expectedValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + register int expectedValueCopy = expectedValue; + return (static_cast(_InterlockedCompareExchange_acq(reinterpret_cast(&_q_value), + newValue, + expectedValueCopy)) + == expectedValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + register int expectedValueCopy = expectedValue; + return (static_cast(_InterlockedCompareExchange_rel(reinterpret_cast(&_q_value), + newValue, + expectedValueCopy)) + == expectedValue); +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + __memory_barrier(); + return testAndSetAcquire(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + if (__builtin_constant_p(valueToAdd)) { + if (valueToAdd == 1) + return __fetchadd4_acq((unsigned int *)&_q_value, 1); + if (valueToAdd == -1) + return __fetchadd4_acq((unsigned int *)&_q_value, -1); + } + return _InterlockedExchangeAdd(&_q_value, valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + if (__builtin_constant_p(valueToAdd)) { + if (valueToAdd == 1) + return __fetchadd4_rel((unsigned int *)&_q_value, 1); + if (valueToAdd == -1) + return __fetchadd4_rel((unsigned int *)&_q_value, -1); + } + __memory_barrier(); + return _InterlockedExchangeAdd(&_q_value, valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + __memory_barrier(); + return fetchAndAddAcquire(valueToAdd); +} + +inline bool QBasicAtomicInt::ref() +{ + return _InterlockedIncrement(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + return _InterlockedDecrement(&_q_value) != 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return (T *)_InterlockedExchangePointer(reinterpret_cast(&_q_value), newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + __memory_barrier(); + return fetchAndStoreAcquire(newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + register T *expectedValueCopy = expectedValue; + return (_InterlockedCompareExchangePointer(reinterpret_cast(&_q_value), + newValue, + expectedValueCopy) + == expectedValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + union { + volatile void *x; + volatile unsigned long *p; + }; + x = &_q_value; + register T *expectedValueCopy = expectedValue; + return (_InterlockedCompareExchange64_acq(p, quintptr(newValue), quintptr(expectedValueCopy)) + == quintptr(expectedValue)); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + union { + volatile void *x; + volatile unsigned long *p; + }; + x = &_q_value; + register T *expectedValueCopy = expectedValue; + return (_InterlockedCompareExchange64_rel(p, quintptr(newValue), quintptr(expectedValueCopy)) + == quintptr(expectedValue)); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + __memory_barrier(); + return testAndSetAcquire(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return (T *)_InterlockedExchangeAdd64((volatile long *)&_q_value, + valueToAdd * sizeof(T)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + __memory_barrier(); + return (T *)_InterlockedExchangeAdd64((volatile long *)&_q_value, + valueToAdd * sizeof(T)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + __memory_barrier(); + return fetchAndAddAcquire(valueToAdd); +} + +#else // !Q_CC_INTEL + +# if defined(Q_CC_GNU) + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + int ret; + asm volatile("xchg4 %0=%1,%2\n" + : "=r" (ret), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return ret; +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + int ret; + asm volatile("mf\n" + "xchg4 %0=%1,%2\n" + : "=r" (ret), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return ret; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + int ret; + asm volatile("mov ar.ccv=%2\n" + ";;\n" + "cmpxchg4.acq %0=%1,%3,ar.ccv\n" + : "=r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret == expectedValue; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + int ret; + asm volatile("mov ar.ccv=%2\n" + ";;\n" + "cmpxchg4.rel %0=%1,%3,ar.ccv\n" + : "=r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret == expectedValue; +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + int ret; + +#if (__GNUC__ >= 4) + // We implement a fast fetch-and-add when we can + if (__builtin_constant_p(valueToAdd) && _q_ia64_fetchadd_immediate(valueToAdd)) { + asm volatile("fetchadd4.acq %0=%1,%2\n" + : "=r" (ret), "+m" (_q_value) + : "i" (valueToAdd) + : "memory"); + return ret; + } +#endif + + // otherwise, use a loop around test-and-set + ret = _q_value; + asm volatile("0:\n" + " mov r9=%0\n" + " mov ar.ccv=%0\n" + " add %0=%0, %2\n" + " ;;\n" + " cmpxchg4.acq %0=%1,%0,ar.ccv\n" + " ;;\n" + " cmp.ne p6,p0 = %0, r9\n" + "(p6) br.dptk 0b\n" + "1:\n" + : "+r" (ret), "+m" (_q_value) + : "r" (valueToAdd) + : "r9", "p6", "memory"); + return ret; +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + int ret; + +#if (__GNUC__ >= 4) + // We implement a fast fetch-and-add when we can + if (__builtin_constant_p(valueToAdd) && _q_ia64_fetchadd_immediate(valueToAdd)) { + asm volatile("fetchadd4.rel %0=%1,%2\n" + : "=r" (ret), "+m" (_q_value) + : "i" (valueToAdd) + : "memory"); + return ret; + } +#endif + + // otherwise, use a loop around test-and-set + ret = _q_value; + asm volatile("0:\n" + " mov r9=%0\n" + " mov ar.ccv=%0\n" + " add %0=%0, %2\n" + " ;;\n" + " cmpxchg4.rel %0=%1,%0,ar.ccv\n" + " ;;\n" + " cmp.ne p6,p0 = %0, r9\n" + "(p6) br.dptk 0b\n" + "1:\n" + : "+r" (ret), "+m" (_q_value) + : "r" (valueToAdd) + : "r9", "p6", "memory"); + return ret; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + asm volatile("mf" ::: "memory"); + return fetchAndAddRelease(valueToAdd); +} + +inline bool QBasicAtomicInt::ref() +{ + int ret; + asm volatile("fetchadd4.acq %0=%1,1\n" + : "=r" (ret), "+m" (_q_value) + : + : "memory"); + return ret != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + int ret; + asm volatile("fetchadd4.rel %0=%1,-1\n" + : "=r" (ret), "+m" (_q_value) + : + : "memory"); + return ret != 1; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + T *ret; + asm volatile("xchg8 %0=%1,%2\n" + : "=r" (ret), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return ret; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + T *ret; + asm volatile("mf\n" + "xchg8 %0=%1,%2\n" + : "=r" (ret), "+m" (_q_value) + : "r" (newValue) + : "memory"); + return ret; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + T *ret; + asm volatile("mov ar.ccv=%2\n" + ";;\n" + "cmpxchg8.acq %0=%1,%3,ar.ccv\n" + : "=r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret == expectedValue; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + T *ret; + asm volatile("mov ar.ccv=%2\n" + ";;\n" + "cmpxchg8.rel %0=%1,%3,ar.ccv\n" + : "=r" (ret), "+m" (_q_value) + : "r" (expectedValue), "r" (newValue) + : "memory"); + return ret == expectedValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + T *ret; + +#if (__GNUC__ >= 4) + // We implement a fast fetch-and-add when we can + if (__builtin_constant_p(valueToAdd) && _q_ia64_fetchadd_immediate(valueToAdd * sizeof(T))) { + asm volatile("fetchadd8.acq %0=%1,%2\n" + : "=r" (ret), "+m" (_q_value) + : "i" (valueToAdd * sizeof(T)) + : "memory"); + return ret; + } +#endif + + // otherwise, use a loop around test-and-set + ret = _q_value; + asm volatile("0:\n" + " mov r9=%0\n" + " mov ar.ccv=%0\n" + " add %0=%0, %2\n" + " ;;\n" + " cmpxchg8.acq %0=%1,%0,ar.ccv\n" + " ;;\n" + " cmp.ne p6,p0 = %0, r9\n" + "(p6) br.dptk 0b\n" + "1:\n" + : "+r" (ret), "+m" (_q_value) + : "r" (valueToAdd * sizeof(T)) + : "r9", "p6", "memory"); + return ret; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + T *ret; + +#if (__GNUC__ >= 4) + // We implement a fast fetch-and-add when we can + if (__builtin_constant_p(valueToAdd) && _q_ia64_fetchadd_immediate(valueToAdd * sizeof(T))) { + asm volatile("fetchadd8.rel %0=%1,%2\n" + : "=r" (ret), "+m" (_q_value) + : "i" (valueToAdd * sizeof(T)) + : "memory"); + return ret; + } +#endif + + // otherwise, use a loop around test-and-set + ret = _q_value; + asm volatile("0:\n" + " mov r9=%0\n" + " mov ar.ccv=%0\n" + " add %0=%0, %2\n" + " ;;\n" + " cmpxchg8.rel %0=%1,%0,ar.ccv\n" + " ;;\n" + " cmp.ne p6,p0 = %0, r9\n" + "(p6) br.dptk 0b\n" + "1:\n" + : "+r" (ret), "+m" (_q_value) + : "r" (valueToAdd * sizeof(T)) + : "r9", "p6", "memory"); + return ret; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + asm volatile("mf" ::: "memory"); + return fetchAndAddRelease(valueToAdd); +} + +#elif defined Q_CC_HPACC + +QT_BEGIN_INCLUDE_NAMESPACE +#include +QT_END_INCLUDE_NAMESPACE + +#define FENCE (_Asm_fence)(_UP_CALL_FENCE | _UP_SYS_FENCE | _DOWN_CALL_FENCE | _DOWN_SYS_FENCE) + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return _Asm_xchg((_Asm_sz)_SZ_W, &_q_value, (unsigned)newValue, + (_Asm_ldhint)_LDHINT_NONE, FENCE); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + _Asm_mf(FENCE); + return _Asm_xchg((_Asm_sz)_SZ_W, &_q_value, (unsigned)newValue, + (_Asm_ldhint)_LDHINT_NONE, FENCE); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (unsigned)expectedValue, FENCE); + int ret = _Asm_cmpxchg((_Asm_sz)_SZ_W, (_Asm_sem)_SEM_ACQ, + &_q_value, (unsigned)newValue, (_Asm_ldhint)_LDHINT_NONE); + return ret == expectedValue; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (unsigned)expectedValue, FENCE); + int ret = _Asm_cmpxchg((_Asm_sz)_SZ_W, (_Asm_sem)_SEM_REL, + &_q_value, newValue, (_Asm_ldhint)_LDHINT_NONE); + return ret == expectedValue; +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + if (valueToAdd == 1) + return _Asm_fetchadd((_Asm_fasz)_FASZ_W, (_Asm_sem)_SEM_ACQ, + &_q_value, 1, (_Asm_ldhint)_LDHINT_NONE, FENCE); + else if (valueToAdd == -1) + return _Asm_fetchadd((_Asm_fasz)_FASZ_W, (_Asm_sem)_SEM_ACQ, + &_q_value, -1, (_Asm_ldhint)_LDHINT_NONE, FENCE); + + // implement the test-and-set loop + register int old, ret; + do { + old = _q_value; + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (unsigned)old, FENCE); + ret = _Asm_cmpxchg((_Asm_sz)_SZ_W, (_Asm_sem)_SEM_ACQ, + &_q_value, old + valueToAdd, (_Asm_ldhint)_LDHINT_NONE); + } while (ret != old); + return old; +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + if (valueToAdd == 1) + return _Asm_fetchadd((_Asm_fasz)_FASZ_W, (_Asm_sem)_SEM_REL, + &_q_value, 1, (_Asm_ldhint)_LDHINT_NONE, FENCE); + else if (valueToAdd == -1) + return _Asm_fetchadd((_Asm_fasz)_FASZ_W, (_Asm_sem)_SEM_REL, + &_q_value, -1, (_Asm_ldhint)_LDHINT_NONE, FENCE); + + // implement the test-and-set loop + register int old, ret; + do { + old = _q_value; + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (unsigned)old, FENCE); + ret = _Asm_cmpxchg((_Asm_sz)_SZ_W, (_Asm_sem)_SEM_REL, + &_q_value, old + valueToAdd, (_Asm_ldhint)_LDHINT_NONE); + } while (ret != old); + return old; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + _Asm_mf(FENCE); + return fetchAndAddAcquire(valueToAdd); +} + +inline bool QBasicAtomicInt::ref() +{ + return (int)_Asm_fetchadd((_Asm_fasz)_FASZ_W, (_Asm_sem)_SEM_ACQ, + &_q_value, 1, (_Asm_ldhint)_LDHINT_NONE, FENCE) != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + return (int)_Asm_fetchadd((_Asm_fasz)_FASZ_W, (_Asm_sem)_SEM_REL, + &_q_value, -1, (_Asm_ldhint)_LDHINT_NONE, FENCE) != 1; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ +#ifdef __LP64__ + return (T *)_Asm_xchg((_Asm_sz)_SZ_D, &_q_value, (quint64)newValue, + (_Asm_ldhint)_LDHINT_NONE, FENCE); +#else + return (T *)_Asm_xchg((_Asm_sz)_SZ_W, &_q_value, (quint32)newValue, + (_Asm_ldhint)_LDHINT_NONE, FENCE); +#endif +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + _Asm_mf(FENCE); + return fetchAndStoreAcquire(newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ +#ifdef __LP64__ + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint64)expectedValue, FENCE); + T *ret = (T *)_Asm_cmpxchg((_Asm_sz)_SZ_D, (_Asm_sem)_SEM_ACQ, + &_q_value, (quint64)newValue, (_Asm_ldhint)_LDHINT_NONE); +#else + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint32)expectedValue, FENCE); + T *ret = (T *)_Asm_cmpxchg((_Asm_sz)_SZ_W, (_Asm_sem)_SEM_ACQ, + &_q_value, (quint32)newValue, (_Asm_ldhint)_LDHINT_NONE); +#endif + return ret == expectedValue; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ +#ifdef __LP64__ + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint64)expectedValue, FENCE); + T *ret = (T *)_Asm_cmpxchg((_Asm_sz)_SZ_D, (_Asm_sem)_SEM_REL, + &_q_value, (quint64)newValue, (_Asm_ldhint)_LDHINT_NONE); +#else + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint32)expectedValue, FENCE); + T *ret = (T *)_Asm_cmpxchg((_Asm_sz)_SZ_W, (_Asm_sem)_SEM_REL, + &_q_value, (quint32)newValue, (_Asm_ldhint)_LDHINT_NONE); +#endif + return ret == expectedValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + // implement the test-and-set loop + register T *old, *ret; + do { + old = _q_value; +#ifdef __LP64__ + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint64)old, FENCE); + ret = (T *)_Asm_cmpxchg((_Asm_sz)_SZ_D, (_Asm_sem)_SEM_ACQ, + &_q_value, (quint64)(old + valueToAdd), + (_Asm_ldhint)_LDHINT_NONE); +#else + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint32)old, FENCE); + ret = (T *)_Asm_cmpxchg((_Asm_sz)_SZ_W, (_Asm_sem)_SEM_ACQ, + &_q_value, (quint32)(old + valueToAdd), + (_Asm_ldhint)_LDHINT_NONE); +#endif + } while (old != ret); + return old; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + // implement the test-and-set loop + register T *old, *ret; + do { + old = _q_value; +#ifdef __LP64__ + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint64)old, FENCE); + ret = (T *)_Asm_cmpxchg((_Asm_sz)_SZ_D, (_Asm_sem)_SEM_REL, + &_q_value, (quint64)(old + valueToAdd), + (_Asm_ldhint)_LDHINT_NONE); +#else + _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint32)old, FENCE); + ret = (T *)_Asm_cmpxchg((_Asm_sz)_SZ_W, (_Asm_sem)_SEM_REL, + &_q_value, (quint32)(old + valueToAdd), + (_Asm_ldhint)_LDHINT_NONE); +#endif + } while (old != ret); + return old; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + _Asm_mf(FENCE); + return fetchAndAddAcquire(valueToAdd); +} + +#else + +extern "C" { + Q_CORE_EXPORT int q_atomic_test_and_set_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_ptr(volatile void *ptr, void *expected, void *newval); +} // extern "C" + +#endif + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +#endif // Q_CC_INTEL + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return fetchAndStoreRelease(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return fetchAndStoreRelaxed(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_IA64_H diff --git a/qtinterface/qt4/Qt/qatomic_macosx.h b/qtinterface/qt4/Qt/qatomic_macosx.h new file mode 100644 index 0000000..a9cfe80 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_macosx.h @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_MACOSX_H +#define QATOMIC_MACOSX_H + +QT_BEGIN_HEADER + +#if defined(__x86_64__) +# include +#elif defined(__i386__) +# include +#else // !__x86_64 && !__i386__ +# include +#endif // !__x86_64__ && !__i386__ + +QT_END_HEADER + +#endif // QATOMIC_MACOSX_H diff --git a/qtinterface/qt4/Qt/qatomic_mips.h b/qtinterface/qt4/Qt/qatomic_mips.h new file mode 100644 index 0000000..f934c0d --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_mips.h @@ -0,0 +1,892 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_MIPS_H +#define QATOMIC_MIPS_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +#if defined(Q_CC_GNU) && !defined(Q_OS_IRIX) + +#if _MIPS_SIM == _ABIO32 +#define SET_MIPS2 ".set mips2\n\t" +#else +#define SET_MIPS2 +#endif + +inline bool QBasicAtomicInt::ref() +{ + register int originalValue; + register int newValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + "ll %[originalValue], %[_q_value]\n" + "addiu %[newValue], %[originalValue], %[one]\n" + "sc %[newValue], %[_q_value]\n" + "beqz %[newValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [_q_value] "+m" (_q_value), + [newValue] "=&r" (newValue) + : [one] "i" (1) + : "cc", "memory"); + return originalValue != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + register int originalValue; + register int newValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + "ll %[originalValue], %[_q_value]\n" + "addiu %[newValue], %[originalValue], %[minusOne]\n" + "sc %[newValue], %[_q_value]\n" + "beqz %[newValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [_q_value] "+m" (_q_value), + [newValue] "=&r" (newValue) + : [minusOne] "i" (-1) + : "cc", "memory"); + return originalValue != 1; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + register int result; + register int tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + "ll %[result], %[_q_value]\n" + "xor %[result], %[result], %[expectedValue]\n" + "bnez %[result], 0f\n" + "nop\n" + "move %[tempValue], %[newValue]\n" + "sc %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + "0:\n" + ".set pop\n" + : [result] "=&r" (result), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + register int result; + register int tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + "ll %[result], %[_q_value]\n" + "xor %[result], %[result], %[expectedValue]\n" + "bnez %[result], 0f\n" + "nop\n" + "move %[tempValue], %[newValue]\n" + "sc %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + "sync\n" + "0:\n" + ".set pop\n" + : [result] "=&r" (result), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + register int result; + register int tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "sync\n" + "0:\n" + "ll %[result], %[_q_value]\n" + "xor %[result], %[result], %[expectedValue]\n" + "bnez %[result], 0f\n" + "nop\n" + "move %[tempValue], %[newValue]\n" + "sc %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + "0:\n" + ".set pop\n" + : [result] "=&r" (result), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + register int originalValue; + register int tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + "ll %[originalValue], %[_q_value]\n" + "move %[tempValue], %[newValue]\n" + "sc %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + register int originalValue; + register int tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + "ll %[originalValue], %[_q_value]\n" + "move %[tempValue], %[newValue]\n" + "sc %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + "sync\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + register int originalValue; + register int tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "sync\n" + "0:\n" + "ll %[originalValue], %[_q_value]\n" + "move %[tempValue], %[newValue]\n" + "sc %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + register int originalValue; + register int newValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + "ll %[originalValue], %[_q_value]\n" + "addu %[newValue], %[originalValue], %[valueToAdd]\n" + "sc %[newValue], %[_q_value]\n" + "beqz %[newValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [_q_value] "+m" (_q_value), + [newValue] "=&r" (newValue) + : [valueToAdd] "r" (valueToAdd) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + register int originalValue; + register int newValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + "ll %[originalValue], %[_q_value]\n" + "addu %[newValue], %[originalValue], %[valueToAdd]\n" + "sc %[newValue], %[_q_value]\n" + "beqz %[newValue], 0b\n" + "nop\n" + "sync\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [_q_value] "+m" (_q_value), + [newValue] "=&r" (newValue) + : [valueToAdd] "r" (valueToAdd) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + register int originalValue; + register int newValue; + asm volatile(".set push\n" + SET_MIPS2 + "sync\n" + "0:\n" + "ll %[originalValue], %[_q_value]\n" + "addu %[newValue], %[originalValue], %[valueToAdd]\n" + "sc %[newValue], %[_q_value]\n" + "beqz %[newValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [_q_value] "+m" (_q_value), + [newValue] "=&r" (newValue) + : [valueToAdd] "r" (valueToAdd) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +#if defined(__LP64__) +# define LLP "lld" +# define SCP "scd" +#else +# define LLP "ll" +# define SCP "sc" +#endif + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + register T *result; + register T *tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + LLP" %[result], %[_q_value]\n" + "xor %[result], %[result], %[expectedValue]\n" + "bnez %[result], 0f\n" + "nop\n" + "move %[tempValue], %[newValue]\n" + SCP" %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + "0:\n" + ".set pop\n" + : [result] "=&r" (result), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + register T *result; + register T *tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + LLP" %[result], %[_q_value]\n" + "xor %[result], %[result], %[expectedValue]\n" + "bnez %[result], 0f\n" + "nop\n" + "move %[tempValue], %[newValue]\n" + SCP" %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + "sync\n" + "0:\n" + ".set pop\n" + : [result] "=&r" (result), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + register T *result; + register T *tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "sync\n" + "0:\n" + LLP" %[result], %[_q_value]\n" + "xor %[result], %[result], %[expectedValue]\n" + "bnez %[result], 0f\n" + "nop\n" + "move %[tempValue], %[newValue]\n" + SCP" %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + "0:\n" + ".set pop\n" + : [result] "=&r" (result), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + register T *originalValue; + register T *tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + LLP" %[originalValue], %[_q_value]\n" + "move %[tempValue], %[newValue]\n" + SCP" %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + register T *originalValue; + register T *tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + LLP" %[originalValue], %[_q_value]\n" + "move %[tempValue], %[newValue]\n" + SCP" %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + "sync\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + register T *originalValue; + register T *tempValue; + asm volatile(".set push\n" + SET_MIPS2 + "sync\n" + "0:\n" + LLP" %[originalValue], %[_q_value]\n" + "move %[tempValue], %[newValue]\n" + SCP" %[tempValue], %[_q_value]\n" + "beqz %[tempValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [tempValue] "=&r" (tempValue), + [_q_value] "+m" (_q_value) + : [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + register T *originalValue; + register T *newValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + LLP" %[originalValue], %[_q_value]\n" + "addu %[newValue], %[originalValue], %[valueToAdd]\n" + SCP" %[newValue], %[_q_value]\n" + "beqz %[newValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [_q_value] "+m" (_q_value), + [newValue] "=&r" (newValue) + : [valueToAdd] "r" (valueToAdd * sizeof(T)) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + register T *originalValue; + register T *newValue; + asm volatile(".set push\n" + SET_MIPS2 + "0:\n" + LLP" %[originalValue], %[_q_value]\n" + "addu %[newValue], %[originalValue], %[valueToAdd]\n" + SCP" %[newValue], %[_q_value]\n" + "beqz %[newValue], 0b\n" + "nop\n" + "sync\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [_q_value] "+m" (_q_value), + [newValue] "=&r" (newValue) + : [valueToAdd] "r" (valueToAdd * sizeof(T)) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + register T *originalValue; + register T *newValue; + asm volatile(".set push\n" + SET_MIPS2 + "sync\n" + "0:\n" + LLP" %[originalValue], %[_q_value]\n" + "addu %[newValue], %[originalValue], %[valueToAdd]\n" + SCP" %[newValue], %[_q_value]\n" + "beqz %[newValue], 0b\n" + "nop\n" + ".set pop\n" + : [originalValue] "=&r" (originalValue), + [_q_value] "+m" (_q_value), + [newValue] "=&r" (newValue) + : [valueToAdd] "r" (valueToAdd * sizeof(T)) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +#else // !Q_CC_GNU + +extern "C" { + Q_CORE_EXPORT int q_atomic_test_and_set_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_acquire_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_release_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_ptr(volatile void *ptr, void *expected, void *newval); + Q_CORE_EXPORT int q_atomic_test_and_set_acquire_ptr(volatile void *ptr, void *expected, void *newval); + Q_CORE_EXPORT int q_atomic_test_and_set_release_ptr(volatile void *ptr, void *expected, void *newval); +} // extern "C" + +inline bool QBasicAtomicInt::ref() +{ + register int expected; + for (;;) { + expected = _q_value; + if (q_atomic_test_and_set_int(&_q_value, expected, expected + 1)) + break; + } + return expected != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + register int expected; + for (;;) { + expected = _q_value; + if (q_atomic_test_and_set_int(&_q_value, expected, expected - 1)) + break; + } + return expected != 1; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_acquire_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_release_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_acquire_int(&_q_value, expectedValue, newValue) != 0; +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + int returnValue; + for (;;) { + returnValue = _q_value; + if (testAndSetRelaxed(returnValue, newValue)) + break; + } + return returnValue; +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + int returnValue; + for (;;) { + returnValue = _q_value; + if (testAndSetAcquire(returnValue, newValue)) + break; + } + return returnValue; +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + int returnValue; + for (;;) { + returnValue = _q_value; + if (testAndSetRelease(returnValue, newValue)) + break; + } + return returnValue; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + int returnValue; + for (;;) { + returnValue = _q_value; + if (testAndSetOrdered(returnValue, newValue)) + break; + } + return returnValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + int returnValue; + for (;;) { + returnValue = _q_value; + if (testAndSetRelaxed(returnValue, returnValue + valueToAdd)) + break; + } + return returnValue; +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + int returnValue; + for (;;) { + returnValue = _q_value; + if (testAndSetAcquire(returnValue, returnValue + valueToAdd)) + break; + } + return returnValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + int returnValue; + for (;;) { + returnValue = _q_value; + if (testAndSetRelease(returnValue, returnValue + valueToAdd)) + break; + } + return returnValue; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + int returnValue; + for (;;) { + returnValue = _q_value; + if (testAndSetOrdered(returnValue, returnValue + valueToAdd)) + break; + } + return returnValue; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_acquire_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_release_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_acquire_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + T *returnValue; + for (;;) { + returnValue = (_q_value); + if (testAndSetRelaxed(returnValue, newValue)) + break; + } + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + T *returnValue; + for (;;) { + returnValue = (_q_value); + if (testAndSetAcquire(returnValue, newValue)) + break; + } + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + T *returnValue; + for (;;) { + returnValue = (_q_value); + if (testAndSetRelease(returnValue, newValue)) + break; + } + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + T *returnValue; + for (;;) { + returnValue = (_q_value); + if (testAndSetOrdered(returnValue, newValue)) + break; + } + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + T *returnValue; + for (;;) { + returnValue = (_q_value); + if (testAndSetRelaxed(returnValue, returnValue + valueToAdd)) + break; + } + return returnValue; +} + +template +Q_INLINE_TEMPLATE +T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + T *returnValue; + for (;;) { + returnValue = (_q_value); + if (testAndSetAcquire(returnValue, returnValue + valueToAdd)) + break; + } + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + T *returnValue; + for (;;) { + returnValue = (_q_value); + if (testAndSetRelease(returnValue, returnValue + valueToAdd)) + break; + } + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + T *returnValue; + for (;;) { + returnValue = (_q_value); + if (testAndSetOrdered(returnValue, returnValue + valueToAdd)) + break; + } + return returnValue; +} + +#endif // Q_CC_GNU + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_MIPS_H diff --git a/qtinterface/qt4/Qt/qatomic_parisc.h b/qtinterface/qt4/Qt/qatomic_parisc.h new file mode 100644 index 0000000..fd1e07e --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_parisc.h @@ -0,0 +1,305 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_PARISC_H +#define QATOMIC_PARISC_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return false; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return false; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +extern "C" { + Q_CORE_EXPORT void q_atomic_lock(int *lock); + Q_CORE_EXPORT void q_atomic_unlock(int *lock); +} + +// Reference counting + +inline bool QBasicAtomicInt::ref() +{ + q_atomic_lock(_q_lock); + bool ret = (++_q_value != 0); + q_atomic_unlock(_q_lock); + return ret; +} + +inline bool QBasicAtomicInt::deref() +{ + q_atomic_lock(_q_lock); + bool ret = (--_q_value != 0); + q_atomic_unlock(_q_lock); + return ret; +} + +// Test-and-set for integers + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + q_atomic_lock(_q_lock); + if (_q_value == expectedValue) { + _q_value = newValue; + q_atomic_unlock(_q_lock); + return true; + } + q_atomic_unlock(_q_lock); + return false; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch-and-store for integers + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + q_atomic_lock(_q_lock); + int returnValue = _q_value; + _q_value = newValue; + q_atomic_unlock(_q_lock); + return returnValue; +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch-and-add for integers + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + q_atomic_lock(_q_lock); + int originalValue = _q_value; + _q_value += valueToAdd; + q_atomic_unlock(_q_lock); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +// Test and set for pointers + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + q_atomic_lock(_q_lock); + if (_q_value == expectedValue) { + _q_value = newValue; + q_atomic_unlock(_q_lock); + return true; + } + q_atomic_unlock(_q_lock); + return false; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + q_atomic_lock(_q_lock); + T *returnValue = (_q_value); + _q_value = newValue; + q_atomic_unlock(_q_lock); + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + q_atomic_lock(_q_lock); + T *returnValue = (_q_value); + _q_value += valueToAdd; + q_atomic_unlock(_q_lock); + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_PARISC_H diff --git a/qtinterface/qt4/Qt/qatomic_powerpc.h b/qtinterface/qt4/Qt/qatomic_powerpc.h new file mode 100644 index 0000000..d9e03e9 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_powerpc.h @@ -0,0 +1,648 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_POWERPC_H +#define QATOMIC_POWERPC_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +#if defined(Q_CC_GNU) + +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2) \ + || (!defined(__64BIT__) && !defined(__powerpc64__) && !defined(__ppc64__)) +# define _Q_VALUE "0, %[_q_value]" +# define _Q_VALUE_MEMORY_OPERAND "+m" (_q_value) +# define _Q_VALUE_REGISTER_OPERAND [_q_value] "r" (&_q_value), +#else +// On 64-bit with gcc >= 4.2 +# define _Q_VALUE "%y[_q_value]" +# define _Q_VALUE_MEMORY_OPERAND [_q_value] "+Z" (_q_value) +# define _Q_VALUE_REGISTER_OPERAND +#endif + +inline bool QBasicAtomicInt::ref() +{ + register int originalValue; + register int newValue; + asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" + "addi %[newValue], %[originalValue], %[one]\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-12\n" + : [originalValue] "=&b" (originalValue), + [newValue] "=&r" (newValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [one] "i" (1) + : "cc", "memory"); + return newValue != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + register int originalValue; + register int newValue; + asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" + "addi %[newValue], %[originalValue], %[minusOne]\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-12\n" + : [originalValue] "=&b" (originalValue), + [newValue] "=&r" (newValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [minusOne] "i" (-1) + : "cc", "memory"); + return newValue != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + register int result; + asm volatile("lwarx %[result]," _Q_VALUE "\n" + "xor. %[result], %[result], %[expectedValue]\n" + "bne $+12\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-16\n" + : [result] "=&r" (result), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + register int result; + asm volatile("lwarx %[result]," _Q_VALUE "\n" + "xor. %[result], %[result], %[expectedValue]\n" + "bne $+16\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-16\n" + "isync\n" + : [result] "=&r" (result), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + register int result; + asm volatile("eieio\n" + "lwarx %[result]," _Q_VALUE "\n" + "xor. %[result], %[result], %[expectedValue]\n" + "bne $+12\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-16\n" + : [result] "=&r" (result), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + register int originalValue; + asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-8\n" + : [originalValue] "=&r" (originalValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + register int originalValue; + asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-8\n" + "isync\n" + : [originalValue] "=&r" (originalValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + register int originalValue; + asm volatile("eieio\n" + "lwarx %[originalValue]," _Q_VALUE "\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-8\n" + : [originalValue] "=&r" (originalValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + register int originalValue; + register int newValue; + asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" + "add %[newValue], %[originalValue], %[valueToAdd]\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-12\n" + : [originalValue] "=&r" (originalValue), + [newValue] "=&r" (newValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [valueToAdd] "r" (valueToAdd) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + register int originalValue; + register int newValue; + asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" + "add %[newValue], %[originalValue], %[valueToAdd]\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-12\n" + "isync\n" + : [originalValue] "=&r" (originalValue), + [newValue] "=&r" (newValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [valueToAdd] "r" (valueToAdd) + : "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + register int originalValue; + register int newValue; + asm volatile("eieio\n" + "lwarx %[originalValue]," _Q_VALUE "\n" + "add %[newValue], %[originalValue], %[valueToAdd]\n" + "stwcx. %[newValue]," _Q_VALUE "\n" + "bne- $-12\n" + : [originalValue] "=&r" (originalValue), + [newValue] "=&r" (newValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [valueToAdd] "r" (valueToAdd) + : "cc", "memory"); + return originalValue; +} + +#if defined(__64BIT__) || defined(__powerpc64__) || defined(__ppc64__) +# define LPARX "ldarx" +# define STPCX "stdcx." +#else +# define LPARX "lwarx" +# define STPCX "stwcx." +#endif + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + register void *result; + asm volatile(LPARX" %[result]," _Q_VALUE "\n" + "xor. %[result], %[result], %[expectedValue]\n" + "bne $+12\n" + STPCX" %[newValue]," _Q_VALUE "\n" + "bne- $-16\n" + : [result] "=&r" (result), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + register void *result; + asm volatile(LPARX" %[result]," _Q_VALUE "\n" + "xor. %[result], %[result], %[expectedValue]\n" + "bne $+16\n" + STPCX" %[newValue]," _Q_VALUE "\n" + "bne- $-16\n" + "isync\n" + : [result] "=&r" (result), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + register void *result; + asm volatile("eieio\n" + LPARX" %[result]," _Q_VALUE "\n" + "xor. %[result], %[result], %[expectedValue]\n" + "bne $+12\n" + STPCX" %[newValue]," _Q_VALUE "\n" + "bne- $-16\n" + : [result] "=&r" (result), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + register T *originalValue; + asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" + STPCX" %[newValue]," _Q_VALUE "\n" + "bne- $-8\n" + : [originalValue] "=&r" (originalValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + register T *originalValue; + asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" + STPCX" %[newValue]," _Q_VALUE "\n" + "bne- $-8\n" + "isync\n" + : [originalValue] "=&r" (originalValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + register T *originalValue; + asm volatile("eieio\n" + LPARX" %[originalValue]," _Q_VALUE "\n" + STPCX" %[newValue]," _Q_VALUE "\n" + "bne- $-8\n" + : [originalValue] "=&r" (originalValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [newValue] "r" (newValue) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + register T *originalValue; + register T *newValue; + asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" + "add %[newValue], %[originalValue], %[valueToAdd]\n" + STPCX" %[newValue]," _Q_VALUE "\n" + "bne- $-12\n" + : [originalValue] "=&r" (originalValue), + [newValue] "=&r" (newValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [valueToAdd] "r" (valueToAdd * sizeof(T)) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + register T *originalValue; + register T *newValue; + asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" + "add %[newValue], %[originalValue], %[valueToAdd]\n" + STPCX" %[newValue]," _Q_VALUE "\n" + "bne- $-12\n" + "isync\n" + : [originalValue] "=&r" (originalValue), + [newValue] "=&r" (newValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [valueToAdd] "r" (valueToAdd * sizeof(T)) + : "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + register T *originalValue; + register T *newValue; + asm volatile("eieio\n" + LPARX" %[originalValue]," _Q_VALUE "\n" + "add %[newValue], %[originalValue], %[valueToAdd]\n" + STPCX" %[newValue]," _Q_VALUE "\n" + "bne- $-12\n" + : [originalValue] "=&r" (originalValue), + [newValue] "=&r" (newValue), + _Q_VALUE_MEMORY_OPERAND + : _Q_VALUE_REGISTER_OPERAND + [valueToAdd] "r" (valueToAdd * sizeof(T)) + : "cc", "memory"); + return originalValue; +} + +#undef LPARX +#undef STPCX +#undef _Q_VALUE +#undef _Q_VALUE_MEMORY_OPERAND +#undef _Q_VALUE_REGISTER_OPERAND + +#else + +extern "C" { + int q_atomic_test_and_set_int(volatile int *ptr, int expectedValue, int newValue); + int q_atomic_test_and_set_acquire_int(volatile int *ptr, int expectedValue, int newValue); + int q_atomic_test_and_set_release_int(volatile int *ptr, int expectedValue, int newValue); + int q_atomic_test_and_set_ptr(volatile void *ptr, void *expectedValue, void *newValue); + int q_atomic_test_and_set_acquire_ptr(volatile void *ptr, void *expectedValue, void *newValue); + int q_atomic_test_and_set_release_ptr(volatile void *ptr, void *expectedValue, void *newValue); + int q_atomic_increment(volatile int *); + int q_atomic_decrement(volatile int *); + int q_atomic_set_int(volatile int *, int); + int q_atomic_fetch_and_store_acquire_int(volatile int *ptr, int newValue); + int q_atomic_fetch_and_store_release_int(volatile int *ptr, int newValue); + void *q_atomic_set_ptr(volatile void *, void *); + int q_atomic_fetch_and_store_acquire_ptr(volatile void *ptr, void *newValue); + int q_atomic_fetch_and_store_release_ptr(volatile void *ptr, void *newValue); + int q_atomic_fetch_and_add_int(volatile int *ptr, int valueToAdd); + int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int valueToAdd); + int q_atomic_fetch_and_add_release_int(volatile int *ptr, int valueToAdd); + void *q_atomic_fetch_and_add_ptr(volatile void *ptr, qptrdiff valueToAdd); + void *q_atomic_fetch_and_add_acquire_ptr(volatile void *ptr, qptrdiff valueToAdd); + void *q_atomic_fetch_and_add_release_ptr(volatile void *ptr, qptrdiff valueToAdd); +} // extern "C" + + +inline bool QBasicAtomicInt::ref() +{ + return q_atomic_increment(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + return q_atomic_decrement(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_acquire_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_release_int(&_q_value, expectedValue, newValue) != 0; +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return q_atomic_set_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return q_atomic_fetch_and_store_acquire_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return q_atomic_fetch_and_store_release_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return q_atomic_fetch_and_add_int(&_q_value, valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return q_atomic_fetch_and_add_acquire_int(&_q_value, valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return q_atomic_fetch_and_add_release_int(&_q_value, valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_acquire_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_release_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return reinterpret_cast(q_atomic_set_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return reinterpret_cast(q_atomic_fetch_and_store_acquire_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return reinterpret_cast(q_atomic_fetch_and_store_release_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_ptr(&_q_value, valueToAdd * sizeof(T))); +} +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_acquire_ptr(&_q_value, valueToAdd * sizeof(T))); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_release_ptr(&_q_value, valueToAdd * sizeof(T))); +} + +#endif + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_POWERPC_H diff --git a/qtinterface/qt4/Qt/qatomic_s390.h b/qtinterface/qt4/Qt/qatomic_s390.h new file mode 100644 index 0000000..4c3311c --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_s390.h @@ -0,0 +1,430 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_S390_H +#define QATOMIC_S390_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif + +#define __CS_LOOP(ptr, op_val, op_string, pre, post) __GNU_EXTENSION ({ \ + volatile int old_val, new_val; \ + __asm__ __volatile__(pre \ + " l %0,0(%3)\n" \ + "0: lr %1,%0\n" \ + op_string " %1,%4\n" \ + " cs %0,%1,0(%3)\n" \ + " jl 0b\n" \ + post \ + : "=&d" (old_val), "=&d" (new_val), \ + "=m" (*ptr) \ + : "a" (ptr), "d" (op_val), \ + "m" (*ptr) \ + : "cc", "memory" ); \ + new_val; \ +}) + +#define __CS_OLD_LOOP(ptr, op_val, op_string, pre, post ) __GNU_EXTENSION ({ \ + volatile int old_val, new_val; \ + __asm__ __volatile__(pre \ + " l %0,0(%3)\n" \ + "0: lr %1,%0\n" \ + op_string " %1,%4\n" \ + " cs %0,%1,0(%3)\n" \ + " jl 0b\n" \ + post \ + : "=&d" (old_val), "=&d" (new_val), \ + "=m" (*ptr) \ + : "a" (ptr), "d" (op_val), \ + "m" (*ptr) \ + : "cc", "memory" ); \ + old_val; \ +}) + +#ifdef __s390x__ +#define __CSG_OLD_LOOP(ptr, op_val, op_string, pre, post) __GNU_EXTENSION ({ \ + long old_val, new_val; \ + __asm__ __volatile__(pre \ + " lg %0,0(%3)\n" \ + "0: lgr %1,%0\n" \ + op_string " %1,%4\n" \ + " csg %0,%1,0(%3)\n" \ + " jl 0b\n" \ + post \ + : "=&d" (old_val), "=&d" (new_val), \ + "=m" (*ptr) \ + : "a" (ptr), "d" (op_val), \ + "m" (*ptr) \ + : "cc", "memory" ); \ + old_val; \ +}) +#endif + +inline bool QBasicAtomicInt::ref() +{ + return __CS_LOOP(&_q_value, 1, "ar", "", "") != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + return __CS_LOOP(&_q_value, 1, "sr", "", "") != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + int retval; + __asm__ __volatile__( + " lr %0,%3\n" + " cs %0,%4,0(%2)\n" + " ipm %0\n" + " srl %0,28\n" + "0:" + : "=&d" (retval), "=m" (_q_value) + : "a" (&_q_value), "d" (expectedValue) , "d" (newValue), + "m" (_q_value) : "cc", "memory" ); + return retval == 0; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + int retval; + __asm__ __volatile__( + " lr %0,%3\n" + " cs %0,%4,0(%2)\n" + " ipm %0\n" + " srl %0,28\n" + "0:\n" + " bcr 15,0\n" + : "=&d" (retval), "=m" (_q_value) + : "a" (&_q_value), "d" (expectedValue) , "d" (newValue), + "m" (_q_value) : "cc", "memory" ); + return retval == 0; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + int retval; + __asm__ __volatile__( + " bcr 15,0\n" + " lr %0,%3\n" + " cs %0,%4,0(%2)\n" + " ipm %0\n" + " srl %0,28\n" + "0:" + : "=&d" (retval), "=m" (_q_value) + : "a" (&_q_value), "d" (expectedValue) , "d" (newValue), + "m" (_q_value) : "cc", "memory" ); + return retval == 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return __CS_OLD_LOOP(&_q_value, newValue, "lr", "", ""); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return __CS_OLD_LOOP(&_q_value, newValue, "lr", "", "bcr 15,0\n"); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return __CS_OLD_LOOP(&_q_value, newValue, "lr", "bcr 15,0\n", ""); +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return __CS_OLD_LOOP(&_q_value, valueToAdd, "ar", "", "bcr 15,0\n"); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + int retval; + +#ifndef __s390x__ + __asm__ __volatile__( + " lr %0,%3\n" + " cs %0,%4,0(%2)\n" + " ipm %0\n" + " srl %0,28\n" + "0:" + : "=&d" (retval), "=m" (_q_value) + : "a" (&_q_value), "d" (expectedValue) , "d" (newValue), + "m" (_q_value) : "cc", "memory" ); +#else + __asm__ __volatile__( + " lgr %0,%3\n" + " csg %0,%4,0(%2)\n" + " ipm %0\n" + " srl %0,28\n" + "0:" + : "=&d" (retval), "=m" (_q_value) + : "a" (&_q_value), "d" (expectedValue) , "d" (newValue), + "m" (_q_value) : "cc", "memory" ); +#endif + + return retval == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + int retval; + +#ifndef __s390x__ + __asm__ __volatile__( + " lr %0,%3\n" + " cs %0,%4,0(%2)\n" + " ipm %0\n" + " srl %0,28\n" + "0:\n" + " bcr 15,0\n" + : "=&d" (retval), "=m" (_q_value) + : "a" (&_q_value), "d" (expectedValue) , "d" (newValue), + "m" (_q_value) : "cc", "memory" ); +#else + __asm__ __volatile__( + " lgr %0,%3\n" + " csg %0,%4,0(%2)\n" + " ipm %0\n" + " srl %0,28\n" + "0:\n" + " bcr 15,0\n" + : "=&d" (retval), "=m" (_q_value) + : "a" (&_q_value), "d" (expectedValue) , "d" (newValue), + "m" (_q_value) : "cc", "memory" ); +#endif + + return retval == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + int retval; + +#ifndef __s390x__ + __asm__ __volatile__( + " bcr 15,0\n" + " lr %0,%3\n" + " cs %0,%4,0(%2)\n" + " ipm %0\n" + " srl %0,28\n" + "0:" + : "=&d" (retval), "=m" (_q_value) + : "a" (&_q_value), "d" (expectedValue) , "d" (newValue), + "m" (_q_value) : "cc", "memory" ); +#else + __asm__ __volatile__( + " bcr 15,0\n" + " lgr %0,%3\n" + " csg %0,%4,0(%2)\n" + " ipm %0\n" + " srl %0,28\n" + "0:" + : "=&d" (retval), "=m" (_q_value) + : "a" (&_q_value), "d" (expectedValue) , "d" (newValue), + "m" (_q_value) : "cc", "memory" ); +#endif + + return retval == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T* QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ +#ifndef __s390x__ + return (T*)__CS_OLD_LOOP(reinterpret_cast(_q_value), (int)newValue, "lr", + "", "bcr 15,0\n"); +#else + return (T*)__CSG_OLD_LOOP(reinterpret_cast(_q_value), (long)newValue, "lgr", + "", "bcr 15,0\n"); +#endif +} + +template +Q_INLINE_TEMPLATE T* QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ +#ifndef __s390x__ + return (T*)__CS_OLD_LOOP(reinterpret_cast(_q_value), (int)newValue, "lr", "", ""); +#else + return (T*)__CSG_OLD_LOOP(reinterpret_cast(_q_value), (long)newValue, "lgr", "", ""); +#endif +} + +template +Q_INLINE_TEMPLATE T* QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ +#ifndef __s390x__ + return (T*)__CS_OLD_LOOP(reinterpret_cast(_q_value), (int)newValue, "lr", + "bcr 15,0 \n", ""); +#else + return (T*)__CSG_OLD_LOOP(reinterpret_cast(_q_value), (long)newValue, "lgr", + "bcr 15,0\n", ""); +#endif +} + +template +Q_INLINE_TEMPLATE T* QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return fetchAndStoreAcquire(newValue); +} + + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +#undef __GNU_EXTENSION + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_S390_H diff --git a/qtinterface/qt4/Qt/qatomic_sh.h b/qtinterface/qt4/Qt/qatomic_sh.h new file mode 100644 index 0000000..89c08f3 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_sh.h @@ -0,0 +1,330 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_SH_H +#define QATOMIC_SH_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return false; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return false; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +extern Q_CORE_EXPORT volatile char qt_atomic_lock; +Q_CORE_EXPORT void qt_atomic_yield(int *count); + +inline int qt_atomic_tasb(volatile char *ptr) +{ + register int ret; + asm volatile("tas.b @%2\n" + "movt %0" + : "=&r"(ret), "=m"(*ptr) + : "r"(ptr) + : "cc", "memory"); + return ret; +} + +// Reference counting + +inline bool QBasicAtomicInt::ref() +{ + int count = 0; + while (qt_atomic_tasb(&qt_atomic_lock) == 0) + qt_atomic_yield(&count); + int originalValue = _q_value++; + qt_atomic_lock = 0; + return originalValue != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + int count = 0; + while (qt_atomic_tasb(&qt_atomic_lock) == 0) + qt_atomic_yield(&count); + int originalValue = _q_value--; + qt_atomic_lock = 0; + return originalValue != 1; +} + +// Test and set for integers + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + bool returnValue = false; + int count = 0; + while (qt_atomic_tasb(&qt_atomic_lock) == 0) + qt_atomic_yield(&count); + if (_q_value == expectedValue) { + _q_value = newValue; + returnValue = true; + } + qt_atomic_lock = 0; + return returnValue; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for integers + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + int count = 0; + while (qt_atomic_tasb(&qt_atomic_lock) == 0) + qt_atomic_yield(&count); + int originalValue = _q_value; + _q_value = newValue; + qt_atomic_lock = 0; + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for integers + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + int count = 0; + while (qt_atomic_tasb(&qt_atomic_lock) == 0) + qt_atomic_yield(&count); + int originalValue = _q_value; + _q_value += valueToAdd; + qt_atomic_lock = 0; + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +// Test and set for pointers + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + bool returnValue = false; + int count = 0; + while (qt_atomic_tasb(&qt_atomic_lock) == 0) + qt_atomic_yield(&count); + if (_q_value == expectedValue) { + _q_value = newValue; + returnValue = true; + } + qt_atomic_lock = 0; + return returnValue; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + int count = 0; + while (qt_atomic_tasb(&qt_atomic_lock) == 0) + qt_atomic_yield(&count); + T *originalValue = _q_value; + _q_value = newValue; + qt_atomic_lock = 0; + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + int count = 0; + while (qt_atomic_tasb(&qt_atomic_lock) == 0) + qt_atomic_yield(&count); + T *originalValue = (_q_value); + _q_value += valueToAdd; + qt_atomic_lock = 0; + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_SH_H diff --git a/qtinterface/qt4/Qt/qatomic_sh4a.h b/qtinterface/qt4/Qt/qatomic_sh4a.h new file mode 100644 index 0000000..d8a95bc --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_sh4a.h @@ -0,0 +1,537 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_SH4A_H +#define QATOMIC_SH4A_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + + +QT_END_NAMESPACE + +QT_END_HEADER + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +QT_BEGIN_NAMESPACE + +#if !defined(Q_CC_GNU) +# error "SH-4A support has not been added for this compiler" +#else + +inline bool QBasicAtomicInt::ref() +{ + register int newValue asm("r0"); + asm volatile("0:\n" + "movli.l @%[_q_value], %[newValue]\n" + "add #1,%[newValue]\n" + "movco.l %[newValue], @%[_q_value]\n" + "bf 0b\n" + : [newValue] "=&r" (newValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value) + : "cc", "memory"); + return newValue != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + register int newValue asm("r0"); + asm volatile("0:\n" + "movli.l @%[_q_value], %[newValue]\n" + "add #-1,%[newValue]\n" + "movco.l %[newValue], @%[_q_value]\n" + "bf 0b\n" + : [newValue] "=&r" (newValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value) + : "cc", "memory"); + return newValue != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + register int result; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "xor %[expectedValue], r0\n" + "cmp/eq #0, r0\n" + "bf/s 0f\n" + "mov r0, %[result]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "0:\n" + : [result] "=&r" (result), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return result == 0; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + register int result; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "xor %[expectedValue], r0\n" + "cmp/eq #0, r0\n" + "bf/s 0f\n" + "mov r0, %[result]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "synco\n" + "0:\n" + : [result] "=&r" (result), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return result == 0; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + register int result; + asm volatile("synco\n" + "0:\n" + "movli.l @%[_q_value], r0\n" + "xor %[expectedValue], r0\n" + "cmp/eq #0, r0\n" + "bf/s 0f\n" + "mov r0, %[result]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "0:\n" + : [result] "=&r" (result), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return result == 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + register int originalValue; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + register int originalValue; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "synco\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + register int originalValue; + asm volatile("synco\n" + "0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + register int originalValue; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "add %[valueToAdd], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [valueToAdd] "r" (valueToAdd) + : "r0", "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + register int originalValue; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "add %[valueToAdd], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "synco\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [valueToAdd] "r" (valueToAdd) + : "r0", "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + register int originalValue; + asm volatile("synco\n" + "0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "add %[valueToAdd], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [valueToAdd] "r" (valueToAdd) + : "r0", "cc", "memory"); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + register T *result; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "xor %[expectedValue], r0\n" + "cmp/eq #0, r0\n" + "bf/s 0f\n" + "mov r0, %[result]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "0:\n" + : [result] "=&r" (result), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + register T *result; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "xor %[expectedValue], r0\n" + "cmp/eq #0, r0\n" + "bf/s 0f\n" + "mov r0, %[result]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "synco\n" + "0:\n" + : [result] "=&r" (result), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + register T *result; + asm volatile("synco\n" + "0:\n" + "movli.l @%[_q_value], r0\n" + "xor %[expectedValue], r0\n" + "cmp/eq #0, r0\n" + "bf/s 0f\n" + "mov r0, %[result]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "0:\n" + : [result] "=&r" (result), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [expectedValue] "r" (expectedValue), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return result == 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return testAndSetAcquire(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + register T *originalValue; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + register T *originalValue; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "synco\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + register T *originalValue; + asm volatile("synco\n" + "0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "mov %[newValue], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [newValue] "r" (newValue) + : "r0", "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return fetchAndStoreAcquire(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + register T *originalValue; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "add %[valueToAdd], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [valueToAdd] "r" (valueToAdd * sizeof(T)) + : "r0", "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + register T *originalValue; + asm volatile("0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "add %[valueToAdd], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + "synco\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [valueToAdd] "r" (valueToAdd * sizeof(T)) + : "r0", "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + register T *originalValue; + asm volatile("synco\n" + "0:\n" + "movli.l @%[_q_value], r0\n" + "mov r0, %[originalValue]\n" + "add %[valueToAdd], r0\n" + "movco.l r0, @%[_q_value]\n" + "bf 0b\n" + : [originalValue] "=&r" (originalValue), + "+m" (_q_value) + : [_q_value] "r" (&_q_value), + [valueToAdd] "r" (valueToAdd * sizeof(T)) + : "r0", "cc", "memory"); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + return fetchAndAddAcquire(valueToAdd); +} + +#endif // Q_CC_GNU + +#endif // QATOMIC_SH4A_H diff --git a/qtinterface/qt4/Qt/qatomic_sparc.h b/qtinterface/qt4/Qt/qatomic_sparc.h new file mode 100644 index 0000000..e9024bb --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_sparc.h @@ -0,0 +1,525 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_SPARC_H +#define QATOMIC_SPARC_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#if defined(_LP64) + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_TEST_AND_SET_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +extern "C" { + Q_CORE_EXPORT int q_atomic_increment(volatile int *ptr); + Q_CORE_EXPORT int q_atomic_decrement(volatile int *ptr); + + Q_CORE_EXPORT int q_atomic_test_and_set_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_acquire_int(volatile int *ptr, + int expected, + int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_release_int(volatile int *ptr, + int expected, + int newval); + + Q_CORE_EXPORT int q_atomic_set_int(volatile int *ptr, int newval); + Q_CORE_EXPORT int q_atomic_fetch_and_store_acquire_int(volatile int *ptr, int newval); + Q_CORE_EXPORT int q_atomic_fetch_and_store_release_int(volatile int *ptr, int newval); + + Q_CORE_EXPORT int q_atomic_fetch_and_add_int(volatile int *ptr, int value); + Q_CORE_EXPORT int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int value); + Q_CORE_EXPORT int q_atomic_fetch_and_add_release_int(volatile int *ptr, int value); + + Q_CORE_EXPORT int q_atomic_test_and_set_ptr(volatile void *ptr, void *expected, void *newval); + Q_CORE_EXPORT int q_atomic_test_and_set_acquire_ptr(volatile void *ptr, + void *expected, + void *newval); + Q_CORE_EXPORT int q_atomic_test_and_set_release_ptr(volatile void *ptr, + void *expected, + void *newval); + + Q_CORE_EXPORT void *q_atomic_set_ptr(volatile void *ptr, void *newval); + Q_CORE_EXPORT void *q_atomic_fetch_and_store_acquire_ptr(volatile void *ptr, void *newval); + Q_CORE_EXPORT void *q_atomic_fetch_and_store_release_ptr(volatile void *ptr, void *newval); + + Q_CORE_EXPORT void *q_atomic_fetch_and_add_ptr(volatile void *ptr, int value); + Q_CORE_EXPORT void *q_atomic_fetch_and_add_acquire_ptr(volatile void *ptr, int value); + Q_CORE_EXPORT void *q_atomic_fetch_and_add_release_ptr(volatile void *ptr, int value); +} + +inline bool QBasicAtomicInt::ref() +{ + return fetchAndAddRelaxed(1) != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + return fetchAndAddRelaxed(-1) != 1; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_acquire_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_release_int(&_q_value, expectedValue, newValue) != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return q_atomic_test_and_set_acquire_int(&_q_value, expectedValue, newValue) != 0; +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return q_atomic_set_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return q_atomic_fetch_and_store_acquire_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return q_atomic_fetch_and_store_release_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return q_atomic_fetch_and_store_acquire_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int newValue) +{ + return q_atomic_fetch_and_add_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int newValue) +{ + return q_atomic_fetch_and_add_acquire_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int newValue) +{ + return q_atomic_fetch_and_add_release_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int newValue) +{ + return q_atomic_fetch_and_add_acquire_int(&_q_value, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_acquire_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_release_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_acquire_ptr(&_q_value, expectedValue, newValue) != 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return reinterpret_cast(q_atomic_set_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return reinterpret_cast(q_atomic_fetch_and_store_acquire_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return reinterpret_cast(q_atomic_fetch_and_store_release_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return reinterpret_cast(q_atomic_fetch_and_store_acquire_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_ptr(&_q_value, valueToAdd * sizeof(T))); +} + +template +Q_INLINE_TEMPLATE +T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_acquire_ptr(&_q_value, valueToAdd * sizeof(T))); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_release_ptr(&_q_value, valueToAdd * sizeof(T))); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_acquire_ptr(&_q_value, valueToAdd * sizeof(T))); +} + +#else + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return false; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return false; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +extern "C" { + Q_CORE_EXPORT int q_atomic_lock_int(volatile int *addr); + Q_CORE_EXPORT int q_atomic_lock_ptr(volatile void *addr); + Q_CORE_EXPORT void q_atomic_unlock(volatile void *addr, int value); + Q_CORE_EXPORT int q_atomic_set_int(volatile int *ptr, int newval); + Q_CORE_EXPORT void *q_atomic_set_ptr(volatile void *ptr, void *newval); +} // extern "C" + +inline bool QBasicAtomicInt::ref() +{ + const int val = q_atomic_lock_int(&_q_value); + q_atomic_unlock(&_q_value, val + 1); + return val != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + const int val = q_atomic_lock_int(&_q_value); + q_atomic_unlock(&_q_value, val - 1); + return val != 1; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + int val = q_atomic_lock_int(&_q_value); + if (val == expectedValue) { + q_atomic_unlock(&_q_value, newValue); + return true; + } + q_atomic_unlock(&_q_value, val); + return false; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return q_atomic_set_int(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + const int originalValue = q_atomic_lock_int(&_q_value); + q_atomic_unlock(&_q_value, originalValue + valueToAdd); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + T *val = reinterpret_cast(q_atomic_lock_ptr(&_q_value)); + if (val == expectedValue) { + q_atomic_unlock(&_q_value, reinterpret_cast(newValue)); + return true; + } + q_atomic_unlock(&_q_value, reinterpret_cast(val)); + return false; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return reinterpret_cast(q_atomic_set_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + T *originalValue = reinterpret_cast(q_atomic_lock_ptr(&_q_value)); + q_atomic_unlock(&_q_value, int(originalValue + valueToAdd)); + return originalValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +#endif // _LP64 + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_SPARC_H diff --git a/qtinterface/qt4/Qt/qatomic_symbian.h b/qtinterface/qt4/Qt/qatomic_symbian.h new file mode 100644 index 0000000..a2e7539 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_symbian.h @@ -0,0 +1,285 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_SYMBIAN_H +#define QATOMIC_SYMBIAN_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_SOMETIMES_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_SOMETIMES_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_SOMETIMES_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_SOMETIMES_NATIVE + +Q_CORE_EXPORT bool QBasicAtomicPointer_isTestAndSetNative(); +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return QBasicAtomicPointer_isTestAndSetNative(); } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_SOMETIMES_NATIVE + +Q_CORE_EXPORT bool QBasicAtomicPointer_isFetchAndStoreNative(); +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return QBasicAtomicPointer_isFetchAndStoreNative(); } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_SOMETIMES_NATIVE + +Q_CORE_EXPORT bool QBasicAtomicPointer_isFetchAndAddNative(); +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return QBasicAtomicPointer_isFetchAndAddNative(); } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +Q_CORE_EXPORT bool QBasicAtomicInt_testAndSetOrdered(volatile int *, int, int); +Q_CORE_EXPORT int QBasicAtomicInt_fetchAndStoreOrdered(volatile int *, int); +Q_CORE_EXPORT int QBasicAtomicInt_fetchAndAddOrdered(volatile int *, int); + +Q_CORE_EXPORT bool QBasicAtomicPointer_testAndSetOrdered(void * volatile *, void *, void *); +Q_CORE_EXPORT void *QBasicAtomicPointer_fetchAndStoreOrdered(void * volatile *, void *); +Q_CORE_EXPORT void *QBasicAtomicPointer_fetchAndAddOrdered(void * volatile *, qptrdiff); + +// Reference counting + +//LockedInc and LockedDec are machine coded for ARMv6 (and future proof) +inline bool QBasicAtomicInt::ref() +{ + int original = User::LockedInc((TInt&)_q_value); + return original != -1; +} + +inline bool QBasicAtomicInt::deref() +{ + int original = User::LockedDec((TInt&)_q_value); + return original != 1; +} + +// Test and set for integers + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return QBasicAtomicInt_testAndSetOrdered(&_q_value, expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for integers + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return QBasicAtomicInt_fetchAndStoreOrdered(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for integers + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return QBasicAtomicInt_fetchAndAddOrdered(&_q_value, valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +// Test and set for pointers + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + union { T * volatile * typed; void * volatile * voidp; } pointer; + pointer.typed = &_q_value; + return QBasicAtomicPointer_testAndSetOrdered(pointer.voidp, expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + union { T * volatile * typed; void * volatile * voidp; } pointer; + union { T *typed; void *voidp; } returnValue; + pointer.typed = &_q_value; + returnValue.voidp = QBasicAtomicPointer_fetchAndStoreOrdered(pointer.voidp, newValue); + return returnValue.typed; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + union { T * volatile *typed; void * volatile *voidp; } pointer; + union { T *typed; void *voidp; } returnValue; + pointer.typed = &_q_value; + returnValue.voidp = QBasicAtomicPointer_fetchAndAddOrdered(pointer.voidp, valueToAdd * sizeof(T)); + return returnValue.typed; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_SYMBIAN_H diff --git a/qtinterface/qt4/Qt/qatomic_vxworks.h b/qtinterface/qt4/Qt/qatomic_vxworks.h new file mode 100644 index 0000000..05f8009 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_vxworks.h @@ -0,0 +1,318 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_VXWORKS_H +#define QATOMIC_VXWORKS_H + +QT_BEGIN_HEADER + +#if defined(__ppc) +# include +#else // generic implementation with taskLock() + +#if 0 +// we don't want to include the system header here for two function prototypes, +// because it pulls in a _lot_ of stuff that pollutes the global namespace +# include +# include +#else +extern "C" int taskLock(); +extern "C" int taskUnlock(); +#endif + + + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return false; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return false; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_NOT_NATIVE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return false; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return false; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_NOT_NATIVE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return false; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return false; } + +// Reference counting + +inline bool QBasicAtomicInt::ref() +{ + taskLock(); + bool ret = (++_q_value != 0); + taskUnlock(); + return ret; +} + +inline bool QBasicAtomicInt::deref() +{ + taskLock(); + bool ret = (--_q_value != 0); + taskUnlock(); + return ret; +} + +// Test-and-set for integers + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + taskLock(); + if (_q_value == expectedValue) { + _q_value = newValue; + taskUnlock(); + return true; + } + taskUnlock(); + return false; +} + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch-and-store for integers + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + taskLock(); + int returnValue = _q_value; + _q_value = newValue; + taskUnlock(); + return returnValue; +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch-and-add for integers + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + taskLock(); + int originalValue = _q_value; + _q_value += valueToAdd; + taskUnlock(); + return originalValue; +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +// Test and set for pointers + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + taskLock(); + if (_q_value == expectedValue) { + _q_value = newValue; + taskUnlock(); + return true; + } + taskUnlock(); + return false; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +// Fetch and store for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + taskLock(); + T *returnValue = (_q_value); + _q_value = newValue; + taskUnlock(); + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +// Fetch and add for pointers + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + taskLock(); + T *returnValue = (_q_value); + _q_value += valueToAdd; + taskUnlock(); + return returnValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +#endif // generic implementation with taskLock() + +QT_END_HEADER + +#endif // QATOMIC_VXWORKS_H diff --git a/qtinterface/qt4/Qt/qatomic_windows.h b/qtinterface/qt4/Qt/qatomic_windows.h new file mode 100644 index 0000000..c56fb40 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_windows.h @@ -0,0 +1,496 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_WINDOWS_H +#define QATOMIC_WINDOWS_H + +#ifndef Q_CC_MSVC + +// Mingw and other GCC platforms get inline assembly + +# ifdef __i386__ +# include "QtCore/qatomic_i386.h" +# else +# include "QtCore/qatomic_x86_64.h" +# endif + +#else // Q_CC_MSVC + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef Q_OS_WINCE + +// use compiler intrinsics for all atomic functions +# define QT_INTERLOCKED_PREFIX _ +# define QT_INTERLOCKED_PROTOTYPE __cdecl +# define QT_INTERLOCKED_DECLARE_PROTOTYPES +# define QT_INTERLOCKED_INTRINSIC + +#else // Q_OS_WINCE + +# if _WIN32_WCE < 0x600 && defined(_X86_) +// For X86 Windows CE, include winbase.h to catch inline functions which +// override the regular definitions inside of coredll.dll. +// Though one could use the original version of Increment/Decrement, others are +// not exported at all. +# include + +// It's safer to remove the volatile and let the compiler add it as needed. +# define QT_INTERLOCKED_NO_VOLATILE + +# else // _WIN32_WCE >= 0x600 || !_X86_ + +# define QT_INTERLOCKED_PROTOTYPE __cdecl +# define QT_INTERLOCKED_DECLARE_PROTOTYPES + +# if _WIN32_WCE >= 0x600 +# if defined(_X86_) +# define QT_INTERLOCKED_PREFIX _ +# define QT_INTERLOCKED_INTRINSIC +# endif +# else +# define QT_INTERLOCKED_NO_VOLATILE +# endif + +# endif // _WIN32_WCE >= 0x600 || !_X86_ + +#endif // Q_OS_WINCE + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Prototype declaration + +#define QT_INTERLOCKED_CONCAT_I(prefix, suffix) \ + prefix ## suffix +#define QT_INTERLOCKED_CONCAT(prefix, suffix) \ + QT_INTERLOCKED_CONCAT_I(prefix, suffix) + +// MSVC intrinsics prefix function names with an underscore. Also, if platform +// SDK headers have been included, the Interlocked names may be defined as +// macros. +// To avoid double underscores, we paste the prefix with Interlocked first and +// then the remainder of the function name. +#define QT_INTERLOCKED_FUNCTION(name) \ + QT_INTERLOCKED_CONCAT( \ + QT_INTERLOCKED_CONCAT(QT_INTERLOCKED_PREFIX, Interlocked), name) + +#ifdef QT_INTERLOCKED_NO_VOLATILE +# define QT_INTERLOCKED_VOLATILE +# define QT_INTERLOCKED_REMOVE_VOLATILE(a) qt_interlocked_remove_volatile(a) +#else +# define QT_INTERLOCKED_VOLATILE volatile +# define QT_INTERLOCKED_REMOVE_VOLATILE(a) a +#endif + +#ifndef QT_INTERLOCKED_PREFIX +#define QT_INTERLOCKED_PREFIX +#endif + +#ifndef QT_INTERLOCKED_PROTOTYPE +#define QT_INTERLOCKED_PROTOTYPE +#endif + +#ifdef QT_INTERLOCKED_DECLARE_PROTOTYPES +#undef QT_INTERLOCKED_DECLARE_PROTOTYPES + +extern "C" { + + long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( Increment )(long QT_INTERLOCKED_VOLATILE *); + long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( Decrement )(long QT_INTERLOCKED_VOLATILE *); + long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( CompareExchange )(long QT_INTERLOCKED_VOLATILE *, long, long); + long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( Exchange )(long QT_INTERLOCKED_VOLATILE *, long); + long QT_INTERLOCKED_PROTOTYPE QT_INTERLOCKED_FUNCTION( ExchangeAdd )(long QT_INTERLOCKED_VOLATILE *, long); + +# if !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86) + void * QT_INTERLOCKED_FUNCTION( CompareExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *, void *); + void * QT_INTERLOCKED_FUNCTION( ExchangePointer )(void * QT_INTERLOCKED_VOLATILE *, void *); + __int64 QT_INTERLOCKED_FUNCTION( ExchangeAdd64 )(__int64 QT_INTERLOCKED_VOLATILE *, __int64); +# endif + +} + +#endif // QT_INTERLOCKED_DECLARE_PROTOTYPES + +#undef QT_INTERLOCKED_PROTOTYPE + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef QT_INTERLOCKED_INTRINSIC +#undef QT_INTERLOCKED_INTRINSIC + +# pragma intrinsic (_InterlockedIncrement) +# pragma intrinsic (_InterlockedDecrement) +# pragma intrinsic (_InterlockedExchange) +# pragma intrinsic (_InterlockedCompareExchange) +# pragma intrinsic (_InterlockedExchangeAdd) + +# if !defined(Q_OS_WINCE) && !defined(_M_IX86) +# pragma intrinsic (_InterlockedCompareExchangePointer) +# pragma intrinsic (_InterlockedExchangePointer) +# pragma intrinsic (_InterlockedExchangeAdd64) +# endif + +#endif // QT_INTERLOCKED_INTRINSIC + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Interlocked* replacement macros + +#define QT_INTERLOCKED_INCREMENT(value) \ + QT_INTERLOCKED_FUNCTION( Increment )( \ + QT_INTERLOCKED_REMOVE_VOLATILE( value ) ) + +#define QT_INTERLOCKED_DECREMENT(value) \ + QT_INTERLOCKED_FUNCTION( Decrement )( \ + QT_INTERLOCKED_REMOVE_VOLATILE( value ) ) + +#define QT_INTERLOCKED_COMPARE_EXCHANGE(value, newValue, expectedValue) \ + QT_INTERLOCKED_FUNCTION( CompareExchange )( \ + QT_INTERLOCKED_REMOVE_VOLATILE( value ), \ + newValue, \ + expectedValue ) + +#define QT_INTERLOCKED_EXCHANGE(value, newValue) \ + QT_INTERLOCKED_FUNCTION( Exchange )( \ + QT_INTERLOCKED_REMOVE_VOLATILE( value ), \ + newValue ) + +#define QT_INTERLOCKED_EXCHANGE_ADD(value, valueToAdd) \ + QT_INTERLOCKED_FUNCTION( ExchangeAdd )( \ + QT_INTERLOCKED_REMOVE_VOLATILE( value ), \ + valueToAdd ) + +#if defined(Q_OS_WINCE) || defined(__i386__) || defined(_M_IX86) + +# define QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(value, newValue, expectedValue) \ + reinterpret_cast( \ + QT_INTERLOCKED_FUNCTION( CompareExchange )( \ + QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \ + (long)( newValue ), \ + (long)( expectedValue ) )) + +# define QT_INTERLOCKED_EXCHANGE_POINTER(value, newValue) \ + QT_INTERLOCKED_FUNCTION( Exchange )( \ + QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \ + (quintptr)( newValue ) ) + +# define QT_INTERLOCKED_EXCHANGE_ADD_POINTER(value, valueToAdd) \ + QT_INTERLOCKED_FUNCTION( ExchangeAdd )( \ + QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \ + valueToAdd ) + +#else // !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86) + +# define QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(value, newValue, expectedValue) \ + QT_INTERLOCKED_FUNCTION( CompareExchangePointer )( \ + reinterpret_cast( QT_INTERLOCKED_REMOVE_VOLATILE( value ) ), \ + newValue, \ + expectedValue ) + +# define QT_INTERLOCKED_EXCHANGE_POINTER(value, newValue) \ + QT_INTERLOCKED_FUNCTION( ExchangePointer )( \ + reinterpret_cast( QT_INTERLOCKED_REMOVE_VOLATILE( value ) ), \ + newValue ) + +# define QT_INTERLOCKED_EXCHANGE_ADD_POINTER(value, valueToAdd) \ + QT_INTERLOCKED_FUNCTION( ExchangeAdd64 )( \ + QT_INTERLOCKED_REMOVE_VOLATILE( value ## _integral ), \ + valueToAdd ) + +#endif // !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86) + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_TEST_AND_SET_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_WAIT_FREE +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return true; } + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef QT_INTERLOCKED_NO_VOLATILE +template +Q_INLINE_TEMPLATE T *qt_interlocked_remove_volatile(T volatile *t) +{ + return const_cast(t); +} +#endif // !QT_INTERLOCKED_NO_VOLATILE + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +inline bool QBasicAtomicInt::ref() +{ + return QT_INTERLOCKED_INCREMENT(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + return QT_INTERLOCKED_DECREMENT(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + return QT_INTERLOCKED_COMPARE_EXCHANGE(&_q_value, newValue, expectedValue) + == expectedValue; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + return QT_INTERLOCKED_EXCHANGE(&_q_value, newValue); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + return QT_INTERLOCKED_EXCHANGE_ADD(&_q_value, valueToAdd); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(&_q_value, newValue, expectedValue) + == expectedValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T* newValue) +{ + return reinterpret_cast( + QT_INTERLOCKED_EXCHANGE_POINTER(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + return reinterpret_cast( + QT_INTERLOCKED_EXCHANGE_ADD_POINTER(&_q_value, valueToAdd * sizeof(T))); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Cleanup + +#undef QT_INTERLOCKED_CONCAT_I +#undef QT_INTERLOCKED_CONCAT +#undef QT_INTERLOCKED_FUNCTION +#undef QT_INTERLOCKED_PREFIX + +#undef QT_INTERLOCKED_NO_VOLATILE +#undef QT_INTERLOCKED_VOLATILE +#undef QT_INTERLOCKED_REMOVE_VOLATILE + +#undef QT_INTERLOCKED_INCREMENT +#undef QT_INTERLOCKED_DECREMENT +#undef QT_INTERLOCKED_COMPARE_EXCHANGE +#undef QT_INTERLOCKED_EXCHANGE +#undef QT_INTERLOCKED_EXCHANGE_ADD +#undef QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER +#undef QT_INTERLOCKED_EXCHANGE_POINTER +#undef QT_INTERLOCKED_EXCHANGE_ADD_POINTER + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // Q_CC_MSVC + +#endif // QATOMIC_WINDOWS_H diff --git a/qtinterface/qt4/Qt/qatomic_windowsce.h b/qtinterface/qt4/Qt/qatomic_windowsce.h new file mode 100644 index 0000000..98344b0 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_windowsce.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef WINDOWSCE_QATOMIC_H +#define WINDOWSCE_QATOMIC_H + +#include +QT_BEGIN_HEADER + +#if defined(QT_ARCH_WINDOWSCE) +#include "QtCore/qatomic_windows.h" +#endif + +QT_END_HEADER + +#endif // QATOMIC_ARCH_H + + diff --git a/qtinterface/qt4/Qt/qatomic_x86_64.h b/qtinterface/qt4/Qt/qatomic_x86_64.h new file mode 100644 index 0000000..54ebef7 --- /dev/null +++ b/qtinterface/qt4/Qt/qatomic_x86_64.h @@ -0,0 +1,363 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QATOMIC_X86_64_H +#define QATOMIC_X86_64_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isReferenceCountingNative() +{ return true; } +inline bool QBasicAtomicInt::isReferenceCountingWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_TEST_AND_SET_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isTestAndSetNative() +{ return true; } +inline bool QBasicAtomicInt::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndStoreNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE +#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_WAIT_FREE + +inline bool QBasicAtomicInt::isFetchAndAddNative() +{ return true; } +inline bool QBasicAtomicInt::isFetchAndAddWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isTestAndSetWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndStoreWaitFree() +{ return true; } + +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE +#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_WAIT_FREE + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddNative() +{ return true; } +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() +{ return true; } + +#if defined(Q_CC_GNU) || defined(Q_CC_INTEL) + +inline bool QBasicAtomicInt::ref() +{ + unsigned char ret; + asm volatile("lock\n" + "incl %0\n" + "setne %1" + : "=m" (_q_value), "=qm" (ret) + : "m" (_q_value) + : "memory"); + return ret != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + unsigned char ret; + asm volatile("lock\n" + "decl %0\n" + "setne %1" + : "=m" (_q_value), "=qm" (ret) + : "m" (_q_value) + : "memory"); + return ret != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) +{ + unsigned char ret; + asm volatile("lock\n" + "cmpxchgl %3,%2\n" + "sete %1\n" + : "=a" (newValue), "=qm" (ret), "+m" (_q_value) + : "r" (newValue), "0" (expectedValue) + : "memory"); + return ret != 0; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) +{ + asm volatile("xchgl %0,%1" + : "=r" (newValue), "+m" (_q_value) + : "0" (newValue) + : "memory"); + return newValue; +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) +{ + asm volatile("lock\n" + "xaddl %0,%1" + : "=r" (valueToAdd), "+m" (_q_value) + : "0" (valueToAdd) + : "memory"); + return valueToAdd; +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + unsigned char ret; + asm volatile("lock\n" + "cmpxchgq %3,%2\n" + "sete %1\n" + : "=a" (newValue), "=qm" (ret), "+m" (_q_value) + : "r" (newValue), "0" (expectedValue) + : "memory"); + return ret != 0; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + asm volatile("xchgq %0,%1" + : "=r" (newValue), "+m" (_q_value) + : "0" (newValue) + : "memory"); + return newValue; +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + asm volatile("lock\n" + "xaddq %0,%1" + : "=r" (valueToAdd), "+m" (_q_value) + : "0" (valueToAdd * sizeof(T)) + : "memory"); + return reinterpret_cast(valueToAdd); +} + +#else // !Q_CC_INTEL && !Q_CC_GNU + +extern "C" { + Q_CORE_EXPORT int q_atomic_test_and_set_int(volatile int *ptr, int expected, int newval); + Q_CORE_EXPORT int q_atomic_test_and_set_ptr(volatile void *ptr, void *expected, void *newval); + Q_CORE_EXPORT int q_atomic_increment(volatile int *ptr); + Q_CORE_EXPORT int q_atomic_decrement(volatile int *ptr); + Q_CORE_EXPORT int q_atomic_set_int(volatile int *ptr, int newval); + Q_CORE_EXPORT void *q_atomic_set_ptr(volatile void *ptr, void *newval); + Q_CORE_EXPORT int q_atomic_fetch_and_add_int(volatile int *ptr, int value); + Q_CORE_EXPORT void *q_atomic_fetch_and_add_ptr(volatile void *ptr, qptrdiff value); +} // extern "C" + +inline bool QBasicAtomicInt::ref() +{ + return q_atomic_increment(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::deref() +{ + return q_atomic_decrement(&_q_value) != 0; +} + +inline bool QBasicAtomicInt::testAndSetOrdered(int expected, int newval) +{ + return q_atomic_test_and_set_int(&_q_value, expected, newval) != 0; +} + +inline int QBasicAtomicInt::fetchAndStoreOrdered(int newval) +{ + return q_atomic_set_int(&_q_value, newval); +} + +inline int QBasicAtomicInt::fetchAndAddOrdered(int aValue) +{ + return q_atomic_fetch_and_add_int(&_q_value, aValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValue, T *newValue) +{ + return q_atomic_test_and_set_ptr(&_q_value, expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) +{ + return reinterpret_cast(q_atomic_set_ptr(&_q_value, newValue)); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueToAdd) +{ + return reinterpret_cast(q_atomic_fetch_and_add_ptr(&_q_value, valueToAdd * sizeof(T))); +} + +#endif // Q_CC_GNU || Q_CC_INTEL + +inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) +{ + return testAndSetOrdered(expectedValue, newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) +{ + return fetchAndStoreOrdered(newValue); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +template +Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) +{ + return fetchAndAddOrdered(valueToAdd); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QATOMIC_X86_64_H diff --git a/qtinterface/qt4/Qt/qaudio.h b/qtinterface/qt4/Qt/qaudio.h new file mode 100644 index 0000000..3d1dd1d --- /dev/null +++ b/qtinterface/qt4/Qt/qaudio.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QAUDIO_H +#define QAUDIO_H + + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +namespace QAudio +{ + enum Error { NoError, OpenError, IOError, UnderrunError, FatalError }; + enum State { ActiveState, SuspendedState, StoppedState, IdleState }; + enum Mode { AudioInput, AudioOutput }; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +Q_DECLARE_METATYPE(QAudio::Error) +Q_DECLARE_METATYPE(QAudio::State) +Q_DECLARE_METATYPE(QAudio::Mode) + +#endif // QAUDIO_H diff --git a/qtinterface/qt4/Qt/qaudiodeviceinfo.h b/qtinterface/qt4/Qt/qaudiodeviceinfo.h new file mode 100644 index 0000000..fd13ba9 --- /dev/null +++ b/qtinterface/qt4/Qt/qaudiodeviceinfo.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QAUDIODEVICEINFO_H +#define QAUDIODEVICEINFO_H + +#include +#include +#include +#include +#include +#include + +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class QAudioDeviceFactory; + +class QAudioDeviceInfoPrivate; +class Q_MULTIMEDIA_EXPORT QAudioDeviceInfo +{ + friend class QAudioDeviceFactory; + +public: + QAudioDeviceInfo(); + QAudioDeviceInfo(const QAudioDeviceInfo& other); + ~QAudioDeviceInfo(); + + QAudioDeviceInfo& operator=(const QAudioDeviceInfo& other); + + bool isNull() const; + + QString deviceName() const; + + bool isFormatSupported(const QAudioFormat &format) const; + QAudioFormat preferredFormat() const; + QAudioFormat nearestFormat(const QAudioFormat &format) const; + + QStringList supportedCodecs() const; + QList supportedFrequencies() const; + QList supportedChannels() const; + QList supportedSampleSizes() const; + QList supportedByteOrders() const; + QList supportedSampleTypes() const; + + static QAudioDeviceInfo defaultInputDevice(); + static QAudioDeviceInfo defaultOutputDevice(); + + static QList availableDevices(QAudio::Mode mode); + +private: + QAudioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode); + QString realm() const; + QByteArray handle() const; + QAudio::Mode mode() const; + + QSharedDataPointer d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +Q_DECLARE_METATYPE(QAudioDeviceInfo) + +#endif // QAUDIODEVICEINFO_H diff --git a/qtinterface/qt4/Qt/qaudioengine.h b/qtinterface/qt4/Qt/qaudioengine.h new file mode 100644 index 0000000..d63e453 --- /dev/null +++ b/qtinterface/qt4/Qt/qaudioengine.h @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QAUDIOENGINE_H +#define QAUDIOENGINE_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +class Q_MULTIMEDIA_EXPORT QAbstractAudioDeviceInfo : public QObject +{ + Q_OBJECT + +public: + virtual QAudioFormat preferredFormat() const = 0; + virtual bool isFormatSupported(const QAudioFormat &format) const = 0; + virtual QAudioFormat nearestFormat(const QAudioFormat &format) const = 0; + virtual QString deviceName() const = 0; + virtual QStringList codecList() = 0; + virtual QList frequencyList() = 0; + virtual QList channelsList() = 0; + virtual QList sampleSizeList() = 0; + virtual QList byteOrderList() = 0; + virtual QList sampleTypeList() = 0; +}; + +class Q_MULTIMEDIA_EXPORT QAbstractAudioOutput : public QObject +{ + Q_OBJECT + +public: + virtual QIODevice* start(QIODevice* device) = 0; + virtual void stop() = 0; + virtual void reset() = 0; + virtual void suspend() = 0; + virtual void resume() = 0; + virtual int bytesFree() const = 0; + virtual int periodSize() const = 0; + virtual void setBufferSize(int value) = 0; + virtual int bufferSize() const = 0; + virtual void setNotifyInterval(int milliSeconds) = 0; + virtual int notifyInterval() const = 0; + virtual qint64 processedUSecs() const = 0; + virtual qint64 elapsedUSecs() const = 0; + virtual QAudio::Error error() const = 0; + virtual QAudio::State state() const = 0; + virtual QAudioFormat format() const = 0; + +Q_SIGNALS: + void stateChanged(QAudio::State); + void notify(); +}; + +class Q_MULTIMEDIA_EXPORT QAbstractAudioInput : public QObject +{ + Q_OBJECT + +public: + virtual QIODevice* start(QIODevice* device) = 0; + virtual void stop() = 0; + virtual void reset() = 0; + virtual void suspend() = 0; + virtual void resume() = 0; + virtual int bytesReady() const = 0; + virtual int periodSize() const = 0; + virtual void setBufferSize(int value) = 0; + virtual int bufferSize() const = 0; + virtual void setNotifyInterval(int milliSeconds) = 0; + virtual int notifyInterval() const = 0; + virtual qint64 processedUSecs() const = 0; + virtual qint64 elapsedUSecs() const = 0; + virtual QAudio::Error error() const = 0; + virtual QAudio::State state() const = 0; + virtual QAudioFormat format() const = 0; + +Q_SIGNALS: + void stateChanged(QAudio::State); + void notify(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOENGINE_H diff --git a/qtinterface/qt4/Qt/qaudioengineplugin.h b/qtinterface/qt4/Qt/qaudioengineplugin.h new file mode 100644 index 0000000..37b0c73 --- /dev/null +++ b/qtinterface/qt4/Qt/qaudioengineplugin.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QAUDIOENGINEPLUGIN_H +#define QAUDIOENGINEPLUGIN_H + +#include +#include +#include + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + +struct Q_MULTIMEDIA_EXPORT QAudioEngineFactoryInterface : public QFactoryInterface +{ + virtual QList availableDevices(QAudio::Mode) const = 0; + virtual QAbstractAudioInput* createInput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; + virtual QAbstractAudioOutput* createOutput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; + virtual QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device, QAudio::Mode mode) = 0; +}; + +#define QAudioEngineFactoryInterface_iid \ + "com.nokia.qt.QAudioEngineFactoryInterface" +Q_DECLARE_INTERFACE(QAudioEngineFactoryInterface, QAudioEngineFactoryInterface_iid) + +class Q_MULTIMEDIA_EXPORT QAudioEnginePlugin : public QObject, public QAudioEngineFactoryInterface +{ + Q_OBJECT + Q_INTERFACES(QAudioEngineFactoryInterface:QFactoryInterface) + +public: + QAudioEnginePlugin(QObject *parent = 0); + ~QAudioEnginePlugin(); + + virtual QStringList keys() const = 0; + virtual QList availableDevices(QAudio::Mode) const = 0; + virtual QAbstractAudioInput* createInput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; + virtual QAbstractAudioOutput* createOutput(const QByteArray& device, const QAudioFormat& format = QAudioFormat()) = 0; + virtual QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device, QAudio::Mode mode) = 0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOENGINEPLUGIN_H diff --git a/qtinterface/qt4/Qt/qaudioformat.h b/qtinterface/qt4/Qt/qaudioformat.h new file mode 100644 index 0000000..d428637 --- /dev/null +++ b/qtinterface/qt4/Qt/qaudioformat.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QAUDIOFORMAT_H +#define QAUDIOFORMAT_H + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QAudioFormatPrivate; + +class Q_MULTIMEDIA_EXPORT QAudioFormat +{ +public: + enum SampleType { Unknown, SignedInt, UnSignedInt, Float }; + enum Endian { BigEndian = QSysInfo::BigEndian, LittleEndian = QSysInfo::LittleEndian }; + + QAudioFormat(); + QAudioFormat(const QAudioFormat &other); + ~QAudioFormat(); + + QAudioFormat& operator=(const QAudioFormat &other); + bool operator==(const QAudioFormat &other) const; + bool operator!=(const QAudioFormat &other) const; + + bool isValid() const; + + void setFrequency(int frequency); + int frequency() const; + + void setChannels(int channels); + int channels() const; + + void setSampleSize(int sampleSize); + int sampleSize() const; + + void setCodec(const QString &codec); + QString codec() const; + + void setByteOrder(QAudioFormat::Endian byteOrder); + QAudioFormat::Endian byteOrder() const; + + void setSampleType(QAudioFormat::SampleType sampleType); + QAudioFormat::SampleType sampleType() const; + +private: + QSharedDataPointer d; +}; + + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOFORMAT_H diff --git a/qtinterface/qt4/Qt/qaudioinput.h b/qtinterface/qt4/Qt/qaudioinput.h new file mode 100644 index 0000000..79aa080 --- /dev/null +++ b/qtinterface/qt4/Qt/qaudioinput.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QAUDIOINPUT_H +#define QAUDIOINPUT_H + +#include +#include + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QAbstractAudioInput; + +class Q_MULTIMEDIA_EXPORT QAudioInput : public QObject +{ + Q_OBJECT + +public: + explicit QAudioInput(const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); + explicit QAudioInput(const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); + ~QAudioInput(); + + QAudioFormat format() const; + + void start(QIODevice *device); + QIODevice* start(); + + void stop(); + void reset(); + void suspend(); + void resume(); + + void setBufferSize(int bytes); + int bufferSize() const; + + int bytesReady() const; + int periodSize() const; + + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + + QAudio::Error error() const; + QAudio::State state() const; + +Q_SIGNALS: + void stateChanged(QAudio::State); + void notify(); + +private: + Q_DISABLE_COPY(QAudioInput) + + QAbstractAudioInput* d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOINPUT_H diff --git a/qtinterface/qt4/Qt/qaudiooutput.h b/qtinterface/qt4/Qt/qaudiooutput.h new file mode 100644 index 0000000..a498c00 --- /dev/null +++ b/qtinterface/qt4/Qt/qaudiooutput.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtMultimedia module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QAUDIOOUTPUT_H +#define QAUDIOOUTPUT_H + +#include +#include + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Multimedia) + + +class QAbstractAudioOutput; + +class Q_MULTIMEDIA_EXPORT QAudioOutput : public QObject +{ + Q_OBJECT + +public: + explicit QAudioOutput(const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); + explicit QAudioOutput(const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format = QAudioFormat(), QObject *parent = 0); + ~QAudioOutput(); + + QAudioFormat format() const; + + void start(QIODevice *device); + QIODevice* start(); + + void stop(); + void reset(); + void suspend(); + void resume(); + + void setBufferSize(int bytes); + int bufferSize() const; + + int bytesFree() const; + int periodSize() const; + + void setNotifyInterval(int milliSeconds); + int notifyInterval() const; + + qint64 processedUSecs() const; + qint64 elapsedUSecs() const; + + QAudio::Error error() const; + QAudio::State state() const; + +Q_SIGNALS: + void stateChanged(QAudio::State); + void notify(); + +private: + Q_DISABLE_COPY(QAudioOutput) + + QAbstractAudioOutput* d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QAUDIOOUTPUT_H diff --git a/qtinterface/qt4/Qt/qauthenticator.h b/qtinterface/qt4/Qt/qauthenticator.h new file mode 100644 index 0000000..fdbe8dc --- /dev/null +++ b/qtinterface/qt4/Qt/qauthenticator.h @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtNetwork module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QAUTHENTICATOR_H +#define QAUTHENTICATOR_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Network) + +class QAuthenticatorPrivate; +class QUrl; + +class Q_NETWORK_EXPORT QAuthenticator +{ +public: + QAuthenticator(); + ~QAuthenticator(); + + QAuthenticator(const QAuthenticator &other); + QAuthenticator &operator=(const QAuthenticator &other); + + bool operator==(const QAuthenticator &other) const; + inline bool operator!=(const QAuthenticator &other) const { return !operator==(other); } + + QString user() const; + void setUser(const QString &user); + + QString password() const; + void setPassword(const QString &password); + + QString realm() const; + + bool isNull() const; + void detach(); +private: + friend class QAuthenticatorPrivate; + QAuthenticatorPrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qbasicatomic.h b/qtinterface/qt4/Qt/qbasicatomic.h new file mode 100644 index 0000000..b92f8e8 --- /dev/null +++ b/qtinterface/qt4/Qt/qbasicatomic.h @@ -0,0 +1,230 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBASICATOMIC_H +#define QBASICATOMIC_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class Q_CORE_EXPORT QBasicAtomicInt +{ +public: +#ifdef QT_ARCH_PARISC + int _q_lock[4]; +#endif +#if defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) + union { // needed for Q_BASIC_ATOMIC_INITIALIZER + volatile long _q_value; + }; +#else + volatile int _q_value; +#endif + + // Non-atomic API + inline bool operator==(int value) const + { + return _q_value == value; + } + + inline bool operator!=(int value) const + { + return _q_value != value; + } + + inline bool operator!() const + { + return _q_value == 0; + } + + inline operator int() const + { + return _q_value; + } + + inline QBasicAtomicInt &operator=(int value) + { +#ifdef QT_ARCH_PARISC + this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; +#endif + _q_value = value; + return *this; + } + + // Atomic API, implemented in qatomic_XXX.h + + static bool isReferenceCountingNative(); + static bool isReferenceCountingWaitFree(); + + bool ref(); + bool deref(); + + static bool isTestAndSetNative(); + static bool isTestAndSetWaitFree(); + + bool testAndSetRelaxed(int expectedValue, int newValue); + bool testAndSetAcquire(int expectedValue, int newValue); + bool testAndSetRelease(int expectedValue, int newValue); + bool testAndSetOrdered(int expectedValue, int newValue); + + static bool isFetchAndStoreNative(); + static bool isFetchAndStoreWaitFree(); + + int fetchAndStoreRelaxed(int newValue); + int fetchAndStoreAcquire(int newValue); + int fetchAndStoreRelease(int newValue); + int fetchAndStoreOrdered(int newValue); + + static bool isFetchAndAddNative(); + static bool isFetchAndAddWaitFree(); + + int fetchAndAddRelaxed(int valueToAdd); + int fetchAndAddAcquire(int valueToAdd); + int fetchAndAddRelease(int valueToAdd); + int fetchAndAddOrdered(int valueToAdd); +}; + +template +class QBasicAtomicPointer +{ +public: +#ifdef QT_ARCH_PARISC + int _q_lock[4]; +#endif +#if defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) + union { + T * volatile _q_value; +# if !defined(Q_OS_WINCE) && !defined(__i386__) && !defined(_M_IX86) + qint64 +# else + long +# endif + volatile _q_value_integral; + }; +#else + T * volatile _q_value; +#endif + + // Non-atomic API + inline bool operator==(T *value) const + { + return _q_value == value; + } + + inline bool operator!=(T *value) const + { + return !operator==(value); + } + + inline bool operator!() const + { + return operator==(0); + } + + inline operator T *() const + { + return _q_value; + } + + inline T *operator->() const + { + return _q_value; + } + + inline QBasicAtomicPointer &operator=(T *value) + { +#ifdef QT_ARCH_PARISC + this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1; +#endif + _q_value = value; + return *this; + } + + // Atomic API, implemented in qatomic_XXX.h + + static bool isTestAndSetNative(); + static bool isTestAndSetWaitFree(); + + bool testAndSetRelaxed(T *expectedValue, T *newValue); + bool testAndSetAcquire(T *expectedValue, T *newValue); + bool testAndSetRelease(T *expectedValue, T *newValue); + bool testAndSetOrdered(T *expectedValue, T *newValue); + + static bool isFetchAndStoreNative(); + static bool isFetchAndStoreWaitFree(); + + T *fetchAndStoreRelaxed(T *newValue); + T *fetchAndStoreAcquire(T *newValue); + T *fetchAndStoreRelease(T *newValue); + T *fetchAndStoreOrdered(T *newValue); + + static bool isFetchAndAddNative(); + static bool isFetchAndAddWaitFree(); + + T *fetchAndAddRelaxed(qptrdiff valueToAdd); + T *fetchAndAddAcquire(qptrdiff valueToAdd); + T *fetchAndAddRelease(qptrdiff valueToAdd); + T *fetchAndAddOrdered(qptrdiff valueToAdd); +}; + +#ifdef QT_ARCH_PARISC +# define Q_BASIC_ATOMIC_INITIALIZER(a) {{-1,-1,-1,-1},(a)} +#elif defined(QT_ARCH_WINDOWS) || defined(QT_ARCH_WINDOWSCE) +# define Q_BASIC_ATOMIC_INITIALIZER(a) { {(a)} } +#else +# define Q_BASIC_ATOMIC_INITIALIZER(a) { (a) } +#endif + +QT_END_NAMESPACE +QT_END_HEADER + +#if defined(QT_MOC) || defined(QT_BUILD_QMAKE) || defined(QT_RCC) || defined(QT_UIC) || defined(QT_BOOTSTRAPPED) +# include +#else +# include +#endif + +#endif // QBASIC_ATOMIC diff --git a/qtinterface/qt4/Qt/qbasictimer.h b/qtinterface/qt4/Qt/qbasictimer.h new file mode 100644 index 0000000..f1cd329 --- /dev/null +++ b/qtinterface/qt4/Qt/qbasictimer.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBASICTIMER_H +#define QBASICTIMER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QObject; + +class Q_CORE_EXPORT QBasicTimer +{ + int id; +public: + inline QBasicTimer() : id(0) {} + inline ~QBasicTimer() { if (id) stop(); } + + inline bool isActive() const { return id != 0; } + inline int timerId() const { return id; } + + void start(int msec, QObject *obj); + void stop(); +}; +Q_DECLARE_TYPEINFO(QBasicTimer, Q_MOVABLE_TYPE); + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBASICTIMER_H diff --git a/qtinterface/qt4/Qt/qbenchmark.h b/qtinterface/qt4/Qt/qbenchmark.h new file mode 100644 index 0000000..d0057bb --- /dev/null +++ b/qtinterface/qt4/Qt/qbenchmark.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBENCHMARK_H +#define QBENCHMARK_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Test) + +namespace QTest +{ + +// +// W A R N I N G +// ------------- +// +// The QBenchmarkIterationController class is not a part of the +// QTestlib API. It exists purely as an implementation detail. +// +// +class Q_TESTLIB_EXPORT QBenchmarkIterationController +{ +public: + enum RunMode { RepeatUntilValidMeasurement, RunOnce }; + QBenchmarkIterationController(); + QBenchmarkIterationController(RunMode runMode); + ~QBenchmarkIterationController(); + bool isDone(); + void next(); + int i; +}; + +} + +#define QBENCHMARK \ + for (QTest::QBenchmarkIterationController __iteration_controller; \ + __iteration_controller.isDone() == false; __iteration_controller.next()) + +#define QBENCHMARK_ONCE \ + for (QTest::QBenchmarkIterationController __iteration_controller(QTest::QBenchmarkIterationController::RunOnce); \ + __iteration_controller.isDone() == false; __iteration_controller.next()) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBENCHMARK_H diff --git a/qtinterface/qt4/Qt/qbitarray.h b/qtinterface/qt4/Qt/qbitarray.h new file mode 100644 index 0000000..25ac433 --- /dev/null +++ b/qtinterface/qt4/Qt/qbitarray.h @@ -0,0 +1,174 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBITARRAY_H +#define QBITARRAY_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QBitRef; +class Q_CORE_EXPORT QBitArray +{ + friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QBitArray &); + friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QBitArray &); + friend Q_CORE_EXPORT uint qHash(const QBitArray &key); + QByteArray d; + +public: + inline QBitArray() {} + explicit QBitArray(int size, bool val = false); + QBitArray(const QBitArray &other) : d(other.d) {} + inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; } + + inline int size() const { return (d.size() << 3) - *d.constData(); } + inline int count() const { return (d.size() << 3) - *d.constData(); } + int count(bool on) const; + // ### Qt 5: Store the number of set bits separately + + inline bool isEmpty() const { return d.isEmpty(); } + inline bool isNull() const { return d.isNull(); } + + void resize(int size); + + inline void detach() { d.detach(); } + inline bool isDetached() const { return d.isDetached(); } + inline void clear() { d.clear(); } + + bool testBit(int i) const; + void setBit(int i); + void setBit(int i, bool val); + void clearBit(int i); + bool toggleBit(int i); + + bool at(int i) const; + QBitRef operator[](int i); + bool operator[](int i) const; + QBitRef operator[](uint i); + bool operator[](uint i) const; + + QBitArray& operator&=(const QBitArray &); + QBitArray& operator|=(const QBitArray &); + QBitArray& operator^=(const QBitArray &); + QBitArray operator~() const; + + inline bool operator==(const QBitArray& a) const { return d == a.d; } + inline bool operator!=(const QBitArray& a) const { return d != a.d; } + + inline bool fill(bool val, int size = -1); + void fill(bool val, int first, int last); + + inline void truncate(int pos) { if (pos < size()) resize(pos); } + +public: + typedef QByteArray::DataPtr DataPtr; + inline DataPtr &data_ptr() { return d.data_ptr(); } +}; + +inline bool QBitArray::fill(bool aval, int asize) +{ *this = QBitArray((asize < 0 ? this->size() : asize), aval); return true; } + +Q_CORE_EXPORT QBitArray operator&(const QBitArray &, const QBitArray &); +Q_CORE_EXPORT QBitArray operator|(const QBitArray &, const QBitArray &); +Q_CORE_EXPORT QBitArray operator^(const QBitArray &, const QBitArray &); + +inline bool QBitArray::testBit(int i) const +{ Q_ASSERT(i >= 0 && i < size()); + return (*(reinterpret_cast(d.constData())+1+(i>>3)) & (1 << (i & 7))) != 0; } + +inline void QBitArray::setBit(int i) +{ Q_ASSERT(i >= 0 && i < size()); + *(reinterpret_cast(d.data())+1+(i>>3)) |= uchar(1 << (i & 7)); } + +inline void QBitArray::clearBit(int i) +{ Q_ASSERT(i >= 0 && i < size()); + *(reinterpret_cast(d.data())+1+(i>>3)) &= ~uchar(1 << (i & 7)); } + +inline void QBitArray::setBit(int i, bool val) +{ if (val) setBit(i); else clearBit(i); } + +inline bool QBitArray::toggleBit(int i) +{ Q_ASSERT(i >= 0 && i < size()); + uchar b = uchar(1<<(i&7)); uchar* p = reinterpret_cast(d.data())+1+(i>>3); + uchar c = uchar(*p&b); *p^=b; return c!=0; } + +inline bool QBitArray::operator[](int i) const { return testBit(i); } +inline bool QBitArray::operator[](uint i) const { return testBit(i); } +inline bool QBitArray::at(int i) const { return testBit(i); } + +class Q_CORE_EXPORT QBitRef +{ +private: + QBitArray& a; + int i; + inline QBitRef(QBitArray& array, int idx) : a(array), i(idx) {} + friend class QBitArray; +public: + inline operator bool() const { return a.testBit(i); } + inline bool operator!() const { return !a.testBit(i); } + QBitRef& operator=(const QBitRef& val) { a.setBit(i, val); return *this; } + QBitRef& operator=(bool val) { a.setBit(i, val); return *this; } +}; + +inline QBitRef QBitArray::operator[](int i) +{ Q_ASSERT(i >= 0); return QBitRef(*this, i); } +inline QBitRef QBitArray::operator[](uint i) +{ return QBitRef(*this, i); } + + +#ifndef QT_NO_DATASTREAM +Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QBitArray &); +Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QBitArray &); +#endif + +Q_DECLARE_TYPEINFO(QBitArray, Q_MOVABLE_TYPE); +Q_DECLARE_SHARED(QBitArray) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBITARRAY_H diff --git a/qtinterface/qt4/Qt/qbitmap.h b/qtinterface/qt4/Qt/qbitmap.h new file mode 100644 index 0000000..39ae209 --- /dev/null +++ b/qtinterface/qt4/Qt/qbitmap.h @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBITMAP_H +#define QBITMAP_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QVariant; + +class Q_GUI_EXPORT QBitmap : public QPixmap +{ +public: + QBitmap(); + QBitmap(const QPixmap &); + QBitmap(int w, int h); + explicit QBitmap(const QSize &); + explicit QBitmap(const QString &fileName, const char *format=0); + ~QBitmap(); + + QBitmap &operator=(const QPixmap &); + operator QVariant() const; + + inline void clear() { fill(Qt::color0); } + + static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor); + static QBitmap fromData(const QSize &size, const uchar *bits, + QImage::Format monoFormat = QImage::Format_MonoLSB); + + QBitmap transformed(const QMatrix &) const; + QBitmap transformed(const QTransform &matrix) const; +#ifdef QT3_SUPPORT + inline QT3_SUPPORT_CONSTRUCTOR QBitmap(int w, int h, bool clear); + inline QT3_SUPPORT_CONSTRUCTOR QBitmap(const QSize &, bool clear); + QT3_SUPPORT_CONSTRUCTOR QBitmap(int w, int h, const uchar *bits, bool isXbitmap=false); + QT3_SUPPORT_CONSTRUCTOR QBitmap(const QSize &, const uchar *bits, bool isXbitmap=false); + inline QT3_SUPPORT QBitmap xForm(const QMatrix &matrix) const { return transformed(QTransform(matrix)); } + QT3_SUPPORT_CONSTRUCTOR QBitmap(const QImage &image) { *this = fromImage(image); } + QT3_SUPPORT QBitmap &operator=(const QImage &image) { *this = fromImage(image); return *this; } +#endif + + typedef QExplicitlySharedDataPointer DataPtr; +}; +Q_DECLARE_SHARED(QBitmap) + +#ifdef QT3_SUPPORT +inline QBitmap::QBitmap(int w, int h, bool clear) + : QPixmap(QSize(w, h), 1) +{ + if (clear) this->clear(); +} + +inline QBitmap::QBitmap(const QSize &size, bool clear) + : QPixmap(size, 1) +{ + if (clear) this->clear(); +} +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBITMAP_H diff --git a/qtinterface/qt4/Qt/qboxlayout.h b/qtinterface/qt4/Qt/qboxlayout.h new file mode 100644 index 0000000..06ace10 --- /dev/null +++ b/qtinterface/qt4/Qt/qboxlayout.h @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBOXLAYOUT_H +#define QBOXLAYOUT_H + +#include +#ifdef QT_INCLUDE_COMPAT +#include +#endif + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QBoxLayoutPrivate; + +class Q_GUI_EXPORT QBoxLayout : public QLayout +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QBoxLayout) +public: + enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop, + Down = TopToBottom, Up = BottomToTop }; + + explicit QBoxLayout(Direction, QWidget *parent = 0); + +#ifdef QT3_SUPPORT + QT3_SUPPORT_CONSTRUCTOR QBoxLayout(QWidget *parent, Direction, int border = 0, int spacing = -1, + const char *name = 0); + QT3_SUPPORT_CONSTRUCTOR QBoxLayout(QLayout *parentLayout, Direction, int spacing = -1, + const char *name = 0); + QT3_SUPPORT_CONSTRUCTOR QBoxLayout(Direction, int spacing, const char *name = 0); +#endif + ~QBoxLayout(); + + Direction direction() const; + void setDirection(Direction); + + void addSpacing(int size); + void addStretch(int stretch = 0); + void addSpacerItem(QSpacerItem *spacerItem); + void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = 0); + void addLayout(QLayout *layout, int stretch = 0); + void addStrut(int); + void addItem(QLayoutItem *); + + void insertSpacing(int index, int size); + void insertStretch(int index, int stretch = 0); + void insertSpacerItem(int index, QSpacerItem *spacerItem); + void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = 0); + void insertLayout(int index, QLayout *layout, int stretch = 0); + + int spacing() const; + void setSpacing(int spacing); + + bool setStretchFactor(QWidget *w, int stretch); + bool setStretchFactor(QLayout *l, int stretch); + void setStretch(int index, int stretch); + int stretch(int index) const; + + QSize sizeHint() const; + QSize minimumSize() const; + QSize maximumSize() const; + + bool hasHeightForWidth() const; + int heightForWidth(int) const; + int minimumHeightForWidth(int) const; + + Qt::Orientations expandingDirections() const; + void invalidate(); + QLayoutItem *itemAt(int) const; + QLayoutItem *takeAt(int); + int count() const; + void setGeometry(const QRect&); +#ifdef QT3_SUPPORT + inline QT3_SUPPORT int findWidget(QWidget* w) {return indexOf(w);} +#endif +protected: + // ### Qt 5: make public + void insertItem(int index, QLayoutItem *); + +private: + Q_DISABLE_COPY(QBoxLayout) +}; + +class Q_GUI_EXPORT QHBoxLayout : public QBoxLayout +{ + Q_OBJECT +public: + QHBoxLayout(); + explicit QHBoxLayout(QWidget *parent); + ~QHBoxLayout(); + +#ifdef QT3_SUPPORT + QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QWidget *parent, int border, + int spacing = -1, const char *name = 0); + QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QLayout *parentLayout, + int spacing = -1, const char *name = 0); + QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(int spacing, const char *name = 0); +#endif + +private: + Q_DISABLE_COPY(QHBoxLayout) +}; + +class Q_GUI_EXPORT QVBoxLayout : public QBoxLayout +{ + Q_OBJECT +public: + QVBoxLayout(); + explicit QVBoxLayout(QWidget *parent); + ~QVBoxLayout(); + +#ifdef QT3_SUPPORT + QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QWidget *parent, int border, + int spacing = -1, const char *name = 0); + QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QLayout *parentLayout, + int spacing = -1, const char *name = 0); + QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(int spacing, const char *name = 0); +#endif + +private: + Q_DISABLE_COPY(QVBoxLayout) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBOXLAYOUT_H diff --git a/qtinterface/qt4/Qt/qbrush.h b/qtinterface/qt4/Qt/qbrush.h new file mode 100644 index 0000000..6ffb70a --- /dev/null +++ b/qtinterface/qt4/Qt/qbrush.h @@ -0,0 +1,332 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBRUSH_H +#define QBRUSH_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(Q_OS_VXWORKS) +# if defined(m_data) +# undef m_data +# endif +# if defined(m_type) +# undef m_type +# endif +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +struct QBrushData; +class QPixmap; +class QGradient; +class QVariant; +struct QBrushDataPointerDeleter; + +class Q_GUI_EXPORT QBrush +{ +public: + QBrush(); + QBrush(Qt::BrushStyle bs); + QBrush(const QColor &color, Qt::BrushStyle bs=Qt::SolidPattern); + QBrush(Qt::GlobalColor color, Qt::BrushStyle bs=Qt::SolidPattern); + + QBrush(const QColor &color, const QPixmap &pixmap); + QBrush(Qt::GlobalColor color, const QPixmap &pixmap); + QBrush(const QPixmap &pixmap); + QBrush(const QImage &image); + + QBrush(const QBrush &brush); + + QBrush(const QGradient &gradient); + + ~QBrush(); + QBrush &operator=(const QBrush &brush); + operator QVariant() const; + + inline Qt::BrushStyle style() const; + void setStyle(Qt::BrushStyle); + + inline const QMatrix &matrix() const; + void setMatrix(const QMatrix &mat); + + inline QTransform transform() const; + void setTransform(const QTransform &); + + QPixmap texture() const; + void setTexture(const QPixmap &pixmap); + + QImage textureImage() const; + void setTextureImage(const QImage &image); + + inline const QColor &color() const; + void setColor(const QColor &color); + inline void setColor(Qt::GlobalColor color); + + const QGradient *gradient() const; + + bool isOpaque() const; + + bool operator==(const QBrush &b) const; + inline bool operator!=(const QBrush &b) const { return !(operator==(b)); } + +#ifdef QT3_SUPPORT + inline QT3_SUPPORT operator const QColor&() const; + QT3_SUPPORT QPixmap *pixmap() const; + inline QT3_SUPPORT void setPixmap(const QPixmap &pixmap) { setTexture(pixmap); } +#endif + +private: +#if defined(Q_WS_X11) + friend class QX11PaintEngine; +#endif + friend class QRasterPaintEngine; + friend class QRasterPaintEnginePrivate; + friend struct QSpanData; + friend class QPainter; + friend bool Q_GUI_EXPORT qHasPixmapTexture(const QBrush& brush); + void detach(Qt::BrushStyle newStyle); + void init(const QColor &color, Qt::BrushStyle bs); + QScopedPointer d; + void cleanUp(QBrushData *x); + +public: + inline bool isDetached() const; + typedef QScopedPointer DataPtr; + inline DataPtr &data_ptr() { return d; } +}; + +inline void QBrush::setColor(Qt::GlobalColor acolor) +{ setColor(QColor(acolor)); } + +Q_DECLARE_TYPEINFO(QBrush, Q_MOVABLE_TYPE); +Q_DECLARE_SHARED(QBrush) + +/***************************************************************************** + QBrush stream functions + *****************************************************************************/ + +#ifndef QT_NO_DATASTREAM +Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QBrush &); +Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QBrush &); +#endif + +#ifndef QT_NO_DEBUG_STREAM +Q_GUI_EXPORT QDebug operator<<(QDebug, const QBrush &); +#endif + +struct QBrushData +{ + QAtomicInt ref; + Qt::BrushStyle style; + QColor color; + QTransform transform; +}; + +inline Qt::BrushStyle QBrush::style() const { return d->style; } +inline const QColor &QBrush::color() const { return d->color; } +inline const QMatrix &QBrush::matrix() const { return d->transform.toAffine(); } +inline QTransform QBrush::transform() const { return d->transform; } +inline bool QBrush::isDetached() const { return d->ref == 1; } + +#ifdef QT3_SUPPORT +inline QBrush::operator const QColor&() const { return d->color; } +#endif + + +/******************************************************************************* + * QGradients + */ +class QGradientPrivate; + +typedef QPair QGradientStop; +typedef QVector QGradientStops; + +class Q_GUI_EXPORT QGradient +{ + Q_GADGET + Q_ENUMS(Type Spread CoordinateMode) +public: + enum Type { + LinearGradient, + RadialGradient, + ConicalGradient, + NoGradient + }; + + enum Spread { + PadSpread, + ReflectSpread, + RepeatSpread + }; + + enum CoordinateMode { + LogicalMode, + StretchToDeviceMode, + ObjectBoundingMode + }; + + enum InterpolationMode { + ColorInterpolation, + ComponentInterpolation + }; + + QGradient(); + + Type type() const { return m_type; } + + inline void setSpread(Spread spread); + Spread spread() const { return m_spread; } + + void setColorAt(qreal pos, const QColor &color); + + void setStops(const QGradientStops &stops); + QGradientStops stops() const; + + CoordinateMode coordinateMode() const; + void setCoordinateMode(CoordinateMode mode); + + InterpolationMode interpolationMode() const; + void setInterpolationMode(InterpolationMode mode); + + bool operator==(const QGradient &gradient) const; + inline bool operator!=(const QGradient &other) const + { return !operator==(other); } + + bool operator==(const QGradient &gradient); // ### Qt 5: remove + +private: + friend class QLinearGradient; + friend class QRadialGradient; + friend class QConicalGradient; + + Type m_type; + Spread m_spread; + QGradientStops m_stops; + union { + struct { + qreal x1, y1, x2, y2; + } linear; + struct { + qreal cx, cy, fx, fy, radius; + } radial; + struct { + qreal cx, cy, angle; + } conical; + } m_data; + void *dummy; +}; + +inline void QGradient::setSpread(Spread aspread) +{ m_spread = aspread; } + +class Q_GUI_EXPORT QLinearGradient : public QGradient +{ +public: + QLinearGradient(); + QLinearGradient(const QPointF &start, const QPointF &finalStop); + QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, qreal yFinalStop); + + QPointF start() const; + void setStart(const QPointF &start); + inline void setStart(qreal x, qreal y) { setStart(QPointF(x, y)); } + + QPointF finalStop() const; + void setFinalStop(const QPointF &stop); + inline void setFinalStop(qreal x, qreal y) { setFinalStop(QPointF(x, y)); } +}; + + +class Q_GUI_EXPORT QRadialGradient : public QGradient +{ +public: + QRadialGradient(); + QRadialGradient(const QPointF ¢er, qreal radius, const QPointF &focalPoint); + QRadialGradient(qreal cx, qreal cy, qreal radius, qreal fx, qreal fy); + + QRadialGradient(const QPointF ¢er, qreal radius); + QRadialGradient(qreal cx, qreal cy, qreal radius); + + QPointF center() const; + void setCenter(const QPointF ¢er); + inline void setCenter(qreal x, qreal y) { setCenter(QPointF(x, y)); } + + QPointF focalPoint() const; + void setFocalPoint(const QPointF &focalPoint); + inline void setFocalPoint(qreal x, qreal y) { setFocalPoint(QPointF(x, y)); } + + qreal radius() const; + void setRadius(qreal radius); +}; + + +class Q_GUI_EXPORT QConicalGradient : public QGradient +{ +public: + QConicalGradient(); + QConicalGradient(const QPointF ¢er, qreal startAngle); + QConicalGradient(qreal cx, qreal cy, qreal startAngle); + + QPointF center() const; + void setCenter(const QPointF ¢er); + inline void setCenter(qreal x, qreal y) { setCenter(QPointF(x, y)); } + + qreal angle() const; + void setAngle(qreal angle); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBRUSH_H diff --git a/qtinterface/qt4/Qt/qbuffer.h b/qtinterface/qt4/Qt/qbuffer.h new file mode 100644 index 0000000..a0dcef5 --- /dev/null +++ b/qtinterface/qt4/Qt/qbuffer.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBUFFER_H +#define QBUFFER_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QObject; +class QBufferPrivate; + +class Q_CORE_EXPORT QBuffer : public QIODevice +{ +#ifndef QT_NO_QOBJECT + Q_OBJECT +#endif + +public: +#ifndef QT_NO_QOBJECT + explicit QBuffer(QObject *parent = 0); + QBuffer(QByteArray *buf, QObject *parent = 0); +#else + QBuffer(); + explicit QBuffer(QByteArray *buf); +#endif + ~QBuffer(); + + QByteArray &buffer(); + const QByteArray &buffer() const; + void setBuffer(QByteArray *a); + + void setData(const QByteArray &data); + inline void setData(const char *data, int len); + const QByteArray &data() const; + + bool open(OpenMode openMode); + + void close(); + qint64 size() const; + qint64 pos() const; + bool seek(qint64 off); + bool atEnd() const; + bool canReadLine() const; + +protected: +#ifndef QT_NO_QOBJECT + void connectNotify(const char*); + void disconnectNotify(const char*); +#endif + qint64 readData(char *data, qint64 maxlen); + qint64 writeData(const char *data, qint64 len); + +private: + Q_DECLARE_PRIVATE(QBuffer) + Q_DISABLE_COPY(QBuffer) + + Q_PRIVATE_SLOT(d_func(), void _q_emitSignals()) +}; + +inline void QBuffer::setData(const char *adata, int alen) +{ setData(QByteArray(adata, alen)); } + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBUFFER_H diff --git a/qtinterface/qt4/Qt/qbuttongroup.h b/qtinterface/qt4/Qt/qbuttongroup.h new file mode 100644 index 0000000..bf9cf2b --- /dev/null +++ b/qtinterface/qt4/Qt/qbuttongroup.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBUTTONGROUP_H +#define QBUTTONGROUP_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_BUTTONGROUP + +class QAbstractButton; +class QAbstractButtonPrivate; +class QButtonGroupPrivate; + +class Q_GUI_EXPORT QButtonGroup : public QObject +{ + Q_OBJECT + + Q_PROPERTY(bool exclusive READ exclusive WRITE setExclusive) +public: + explicit QButtonGroup(QObject *parent = 0); + ~QButtonGroup(); + + void setExclusive(bool); + bool exclusive() const; + + void addButton(QAbstractButton *); + void addButton(QAbstractButton *, int id); + void removeButton(QAbstractButton *); + + QList buttons() const; + + QAbstractButton * checkedButton() const; + // no setter on purpose! + + QAbstractButton *button(int id) const; + void setId(QAbstractButton *button, int id); + int id(QAbstractButton *button) const; + int checkedId() const; + +Q_SIGNALS: + void buttonClicked(QAbstractButton *); + void buttonClicked(int); + void buttonPressed(QAbstractButton *); + void buttonPressed(int); + void buttonReleased(QAbstractButton *); + void buttonReleased(int); + +#ifdef QT3_SUPPORT +public: + inline QT3_SUPPORT void insert(QAbstractButton *b) { addButton(b); } + inline QT3_SUPPORT void remove(QAbstractButton *b) { removeButton(b); } +#endif + +private: + Q_DISABLE_COPY(QButtonGroup) + Q_DECLARE_PRIVATE(QButtonGroup) + friend class QAbstractButton; + friend class QAbstractButtonPrivate; +}; + +#endif // QT_NO_BUTTONGROUP + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBUTTONGROUP_H diff --git a/qtinterface/qt4/Qt/qbytearray.h b/qtinterface/qt4/Qt/qbytearray.h new file mode 100644 index 0000000..f7c0cd3 --- /dev/null +++ b/qtinterface/qt4/Qt/qbytearray.h @@ -0,0 +1,596 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBYTEARRAY_H +#define QBYTEARRAY_H + +#include +#include + +#include +#include + +#ifdef truncate +#error qbytearray.h must be included before any header file that defines truncate +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +/***************************************************************************** + Safe and portable C string functions; extensions to standard string.h + *****************************************************************************/ + +Q_CORE_EXPORT char *qstrdup(const char *); + +inline uint qstrlen(const char *str) +{ return str ? uint(strlen(str)) : 0; } + +inline uint qstrnlen(const char *str, uint maxlen) +{ + uint length = 0; + if (str) { + while (length < maxlen && *str++) + length++; + } + return length; +} + +Q_CORE_EXPORT char *qstrcpy(char *dst, const char *src); +Q_CORE_EXPORT char *qstrncpy(char *dst, const char *src, uint len); + +Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2); +Q_CORE_EXPORT int qstrcmp(const QByteArray &str1, const QByteArray &str2); +Q_CORE_EXPORT int qstrcmp(const QByteArray &str1, const char *str2); +static inline int qstrcmp(const char *str1, const QByteArray &str2) +{ return -qstrcmp(str2, str1); } + +inline int qstrncmp(const char *str1, const char *str2, uint len) +{ + return (str1 && str2) ? strncmp(str1, str2, len) + : (str1 ? 1 : (str2 ? -1 : 0)); +} +Q_CORE_EXPORT int qstricmp(const char *, const char *); +Q_CORE_EXPORT int qstrnicmp(const char *, const char *, uint len); + +// implemented in qvsnprintf.cpp +Q_CORE_EXPORT int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap); +Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt, ...); + +#ifdef QT3_SUPPORT +inline QT3_SUPPORT void *qmemmove(void *dst, const void *src, uint len) +{ return memmove(dst, src, len); } +inline QT3_SUPPORT uint cstrlen(const char *str) +{ return uint(strlen(str)); } +inline QT3_SUPPORT char *cstrcpy(char *dst, const char *src) +{ return qstrcpy(dst,src); } +inline QT3_SUPPORT int cstrcmp(const char *str1, const char *str2) +{ return strcmp(str1,str2); } +inline QT3_SUPPORT int cstrncmp(const char *str1, const char *str2, uint len) +{ return strncmp(str1,str2,len); } +#endif + +// qChecksum: Internet checksum + +Q_CORE_EXPORT quint16 qChecksum(const char *s, uint len); + +class QByteRef; +class QString; +class QDataStream; +template class QList; + +class Q_CORE_EXPORT QByteArray +{ +private: + struct Data { + QBasicAtomicInt ref; + int alloc, size; + // ### Qt 5.0: We need to add the missing capacity bit + // (like other tool classes have), to maintain the + // reserved memory on resize. + char *data; + char array[1]; + }; + +public: + inline QByteArray(); + QByteArray(const char *); + QByteArray(const char *, int size); + QByteArray(int size, char c); + QByteArray(int size, Qt::Initialization); + inline QByteArray(const QByteArray &); + inline ~QByteArray(); + + QByteArray &operator=(const QByteArray &); + QByteArray &operator=(const char *str); + + inline int size() const; + bool isEmpty() const; + void resize(int size); + + QByteArray &fill(char c, int size = -1); + + int capacity() const; + void reserve(int size); + void squeeze(); + +#ifndef QT_NO_CAST_FROM_BYTEARRAY + operator const char *() const; + operator const void *() const; +#endif + char *data(); + const char *data() const; + inline const char *constData() const; + inline void detach(); + bool isDetached() const; + void clear(); + +#ifdef Q_COMPILER_MANGLES_RETURN_TYPE + const char at(int i) const; + const char operator[](int i) const; + const char operator[](uint i) const; +#else + char at(int i) const; + char operator[](int i) const; + char operator[](uint i) const; +#endif + QByteRef operator[](int i); + QByteRef operator[](uint i); + + int indexOf(char c, int from = 0) const; + int indexOf(const char *c, int from = 0) const; + int indexOf(const QByteArray &a, int from = 0) const; + int lastIndexOf(char c, int from = -1) const; + int lastIndexOf(const char *c, int from = -1) const; + int lastIndexOf(const QByteArray &a, int from = -1) const; + + QBool contains(char c) const; + QBool contains(const char *a) const; + QBool contains(const QByteArray &a) const; + int count(char c) const; + int count(const char *a) const; + int count(const QByteArray &a) const; + + QByteArray left(int len) const; + QByteArray right(int len) const; + QByteArray mid(int index, int len = -1) const; + + bool startsWith(const QByteArray &a) const; + bool startsWith(char c) const; + bool startsWith(const char *c) const; + + bool endsWith(const QByteArray &a) const; + bool endsWith(char c) const; + bool endsWith(const char *c) const; + + void truncate(int pos); + void chop(int n); + + QByteArray toLower() const; + QByteArray toUpper() const; + + QByteArray trimmed() const; + QByteArray simplified() const; + QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const; + QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const; + +#ifdef QT3_SUPPORT + inline QT3_SUPPORT QByteArray leftJustify(uint width, char aFill = ' ', bool aTruncate = false) const + { return leftJustified(int(width), aFill, aTruncate); } + inline QT3_SUPPORT QByteArray rightJustify(uint width, char aFill = ' ', bool aTruncate = false) const + { return rightJustified(int(width), aFill, aTruncate); } +#endif + + QByteArray &prepend(char c); + QByteArray &prepend(const char *s); + QByteArray &prepend(const char *s, int len); + QByteArray &prepend(const QByteArray &a); + QByteArray &append(char c); + QByteArray &append(const char *s); + QByteArray &append(const char *s, int len); + QByteArray &append(const QByteArray &a); + QByteArray &insert(int i, char c); + QByteArray &insert(int i, const char *s); + QByteArray &insert(int i, const char *s, int len); + QByteArray &insert(int i, const QByteArray &a); + QByteArray &remove(int index, int len); + QByteArray &replace(int index, int len, const char *s); + QByteArray &replace(int index, int len, const QByteArray &s); + QByteArray &replace(char before, const char *after); + QByteArray &replace(char before, const QByteArray &after); + QByteArray &replace(const char *before, const char *after); + QByteArray &replace(const char *before, int bsize, const char *after, int asize); + QByteArray &replace(const QByteArray &before, const QByteArray &after); + QByteArray &replace(const QByteArray &before, const char *after); + QByteArray &replace(const char *before, const QByteArray &after); + QByteArray &replace(char before, char after); + QByteArray &operator+=(char c); + QByteArray &operator+=(const char *s); + QByteArray &operator+=(const QByteArray &a); + + QList split(char sep) const; + + QByteArray repeated(int times) const; + +#ifndef QT_NO_CAST_TO_ASCII + QT_ASCII_CAST_WARN QByteArray &append(const QString &s); + QT_ASCII_CAST_WARN QByteArray &insert(int i, const QString &s); + QT_ASCII_CAST_WARN QByteArray &replace(const QString &before, const char *after); + QT_ASCII_CAST_WARN QByteArray &replace(char c, const QString &after); + QT_ASCII_CAST_WARN QByteArray &replace(const QString &before, const QByteArray &after); + + QT_ASCII_CAST_WARN QByteArray &operator+=(const QString &s); + QT_ASCII_CAST_WARN int indexOf(const QString &s, int from = 0) const; + QT_ASCII_CAST_WARN int lastIndexOf(const QString &s, int from = -1) const; +#endif +#ifndef QT_NO_CAST_FROM_ASCII + inline QT_ASCII_CAST_WARN bool operator==(const QString &s2) const; + inline QT_ASCII_CAST_WARN bool operator!=(const QString &s2) const; + inline QT_ASCII_CAST_WARN bool operator<(const QString &s2) const; + inline QT_ASCII_CAST_WARN bool operator>(const QString &s2) const; + inline QT_ASCII_CAST_WARN bool operator<=(const QString &s2) const; + inline QT_ASCII_CAST_WARN bool operator>=(const QString &s2) const; +#endif + + short toShort(bool *ok = 0, int base = 10) const; + ushort toUShort(bool *ok = 0, int base = 10) const; + int toInt(bool *ok = 0, int base = 10) const; + uint toUInt(bool *ok = 0, int base = 10) const; + long toLong(bool *ok = 0, int base = 10) const; + ulong toULong(bool *ok = 0, int base = 10) const; + qlonglong toLongLong(bool *ok = 0, int base = 10) const; + qulonglong toULongLong(bool *ok = 0, int base = 10) const; + float toFloat(bool *ok = 0) const; + double toDouble(bool *ok = 0) const; + QByteArray toBase64() const; + QByteArray toHex() const; + QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(), + const QByteArray &include = QByteArray(), + char percent = '%') const; + + QByteArray &setNum(short, int base = 10); + QByteArray &setNum(ushort, int base = 10); + QByteArray &setNum(int, int base = 10); + QByteArray &setNum(uint, int base = 10); + QByteArray &setNum(qlonglong, int base = 10); + QByteArray &setNum(qulonglong, int base = 10); + QByteArray &setNum(float, char f = 'g', int prec = 6); + QByteArray &setNum(double, char f = 'g', int prec = 6); + + static QByteArray number(int, int base = 10); + static QByteArray number(uint, int base = 10); + static QByteArray number(qlonglong, int base = 10); + static QByteArray number(qulonglong, int base = 10); + static QByteArray number(double, char f = 'g', int prec = 6); + static QByteArray fromRawData(const char *, int size); + static QByteArray fromBase64(const QByteArray &base64); + static QByteArray fromHex(const QByteArray &hexEncoded); + static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%'); + + + typedef char *iterator; + typedef const char *const_iterator; + typedef iterator Iterator; + typedef const_iterator ConstIterator; + iterator begin(); + const_iterator begin() const; + const_iterator constBegin() const; + iterator end(); + const_iterator end() const; + const_iterator constEnd() const; + + // stl compatibility + typedef const char & const_reference; + typedef char & reference; + typedef char value_type; + void push_back(char c); + void push_back(const char *c); + void push_back(const QByteArray &a); + void push_front(char c); + void push_front(const char *c); + void push_front(const QByteArray &a); + + inline int count() const { return d->size; } + int length() const { return d->size; } + bool isNull() const; + + // compatibility +#ifdef QT3_SUPPORT + QT3_SUPPORT_CONSTRUCTOR QByteArray(int size); + inline QT3_SUPPORT QByteArray& duplicate(const QByteArray& a) { *this = a; return *this; } + inline QT3_SUPPORT QByteArray& duplicate(const char *a, uint n) + { *this = QByteArray(a, n); return *this; } + inline QT3_SUPPORT QByteArray& setRawData(const char *a, uint n) + { *this = fromRawData(a, n); return *this; } + inline QT3_SUPPORT void resetRawData(const char *, uint) { clear(); } + inline QT3_SUPPORT QByteArray lower() const { return toLower(); } + inline QT3_SUPPORT QByteArray upper() const { return toUpper(); } + inline QT3_SUPPORT QByteArray stripWhiteSpace() const { return trimmed(); } + inline QT3_SUPPORT QByteArray simplifyWhiteSpace() const { return simplified(); } + inline QT3_SUPPORT int find(char c, int from = 0) const { return indexOf(c, from); } + inline QT3_SUPPORT int find(const char *c, int from = 0) const { return indexOf(c, from); } + inline QT3_SUPPORT int find(const QByteArray &ba, int from = 0) const { return indexOf(ba, from); } + inline QT3_SUPPORT int findRev(char c, int from = -1) const { return lastIndexOf(c, from); } + inline QT3_SUPPORT int findRev(const char *c, int from = -1) const { return lastIndexOf(c, from); } + inline QT3_SUPPORT int findRev(const QByteArray &ba, int from = -1) const { return lastIndexOf(ba, from); } +#ifndef QT_NO_CAST_TO_ASCII + QT3_SUPPORT int find(const QString &s, int from = 0) const; + QT3_SUPPORT int findRev(const QString &s, int from = -1) const; +#endif +#endif + +private: + operator QNoImplicitBoolCast() const; + static Data shared_null; + static Data shared_empty; + Data *d; + QByteArray(Data *dd, int /*dummy*/, int /*dummy*/) : d(dd) {} + void realloc(int alloc); + void expand(int i); + QByteArray nulTerminated() const; + + friend class QByteRef; + friend class QString; + friend Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, int nbytes); +public: + typedef Data * DataPtr; + inline DataPtr &data_ptr() { return d; } +}; + +inline QByteArray::QByteArray(): d(&shared_null) { d->ref.ref(); } +inline QByteArray::~QByteArray() { if (!d->ref.deref()) qFree(d); } +inline int QByteArray::size() const +{ return d->size; } + +#ifdef Q_COMPILER_MANGLES_RETURN_TYPE +inline const char QByteArray::at(int i) const +{ Q_ASSERT(i >= 0 && i < size()); return d->data[i]; } +inline const char QByteArray::operator[](int i) const +{ Q_ASSERT(i >= 0 && i < size()); return d->data[i]; } +inline const char QByteArray::operator[](uint i) const +{ Q_ASSERT(i < uint(size())); return d->data[i]; } +#else +inline char QByteArray::at(int i) const +{ Q_ASSERT(i >= 0 && i < size()); return d->data[i]; } +inline char QByteArray::operator[](int i) const +{ Q_ASSERT(i >= 0 && i < size()); return d->data[i]; } +inline char QByteArray::operator[](uint i) const +{ Q_ASSERT(i < uint(size())); return d->data[i]; } +#endif + +inline bool QByteArray::isEmpty() const +{ return d->size == 0; } +#ifndef QT_NO_CAST_FROM_BYTEARRAY +inline QByteArray::operator const char *() const +{ return d->data; } +inline QByteArray::operator const void *() const +{ return d->data; } +#endif +inline char *QByteArray::data() +{ detach(); return d->data; } +inline const char *QByteArray::data() const +{ return d->data; } +inline const char *QByteArray::constData() const +{ return d->data; } +inline void QByteArray::detach() +{ if (d->ref != 1 || d->data != d->array) realloc(d->size); } +inline bool QByteArray::isDetached() const +{ return d->ref == 1; } +inline QByteArray::QByteArray(const QByteArray &a) : d(a.d) +{ d->ref.ref(); } +#ifdef QT3_SUPPORT +inline QByteArray::QByteArray(int aSize) : d(&shared_null) +{ d->ref.ref(); if (aSize > 0) fill('\0', aSize); } +#endif + +inline int QByteArray::capacity() const +{ return d->alloc; } + +inline void QByteArray::reserve(int asize) +{ if (d->ref != 1 || asize > d->alloc) realloc(asize); } + +inline void QByteArray::squeeze() +{ if (d->size < d->alloc) realloc(d->size); } + +class Q_CORE_EXPORT QByteRef { + QByteArray &a; + int i; + inline QByteRef(QByteArray &array, int idx) + : a(array),i(idx) {} + friend class QByteArray; +public: +#ifdef Q_COMPILER_MANGLES_RETURN_TYPE + inline operator const char() const + { return i < a.d->size ? a.d->data[i] : char(0); } +#else + inline operator char() const + { return i < a.d->size ? a.d->data[i] : char(0); } +#endif + inline QByteRef &operator=(char c) + { if (i >= a.d->size) a.expand(i); else a.detach(); + a.d->data[i] = c; return *this; } + inline QByteRef &operator=(const QByteRef &c) + { if (i >= a.d->size) a.expand(i); else a.detach(); + a.d->data[i] = c.a.d->data[c.i]; return *this; } + inline bool operator==(char c) const + { return a.d->data[i] == c; } + inline bool operator!=(char c) const + { return a.d->data[i] != c; } + inline bool operator>(char c) const + { return a.d->data[i] > c; } + inline bool operator>=(char c) const + { return a.d->data[i] >= c; } + inline bool operator<(char c) const + { return a.d->data[i] < c; } + inline bool operator<=(char c) const + { return a.d->data[i] <= c; } +}; + +inline QByteRef QByteArray::operator[](int i) +{ Q_ASSERT(i >= 0); return QByteRef(*this, i); } +inline QByteRef QByteArray::operator[](uint i) +{ return QByteRef(*this, i); } +inline QByteArray::iterator QByteArray::begin() +{ detach(); return d->data; } +inline QByteArray::const_iterator QByteArray::begin() const +{ return d->data; } +inline QByteArray::const_iterator QByteArray::constBegin() const +{ return d->data; } +inline QByteArray::iterator QByteArray::end() +{ detach(); return d->data + d->size; } +inline QByteArray::const_iterator QByteArray::end() const +{ return d->data + d->size; } +inline QByteArray::const_iterator QByteArray::constEnd() const +{ return d->data + d->size; } +inline QByteArray &QByteArray::operator+=(char c) +{ return append(c); } +inline QByteArray &QByteArray::operator+=(const char *s) +{ return append(s); } +inline QByteArray &QByteArray::operator+=(const QByteArray &a) +{ return append(a); } +inline void QByteArray::push_back(char c) +{ append(c); } +inline void QByteArray::push_back(const char *c) +{ append(c); } +inline void QByteArray::push_back(const QByteArray &a) +{ append(a); } +inline void QByteArray::push_front(char c) +{ prepend(c); } +inline void QByteArray::push_front(const char *c) +{ prepend(c); } +inline void QByteArray::push_front(const QByteArray &a) +{ prepend(a); } +inline QBool QByteArray::contains(const QByteArray &a) const +{ return QBool(indexOf(a) != -1); } +inline QBool QByteArray::contains(char c) const +{ return QBool(indexOf(c) != -1); } +inline bool operator==(const QByteArray &a1, const QByteArray &a2) +{ return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); } +inline bool operator==(const QByteArray &a1, const char *a2) +{ return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); } +inline bool operator==(const char *a1, const QByteArray &a2) +{ return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); } +inline bool operator!=(const QByteArray &a1, const QByteArray &a2) +{ return !(a1==a2); } +inline bool operator!=(const QByteArray &a1, const char *a2) +{ return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); } +inline bool operator!=(const char *a1, const QByteArray &a2) +{ return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); } +inline bool operator<(const QByteArray &a1, const QByteArray &a2) +{ return qstrcmp(a1, a2) < 0; } + inline bool operator<(const QByteArray &a1, const char *a2) +{ return qstrcmp(a1, a2) < 0; } +inline bool operator<(const char *a1, const QByteArray &a2) +{ return qstrcmp(a1, a2) < 0; } +inline bool operator<=(const QByteArray &a1, const QByteArray &a2) +{ return qstrcmp(a1, a2) <= 0; } +inline bool operator<=(const QByteArray &a1, const char *a2) +{ return qstrcmp(a1, a2) <= 0; } +inline bool operator<=(const char *a1, const QByteArray &a2) +{ return qstrcmp(a1, a2) <= 0; } +inline bool operator>(const QByteArray &a1, const QByteArray &a2) +{ return qstrcmp(a1, a2) > 0; } +inline bool operator>(const QByteArray &a1, const char *a2) +{ return qstrcmp(a1, a2) > 0; } +inline bool operator>(const char *a1, const QByteArray &a2) +{ return qstrcmp(a1, a2) > 0; } +inline bool operator>=(const QByteArray &a1, const QByteArray &a2) +{ return qstrcmp(a1, a2) >= 0; } +inline bool operator>=(const QByteArray &a1, const char *a2) +{ return qstrcmp(a1, a2) >= 0; } +inline bool operator>=(const char *a1, const QByteArray &a2) +{ return qstrcmp(a1, a2) >= 0; } +inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2) +{ return QByteArray(a1) += a2; } +inline const QByteArray operator+(const QByteArray &a1, const char *a2) +{ return QByteArray(a1) += a2; } +inline const QByteArray operator+(const QByteArray &a1, char a2) +{ return QByteArray(a1) += a2; } +inline const QByteArray operator+(const char *a1, const QByteArray &a2) +{ return QByteArray(a1) += a2; } +inline const QByteArray operator+(char a1, const QByteArray &a2) +{ return QByteArray(&a1, 1) += a2; } +inline QBool QByteArray::contains(const char *c) const +{ return QBool(indexOf(c) != -1); } +inline QByteArray &QByteArray::replace(char before, const char *c) +{ return replace(&before, 1, c, qstrlen(c)); } +inline QByteArray &QByteArray::replace(const QByteArray &before, const char *c) +{ return replace(before.constData(), before.size(), c, qstrlen(c)); } +inline QByteArray &QByteArray::replace(const char *before, const char *after) +{ return replace(before, qstrlen(before), after, qstrlen(after)); } + +inline QByteArray &QByteArray::setNum(short n, int base) +{ return setNum(qlonglong(n), base); } +inline QByteArray &QByteArray::setNum(ushort n, int base) +{ return setNum(qulonglong(n), base); } +inline QByteArray &QByteArray::setNum(int n, int base) +{ return setNum(qlonglong(n), base); } +inline QByteArray &QByteArray::setNum(uint n, int base) +{ return setNum(qulonglong(n), base); } +inline QByteArray &QByteArray::setNum(float n, char f, int prec) +{ return setNum(double(n),f,prec); } + + +#if !defined(QT_NO_DATASTREAM) || (defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)) +Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QByteArray &); +Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QByteArray &); +#endif + +#ifndef QT_NO_COMPRESS +Q_CORE_EXPORT QByteArray qCompress(const uchar* data, int nbytes, int compressionLevel = -1); +Q_CORE_EXPORT QByteArray qUncompress(const uchar* data, int nbytes); +inline QByteArray qCompress(const QByteArray& data, int compressionLevel = -1) +{ return qCompress(reinterpret_cast(data.constData()), data.size(), compressionLevel); } +inline QByteArray qUncompress(const QByteArray& data) +{ return qUncompress(reinterpret_cast(data.constData()), data.size()); } +#endif + +Q_DECLARE_TYPEINFO(QByteArray, Q_MOVABLE_TYPE); +Q_DECLARE_SHARED(QByteArray) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBYTEARRAY_H diff --git a/qtinterface/qt4/Qt/qbytearraymatcher.h b/qtinterface/qt4/Qt/qbytearraymatcher.h new file mode 100644 index 0000000..690241f --- /dev/null +++ b/qtinterface/qt4/Qt/qbytearraymatcher.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBYTEARRAYMATCHER_H +#define QBYTEARRAYMATCHER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QByteArrayMatcherPrivate; + +class Q_CORE_EXPORT QByteArrayMatcher +{ +public: + QByteArrayMatcher(); + explicit QByteArrayMatcher(const QByteArray &pattern); + explicit QByteArrayMatcher(const char *pattern, int length); + QByteArrayMatcher(const QByteArrayMatcher &other); + ~QByteArrayMatcher(); + + QByteArrayMatcher &operator=(const QByteArrayMatcher &other); + + void setPattern(const QByteArray &pattern); + + int indexIn(const QByteArray &ba, int from = 0) const; + int indexIn(const char *str, int len, int from = 0) const; + inline QByteArray pattern() const + { + if (q_pattern.isNull()) + return QByteArray(reinterpret_cast(p.p), p.l); + return q_pattern; + } + +private: + QByteArrayMatcherPrivate *d; + QByteArray q_pattern; +#ifdef Q_CC_RVCT +// explicitely allow anonymous unions for RVCT to prevent compiler warnings +# pragma push +# pragma anon_unions +#endif + struct Data { + uchar q_skiptable[256]; + const uchar *p; + int l; + }; + union { + uint dummy[256]; + Data p; + }; +#ifdef Q_CC_RVCT +# pragma pop +#endif +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBYTEARRAYMATCHER_H diff --git a/qtinterface/qt4/Qt/qcache.h b/qtinterface/qt4/Qt/qcache.h new file mode 100644 index 0000000..14a955a --- /dev/null +++ b/qtinterface/qt4/Qt/qcache.h @@ -0,0 +1,217 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCACHE_H +#define QCACHE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +template +class QCache +{ + struct Node { + inline Node() : keyPtr(0) {} + inline Node(T *data, int cost) + : keyPtr(0), t(data), c(cost), p(0), n(0) {} + const Key *keyPtr; T *t; int c; Node *p,*n; + }; + Node *f, *l; + QHash hash; + void *unused; + int mx, total; + + inline void unlink(Node &n) { + if (n.p) n.p->n = n.n; + if (n.n) n.n->p = n.p; + if (l == &n) l = n.p; + if (f == &n) f = n.n; + total -= n.c; + T *obj = n.t; + hash.remove(*n.keyPtr); + delete obj; + } + inline T *relink(const Key &key) { + typename QHash::iterator i = hash.find(key); + if (typename QHash::const_iterator(i) == hash.constEnd()) + return 0; + + Node &n = *i; + if (f != &n) { + if (n.p) n.p->n = n.n; + if (n.n) n.n->p = n.p; + if (l == &n) l = n.p; + n.p = 0; + n.n = f; + f->p = &n; + f = &n; + } + return n.t; + } + + Q_DISABLE_COPY(QCache) + +public: + inline explicit QCache(int maxCost = 100); +#ifdef QT3_SUPPORT + inline QT3_SUPPORT_CONSTRUCTOR QCache(int maxCost, int /* dummy */) + : f(0), l(0), mx(maxCost), total(0) {} +#endif + inline ~QCache() { clear(); } + + inline int maxCost() const { return mx; } + void setMaxCost(int m); + inline int totalCost() const { return total; } + + inline int size() const { return hash.size(); } + inline int count() const { return hash.size(); } + inline bool isEmpty() const { return hash.isEmpty(); } + inline QList keys() const { return hash.keys(); } + + void clear(); + + bool insert(const Key &key, T *object, int cost = 1); + T *object(const Key &key) const; + inline bool contains(const Key &key) const { return hash.contains(key); } + T *operator[](const Key &key) const; + + bool remove(const Key &key); + T *take(const Key &key); + +private: + void trim(int m); + +#ifdef QT3_SUPPORT + inline QT3_SUPPORT T *find(const Key &key) const { return object(key); } +#endif + +}; + +template +inline QCache::QCache(int amaxCost) + : f(0), l(0), unused(0), mx(amaxCost), total(0) {} + +template +inline void QCache::clear() +{ while (f) { delete f->t; f = f->n; } + hash.clear(); l = 0; total = 0; } + +template +inline void QCache::setMaxCost(int m) +{ mx = m; trim(mx); } + +template +inline T *QCache::object(const Key &key) const +{ return const_cast*>(this)->relink(key); } + +template +inline T *QCache::operator[](const Key &key) const +{ return object(key); } + +template +inline bool QCache::remove(const Key &key) +{ + typename QHash::iterator i = hash.find(key); + if (typename QHash::const_iterator(i) == hash.constEnd()) { + return false; + } else { + unlink(*i); + return true; + } +} + +template +inline T *QCache::take(const Key &key) +{ + typename QHash::iterator i = hash.find(key); + if (i == hash.end()) + return 0; + + Node &n = *i; + T *t = n.t; + n.t = 0; + unlink(n); + return t; +} + +template +bool QCache::insert(const Key &akey, T *aobject, int acost) +{ + remove(akey); + if (acost > mx) { + delete aobject; + return false; + } + trim(mx - acost); + Node sn(aobject, acost); + typename QHash::iterator i = hash.insert(akey, sn); + total += acost; + Node *n = &i.value(); + n->keyPtr = &i.key(); + if (f) f->p = n; + n->n = f; + f = n; + if (!l) l = f; + return true; +} + +template +void QCache::trim(int m) +{ + Node *n = l; + while (n && total > m) { + Node *u = n; + n = n->p; + if (qIsDetached(*u->t)) + unlink(*u); + } +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCACHE_H diff --git a/qtinterface/qt4/Qt/qcalendarwidget.h b/qtinterface/qt4/Qt/qcalendarwidget.h new file mode 100644 index 0000000..bc00977 --- /dev/null +++ b/qtinterface/qt4/Qt/qcalendarwidget.h @@ -0,0 +1,204 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCALENDARWIDGET_H +#define QCALENDARWIDGET_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_CALENDARWIDGET + +class QDate; +class QTextCharFormat; +class QCalendarWidgetPrivate; + +class Q_GUI_EXPORT QCalendarWidget : public QWidget +{ + Q_OBJECT + Q_ENUMS(Qt::DayOfWeek) + Q_ENUMS(HorizontalHeaderFormat) + Q_ENUMS(VerticalHeaderFormat) + Q_ENUMS(SelectionMode) + Q_PROPERTY(QDate selectedDate READ selectedDate WRITE setSelectedDate) + Q_PROPERTY(QDate minimumDate READ minimumDate WRITE setMinimumDate) + Q_PROPERTY(QDate maximumDate READ maximumDate WRITE setMaximumDate) + Q_PROPERTY(Qt::DayOfWeek firstDayOfWeek READ firstDayOfWeek WRITE setFirstDayOfWeek) + Q_PROPERTY(bool gridVisible READ isGridVisible WRITE setGridVisible) + Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) + Q_PROPERTY(HorizontalHeaderFormat horizontalHeaderFormat READ horizontalHeaderFormat WRITE setHorizontalHeaderFormat) + Q_PROPERTY(VerticalHeaderFormat verticalHeaderFormat READ verticalHeaderFormat WRITE setVerticalHeaderFormat) + Q_PROPERTY(bool headerVisible READ isHeaderVisible WRITE setHeaderVisible STORED false DESIGNABLE false) // obsolete + Q_PROPERTY(bool navigationBarVisible READ isNavigationBarVisible WRITE setNavigationBarVisible) + Q_PROPERTY(bool dateEditEnabled READ isDateEditEnabled WRITE setDateEditEnabled) + Q_PROPERTY(int dateEditAcceptDelay READ dateEditAcceptDelay WRITE setDateEditAcceptDelay) + +public: + enum HorizontalHeaderFormat { + NoHorizontalHeader, + SingleLetterDayNames, + ShortDayNames, + LongDayNames + }; + + enum VerticalHeaderFormat { + NoVerticalHeader, + ISOWeekNumbers + }; + + enum SelectionMode { + NoSelection, + SingleSelection + }; + + explicit QCalendarWidget(QWidget *parent = 0); + ~QCalendarWidget(); + + virtual QSize sizeHint() const; + virtual QSize minimumSizeHint() const; + + QDate selectedDate() const; + + int yearShown() const; + int monthShown() const; + + QDate minimumDate() const; + void setMinimumDate(const QDate &date); + + QDate maximumDate() const; + void setMaximumDate(const QDate &date); + + Qt::DayOfWeek firstDayOfWeek() const; + void setFirstDayOfWeek(Qt::DayOfWeek dayOfWeek); + + // ### Qt 5: eliminate these two + bool isHeaderVisible() const; + void setHeaderVisible(bool show); + + inline bool isNavigationBarVisible() const { return isHeaderVisible(); } + + bool isGridVisible() const; + + SelectionMode selectionMode() const; + void setSelectionMode(SelectionMode mode); + + HorizontalHeaderFormat horizontalHeaderFormat() const; + void setHorizontalHeaderFormat(HorizontalHeaderFormat format); + + VerticalHeaderFormat verticalHeaderFormat() const; + void setVerticalHeaderFormat(VerticalHeaderFormat format); + + QTextCharFormat headerTextFormat() const; + void setHeaderTextFormat(const QTextCharFormat &format); + + QTextCharFormat weekdayTextFormat(Qt::DayOfWeek dayOfWeek) const; + void setWeekdayTextFormat(Qt::DayOfWeek dayOfWeek, const QTextCharFormat &format); + + QMap dateTextFormat() const; + QTextCharFormat dateTextFormat(const QDate &date) const; + void setDateTextFormat(const QDate &date, const QTextCharFormat &format); + + bool isDateEditEnabled() const; + void setDateEditEnabled(bool enable); + + int dateEditAcceptDelay() const; + void setDateEditAcceptDelay(int delay); + +protected: + bool event(QEvent *event); + bool eventFilter(QObject *watched, QEvent *event); + void mousePressEvent(QMouseEvent *event); + void resizeEvent(QResizeEvent * event); + void keyPressEvent(QKeyEvent * event); + + virtual void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const; + void updateCell(const QDate &date); + void updateCells(); + +public Q_SLOTS: + void setSelectedDate(const QDate &date); + void setDateRange(const QDate &min, const QDate &max); + void setCurrentPage(int year, int month); + void setGridVisible(bool show); + void setNavigationBarVisible(bool visible); + void showNextMonth(); + void showPreviousMonth(); + void showNextYear(); + void showPreviousYear(); + void showSelectedDate(); + void showToday(); + +Q_SIGNALS: + void selectionChanged(); + void clicked(const QDate &date); + void activated(const QDate &date); + void currentPageChanged(int year, int month); + +private: + Q_DECLARE_PRIVATE(QCalendarWidget) + Q_DISABLE_COPY(QCalendarWidget) + + Q_PRIVATE_SLOT(d_func(), void _q_slotShowDate(const QDate &date)) + Q_PRIVATE_SLOT(d_func(), void _q_slotChangeDate(const QDate &date)) + Q_PRIVATE_SLOT(d_func(), void _q_slotChangeDate(const QDate &date, bool changeMonth)) + Q_PRIVATE_SLOT(d_func(), void _q_editingFinished()) + Q_PRIVATE_SLOT(d_func(), void _q_prevMonthClicked()) + Q_PRIVATE_SLOT(d_func(), void _q_nextMonthClicked()) + Q_PRIVATE_SLOT(d_func(), void _q_yearEditingFinished()) + Q_PRIVATE_SLOT(d_func(), void _q_yearClicked()) + Q_PRIVATE_SLOT(d_func(), void _q_monthChanged(QAction *act)) + +}; + +#endif // QT_NO_CALENDARWIDGET + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCALENDARWIDGET_H + diff --git a/qtinterface/qt4/Qt/qcdestyle.h b/qtinterface/qt4/Qt/qcdestyle.h new file mode 100644 index 0000000..feb1391 --- /dev/null +++ b/qtinterface/qt4/Qt/qcdestyle.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#ifndef QCDESTYLE_H +#define QCDESTYLE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#if !defined(QT_NO_STYLE_CDE) + +class Q_GUI_EXPORT QCDEStyle : public QMotifStyle +{ + Q_OBJECT +public: + explicit QCDEStyle(bool useHighlightCols = false); + virtual ~QCDEStyle(); + + int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, + const QWidget *widget = 0) const; + void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, + const QWidget *w = 0) const; + void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, + const QWidget *w = 0) const; + QPalette standardPalette() const; + +protected Q_SLOTS: + QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt = 0, + const QWidget *widget = 0) const; +}; + +#endif // QT_NO_STYLE_CDE + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCDESTYLE_H diff --git a/qtinterface/qt4/Qt/qchar.h b/qtinterface/qt4/Qt/qchar.h new file mode 100644 index 0000000..6e0794b --- /dev/null +++ b/qtinterface/qt4/Qt/qchar.h @@ -0,0 +1,397 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCHAR_H +#define QCHAR_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QString; + +struct QLatin1Char +{ +public: + inline explicit QLatin1Char(char c) : ch(c) {} +#ifdef Q_COMPILER_MANGLES_RETURN_TYPE + inline const char toLatin1() const { return ch; } + inline const ushort unicode() const { return ushort(uchar(ch)); } +#else + inline char toLatin1() const { return ch; } + inline ushort unicode() const { return ushort(uchar(ch)); } +#endif + +private: + char ch; +}; + + +class Q_CORE_EXPORT QChar { +public: + QChar(); +#ifndef QT_NO_CAST_FROM_ASCII + QT_ASCII_CAST_WARN_CONSTRUCTOR QChar(char c); + QT_ASCII_CAST_WARN_CONSTRUCTOR QChar(uchar c); +#endif + QChar(QLatin1Char ch); + QChar(uchar c, uchar r); + inline QChar(ushort rc) : ucs(rc){} + QChar(short rc); + QChar(uint rc); + QChar(int rc); + enum SpecialCharacter { + Null = 0x0000, + Nbsp = 0x00a0, + ReplacementCharacter = 0xfffd, + ObjectReplacementCharacter = 0xfffc, + ByteOrderMark = 0xfeff, + ByteOrderSwapped = 0xfffe, +#ifdef QT3_SUPPORT + null = Null, + replacement = ReplacementCharacter, + byteOrderMark = ByteOrderMark, + byteOrderSwapped = ByteOrderSwapped, + nbsp = Nbsp, +#endif + ParagraphSeparator = 0x2029, + LineSeparator = 0x2028 + }; + QChar(SpecialCharacter sc); + + // Unicode information + + enum Category + { + NoCategory, + + Mark_NonSpacing, // Mn + Mark_SpacingCombining, // Mc + Mark_Enclosing, // Me + + Number_DecimalDigit, // Nd + Number_Letter, // Nl + Number_Other, // No + + Separator_Space, // Zs + Separator_Line, // Zl + Separator_Paragraph, // Zp + + Other_Control, // Cc + Other_Format, // Cf + Other_Surrogate, // Cs + Other_PrivateUse, // Co + Other_NotAssigned, // Cn + + Letter_Uppercase, // Lu + Letter_Lowercase, // Ll + Letter_Titlecase, // Lt + Letter_Modifier, // Lm + Letter_Other, // Lo + + Punctuation_Connector, // Pc + Punctuation_Dash, // Pd + Punctuation_Open, // Ps + Punctuation_Close, // Pe + Punctuation_InitialQuote, // Pi + Punctuation_FinalQuote, // Pf + Punctuation_Other, // Po + + Symbol_Math, // Sm + Symbol_Currency, // Sc + Symbol_Modifier, // Sk + Symbol_Other, // So + + Punctuation_Dask = Punctuation_Dash // oops + }; + + enum Direction + { + DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON, + DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN + }; + + enum Decomposition + { + NoDecomposition, + Canonical, + Font, + NoBreak, + Initial, + Medial, + Final, + Isolated, + Circle, + Super, + Sub, + Vertical, + Wide, + Narrow, + Small, + Square, + Compat, + Fraction + +#ifdef QT3_SUPPORT + , Single = NoDecomposition +#endif + }; + + enum Joining + { + OtherJoining, Dual, Right, Center + }; + + enum CombiningClass + { + Combining_BelowLeftAttached = 200, + Combining_BelowAttached = 202, + Combining_BelowRightAttached = 204, + Combining_LeftAttached = 208, + Combining_RightAttached = 210, + Combining_AboveLeftAttached = 212, + Combining_AboveAttached = 214, + Combining_AboveRightAttached = 216, + + Combining_BelowLeft = 218, + Combining_Below = 220, + Combining_BelowRight = 222, + Combining_Left = 224, + Combining_Right = 226, + Combining_AboveLeft = 228, + Combining_Above = 230, + Combining_AboveRight = 232, + + Combining_DoubleBelow = 233, + Combining_DoubleAbove = 234, + Combining_IotaSubscript = 240 + }; + + enum UnicodeVersion { + Unicode_Unassigned, + Unicode_1_1, + Unicode_2_0, + Unicode_2_1_2, + Unicode_3_0, + Unicode_3_1, + Unicode_3_2, + Unicode_4_0, + Unicode_4_1, + Unicode_5_0 + }; + // ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO + + Category category() const; + Direction direction() const; + Joining joining() const; + bool hasMirrored() const; + unsigned char combiningClass() const; + + QChar mirroredChar() const; + QString decomposition() const; + Decomposition decompositionTag() const; + + int digitValue() const; + QChar toLower() const; + QChar toUpper() const; + QChar toTitleCase() const; + QChar toCaseFolded() const; + + UnicodeVersion unicodeVersion() const; + +#ifdef Q_COMPILER_MANGLES_RETURN_TYPE + const char toAscii() const; + inline const char toLatin1() const; + inline const ushort unicode() const { return ucs; } +#else + char toAscii() const; + inline char toLatin1() const; + inline ushort unicode() const { return ucs; } +#endif +#ifdef Q_NO_PACKED_REFERENCE + inline ushort &unicode() { return const_cast(ucs); } +#else + inline ushort &unicode() { return ucs; } +#endif + + static QChar fromAscii(char c); + static QChar fromLatin1(char c); + + inline bool isNull() const { return ucs == 0; } + bool isPrint() const; + bool isPunct() const; + bool isSpace() const; + bool isMark() const; + bool isLetter() const; + bool isNumber() const; + bool isLetterOrNumber() const; + bool isDigit() const; + bool isSymbol() const; + inline bool isLower() const { return category() == Letter_Lowercase; } + inline bool isUpper() const { return category() == Letter_Uppercase; } + inline bool isTitleCase() const { return category() == Letter_Titlecase; } + + inline bool isHighSurrogate() const { + return ((ucs & 0xfc00) == 0xd800); + } + inline bool isLowSurrogate() const { + return ((ucs & 0xfc00) == 0xdc00); + } + + inline uchar cell() const { return uchar(ucs & 0xff); } + inline uchar row() const { return uchar((ucs>>8)&0xff); } + inline void setCell(uchar cell); + inline void setRow(uchar row); + + static inline uint surrogateToUcs4(ushort high, ushort low) { + return (uint(high)<<10) + low - 0x35fdc00; + } + static inline uint surrogateToUcs4(QChar high, QChar low) { + return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00; + } + static inline ushort highSurrogate(uint ucs4) { + return ushort((ucs4>>10) + 0xd7c0); + } + static inline ushort lowSurrogate(uint ucs4) { + return ushort(ucs4%0x400 + 0xdc00); + } + + static Category QT_FASTCALL category(uint ucs4); + static Category QT_FASTCALL category(ushort ucs2); + static Direction QT_FASTCALL direction(uint ucs4); + static Direction QT_FASTCALL direction(ushort ucs2); + static Joining QT_FASTCALL joining(uint ucs4); + static Joining QT_FASTCALL joining(ushort ucs2); + static unsigned char QT_FASTCALL combiningClass(uint ucs4); + static unsigned char QT_FASTCALL combiningClass(ushort ucs2); + + static uint QT_FASTCALL mirroredChar(uint ucs4); + static ushort QT_FASTCALL mirroredChar(ushort ucs2); + static Decomposition QT_FASTCALL decompositionTag(uint ucs4); + + static int QT_FASTCALL digitValue(uint ucs4); + static int QT_FASTCALL digitValue(ushort ucs2); + static uint QT_FASTCALL toLower(uint ucs4); + static ushort QT_FASTCALL toLower(ushort ucs2); + static uint QT_FASTCALL toUpper(uint ucs4); + static ushort QT_FASTCALL toUpper(ushort ucs2); + static uint QT_FASTCALL toTitleCase(uint ucs4); + static ushort QT_FASTCALL toTitleCase(ushort ucs2); + static uint QT_FASTCALL toCaseFolded(uint ucs4); + static ushort QT_FASTCALL toCaseFolded(ushort ucs2); + + static UnicodeVersion QT_FASTCALL unicodeVersion(uint ucs4); + static UnicodeVersion QT_FASTCALL unicodeVersion(ushort ucs2); + + static QString QT_FASTCALL decomposition(uint ucs4); + +#ifdef QT3_SUPPORT + inline QT3_SUPPORT bool mirrored() const { return hasMirrored(); } + inline QT3_SUPPORT QChar lower() const { return toLower(); } + inline QT3_SUPPORT QChar upper() const { return toUpper(); } + static inline QT3_SUPPORT bool networkOrdered() { + return QSysInfo::ByteOrder == QSysInfo::BigEndian; + } +#ifdef Q_COMPILER_MANGLES_RETURN_TYPE + inline QT3_SUPPORT const char latin1() const { return toLatin1(); } + inline QT3_SUPPORT const char ascii() const { return toAscii(); } +#else + inline QT3_SUPPORT char latin1() const { return toLatin1(); } + inline QT3_SUPPORT char ascii() const { return toAscii(); } +#endif +#endif + +private: +#ifdef QT_NO_CAST_FROM_ASCII + QChar(char c); + QChar(uchar c); +#endif + ushort ucs; +} +#if (defined(__arm__) || defined(__ARMEL__)) + Q_PACKED +#endif + ; + +Q_DECLARE_TYPEINFO(QChar, Q_MOVABLE_TYPE); + +inline QChar::QChar() : ucs(0) {} + +#ifdef Q_COMPILER_MANGLES_RETURN_TYPE +inline const char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); } +#else +inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); } +#endif +inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); } + +inline QChar::QChar(uchar c, uchar r) : ucs(ushort((r << 8) | c)){} +inline QChar::QChar(short rc) : ucs(ushort(rc)){} +inline QChar::QChar(uint rc) : ucs(ushort(rc & 0xffff)){} +inline QChar::QChar(int rc) : ucs(ushort(rc & 0xffff)){} +inline QChar::QChar(SpecialCharacter s) : ucs(ushort(s)) {} +inline QChar::QChar(QLatin1Char ch) : ucs(ch.unicode()) {} + +inline void QChar::setCell(uchar acell) +{ ucs = ushort((ucs & 0xff00) + acell); } +inline void QChar::setRow(uchar arow) +{ ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); } + +inline bool operator==(QChar c1, QChar c2) { return c1.unicode() == c2.unicode(); } +inline bool operator!=(QChar c1, QChar c2) { return c1.unicode() != c2.unicode(); } +inline bool operator<=(QChar c1, QChar c2) { return c1.unicode() <= c2.unicode(); } +inline bool operator>=(QChar c1, QChar c2) { return c1.unicode() >= c2.unicode(); } +inline bool operator<(QChar c1, QChar c2) { return c1.unicode() < c2.unicode(); } +inline bool operator>(QChar c1, QChar c2) { return c1.unicode() > c2.unicode(); } + +#ifndef QT_NO_DATASTREAM +Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QChar &); +Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QChar &); +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCHAR_H diff --git a/qtinterface/qt4/Qt/qcheckbox.h b/qtinterface/qt4/Qt/qcheckbox.h new file mode 100644 index 0000000..696c759 --- /dev/null +++ b/qtinterface/qt4/Qt/qcheckbox.h @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCHECKBOX_H +#define QCHECKBOX_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QCheckBoxPrivate; +class QStyleOptionButton; + +class Q_GUI_EXPORT QCheckBox : public QAbstractButton +{ + Q_OBJECT + + Q_PROPERTY(bool tristate READ isTristate WRITE setTristate) + +public: + explicit QCheckBox(QWidget *parent=0); + explicit QCheckBox(const QString &text, QWidget *parent=0); + + + QSize sizeHint() const; + + void setTristate(bool y = true); + bool isTristate() const; + + Qt::CheckState checkState() const; + void setCheckState(Qt::CheckState state); + +Q_SIGNALS: + void stateChanged(int); + +protected: + bool event(QEvent *e); + bool hitButton(const QPoint &pos) const; + void checkStateSet(); + void nextCheckState(); + void paintEvent(QPaintEvent *); + void mouseMoveEvent(QMouseEvent *); + void initStyleOption(QStyleOptionButton *option) const; + +#ifdef QT3_SUPPORT +public: + enum ToggleState { + Off = Qt::Unchecked, + NoChange = Qt::PartiallyChecked, + On = Qt::Checked + }; + inline QT3_SUPPORT ToggleState state() const + { return static_cast(static_cast(checkState())); } + inline QT3_SUPPORT void setState(ToggleState state) + { setCheckState(static_cast(static_cast(state))); } + inline QT3_SUPPORT void setNoChange() + { setCheckState(Qt::PartiallyChecked); } + QT3_SUPPORT_CONSTRUCTOR QCheckBox(QWidget *parent, const char* name); + QT3_SUPPORT_CONSTRUCTOR QCheckBox(const QString &text, QWidget *parent, const char* name); +#endif + +private: + Q_DECLARE_PRIVATE(QCheckBox) + Q_DISABLE_COPY(QCheckBox) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCHECKBOX_H diff --git a/qtinterface/qt4/Qt/qcleanlooksstyle.h b/qtinterface/qt4/Qt/qcleanlooksstyle.h new file mode 100644 index 0000000..86d8eeb --- /dev/null +++ b/qtinterface/qt4/Qt/qcleanlooksstyle.h @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCLEANLOOKSSTYLE_H +#define QCLEANLOOKSSTYLE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#if !defined(QT_NO_STYLE_CLEANLOOKS) + +class QCleanlooksStylePrivate; +class Q_GUI_EXPORT QCleanlooksStyle : public QWindowsStyle +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QCleanlooksStyle) + +public: + QCleanlooksStyle(); + ~QCleanlooksStyle(); + + QPalette standardPalette () const; + void drawPrimitive(PrimitiveElement elem, + const QStyleOption *option, + QPainter *painter, const QWidget *widget = 0) const; + void drawControl(ControlElement ce, const QStyleOption *option, QPainter *painter, + const QWidget *widget) const; + int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const; + void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, + QPainter *painter, const QWidget *widget) const; + QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const; + QSize sizeFromContents(ContentsType type, const QStyleOption *option, + const QSize &size, const QWidget *widget) const; + SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, + const QPoint &pt, const QWidget *w = 0) const; + QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, + SubControl sc, const QWidget *widget) const; + QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, + const QStyleOption *opt) const; + int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0, + QStyleHintReturn *returnData = 0) const; + QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const; + QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, + const QWidget *widget = 0) const; + void drawItemPixmap(QPainter *painter, const QRect &rect, + int alignment, const QPixmap &pixmap) const; + void drawItemText(QPainter *painter, const QRect &rect, + int flags, const QPalette &pal, bool enabled, + const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const; + void polish(QWidget *widget); + void polish(QApplication *app); + void polish(QPalette &pal); + void unpolish(QWidget *widget); + void unpolish(QApplication *app); + +protected Q_SLOTS: + QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, + const QWidget *widget = 0) const; + +protected: + QCleanlooksStyle(QCleanlooksStylePrivate &dd); + +}; + +#endif // QT_NO_STYLE_CLEANLOOKS + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCLEANLOOKSSTYLE_H diff --git a/qtinterface/qt4/Qt/qclipboard.h b/qtinterface/qt4/Qt/qclipboard.h new file mode 100644 index 0000000..ceed32a --- /dev/null +++ b/qtinterface/qt4/Qt/qclipboard.h @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCLIPBOARD_H +#define QCLIPBOARD_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_CLIPBOARD + +class QMimeSource; +class QMimeData; +class QImage; +class QPixmap; + +class QClipboardPrivate; + +class Q_GUI_EXPORT QClipboard : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QClipboard) +private: + QClipboard(QObject *parent); + ~QClipboard(); + +public: + enum Mode { Clipboard, Selection, FindBuffer, LastMode = FindBuffer }; + + void clear(Mode mode = Clipboard); + + bool supportsSelection() const; + bool supportsFindBuffer() const; + + bool ownsSelection() const; + bool ownsClipboard() const; + bool ownsFindBuffer() const; + + QString text(Mode mode = Clipboard) const; + QString text(QString& subtype, Mode mode = Clipboard) const; + void setText(const QString &, Mode mode = Clipboard); + +#ifdef QT3_SUPPORT + QT3_SUPPORT QMimeSource *data(Mode mode = Clipboard) const; + QT3_SUPPORT void setData(QMimeSource*, Mode mode = Clipboard); +#endif + const QMimeData *mimeData(Mode mode = Clipboard ) const; + void setMimeData(QMimeData *data, Mode mode = Clipboard); + + QImage image(Mode mode = Clipboard) const; + QPixmap pixmap(Mode mode = Clipboard) const; + void setImage(const QImage &, Mode mode = Clipboard); + void setPixmap(const QPixmap &, Mode mode = Clipboard); + +Q_SIGNALS: + void changed(QClipboard::Mode mode); + void selectionChanged(); + void findBufferChanged(); + void dataChanged(); +private Q_SLOTS: + void ownerDestroyed(); + +protected: + void connectNotify(const char *); + bool event(QEvent *); + + friend class QApplication; + friend class QApplicationPrivate; + friend class QBaseApplication; + friend class QDragManager; + friend class QMimeSource; + +private: + Q_DISABLE_COPY(QClipboard) + + bool supportsMode(Mode mode) const; + bool ownsMode(Mode mode) const; + void emitChanged(Mode mode); +}; + +#endif // QT_NO_CLIPBOARD + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCLIPBOARD_H diff --git a/qtinterface/qt4/Qt/qcolor.h b/qtinterface/qt4/Qt/qcolor.h new file mode 100644 index 0000000..ecffb94 --- /dev/null +++ b/qtinterface/qt4/Qt/qcolor.h @@ -0,0 +1,305 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOLOR_H +#define QCOLOR_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QColor; +class QColormap; +class QVariant; + +#ifndef QT_NO_DEBUG_STREAM +Q_GUI_EXPORT QDebug operator<<(QDebug, const QColor &); +#endif +#ifndef QT_NO_DATASTREAM +Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QColor &); +Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColor &); +#endif + +class Q_GUI_EXPORT QColor +{ +public: + enum Spec { Invalid, Rgb, Hsv, Cmyk, Hsl }; + + QColor(); + QColor(Qt::GlobalColor color); + QColor(int r, int g, int b, int a = 255); + QColor(QRgb rgb); + QColor(const QString& name); + QColor(const char *name); + QColor(const QColor &color); + QColor(Spec spec); + + bool isValid() const; + + QString name() const; + void setNamedColor(const QString& name); + + static QStringList colorNames(); + + inline Spec spec() const + { return cspec; } + + int alpha() const; + void setAlpha(int alpha); + + qreal alphaF() const; + void setAlphaF(qreal alpha); + + int red() const; + int green() const; + int blue() const; + void setRed(int red); + void setGreen(int green); + void setBlue(int blue); + + qreal redF() const; + qreal greenF() const; + qreal blueF() const; + void setRedF(qreal red); + void setGreenF(qreal green); + void setBlueF(qreal blue); + + void getRgb(int *r, int *g, int *b, int *a = 0) const; + void setRgb(int r, int g, int b, int a = 255); + + void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = 0) const; + void setRgbF(qreal r, qreal g, qreal b, qreal a = 1.0); + + QRgb rgba() const; + void setRgba(QRgb rgba); + + QRgb rgb() const; + void setRgb(QRgb rgb); + + int hue() const; // 0 <= hue < 360 + int saturation() const; + int hsvHue() const; // 0 <= hue < 360 + int hsvSaturation() const; + int value() const; + + qreal hueF() const; // 0.0 <= hueF < 360.0 + qreal saturationF() const; + qreal hsvHueF() const; // 0.0 <= hueF < 360.0 + qreal hsvSaturationF() const; + qreal valueF() const; + + void getHsv(int *h, int *s, int *v, int *a = 0) const; + void setHsv(int h, int s, int v, int a = 255); + + void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = 0) const; + void setHsvF(qreal h, qreal s, qreal v, qreal a = 1.0); + + int cyan() const; + int magenta() const; + int yellow() const; + int black() const; + + qreal cyanF() const; + qreal magentaF() const; + qreal yellowF() const; + qreal blackF() const; + + void getCmyk(int *c, int *m, int *y, int *k, int *a = 0); + void setCmyk(int c, int m, int y, int k, int a = 255); + + void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = 0); + void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0); + + int hslHue() const; // 0 <= hue < 360 + int hslSaturation() const; + int lightness() const; + + qreal hslHueF() const; // 0.0 <= hueF < 360.0 + qreal hslSaturationF() const; + qreal lightnessF() const; + + void getHsl(int *h, int *s, int *l, int *a = 0) const; + void setHsl(int h, int s, int l, int a = 255); + + void getHslF(qreal *h, qreal *s, qreal *l, qreal *a = 0) const; + void setHslF(qreal h, qreal s, qreal l, qreal a = 1.0); + + QColor toRgb() const; + QColor toHsv() const; + QColor toCmyk() const; + QColor toHsl() const; + + QColor convertTo(Spec colorSpec) const; + + static QColor fromRgb(QRgb rgb); + static QColor fromRgba(QRgb rgba); + + static QColor fromRgb(int r, int g, int b, int a = 255); + static QColor fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0); + + static QColor fromHsv(int h, int s, int v, int a = 255); + static QColor fromHsvF(qreal h, qreal s, qreal v, qreal a = 1.0); + + static QColor fromCmyk(int c, int m, int y, int k, int a = 255); + static QColor fromCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0); + + static QColor fromHsl(int h, int s, int l, int a = 255); + static QColor fromHslF(qreal h, qreal s, qreal l, qreal a = 1.0); + + QColor light(int f = 150) const; + QColor lighter(int f = 150) const; + QColor dark(int f = 200) const; + QColor darker(int f = 200) const; + + QColor &operator=(const QColor &); + QColor &operator=(Qt::GlobalColor color); + + bool operator==(const QColor &c) const; + bool operator!=(const QColor &c) const; + + operator QVariant() const; + +#ifdef Q_WS_X11 + static bool allowX11ColorNames(); + static void setAllowX11ColorNames(bool enabled); +#endif + +#ifdef QT3_SUPPORT + inline QT3_SUPPORT_CONSTRUCTOR QColor(int x, int y, int z, Spec colorSpec) + { if (colorSpec == Hsv) setHsv(x, y, z); else setRgb(x, y, z); } + + inline QT3_SUPPORT void rgb(int *r, int *g, int *b) const + { getRgb(r, g, b); } + inline QT3_SUPPORT void hsv(int *h, int *s, int *v) const + { getHsv(h, s, v); } + + inline QT3_SUPPORT void setRgba(int r, int g, int b, int a) + { setRgb(r, g, b, a); } + inline QT3_SUPPORT void getRgba(int *r, int *g, int *b, int *a) const + { getRgb(r, g, b, a); } + + QT3_SUPPORT uint pixel(int screen = -1) const; +#endif + +private: +#ifndef QT3_SUPPORT + // do not allow a spec to be used as an alpha value + QColor(int, int, int, Spec); +#endif + + void invalidate(); + + Spec cspec; + union { + struct { + ushort alpha; + ushort red; + ushort green; + ushort blue; + ushort pad; + } argb; + struct { + ushort alpha; + ushort hue; + ushort saturation; + ushort value; + ushort pad; + } ahsv; + struct { + ushort alpha; + ushort cyan; + ushort magenta; + ushort yellow; + ushort black; + } acmyk; + struct { + ushort alpha; + ushort hue; + ushort saturation; + ushort lightness; + ushort pad; + } ahsl; + ushort array[5]; + } ct; + + friend class QColormap; +#ifndef QT_NO_DATASTREAM + friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QColor &); + friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColor &); +#endif +}; + +inline QColor::QColor() +{ invalidate(); } + +inline QColor::QColor(int r, int g, int b, int a) +{ setRgb(r, g, b, a); } + +inline QColor::QColor(const char *aname) +{ setNamedColor(QLatin1String(aname)); } + +inline QColor::QColor(const QString& aname) +{ setNamedColor(aname); } + +inline QColor::QColor(const QColor &acolor) + : cspec(acolor.cspec) +{ ct.argb = acolor.ct.argb; } + +inline bool QColor::isValid() const +{ return cspec != Invalid; } + +inline QColor QColor::lighter(int f) const +{ return light(f); } + +inline QColor QColor::darker(int f) const +{ return dark(f); } + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOLOR_H diff --git a/qtinterface/qt4/Qt/qcolordialog.h b/qtinterface/qt4/Qt/qcolordialog.h new file mode 100644 index 0000000..b54cf97 --- /dev/null +++ b/qtinterface/qt4/Qt/qcolordialog.h @@ -0,0 +1,150 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOLORDIALOG_H +#define QCOLORDIALOG_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_COLORDIALOG + +class QColorDialogPrivate; + +class Q_GUI_EXPORT QColorDialog : public QDialog +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QColorDialog) + Q_ENUMS(ColorDialogOption) + Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor + NOTIFY currentColorChanged) + Q_PROPERTY(ColorDialogOptions options READ options WRITE setOptions) + +public: + enum ColorDialogOption { + ShowAlphaChannel = 0x00000001, + NoButtons = 0x00000002, + DontUseNativeDialog = 0x00000004 + }; + + Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption) + + explicit QColorDialog(QWidget *parent = 0); + explicit QColorDialog(const QColor &initial, QWidget *parent = 0); + ~QColorDialog(); + + void setCurrentColor(const QColor &color); + QColor currentColor() const; + + QColor selectedColor() const; + + void setOption(ColorDialogOption option, bool on = true); + bool testOption(ColorDialogOption option) const; + void setOptions(ColorDialogOptions options); + ColorDialogOptions options() const; + +#ifdef Q_NO_USING_KEYWORD + void open() { QDialog::open(); } +#else + using QDialog::open; +#endif + void open(QObject *receiver, const char *member); + + void setVisible(bool visible); + + // ### Qt 5: merge overloads with title = QString() + static QColor getColor(const QColor &initial, QWidget *parent, const QString &title, + ColorDialogOptions options = 0); + static QColor getColor(const QColor &initial = Qt::white, QWidget *parent = 0); + + // obsolete + static QRgb getRgba(QRgb rgba = 0xffffffff, bool *ok = 0, QWidget *parent = 0); + + // ### Qt 5: use QColor in signatures + static int customCount(); + static QRgb customColor(int index); + static void setCustomColor(int index, QRgb color); + static void setStandardColor(int index, QRgb color); + +#ifdef QT3_SUPPORT + static QColor getColor(const QColor &init, QWidget *parent, const char *name) + { Q_UNUSED(name); return getColor(init, parent); } + static QRgb getRgba(QRgb rgba, bool *ok, QWidget *parent, const char *name) + { Q_UNUSED(name); return getRgba(rgba, ok, parent); } +#endif + +Q_SIGNALS: + void currentColorChanged(const QColor &color); + void colorSelected(const QColor &color); + +protected: + void changeEvent(QEvent *event); + void done(int result); + +private: + Q_DISABLE_COPY(QColorDialog) + + Q_PRIVATE_SLOT(d_func(), void _q_addCustom()) + Q_PRIVATE_SLOT(d_func(), void _q_newHsv(int h, int s, int v)) + Q_PRIVATE_SLOT(d_func(), void _q_newColorTypedIn(QRgb rgb)) + Q_PRIVATE_SLOT(d_func(), void _q_newCustom(int, int)) + Q_PRIVATE_SLOT(d_func(), void _q_newStandard(int, int)) +#if defined(Q_WS_MAC) + Q_PRIVATE_SLOT(d_func(), void _q_macRunNativeAppModalPanel()) +#endif + + friend class QColorShower; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QColorDialog::ColorDialogOptions) + +#endif // QT_NO_COLORDIALOG + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOLORDIALOG_H diff --git a/qtinterface/qt4/Qt/qcolormap.h b/qtinterface/qt4/Qt/qcolormap.h new file mode 100644 index 0000000..7dceb11 --- /dev/null +++ b/qtinterface/qt4/Qt/qcolormap.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOLORMAP_H +#define QCOLORMAP_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QColor; +class QColormapPrivate; + +class Q_GUI_EXPORT QColormap +{ +public: + enum Mode { Direct, Indexed, Gray }; + + static void initialize(); + static void cleanup(); + + static QColormap instance(int screen = -1); + + QColormap(const QColormap &colormap); + ~QColormap(); + + QColormap &operator=(const QColormap &colormap); + + Mode mode() const; + + int depth() const; + int size() const; + + uint pixel(const QColor &color) const; + const QColor colorAt(uint pixel) const; + + const QVector colormap() const; + +#ifdef Q_WS_WIN + static HPALETTE hPal(); +#endif + +private: + QColormap(); + QColormapPrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOLORMAP_H diff --git a/qtinterface/qt4/Qt/qcolumnview.h b/qtinterface/qt4/Qt/qcolumnview.h new file mode 100644 index 0000000..767c166 --- /dev/null +++ b/qtinterface/qt4/Qt/qcolumnview.h @@ -0,0 +1,123 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOLUMNVIEW_H +#define QCOLUMNVIEW_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_COLUMNVIEW + +class QColumnViewPrivate; + +class Q_GUI_EXPORT QColumnView : public QAbstractItemView { + +Q_OBJECT + Q_PROPERTY(bool resizeGripsVisible READ resizeGripsVisible WRITE setResizeGripsVisible) + +Q_SIGNALS: + void updatePreviewWidget(const QModelIndex &index); + +public: + explicit QColumnView(QWidget *parent = 0); + ~QColumnView(); + + // QAbstractItemView overloads + QModelIndex indexAt(const QPoint &point) const; + void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible); + QSize sizeHint() const; + QRect visualRect(const QModelIndex &index) const; + void setModel(QAbstractItemModel *model); + void setSelectionModel(QItemSelectionModel * selectionModel); + void setRootIndex(const QModelIndex &index); + void selectAll(); + + // QColumnView functions + void setResizeGripsVisible(bool visible); + bool resizeGripsVisible() const; + + QWidget *previewWidget() const; + void setPreviewWidget(QWidget *widget); + + void setColumnWidths(const QList &list); + QList columnWidths() const; + +protected: + QColumnView(QColumnViewPrivate &dd, QWidget *parent = 0); + + // QAbstractItemView overloads + bool isIndexHidden(const QModelIndex &index) const; + QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers); + void resizeEvent(QResizeEvent *event); + void setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command); + QRegion visualRegionForSelection(const QItemSelection &selection) const; + int horizontalOffset() const; + int verticalOffset() const; + void rowsInserted(const QModelIndex &parent, int start, int end); + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); + + // QColumnView functions + void scrollContentsBy(int dx, int dy); + virtual QAbstractItemView* createColumn(const QModelIndex &rootIndex); + void initializeColumn(QAbstractItemView *column) const; + +private: + Q_DECLARE_PRIVATE(QColumnView) + Q_DISABLE_COPY(QColumnView) + Q_PRIVATE_SLOT(d_func(), void _q_gripMoved(int)) + Q_PRIVATE_SLOT(d_func(), void _q_changeCurrentColumn()) + Q_PRIVATE_SLOT(d_func(), void _q_clicked(const QModelIndex &)) +}; + +#endif // QT_NO_COLUMNVIEW + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOLUMNVIEW_H + diff --git a/qtinterface/qt4/Qt/qcombobox.h b/qtinterface/qt4/Qt/qcombobox.h new file mode 100644 index 0000000..41bc749 --- /dev/null +++ b/qtinterface/qt4/Qt/qcombobox.h @@ -0,0 +1,337 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOMBOBOX_H +#define QCOMBOBOX_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) +#ifndef QT_NO_COMBOBOX + +class QAbstractItemView; +class QLineEdit; +class QComboBoxPrivate; +class QCompleter; + +class Q_GUI_EXPORT QComboBox : public QWidget +{ + Q_OBJECT + + Q_ENUMS(InsertPolicy) + Q_ENUMS(SizeAdjustPolicy) + Q_PROPERTY(bool editable READ isEditable WRITE setEditable) + Q_PROPERTY(int count READ count) + Q_PROPERTY(QString currentText READ currentText) + Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) + Q_PROPERTY(int maxVisibleItems READ maxVisibleItems WRITE setMaxVisibleItems) + Q_PROPERTY(int maxCount READ maxCount WRITE setMaxCount) + Q_PROPERTY(InsertPolicy insertPolicy READ insertPolicy WRITE setInsertPolicy) + Q_PROPERTY(SizeAdjustPolicy sizeAdjustPolicy READ sizeAdjustPolicy WRITE setSizeAdjustPolicy) + Q_PROPERTY(int minimumContentsLength READ minimumContentsLength WRITE setMinimumContentsLength) + Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) + +#ifndef QT_NO_COMPLETER + Q_PROPERTY(bool autoCompletion READ autoCompletion WRITE setAutoCompletion DESIGNABLE false) + Q_PROPERTY(Qt::CaseSensitivity autoCompletionCaseSensitivity READ autoCompletionCaseSensitivity WRITE setAutoCompletionCaseSensitivity DESIGNABLE false) +#endif // QT_NO_COMPLETER + + Q_PROPERTY(bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled) + Q_PROPERTY(bool frame READ hasFrame WRITE setFrame) + Q_PROPERTY(int modelColumn READ modelColumn WRITE setModelColumn) + +public: + explicit QComboBox(QWidget *parent = 0); + ~QComboBox(); + + int maxVisibleItems() const; + void setMaxVisibleItems(int maxItems); + + int count() const; + void setMaxCount(int max); + int maxCount() const; + +#ifndef QT_NO_COMPLETER + bool autoCompletion() const; + void setAutoCompletion(bool enable); + + Qt::CaseSensitivity autoCompletionCaseSensitivity() const; + void setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity); +#endif + + bool duplicatesEnabled() const; + void setDuplicatesEnabled(bool enable); + + void setFrame(bool); + bool hasFrame() const; + + inline int findText(const QString &text, + Qt::MatchFlags flags = Qt::MatchExactly|Qt::MatchCaseSensitive) const + { return findData(text, Qt::DisplayRole, flags); } + int findData(const QVariant &data, int role = Qt::UserRole, + Qt::MatchFlags flags = Qt::MatchExactly|Qt::MatchCaseSensitive) const; + + enum InsertPolicy { + NoInsert, + InsertAtTop, + InsertAtCurrent, + InsertAtBottom, + InsertAfterCurrent, + InsertBeforeCurrent, + InsertAlphabetically +#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) + , + NoInsertion = NoInsert, + AtTop = InsertAtTop, + AtCurrent = InsertAtCurrent, + AtBottom = InsertAtBottom, + AfterCurrent = InsertAfterCurrent, + BeforeCurrent = InsertBeforeCurrent +#endif + }; +#ifdef QT3_SUPPORT + typedef InsertPolicy Policy; +#endif + + InsertPolicy insertPolicy() const; + void setInsertPolicy(InsertPolicy policy); + + enum SizeAdjustPolicy { + AdjustToContents, + AdjustToContentsOnFirstShow, + AdjustToMinimumContentsLength, // ### Qt 5: remove + AdjustToMinimumContentsLengthWithIcon + }; + + SizeAdjustPolicy sizeAdjustPolicy() const; + void setSizeAdjustPolicy(SizeAdjustPolicy policy); + int minimumContentsLength() const; + void setMinimumContentsLength(int characters); + QSize iconSize() const; + void setIconSize(const QSize &size); + + bool isEditable() const; + void setEditable(bool editable); + void setLineEdit(QLineEdit *edit); + QLineEdit *lineEdit() const; +#ifndef QT_NO_VALIDATOR + void setValidator(const QValidator *v); + const QValidator *validator() const; +#endif + +#ifndef QT_NO_COMPLETER + void setCompleter(QCompleter *c); + QCompleter *completer() const; +#endif + + QAbstractItemDelegate *itemDelegate() const; + void setItemDelegate(QAbstractItemDelegate *delegate); + + QAbstractItemModel *model() const; + void setModel(QAbstractItemModel *model); + + QModelIndex rootModelIndex() const; + void setRootModelIndex(const QModelIndex &index); + + int modelColumn() const; + void setModelColumn(int visibleColumn); + + int currentIndex() const; + + QString currentText() const; + + QString itemText(int index) const; + QIcon itemIcon(int index) const; + QVariant itemData(int index, int role = Qt::UserRole) const; + + inline void addItem(const QString &text, const QVariant &userData = QVariant()); + inline void addItem(const QIcon &icon, const QString &text, + const QVariant &userData = QVariant()); + inline void addItems(const QStringList &texts) + { insertItems(count(), texts); } + + inline void insertItem(int index, const QString &text, const QVariant &userData = QVariant()); + void insertItem(int index, const QIcon &icon, const QString &text, + const QVariant &userData = QVariant()); + void insertItems(int index, const QStringList &texts); + void insertSeparator(int index); + + void removeItem(int index); + + void setItemText(int index, const QString &text); + void setItemIcon(int index, const QIcon &icon); + void setItemData(int index, const QVariant &value, int role = Qt::UserRole); + + QAbstractItemView *view() const; + void setView(QAbstractItemView *itemView); + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + virtual void showPopup(); + virtual void hidePopup(); + + bool event(QEvent *event); + +public Q_SLOTS: + void clear(); + void clearEditText(); + void setEditText(const QString &text); + void setCurrentIndex(int index); + +Q_SIGNALS: + void editTextChanged(const QString &); + void activated(int index); + void activated(const QString &); + void highlighted(int index); + void highlighted(const QString &); + void currentIndexChanged(int index); + void currentIndexChanged(const QString &); + +protected: + void focusInEvent(QFocusEvent *e); + void focusOutEvent(QFocusEvent *e); + void changeEvent(QEvent *e); + void resizeEvent(QResizeEvent *e); + void paintEvent(QPaintEvent *e); + void showEvent(QShowEvent *e); + void hideEvent(QHideEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + void keyPressEvent(QKeyEvent *e); + void keyReleaseEvent(QKeyEvent *e); + void wheelEvent(QWheelEvent *e); + void contextMenuEvent(QContextMenuEvent *e); + void inputMethodEvent(QInputMethodEvent *); + QVariant inputMethodQuery(Qt::InputMethodQuery) const; + void initStyleOption(QStyleOptionComboBox *option) const; + +#ifdef QT3_SUPPORT +public: + QT3_SUPPORT_CONSTRUCTOR QComboBox(QWidget *parent, const char *name); + QT3_SUPPORT_CONSTRUCTOR QComboBox(bool rw, QWidget *parent, const char *name = 0); + inline QT3_SUPPORT int currentItem() const { return currentIndex(); } + inline QT3_SUPPORT void setCurrentItem(int index) { setCurrentIndex(index); } + inline QT3_SUPPORT InsertPolicy insertionPolicy() const { return insertPolicy(); } + inline QT3_SUPPORT void setInsertionPolicy(InsertPolicy policy) { setInsertPolicy(policy); } + inline QT3_SUPPORT bool editable() const { return isEditable(); } + inline QT3_SUPPORT void popup() { showPopup(); } + inline QT3_SUPPORT void setCurrentText(const QString& text) { + int i = findText(text); + if (i != -1) + setCurrentIndex(i); + else if (isEditable()) + setEditText(text); + else + setItemText(currentIndex(), text); + } + inline QT3_SUPPORT QString text(int index) const { return itemText(index); } + + inline QT3_SUPPORT QPixmap pixmap(int index) const + { return itemIcon(index).pixmap(iconSize(), isEnabled() ? QIcon::Normal : QIcon::Disabled); } + inline QT3_SUPPORT void insertStringList(const QStringList &list, int index = -1) + { insertItems((index < 0 ? count() : index), list); } + inline QT3_SUPPORT void insertItem(const QString &text, int index = -1) + { insertItem((index < 0 ? count() : index), text); } + inline QT3_SUPPORT void insertItem(const QPixmap &pix, int index = -1) + { insertItem((index < 0 ? count() : index), QIcon(pix), QString()); } + inline QT3_SUPPORT void insertItem(const QPixmap &pix, const QString &text, int index = -1) + { insertItem((index < 0 ? count() : index), QIcon(pix), text); } + inline QT3_SUPPORT void changeItem(const QString &text, int index) + { setItemText(index, text); } + inline QT3_SUPPORT void changeItem(const QPixmap &pix, int index) + { setItemIcon(index, QIcon(pix)); } + inline QT3_SUPPORT void changeItem(const QPixmap &pix, const QString &text, int index) + { setItemIcon(index, QIcon(pix)); setItemText(index, text); } + inline QT3_SUPPORT void clearValidator() { setValidator(0); } + inline QT3_SUPPORT void clearEdit() { clearEditText(); } + +Q_SIGNALS: + QT_MOC_COMPAT void textChanged(const QString &); +#endif + +protected: + QComboBox(QComboBoxPrivate &, QWidget *); + +private: + Q_DECLARE_PRIVATE(QComboBox) + Q_DISABLE_COPY(QComboBox) + Q_PRIVATE_SLOT(d_func(), void _q_itemSelected(const QModelIndex &item)) + Q_PRIVATE_SLOT(d_func(), void _q_emitHighlighted(const QModelIndex &)) + Q_PRIVATE_SLOT(d_func(), void _q_emitCurrentIndexChanged(const QModelIndex &index)) + Q_PRIVATE_SLOT(d_func(), void _q_editingFinished()) + Q_PRIVATE_SLOT(d_func(), void _q_returnPressed()) + Q_PRIVATE_SLOT(d_func(), void _q_resetButton()) + Q_PRIVATE_SLOT(d_func(), void _q_dataChanged(const QModelIndex &, const QModelIndex &)) + Q_PRIVATE_SLOT(d_func(), void _q_updateIndexBeforeChange()) + Q_PRIVATE_SLOT(d_func(), void _q_rowsInserted(const QModelIndex & parent, int start, int end)) + Q_PRIVATE_SLOT(d_func(), void _q_rowsRemoved(const QModelIndex & parent, int start, int end)) + Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed()) + Q_PRIVATE_SLOT(d_func(), void _q_modelReset()) +#ifdef QT_KEYPAD_NAVIGATION + Q_PRIVATE_SLOT(d_func(), void _q_completerActivated()) +#endif +}; + +inline void QComboBox::addItem(const QString &atext, const QVariant &auserData) +{ insertItem(count(), atext, auserData); } +inline void QComboBox::addItem(const QIcon &aicon, const QString &atext, + const QVariant &auserData) +{ insertItem(count(), aicon, atext, auserData); } + +inline void QComboBox::insertItem(int aindex, const QString &atext, + const QVariant &auserData) +{ insertItem(aindex, QIcon(), atext, auserData); } + +#endif // QT_NO_COMBOBOX + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOMBOBOX_H diff --git a/qtinterface/qt4/Qt/qcommandlinkbutton.h b/qtinterface/qt4/Qt/qcommandlinkbutton.h new file mode 100644 index 0000000..2be5326 --- /dev/null +++ b/qtinterface/qt4/Qt/qcommandlinkbutton.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOMMANDLINKBUTTON_H +#define QCOMMANDLINKBUTTON_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QCommandLinkButtonPrivate; + +class Q_GUI_EXPORT QCommandLinkButton: public QPushButton +{ + Q_OBJECT + + Q_PROPERTY(QString description READ description WRITE setDescription) + Q_PROPERTY(bool flat READ isFlat WRITE setFlat DESIGNABLE false) + +public: + explicit QCommandLinkButton(QWidget *parent=0); + explicit QCommandLinkButton(const QString &text, QWidget *parent=0); + QCommandLinkButton(const QString &text, const QString &description, QWidget *parent=0); + QString description() const; + void setDescription(const QString &description); + +protected: + QSize sizeHint() const; + int heightForWidth(int) const; + QSize minimumSizeHint() const; + bool event(QEvent *e); + void paintEvent(QPaintEvent *); + +private: + Q_DISABLE_COPY(QCommandLinkButton) + Q_DECLARE_PRIVATE(QCommandLinkButton) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOMMANDLINKBUTTON diff --git a/qtinterface/qt4/Qt/qcommonstyle.h b/qtinterface/qt4/Qt/qcommonstyle.h new file mode 100644 index 0000000..a49abc5 --- /dev/null +++ b/qtinterface/qt4/Qt/qcommonstyle.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOMMONSTYLE_H +#define QCOMMONSTYLE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE +QT_MODULE(Gui) + +class QCommonStylePrivate; + +class Q_GUI_EXPORT QCommonStyle: public QStyle +{ + Q_OBJECT + +public: + QCommonStyle(); + ~QCommonStyle(); + + void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, + const QWidget *w = 0) const; + void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, + const QWidget *w = 0) const; + QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const; + void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, + const QWidget *w = 0) const; + SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, + const QPoint &pt, const QWidget *w = 0) const; + QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, + const QWidget *w = 0) const; + QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, + const QSize &contentsSize, const QWidget *widget = 0) const; + + int pixelMetric(PixelMetric m, const QStyleOption *opt = 0, const QWidget *widget = 0) const; + + int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0, + QStyleHintReturn *shret = 0) const; + + QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt = 0, + const QWidget *widget = 0) const; + + QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, + const QStyleOption *opt) const; + + void polish(QPalette &); + void polish(QApplication *app); + void polish(QWidget *widget); + void unpolish(QWidget *widget); + void unpolish(QApplication *application); + +protected Q_SLOTS: + QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt = 0, + const QWidget *widget = 0) const; + +protected: + QCommonStyle(QCommonStylePrivate &dd); + +private: + Q_DECLARE_PRIVATE(QCommonStyle) + Q_DISABLE_COPY(QCommonStyle) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOMMONSTYLE_H diff --git a/qtinterface/qt4/Qt/qcompleter.h b/qtinterface/qt4/Qt/qcompleter.h new file mode 100644 index 0000000..e2345d9 --- /dev/null +++ b/qtinterface/qt4/Qt/qcompleter.h @@ -0,0 +1,170 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOMPLETER_H +#define QCOMPLETER_H + +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_COMPLETER + +class QCompleterPrivate; +class QAbstractItemView; +class QAbstractProxyModel; +class QWidget; + +class Q_GUI_EXPORT QCompleter : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString completionPrefix READ completionPrefix WRITE setCompletionPrefix) + Q_PROPERTY(ModelSorting modelSorting READ modelSorting WRITE setModelSorting) + Q_PROPERTY(CompletionMode completionMode READ completionMode WRITE setCompletionMode) + Q_PROPERTY(int completionColumn READ completionColumn WRITE setCompletionColumn) + Q_PROPERTY(int completionRole READ completionRole WRITE setCompletionRole) + Q_PROPERTY(int maxVisibleItems READ maxVisibleItems WRITE setMaxVisibleItems) + Q_PROPERTY(Qt::CaseSensitivity caseSensitivity READ caseSensitivity WRITE setCaseSensitivity) + Q_PROPERTY(bool wrapAround READ wrapAround WRITE setWrapAround) + +public: + enum CompletionMode { + PopupCompletion, + UnfilteredPopupCompletion, + InlineCompletion + }; + + enum ModelSorting { + UnsortedModel = 0, + CaseSensitivelySortedModel, + CaseInsensitivelySortedModel + }; + + QCompleter(QObject *parent = 0); + QCompleter(QAbstractItemModel *model, QObject *parent = 0); +#ifndef QT_NO_STRINGLISTMODEL + QCompleter(const QStringList& completions, QObject *parent = 0); +#endif + ~QCompleter(); + + void setWidget(QWidget *widget); + QWidget *widget() const; + + void setModel(QAbstractItemModel *c); + QAbstractItemModel *model() const; + + void setCompletionMode(CompletionMode mode); + CompletionMode completionMode() const; + + QAbstractItemView *popup() const; + void setPopup(QAbstractItemView *popup); + + void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity); + Qt::CaseSensitivity caseSensitivity() const; + + void setModelSorting(ModelSorting sorting); + ModelSorting modelSorting() const; + + void setCompletionColumn(int column); + int completionColumn() const; + + void setCompletionRole(int role); + int completionRole() const; + + bool wrapAround() const; + + int maxVisibleItems() const; + void setMaxVisibleItems(int maxItems); + + int completionCount() const; + bool setCurrentRow(int row); + int currentRow() const; + + QModelIndex currentIndex() const; + QString currentCompletion() const; + + QAbstractItemModel *completionModel() const; + + QString completionPrefix() const; + +public Q_SLOTS: + void setCompletionPrefix(const QString &prefix); + void complete(const QRect& rect = QRect()); + void setWrapAround(bool wrap); + +public: + virtual QString pathFromIndex(const QModelIndex &index) const; + virtual QStringList splitPath(const QString &path) const; + +protected: + bool eventFilter(QObject *o, QEvent *e); + bool event(QEvent *); + +Q_SIGNALS: + void activated(const QString &text); + void activated(const QModelIndex &index); + void highlighted(const QString &text); + void highlighted(const QModelIndex &index); + +private: + Q_DISABLE_COPY(QCompleter) + Q_DECLARE_PRIVATE(QCompleter) + + Q_PRIVATE_SLOT(d_func(), void _q_complete(QModelIndex)) + Q_PRIVATE_SLOT(d_func(), void _q_completionSelected(const QItemSelection&)) + Q_PRIVATE_SLOT(d_func(), void _q_autoResizePopup()) +}; + +#endif // QT_NO_COMPLETER + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOMPLETER_H diff --git a/qtinterface/qt4/Qt/qconfig-dist.h b/qtinterface/qt4/Qt/qconfig-dist.h new file mode 100644 index 0000000..730ef89 --- /dev/null +++ b/qtinterface/qt4/Qt/qconfig-dist.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +/* + Empty leaves all features enabled. See doc/html/emb-features.html for choices. + + Note that disabling some features will produce a libqt that is not + compatible with other libqt builds. Such modifications are only + supported on Qt for Embedded Linux where reducing the library size is + important and where the application suite is often a fixed set. +*/ diff --git a/qtinterface/qt4/Qt/qconfig-large.h b/qtinterface/qt4/Qt/qconfig-large.h new file mode 100644 index 0000000..355d4d0 --- /dev/null +++ b/qtinterface/qt4/Qt/qconfig-large.h @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Dialogs */ +#ifndef QT_NO_FILEDIALOG +# define QT_NO_FILEDIALOG +#endif +#ifndef QT_NO_FONTDIALOG +# define QT_NO_FONTDIALOG +#endif +#ifndef QT_NO_INPUTDIALOG +# define QT_NO_INPUTDIALOG +#endif +#ifndef QT_NO_PRINTDIALOG +# define QT_NO_PRINTDIALOG +#endif +#ifndef QT_NO_PROGRESSDIALOG +# define QT_NO_PROGRESSDIALOG +#endif + +/* Fonts */ +#ifndef QT_NO_QWS_QPF +# define QT_NO_QWS_QPF +#endif + +/* Images */ +#ifndef QT_NO_IMAGEFORMAT_BMP +# define QT_NO_IMAGEFORMAT_BMP +#endif +#ifndef QT_NO_IMAGEFORMAT_PPM +# define QT_NO_IMAGEFORMAT_PPM +#endif + +/* Internationalization */ +#ifndef QT_NO_CODECS +# define QT_NO_CODECS +#endif +#ifndef QT_NO_TRANSLATION +# define QT_NO_TRANSLATION +#endif +#ifndef QT_NO_TRANSLATION_UTF8 +# define QT_NO_TRANSLATION_UTF8 +#endif + +/* ItemViews */ +#ifndef QT_NO_TABLEVIEW +# define QT_NO_TABLEVIEW +#endif +#ifndef QT_NO_TREEVIEW +# define QT_NO_TREEVIEW +#endif + +/* Kernel */ +#ifndef QT_NO_CLIPBOARD +# define QT_NO_CLIPBOARD +#endif +#ifndef QT_NO_DRAGANDDROP +# define QT_NO_DRAGANDDROP +#endif +#ifndef QT_NO_EFFECTS +# define QT_NO_EFFECTS +#endif +#ifndef QT_NO_PROPERTIES +# define QT_NO_PROPERTIES +#endif +#ifndef QT_NO_SOUND +# define QT_NO_SOUND +#endif + +/* Networking */ +#ifndef QT_NO_HOSTINFO +# define QT_NO_HOSTINFO +#endif +#ifndef QT_NO_HTTP +# define QT_NO_HTTP +#endif +#ifndef QT_NO_UDPSOCKET +# define QT_NO_UDPSOCKET +#endif +#ifndef QT_NO_URLINFO +# define QT_NO_URLINFO +#endif +#ifndef QT_NO_FTP +# define QT_NO_FTP +#endif + +/* Painting */ +#ifndef QT_NO_COLORNAMES +# define QT_NO_COLORNAMES +#endif +#ifndef QT_NO_PICTURE +# define QT_NO_PICTURE +#endif +#ifndef QT_NO_PRINTER +# define QT_NO_PRINTER +#endif +#ifndef QT_NO_CUPS +# define QT_NO_CUPS +#endif + +/* Qt for Embedded Linux */ +#ifndef QT_NO_QWS_SOUNDSERVER +# define QT_NO_QWS_SOUNDSERVER +#endif + +/* Styles */ +#ifndef QT_NO_STYLE_MOTIF +# define QT_NO_STYLE_MOTIF +#endif +#ifndef QT_NO_STYLE_CDE +# define QT_NO_STYLE_CDE +#endif +#ifndef QT_NO_STYLE_STYLESHEET +# define QT_NO_STYLE_STYLESHEET +#endif + +/* Widgets */ +#ifndef QT_NO_CALENDARWIDGET +# define QT_NO_CALENDARWIDGET +#endif +#ifndef QT_NO_DATETIMEEDIT +# define QT_NO_DATETIMEEDIT +#endif +#ifndef QT_NO_WORKSPACE +# define QT_NO_WORKSPACE +#endif +#ifndef QT_NO_DIAL +# define QT_NO_DIAL +#endif +#ifndef QT_NO_TABLEWIDGET +# define QT_NO_TABLEWIDGET +#endif +#ifndef QT_NO_TREEWIDGET +# define QT_NO_TREEWIDGET +#endif diff --git a/qtinterface/qt4/Qt/qconfig-medium.h b/qtinterface/qt4/Qt/qconfig-medium.h new file mode 100644 index 0000000..3178ef2 --- /dev/null +++ b/qtinterface/qt4/Qt/qconfig-medium.h @@ -0,0 +1,294 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Dialogs */ +#ifndef QT_NO_COLORDIALOG +# define QT_NO_COLORDIALOG +#endif +#ifndef QT_NO_FILEDIALOG +# define QT_NO_FILEDIALOG +#endif +#ifndef QT_NO_FONTDIALOG +# define QT_NO_FONTDIALOG +#endif +#ifndef QT_NO_INPUTDIALOG +# define QT_NO_INPUTDIALOG +#endif +#ifndef QT_NO_PRINTDIALOG +# define QT_NO_PRINTDIALOG +#endif +#ifndef QT_NO_PROGRESSDIALOG +# define QT_NO_PROGRESSDIALOG +#endif +#ifndef QT_NO_TABDIALOG +# define QT_NO_TABDIALOG +#endif + +/* Fonts */ +#ifndef QT_NO_QWS_QPF +# define QT_NO_QWS_QPF +#endif + +/* Images */ +#ifndef QT_NO_IMAGEFORMAT_BMP +# define QT_NO_IMAGEFORMAT_BMP +#endif +#ifndef QT_NO_IMAGEFORMAT_PPM +# define QT_NO_IMAGEFORMAT_PPM +#endif +#ifndef QT_NO_IMAGE_TEXT +# define QT_NO_IMAGE_TEXT +#endif +#ifndef QT_NO_MOVIE +# define QT_NO_MOVIE +#endif + +/* Internationalization */ +#ifndef QT_NO_BIG_CODECS +# define QT_NO_BIG_CODECS +#endif +#ifndef QT_NO_TEXTCODEC +# define QT_NO_TEXTCODEC +#endif +#ifndef QT_NO_CODECS +# define QT_NO_CODECS +#endif +#ifndef QT_NO_TEXTCODECPLUGIN +# define QT_NO_TEXTCODECPLUGIN +#endif +#ifndef QT_NO_TRANSLATION +# define QT_NO_TRANSLATION +#endif +#ifndef QT_NO_TRANSLATION_UTF8 +# define QT_NO_TRANSLATION_UTF8 +#endif + +/* ItemViews */ +#ifndef QT_NO_TABLEVIEW +# define QT_NO_TABLEVIEW +#endif +#ifndef QT_NO_TREEVIEW +# define QT_NO_TREEVIEW +#endif + +/* Kernel */ +#ifndef QT_NO_ACTION +# define QT_NO_ACTION +#endif +#ifndef QT_NO_CLIPBOARD +# define QT_NO_CLIPBOARD +#endif +#ifndef QT_NO_DRAGANDDROP +# define QT_NO_DRAGANDDROP +#endif +#ifndef QT_NO_EFFECTS +# define QT_NO_EFFECTS +#endif +#ifndef QT_NO_PROPERTIES +# define QT_NO_PROPERTIES +#endif +#ifndef QT_NO_SESSIONMANAGER +# define QT_NO_SESSIONMANAGER +#endif +#ifndef QT_NO_SHORTCUT +# define QT_NO_SHORTCUT +#endif +#ifndef QT_NO_SOUND +# define QT_NO_SOUND +#endif +#ifndef QT_NO_WHEELEVENT +# define QT_NO_WHEELEVENT +#endif + +/* Networking */ +#ifndef QT_NO_COP +# define QT_NO_COP +#endif +#ifndef QT_NO_HOSTINFO +# define QT_NO_HOSTINFO +#endif +#ifndef QT_NO_HTTP +# define QT_NO_HTTP +#endif +#ifndef QT_NO_NETWORKPROXY +# define QT_NO_NETWORKPROXY +#endif +#ifndef QT_NO_SOCKS5 +# define QT_NO_SOCKS5 +#endif +#ifndef QT_NO_UDPSOCKET +# define QT_NO_UDPSOCKET +#endif +#ifndef QT_NO_URLINFO +# define QT_NO_URLINFO +#endif +#ifndef QT_NO_FTP +# define QT_NO_FTP +#endif + +/* Painting */ +#ifndef QT_NO_COLORNAMES +# define QT_NO_COLORNAMES +#endif +#ifndef QT_NO_PICTURE +# define QT_NO_PICTURE +#endif +#ifndef QT_NO_PRINTER +# define QT_NO_PRINTER +#endif +#ifndef QT_NO_CUPS +# define QT_NO_CUPS +#endif + +/* Qt for Embedded Linux */ +#ifndef QT_NO_QWSEMBEDWIDGET +# define QT_NO_QWSEMBEDWIDGET +#endif +#ifndef QT_NO_QWS_SOUNDSERVER +# define QT_NO_QWS_SOUNDSERVER +#endif +#ifndef QT_NO_QWS_PROPERTIES +# define QT_NO_QWS_PROPERTIES +#endif + +/* Styles */ +#ifndef QT_NO_STYLE_MOTIF +# define QT_NO_STYLE_MOTIF +#endif +#ifndef QT_NO_STYLE_CDE +# define QT_NO_STYLE_CDE +#endif +#ifndef QT_NO_STYLE_STYLESHEET +# define QT_NO_STYLE_STYLESHEET +#endif + +/* Utilities */ +#ifndef QT_NO_UNDOCOMMAND +# define QT_NO_UNDOCOMMAND +#endif +#ifndef QT_NO_UNDOGROUP +# define QT_NO_UNDOGROUP +#endif +#ifndef QT_NO_UNDOSTACK +# define QT_NO_UNDOSTACK +#endif +#ifndef QT_NO_UNDOVIEW +# define QT_NO_UNDOVIEW +#endif + +/* Widgets */ +#ifndef QT_NO_LCDNUMBER +# define QT_NO_LCDNUMBER +#endif +#ifndef QT_NO_CALENDARWIDGET +# define QT_NO_CALENDARWIDGET +#endif +#ifndef QT_NO_DATETIMEEDIT +# define QT_NO_DATETIMEEDIT +#endif +#ifndef QT_NO_MENU +# define QT_NO_MENU +#endif +#ifndef QT_NO_CONTEXTMENU +# define QT_NO_CONTEXTMENU +#endif +#ifndef QT_NO_MAINWINDOW +# define QT_NO_MAINWINDOW +#endif +#ifndef QT_NO_DOCKWIDGET +# define QT_NO_DOCKWIDGET +#endif +#ifndef QT_NO_TOOLBAR +# define QT_NO_TOOLBAR +#endif +#ifndef QT_NO_MENUBAR +# define QT_NO_MENUBAR +#endif +#ifndef QT_NO_WORKSPACE +# define QT_NO_WORKSPACE +#endif +#ifndef QT_NO_PROGRESSBAR +# define QT_NO_PROGRESSBAR +#endif +#ifndef QT_NO_SIZEGRIP +# define QT_NO_SIZEGRIP +#endif +#ifndef QT_NO_DIAL +# define QT_NO_DIAL +#endif +#ifndef QT_NO_STACKEDWIDGET +# define QT_NO_STACKEDWIDGET +#endif +#ifndef QT_NO_TABWIDGET +# define QT_NO_TABWIDGET +#endif +#ifndef QT_NO_STATUSBAR +# define QT_NO_STATUSBAR +#endif +#ifndef QT_NO_STATUSTIP +# define QT_NO_STATUSTIP +#endif +#ifndef QT_NO_TABLEWIDGET +# define QT_NO_TABLEWIDGET +#endif +#ifndef QT_NO_TOOLBUTTON +# define QT_NO_TOOLBUTTON +#endif +#ifndef QT_NO_TABBAR +# define QT_NO_TABBAR +#endif +#ifndef QT_NO_TOOLBOX +# define QT_NO_TOOLBOX +#endif +#ifndef QT_NO_WHATSTHIS +# define QT_NO_WHATSTHIS +#endif +#ifndef QT_NO_TOOLTIP +# define QT_NO_TOOLTIP +#endif +#ifndef QT_NO_TREEWIDGET +# define QT_NO_TREEWIDGET +#endif + +/* Windows */ +#ifndef QT_NO_WIN_ACTIVEQT +# define QT_NO_WIN_ACTIVEQT +#endif diff --git a/qtinterface/qt4/Qt/qconfig-minimal.h b/qtinterface/qt4/Qt/qconfig-minimal.h new file mode 100644 index 0000000..bb83242 --- /dev/null +++ b/qtinterface/qt4/Qt/qconfig-minimal.h @@ -0,0 +1,597 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Data structures */ +#ifndef QT_NO_QUUID_STRING +# define QT_NO_QUUID_STRING +#endif +#ifndef QT_NO_STL +# define QT_NO_STL +#endif +#ifndef QT_NO_TEXTDATE +# define QT_NO_TEXTDATE +#endif +#ifndef QT_NO_DATESTRING +# define QT_NO_DATESTRING +#endif + +/* Dialogs */ +#ifndef QT_NO_COLORDIALOG +# define QT_NO_COLORDIALOG +#endif +#ifndef QT_NO_ERRORMESSAGE +# define QT_NO_ERRORMESSAGE +#endif +#ifndef QT_NO_FILEDIALOG +# define QT_NO_FILEDIALOG +#endif +#ifndef QT_NO_FONTDIALOG +# define QT_NO_FONTDIALOG +#endif +#ifndef QT_NO_INPUTDIALOG +# define QT_NO_INPUTDIALOG +#endif +#ifndef QT_NO_MESSAGEBOX +# define QT_NO_MESSAGEBOX +#endif +#ifndef QT_NO_PRINTDIALOG +# define QT_NO_PRINTDIALOG +#endif +#ifndef QT_NO_PRINTPREVIEWDIALOG +# define QT_NO_PRINTPREVIEWDIALOG +#endif +#ifndef QT_NO_PROGRESSDIALOG +# define QT_NO_PROGRESSDIALOG +#endif +#ifndef QT_NO_TABDIALOG +# define QT_NO_TABDIALOG +#endif +#ifndef QT_NO_WIZARD +# define QT_NO_WIZARD +#endif + +/* File I/O */ +#ifndef QT_NO_DOM +# define QT_NO_DOM +#endif +#ifndef QT_NO_FILESYSTEMWATCHER +# define QT_NO_FILESYSTEMWATCHER +#endif +#ifndef QT_NO_FILESYSTEMMODEL +# define QT_NO_FILESYSTEMMODEL +#endif +#ifndef QT_NO_PROCESS +# define QT_NO_PROCESS +#endif +#ifndef QT_NO_TEMPORARYFILE +# define QT_NO_TEMPORARYFILE +#endif +#ifndef QT_NO_TEXTSTREAM +# define QT_NO_TEXTSTREAM +#endif +#ifndef QT_NO_SETTINGS +# define QT_NO_SETTINGS +#endif +#ifndef QT_NO_LIBRARY +# define QT_NO_LIBRARY +#endif + +/* Fonts */ +#ifndef QT_NO_FREETYPE +# define QT_NO_FREETYPE +#endif +#ifndef QT_NO_QWS_QPF2 +# define QT_NO_QWS_QPF2 +#endif + +/* Images */ +#ifndef QT_NO_IMAGEFORMATPLUGIN +# define QT_NO_IMAGEFORMATPLUGIN +#endif +#ifndef QT_NO_IMAGEFORMAT_BMP +# define QT_NO_IMAGEFORMAT_BMP +#endif +#ifndef QT_NO_IMAGEFORMAT_JPEG +# define QT_NO_IMAGEFORMAT_JPEG +#endif +#ifndef QT_NO_IMAGEFORMAT_PNG +# define QT_NO_IMAGEFORMAT_PNG +#endif +#ifndef QT_NO_IMAGEFORMAT_PPM +# define QT_NO_IMAGEFORMAT_PPM +#endif +#ifndef QT_NO_IMAGEFORMAT_XBM +# define QT_NO_IMAGEFORMAT_XBM +#endif +#ifndef QT_NO_IMAGEFORMAT_XPM +# define QT_NO_IMAGEFORMAT_XPM +#endif +#ifndef QT_NO_IMAGE_HEURISTIC_MASK +# define QT_NO_IMAGE_HEURISTIC_MASK +#endif +#ifndef QT_NO_IMAGE_TEXT +# define QT_NO_IMAGE_TEXT +#endif +#ifndef QT_NO_MOVIE +# define QT_NO_MOVIE +#endif + +/* Internationalization */ +#ifndef QT_NO_BIG_CODECS +# define QT_NO_BIG_CODECS +#endif +#ifndef QT_NO_QWS_INPUTMETHODS +# define QT_NO_QWS_INPUTMETHODS +#endif +#ifndef QT_NO_TEXTCODEC +# define QT_NO_TEXTCODEC +#endif +#ifndef QT_NO_CODECS +# define QT_NO_CODECS +#endif +#ifndef QT_NO_TEXTCODECPLUGIN +# define QT_NO_TEXTCODECPLUGIN +#endif +#ifndef QT_NO_TRANSLATION +# define QT_NO_TRANSLATION +#endif +#ifndef QT_NO_TRANSLATION_UTF8 +# define QT_NO_TRANSLATION_UTF8 +#endif + +/* ItemViews */ +#ifndef QT_NO_ITEMVIEWS +# define QT_NO_ITEMVIEWS +#endif +#ifndef QT_NO_DATAWIDGETMAPPER +# define QT_NO_DATAWIDGETMAPPER +#endif +#ifndef QT_NO_DIRMODEL +# define QT_NO_DIRMODEL +#endif +#ifndef QT_NO_LISTVIEW +# define QT_NO_LISTVIEW +#endif +#ifndef QT_NO_COLUMNVIEW +# define QT_NO_COLUMNVIEW +#endif +#ifndef QT_NO_PROXYMODEL +# define QT_NO_PROXYMODEL +#endif +#ifndef QT_NO_SORTFILTERPROXYMODEL +# define QT_NO_SORTFILTERPROXYMODEL +#endif +#ifndef QT_NO_STANDARDITEMMODEL +# define QT_NO_STANDARDITEMMODEL +#endif +#ifndef QT_NO_STRINGLISTMODEL +# define QT_NO_STRINGLISTMODEL +#endif +#ifndef QT_NO_TABLEVIEW +# define QT_NO_TABLEVIEW +#endif +#ifndef QT_NO_TREEVIEW +# define QT_NO_TREEVIEW +#endif + +/* Kernel */ +#ifndef QT_NO_ACTION +# define QT_NO_ACTION +#endif +#ifndef QT_NO_CLIPBOARD +# define QT_NO_CLIPBOARD +#endif +#ifndef QT_NO_CSSPARSER +# define QT_NO_CSSPARSER +#endif +#ifndef QT_NO_CURSOR +# define QT_NO_CURSOR +#endif +#ifndef QT_NO_DRAGANDDROP +# define QT_NO_DRAGANDDROP +#endif +#ifndef QT_NO_EFFECTS +# define QT_NO_EFFECTS +#endif +#ifndef QT_NO_PROPERTIES +# define QT_NO_PROPERTIES +#endif +#ifndef QT_NO_SESSIONMANAGER +# define QT_NO_SESSIONMANAGER +#endif +#ifndef QT_NO_SHAREDMEMORY +# define QT_NO_SHAREDMEMORY +#endif +#ifndef QT_NO_SHORTCUT +# define QT_NO_SHORTCUT +#endif +#ifndef QT_NO_SOUND +# define QT_NO_SOUND +#endif +#ifndef QT_NO_SYSTEMSEMAPHORE +# define QT_NO_SYSTEMSEMAPHORE +#endif +#ifndef QT_NO_TABLETEVENT +# define QT_NO_TABLETEVENT +#endif +#ifndef QT_NO_TEXTHTMLPARSER +# define QT_NO_TEXTHTMLPARSER +#endif +#ifndef QT_NO_CONCURRENT +# define QT_NO_CONCURRENT +#endif +#ifndef QT_NO_WHEELEVENT +# define QT_NO_WHEELEVENT +#endif +#ifndef QT_NO_XMLSTREAM +# define QT_NO_XMLSTREAM +#endif +#ifndef QT_NO_XMLSTREAMREADER +# define QT_NO_XMLSTREAMREADER +#endif +#ifndef QT_NO_XMLSTREAMWRITER +# define QT_NO_XMLSTREAMWRITER +#endif + +/* Networking */ +#ifndef QT_NO_COP +# define QT_NO_COP +#endif +#ifndef QT_NO_HOSTINFO +# define QT_NO_HOSTINFO +#endif +#ifndef QT_NO_HTTP +# define QT_NO_HTTP +#endif +#ifndef QT_NO_NETWORKPROXY +# define QT_NO_NETWORKPROXY +#endif +#ifndef QT_NO_SOCKS5 +# define QT_NO_SOCKS5 +#endif +#ifndef QT_NO_UDPSOCKET +# define QT_NO_UDPSOCKET +#endif +#ifndef QT_NO_URLINFO +# define QT_NO_URLINFO +#endif +#ifndef QT_NO_FTP +# define QT_NO_FTP +#endif + +/* Painting */ +#ifndef QT_NO_COLORNAMES +# define QT_NO_COLORNAMES +#endif +#ifndef QT_NO_DIRECTPAINTER +# define QT_NO_DIRECTPAINTER +#endif +#ifndef QT_NO_PAINTONSCREEN +# define QT_NO_PAINTONSCREEN +#endif +#ifndef QT_NO_PAINT_DEBUG +# define QT_NO_PAINT_DEBUG +#endif +#ifndef QT_NO_PICTURE +# define QT_NO_PICTURE +#endif +#ifndef QT_NO_PRINTER +# define QT_NO_PRINTER +#endif +#ifndef QT_NO_CUPS +# define QT_NO_CUPS +#endif + +/* Qt for Embedded Linux */ +#ifndef QT_NO_QWSEMBEDWIDGET +# define QT_NO_QWSEMBEDWIDGET +#endif +#ifndef QT_NO_QWS_ALPHA_CURSOR +# define QT_NO_QWS_ALPHA_CURSOR +#endif +#ifndef QT_NO_QWS_CURSOR +# define QT_NO_QWS_CURSOR +#endif +#ifndef QT_NO_QWS_DECORATION_DEFAULT +# define QT_NO_QWS_DECORATION_DEFAULT +#endif +#ifndef QT_NO_QWS_DECORATION_STYLED +# define QT_NO_QWS_DECORATION_STYLED +#endif +#ifndef QT_NO_QWS_DECORATION_WINDOWS +# define QT_NO_QWS_DECORATION_WINDOWS +#endif +#ifndef QT_NO_QWS_MANAGER +# define QT_NO_QWS_MANAGER +#endif +#ifndef QT_NO_QWS_KEYBOARD +# define QT_NO_QWS_KEYBOARD +#endif +#ifndef QT_NO_QWS_MOUSE +# define QT_NO_QWS_MOUSE +#endif +#ifndef QT_NO_QWS_MOUSE_AUTO +# define QT_NO_QWS_MOUSE_AUTO +#endif +#ifndef QT_NO_QWS_MOUSE_MANUAL +# define QT_NO_QWS_MOUSE_MANUAL +#endif +#ifndef QT_NO_QWS_MULTIPROCESS +# define QT_NO_QWS_MULTIPROCESS +#endif +#ifndef QT_NO_QWS_SOUNDSERVER +# define QT_NO_QWS_SOUNDSERVER +#endif +#ifndef QT_NO_SXE +# define QT_NO_SXE +#endif +#ifndef QT_NO_QWS_PROPERTIES +# define QT_NO_QWS_PROPERTIES +#endif +#ifndef QT_NO_QWS_PROXYSCREEN +# define QT_NO_QWS_PROXYSCREEN +#endif +#ifndef QT_NO_QWS_DYNAMICSCREENTRANSFORMATION +# define QT_NO_QWS_DYNAMICSCREENTRANSFORMATION +#endif + +/* SVG */ +#ifndef QT_NO_SVG +# define QT_NO_SVG +#endif +#ifndef QT_NO_GRAPHICSSVGITEM +# define QT_NO_GRAPHICSSVGITEM +#endif +#ifndef QT_NO_SVGGENERATOR +# define QT_NO_SVGGENERATOR +#endif +#ifndef QT_NO_SVGRENDERER +# define QT_NO_SVGRENDERER +#endif +#ifndef QT_NO_SVGWIDGET +# define QT_NO_SVGWIDGET +#endif + +/* Styles */ +#ifndef QT_NO_STYLE_MOTIF +# define QT_NO_STYLE_MOTIF +#endif +#ifndef QT_NO_STYLE_CDE +# define QT_NO_STYLE_CDE +#endif +#ifndef QT_NO_STYLE_CLEANLOOKS +# define QT_NO_STYLE_CLEANLOOKS +#endif +#ifndef QT_NO_STYLE_PLASTIQUE +# define QT_NO_STYLE_PLASTIQUE +#endif +#ifndef QT_NO_STYLE_STYLESHEET +# define QT_NO_STYLE_STYLESHEET +#endif +#ifndef QT_NO_STYLE_WINDOWSCE +# define QT_NO_STYLE_WINDOWSCE +#endif +#ifndef QT_NO_STYLE_WINDOWSMOBILE +# define QT_NO_STYLE_WINDOWSMOBILE +#endif +#ifndef QT_NO_STYLE_WINDOWSVISTA +# define QT_NO_STYLE_WINDOWSVISTA +#endif +#ifndef QT_NO_STYLE_WINDOWSXP +# define QT_NO_STYLE_WINDOWSXP +#endif + +/* Utilities */ +#ifndef QT_NO_ACCESSIBILITY +# define QT_NO_ACCESSIBILITY +#endif +#ifndef QT_NO_COMPLETER +# define QT_NO_COMPLETER +#endif +#ifndef QT_NO_DESKTOPSERVICES +# define QT_NO_DESKTOPSERVICES +#endif +#ifndef QT_NO_SCRIPT +# define QT_NO_SCRIPT +#endif +#ifndef QT_NO_SYSTEMTRAYICON +# define QT_NO_SYSTEMTRAYICON +#endif +#ifndef QT_NO_UNDOCOMMAND +# define QT_NO_UNDOCOMMAND +#endif +#ifndef QT_NO_UNDOGROUP +# define QT_NO_UNDOGROUP +#endif +#ifndef QT_NO_UNDOSTACK +# define QT_NO_UNDOSTACK +#endif +#ifndef QT_NO_UNDOVIEW +# define QT_NO_UNDOVIEW +#endif + +/* Widgets */ +#ifndef QT_NO_GROUPBOX +# define QT_NO_GROUPBOX +#endif +#ifndef QT_NO_BUTTONGROUP +# define QT_NO_BUTTONGROUP +#endif +#ifndef QT_NO_LCDNUMBER +# define QT_NO_LCDNUMBER +#endif +#ifndef QT_NO_LINEEDIT +# define QT_NO_LINEEDIT +#endif +#ifndef QT_NO_COMBOBOX +# define QT_NO_COMBOBOX +#endif +#ifndef QT_NO_FONTCOMBOBOX +# define QT_NO_FONTCOMBOBOX +#endif +#ifndef QT_NO_SPINBOX +# define QT_NO_SPINBOX +#endif +#ifndef QT_NO_CALENDARWIDGET +# define QT_NO_CALENDARWIDGET +#endif +#ifndef QT_NO_DATETIMEEDIT +# define QT_NO_DATETIMEEDIT +#endif +#ifndef QT_NO_LISTWIDGET +# define QT_NO_LISTWIDGET +#endif +#ifndef QT_NO_MENU +# define QT_NO_MENU +#endif +#ifndef QT_NO_CONTEXTMENU +# define QT_NO_CONTEXTMENU +#endif +#ifndef QT_NO_MAINWINDOW +# define QT_NO_MAINWINDOW +#endif +#ifndef QT_NO_DOCKWIDGET +# define QT_NO_DOCKWIDGET +#endif +#ifndef QT_NO_TOOLBAR +# define QT_NO_TOOLBAR +#endif +#ifndef QT_NO_MENUBAR +# define QT_NO_MENUBAR +#endif +#ifndef QT_NO_WORKSPACE +# define QT_NO_WORKSPACE +#endif +#ifndef QT_NO_PROGRESSBAR +# define QT_NO_PROGRESSBAR +#endif +#ifndef QT_NO_RESIZEHANDLER +# define QT_NO_RESIZEHANDLER +#endif +#ifndef QT_NO_RUBBERBAND +# define QT_NO_RUBBERBAND +#endif +#ifndef QT_NO_SPLITTER +# define QT_NO_SPLITTER +#endif +#ifndef QT_NO_SIGNALMAPPER +# define QT_NO_SIGNALMAPPER +#endif +#ifndef QT_NO_SIZEGRIP +# define QT_NO_SIZEGRIP +#endif +#ifndef QT_NO_SLIDER +# define QT_NO_SLIDER +#endif +#ifndef QT_NO_DIAL +# define QT_NO_DIAL +#endif +#ifndef QT_NO_SCROLLBAR +# define QT_NO_SCROLLBAR +#endif +#ifndef QT_NO_SCROLLAREA +# define QT_NO_SCROLLAREA +#endif +#ifndef QT_NO_GRAPHICSVIEW +# define QT_NO_GRAPHICSVIEW +#endif +#ifndef QT_NO_PRINTPREVIEWWIDGET +# define QT_NO_PRINTPREVIEWWIDGET +#endif +#ifndef QT_NO_MDIAREA +# define QT_NO_MDIAREA +#endif +#ifndef QT_NO_TEXTEDIT +# define QT_NO_TEXTEDIT +#endif +#ifndef QT_NO_SYNTAXHIGHLIGHTER +# define QT_NO_SYNTAXHIGHLIGHTER +#endif +#ifndef QT_NO_TEXTBROWSER +# define QT_NO_TEXTBROWSER +#endif +#ifndef QT_NO_SPINWIDGET +# define QT_NO_SPINWIDGET +#endif +#ifndef QT_NO_SPLASHSCREEN +# define QT_NO_SPLASHSCREEN +#endif +#ifndef QT_NO_STACKEDWIDGET +# define QT_NO_STACKEDWIDGET +#endif +#ifndef QT_NO_TABWIDGET +# define QT_NO_TABWIDGET +#endif +#ifndef QT_NO_STATUSBAR +# define QT_NO_STATUSBAR +#endif +#ifndef QT_NO_STATUSTIP +# define QT_NO_STATUSTIP +#endif +#ifndef QT_NO_TABLEWIDGET +# define QT_NO_TABLEWIDGET +#endif +#ifndef QT_NO_TOOLBUTTON +# define QT_NO_TOOLBUTTON +#endif +#ifndef QT_NO_TABBAR +# define QT_NO_TABBAR +#endif +#ifndef QT_NO_TOOLBOX +# define QT_NO_TOOLBOX +#endif +#ifndef QT_NO_WHATSTHIS +# define QT_NO_WHATSTHIS +#endif +#ifndef QT_NO_TOOLTIP +# define QT_NO_TOOLTIP +#endif +#ifndef QT_NO_TREEWIDGET +# define QT_NO_TREEWIDGET +#endif +#ifndef QT_NO_VALIDATOR +# define QT_NO_VALIDATOR +#endif + +/* Windows */ +#ifndef QT_NO_WIN_ACTIVEQT +# define QT_NO_WIN_ACTIVEQT +#endif diff --git a/qtinterface/qt4/Qt/qconfig-small.h b/qtinterface/qt4/Qt/qconfig-small.h new file mode 100644 index 0000000..85f961b --- /dev/null +++ b/qtinterface/qt4/Qt/qconfig-small.h @@ -0,0 +1,332 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Data structures */ +#ifndef QT_NO_QUUID_STRING +# define QT_NO_QUUID_STRING +#endif +#ifndef QT_NO_STL +# define QT_NO_STL +#endif + +/* Dialogs */ +#ifndef QT_NO_COLORDIALOG +# define QT_NO_COLORDIALOG +#endif +#ifndef QT_NO_ERRORMESSAGE +# define QT_NO_ERRORMESSAGE +#endif +#ifndef QT_NO_FILEDIALOG +# define QT_NO_FILEDIALOG +#endif +#ifndef QT_NO_FONTDIALOG +# define QT_NO_FONTDIALOG +#endif +#ifndef QT_NO_INPUTDIALOG +# define QT_NO_INPUTDIALOG +#endif +#ifndef QT_NO_MESSAGEBOX +# define QT_NO_MESSAGEBOX +#endif +#ifndef QT_NO_PRINTDIALOG +# define QT_NO_PRINTDIALOG +#endif +#ifndef QT_NO_PROGRESSDIALOG +# define QT_NO_PROGRESSDIALOG +#endif +#ifndef QT_NO_TABDIALOG +# define QT_NO_TABDIALOG +#endif + +/* File I/O */ +#ifndef QT_NO_TEXTSTREAM +# define QT_NO_TEXTSTREAM +#endif +#ifndef QT_NO_SETTINGS +# define QT_NO_SETTINGS +#endif +#ifndef QT_NO_LIBRARY +# define QT_NO_LIBRARY +#endif + +/* Fonts */ +#ifndef QT_NO_FREETYPE +# define QT_NO_FREETYPE +#endif + +/* Images */ +#ifndef QT_NO_IMAGEFORMATPLUGIN +# define QT_NO_IMAGEFORMATPLUGIN +#endif +#ifndef QT_NO_IMAGEFORMAT_BMP +# define QT_NO_IMAGEFORMAT_BMP +#endif +#ifndef QT_NO_IMAGEFORMAT_JPEG +# define QT_NO_IMAGEFORMAT_JPEG +#endif +#ifndef QT_NO_IMAGEFORMAT_PPM +# define QT_NO_IMAGEFORMAT_PPM +#endif +#ifndef QT_NO_IMAGEFORMAT_XBM +# define QT_NO_IMAGEFORMAT_XBM +#endif +#ifndef QT_NO_IMAGEFORMAT_XPM +# define QT_NO_IMAGEFORMAT_XPM +#endif +#ifndef QT_NO_IMAGE_TEXT +# define QT_NO_IMAGE_TEXT +#endif +#ifndef QT_NO_MOVIE +# define QT_NO_MOVIE +#endif + +/* Internationalization */ +#ifndef QT_NO_QWS_INPUTMETHODS +# define QT_NO_QWS_INPUTMETHODS +#endif +#ifndef QT_NO_TEXTCODEC +# define QT_NO_TEXTCODEC +#endif +#ifndef QT_NO_CODECS +# define QT_NO_CODECS +#endif +#ifndef QT_NO_TEXTCODECPLUGIN +# define QT_NO_TEXTCODECPLUGIN +#endif +#ifndef QT_NO_TRANSLATION +# define QT_NO_TRANSLATION +#endif +#ifndef QT_NO_TRANSLATION_UTF8 +# define QT_NO_TRANSLATION_UTF8 +#endif + +/* ItemViews */ +#ifndef QT_NO_DIRMODEL +# define QT_NO_DIRMODEL +#endif +#ifndef QT_NO_PROXYMODEL +# define QT_NO_PROXYMODEL +#endif +#ifndef QT_NO_SORTFILTERPROXYMODEL +# define QT_NO_SORTFILTERPROXYMODEL +#endif +#ifndef QT_NO_STRINGLISTMODEL +# define QT_NO_STRINGLISTMODEL +#endif +#ifndef QT_NO_TABLEVIEW +# define QT_NO_TABLEVIEW +#endif +#ifndef QT_NO_TREEVIEW +# define QT_NO_TREEVIEW +#endif + +/* Kernel */ +#ifndef QT_NO_ACTION +# define QT_NO_ACTION +#endif +#ifndef QT_NO_CLIPBOARD +# define QT_NO_CLIPBOARD +#endif +#ifndef QT_NO_DRAGANDDROP +# define QT_NO_DRAGANDDROP +#endif +#ifndef QT_NO_EFFECTS +# define QT_NO_EFFECTS +#endif +#ifndef QT_NO_PROPERTIES +# define QT_NO_PROPERTIES +#endif +#ifndef QT_NO_SESSIONMANAGER +# define QT_NO_SESSIONMANAGER +#endif +#ifndef QT_NO_SHORTCUT +# define QT_NO_SHORTCUT +#endif +#ifndef QT_NO_SOUND +# define QT_NO_SOUND +#endif +#ifndef QT_NO_WHEELEVENT +# define QT_NO_WHEELEVENT +#endif + +/* Networking */ +#ifndef QT_NO_COP +# define QT_NO_COP +#endif +#ifndef QT_NO_HOSTINFO +# define QT_NO_HOSTINFO +#endif +#ifndef QT_NO_HTTP +# define QT_NO_HTTP +#endif + +/* Painting */ +#ifndef QT_NO_COLORNAMES +# define QT_NO_COLORNAMES +#endif +#ifndef QT_NO_PICTURE +# define QT_NO_PICTURE +#endif +#ifndef QT_NO_PRINTER +# define QT_NO_PRINTER +#endif +#ifndef QT_NO_CUPS +# define QT_NO_CUPS +#endif + +/* Qt for Embedded Linux */ +#ifndef QT_NO_QWS_SOUNDSERVER +# define QT_NO_QWS_SOUNDSERVER +#endif +#ifndef QT_NO_QWS_PROPERTIES +# define QT_NO_QWS_PROPERTIES +#endif + +/* Styles */ +#ifndef QT_NO_STYLE_MOTIF +# define QT_NO_STYLE_MOTIF +#endif +#ifndef QT_NO_STYLE_CDE +# define QT_NO_STYLE_CDE +#endif +#ifndef QT_NO_STYLE_CLEANLOOKS +# define QT_NO_STYLE_CLEANLOOKS +#endif +#ifndef QT_NO_STYLE_PLASTIQUE +# define QT_NO_STYLE_PLASTIQUE +#endif +#ifndef QT_NO_STYLE_STYLESHEET +# define QT_NO_STYLE_STYLESHEET +#endif +#ifndef QT_NO_STYLE_WINDOWSXP +# define QT_NO_STYLE_WINDOWSXP +#endif + +/* Utilities */ +#ifndef QT_NO_COMPLETER +# define QT_NO_COMPLETER +#endif +#ifndef QT_NO_DESKTOPSERVICES +# define QT_NO_DESKTOPSERVICES +#endif +#ifndef QT_NO_SYSTEMTRAYICON +# define QT_NO_SYSTEMTRAYICON +#endif + +/* Widgets */ +#ifndef QT_NO_LCDNUMBER +# define QT_NO_LCDNUMBER +#endif +#ifndef QT_NO_FONTCOMBOBOX +# define QT_NO_FONTCOMBOBOX +#endif +#ifndef QT_NO_SPINBOX +# define QT_NO_SPINBOX +#endif +#ifndef QT_NO_CALENDARWIDGET +# define QT_NO_CALENDARWIDGET +#endif +#ifndef QT_NO_DATETIMEEDIT +# define QT_NO_DATETIMEEDIT +#endif +#ifndef QT_NO_MENU +# define QT_NO_MENU +#endif +#ifndef QT_NO_CONTEXTMENU +# define QT_NO_CONTEXTMENU +#endif +#ifndef QT_NO_MAINWINDOW +# define QT_NO_MAINWINDOW +#endif +#ifndef QT_NO_DOCKWIDGET +# define QT_NO_DOCKWIDGET +#endif +#ifndef QT_NO_TOOLBAR +# define QT_NO_TOOLBAR +#endif +#ifndef QT_NO_MENUBAR +# define QT_NO_MENUBAR +#endif +#ifndef QT_NO_WORKSPACE +# define QT_NO_WORKSPACE +#endif +#ifndef QT_NO_PROGRESSBAR +# define QT_NO_PROGRESSBAR +#endif +#ifndef QT_NO_SPLITTER +# define QT_NO_SPLITTER +#endif +#ifndef QT_NO_SIZEGRIP +# define QT_NO_SIZEGRIP +#endif +#ifndef QT_NO_STACKEDWIDGET +# define QT_NO_STACKEDWIDGET +#endif +#ifndef QT_NO_TABWIDGET +# define QT_NO_TABWIDGET +#endif +#ifndef QT_NO_STATUSBAR +# define QT_NO_STATUSBAR +#endif +#ifndef QT_NO_TABLEWIDGET +# define QT_NO_TABLEWIDGET +#endif +#ifndef QT_NO_TOOLBUTTON +# define QT_NO_TOOLBUTTON +#endif +#ifndef QT_NO_TABBAR +# define QT_NO_TABBAR +#endif +#ifndef QT_NO_TOOLBOX +# define QT_NO_TOOLBOX +#endif +#ifndef QT_NO_WHATSTHIS +# define QT_NO_WHATSTHIS +#endif +#ifndef QT_NO_TOOLTIP +# define QT_NO_TOOLTIP +#endif +#ifndef QT_NO_TREEWIDGET +# define QT_NO_TREEWIDGET +#endif +#ifndef QT_NO_VALIDATOR +# define QT_NO_VALIDATOR +#endif diff --git a/qtinterface/qt4/Qt/qconfig.h b/qtinterface/qt4/Qt/qconfig.h new file mode 100644 index 0000000..e1d756c --- /dev/null +++ b/qtinterface/qt4/Qt/qconfig.h @@ -0,0 +1,126 @@ +/* Everything */ + +/* Qt Edition */ +#ifndef QT_EDITION +# define QT_EDITION QT_EDITION_OPENSOURCE +#endif + +/* Machine byte-order */ +#define Q_BIG_ENDIAN 4321 +#define Q_LITTLE_ENDIAN 1234 +#define QT_BUILD_KEY "x86_64 linux g++-4 full-config" +#define QT_BUILD_KEY_COMPAT "x86_64 Linux g++-4 full-config" + +#ifdef QT_BOOTSTRAPPED +#define Q_BYTE_ORDER Q_LITTLE_ENDIAN +#else +#define Q_BYTE_ORDER Q_LITTLE_ENDIAN +#endif +/* Machine Architecture */ +#ifndef QT_BOOTSTRAPPED +# define QT_ARCH_X86_64 +#else +# define QT_ARCH_X86_64 +#endif +/* Compile time features */ +#define QT_LARGEFILE_SUPPORT 64 +#define QT_POINTER_SIZE 8 + +#if defined(QT_BUILTIN_GIF_READER) && defined(QT_NO_BUILTIN_GIF_READER) +# undef QT_BUILTIN_GIF_READER +#elif !defined(QT_BUILTIN_GIF_READER) && !defined(QT_NO_BUILTIN_GIF_READER) +# define QT_BUILTIN_GIF_READER 1 +#endif + +#if defined(QT_NO_DECLARATIVE) && defined(QT_DECLARATIVE) +# undef QT_NO_DECLARATIVE +#elif !defined(QT_NO_DECLARATIVE) && !defined(QT_DECLARATIVE) +# define QT_NO_DECLARATIVE +#endif + +#if defined(QT_NO_EGL) && defined(QT_EGL) +# undef QT_NO_EGL +#elif !defined(QT_NO_EGL) && !defined(QT_EGL) +# define QT_NO_EGL +#endif + +#if defined(QT_NO_GSTREAMER) && defined(QT_GSTREAMER) +# undef QT_NO_GSTREAMER +#elif !defined(QT_NO_GSTREAMER) && !defined(QT_GSTREAMER) +# define QT_NO_GSTREAMER +#endif + +#if defined(QT_NO_IMAGEFORMAT_JPEG) && defined(QT_IMAGEFORMAT_JPEG) +# undef QT_NO_IMAGEFORMAT_JPEG +#elif !defined(QT_NO_IMAGEFORMAT_JPEG) && !defined(QT_IMAGEFORMAT_JPEG) +# define QT_NO_IMAGEFORMAT_JPEG +#endif + +#if defined(QT_NO_IMAGEFORMAT_MNG) && defined(QT_IMAGEFORMAT_MNG) +# undef QT_NO_IMAGEFORMAT_MNG +#elif !defined(QT_NO_IMAGEFORMAT_MNG) && !defined(QT_IMAGEFORMAT_MNG) +# define QT_NO_IMAGEFORMAT_MNG +#endif + +#if defined(QT_NO_IMAGEFORMAT_TIFF) && defined(QT_IMAGEFORMAT_TIFF) +# undef QT_NO_IMAGEFORMAT_TIFF +#elif !defined(QT_NO_IMAGEFORMAT_TIFF) && !defined(QT_IMAGEFORMAT_TIFF) +# define QT_NO_IMAGEFORMAT_TIFF +#endif + +#if defined(QT_NO_OPENVG) && defined(QT_OPENVG) +# undef QT_NO_OPENVG +#elif !defined(QT_NO_OPENVG) && !defined(QT_OPENVG) +# define QT_NO_OPENVG +#endif + +#if defined(QT_NO_SXE) && defined(QT_SXE) +# undef QT_NO_SXE +#elif !defined(QT_NO_SXE) && !defined(QT_SXE) +# define QT_NO_SXE +#endif + +#if defined(QT_NO_ZLIB) && defined(QT_ZLIB) +# undef QT_NO_ZLIB +#elif !defined(QT_NO_ZLIB) && !defined(QT_ZLIB) +# define QT_NO_ZLIB +#endif + +#if defined(QT_RUNTIME_XCURSOR) && defined(QT_NO_RUNTIME_XCURSOR) +# undef QT_RUNTIME_XCURSOR +#elif !defined(QT_RUNTIME_XCURSOR) && !defined(QT_NO_RUNTIME_XCURSOR) +# define QT_RUNTIME_XCURSOR +#endif + +#if defined(QT_RUNTIME_XFIXES) && defined(QT_NO_RUNTIME_XFIXES) +# undef QT_RUNTIME_XFIXES +#elif !defined(QT_RUNTIME_XFIXES) && !defined(QT_NO_RUNTIME_XFIXES) +# define QT_RUNTIME_XFIXES +#endif + +#if defined(QT_RUNTIME_XINERAMA) && defined(QT_NO_RUNTIME_XINERAMA) +# undef QT_RUNTIME_XINERAMA +#elif !defined(QT_RUNTIME_XINERAMA) && !defined(QT_NO_RUNTIME_XINERAMA) +# define QT_RUNTIME_XINERAMA +#endif + +#if defined(QT_RUNTIME_XINPUT) && defined(QT_NO_RUNTIME_XINPUT) +# undef QT_RUNTIME_XINPUT +#elif !defined(QT_RUNTIME_XINPUT) && !defined(QT_NO_RUNTIME_XINPUT) +# define QT_RUNTIME_XINPUT +#endif + +#if defined(QT_RUNTIME_XRANDR) && defined(QT_NO_RUNTIME_XRANDR) +# undef QT_RUNTIME_XRANDR +#elif !defined(QT_RUNTIME_XRANDR) && !defined(QT_NO_RUNTIME_XRANDR) +# define QT_RUNTIME_XRANDR +#endif + +#if defined(QT_USE_MATH_H_FLOATS) && defined(QT_NO_USE_MATH_H_FLOATS) +# undef QT_USE_MATH_H_FLOATS +#elif !defined(QT_USE_MATH_H_FLOATS) && !defined(QT_NO_USE_MATH_H_FLOATS) +# define QT_USE_MATH_H_FLOATS +#endif + +#define QT_VISIBILITY_AVAILABLE + diff --git a/qtinterface/qt4/Qt/qcontainerfwd.h b/qtinterface/qt4/Qt/qcontainerfwd.h new file mode 100644 index 0000000..da0bdc4 --- /dev/null +++ b/qtinterface/qt4/Qt/qcontainerfwd.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCONTAINERFWD_H +#define QCONTAINERFWD_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +template class QCache; +template class QHash; +template class QLinkedList; +template class QList; +template class QMap; +template class QMultiHash; +template class QMultiMap; +template struct QPair; +template class QQueue; +template class QSet; +template class QStack; +template class QVarLengthArray; +template class QVector; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCONTAINERFWD_H diff --git a/qtinterface/qt4/Qt/qcontiguouscache.h b/qtinterface/qt4/Qt/qcontiguouscache.h new file mode 100644 index 0000000..5e20f37 --- /dev/null +++ b/qtinterface/qt4/Qt/qcontiguouscache.h @@ -0,0 +1,454 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCONTIGUOUSCACHE_H +#define QCONTIGUOUSCACHE_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +#undef QT_QCONTIGUOUSCACHE_DEBUG +QT_MODULE(Core) + + +struct Q_CORE_EXPORT QContiguousCacheData +{ + QBasicAtomicInt ref; + int alloc; + int count; + int start; + int offset; + uint sharable : 1; + uint reserved : 31; + + // total is 24 bytes (HP-UX aCC: 40 bytes) + // the next entry is already aligned to 8 bytes + // there will be an 8 byte gap here if T requires 16-byte alignment + // (such as long double on 64-bit platforms, __int128, __float128) + + static QContiguousCacheData *allocate(int size, int alignment); + static void free(QContiguousCacheData *data); + +#ifdef QT_QCONTIGUOUSCACHE_DEBUG + void dump() const; +#endif +}; + +template +struct QContiguousCacheTypedData: private QContiguousCacheData +{ + // private inheritance to avoid aliasing warningss + T array[1]; + + static inline void free(QContiguousCacheTypedData *data) { QContiguousCacheData::free(data); } +}; + +template +class QContiguousCache { + typedef QContiguousCacheTypedData Data; + union { QContiguousCacheData *d; QContiguousCacheTypedData *p; }; +public: + // STL compatibility + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef ptrdiff_t difference_type; + typedef int size_type; + + explicit QContiguousCache(int capacity = 0); + QContiguousCache(const QContiguousCache &v) : d(v.d) { d->ref.ref(); if (!d->sharable) detach_helper(); } + + inline ~QContiguousCache() { if (!d) return; if (!d->ref.deref()) free(p); } + + inline void detach() { if (d->ref != 1) detach_helper(); } + inline bool isDetached() const { return d->ref == 1; } + inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + + QContiguousCache &operator=(const QContiguousCache &other); + bool operator==(const QContiguousCache &other) const; + inline bool operator!=(const QContiguousCache &other) const { return !(*this == other); } + + inline int capacity() const {return d->alloc; } + inline int count() const { return d->count; } + inline int size() const { return d->count; } + + inline bool isEmpty() const { return d->count == 0; } + inline bool isFull() const { return d->count == d->alloc; } + inline int available() const { return d->alloc - d->count; } + + void clear(); + void setCapacity(int size); + + const T &at(int pos) const; + T &operator[](int i); + const T &operator[](int i) const; + + void append(const T &value); + void prepend(const T &value); + void insert(int pos, const T &value); + + inline bool containsIndex(int pos) const { return pos >= d->offset && pos - d->offset < d->count; } + inline int firstIndex() const { return d->offset; } + inline int lastIndex() const { return d->offset + d->count - 1; } + + inline const T &first() const { Q_ASSERT(!isEmpty()); return p->array[d->start]; } + inline const T &last() const { Q_ASSERT(!isEmpty()); return p->array[(d->start + d->count -1) % d->alloc]; } + inline T &first() { Q_ASSERT(!isEmpty()); detach(); return p->array[d->start]; } + inline T &last() { Q_ASSERT(!isEmpty()); detach(); return p->array[(d->start + d->count -1) % d->alloc]; } + + void removeFirst(); + T takeFirst(); + void removeLast(); + T takeLast(); + + inline bool areIndexesValid() const + { return d->offset >= 0 && d->offset < INT_MAX - d->count && (d->offset % d->alloc) == d->start; } + + inline void normalizeIndexes() { d->offset = d->start; } + +#ifdef QT_QCONTIGUOUSCACHE_DEBUG + void dump() const { p->dump(); } +#endif +private: + void detach_helper(); + + QContiguousCacheData *malloc(int aalloc); + void free(Data *x); + int sizeOfTypedData() { + // this is more or less the same as sizeof(Data), except that it doesn't + // count the padding at the end + return reinterpret_cast(&(reinterpret_cast(this))->array[1]) - reinterpret_cast(this); + } + int alignOfTypedData() const + { +#ifdef Q_ALIGNOF + return qMax(sizeof(void*), Q_ALIGNOF(Data)); +#else + return 0; +#endif + } +}; + +template +void QContiguousCache::detach_helper() +{ + union { QContiguousCacheData *d; QContiguousCacheTypedData *p; } x; + + x.d = malloc(d->alloc); + x.d->ref = 1; + x.d->count = d->count; + x.d->start = d->start; + x.d->offset = d->offset; + x.d->alloc = d->alloc; + x.d->sharable = true; + x.d->reserved = 0; + + T *dest = x.p->array + x.d->start; + T *src = p->array + d->start; + int oldcount = x.d->count; + while (oldcount--) { + if (QTypeInfo::isComplex) { + new (dest) T(*src); + } else { + *dest = *src; + } + dest++; + if (dest == x.p->array + x.d->alloc) + dest = x.p->array; + src++; + if (src == p->array + d->alloc) + src = p->array; + } + + if (!d->ref.deref()) + free(p); + d = x.d; +} + +template +void QContiguousCache::setCapacity(int asize) +{ + if (asize == d->alloc) + return; + detach(); + union { QContiguousCacheData *d; QContiguousCacheTypedData *p; } x; + x.d = malloc(asize); + x.d->alloc = asize; + x.d->count = qMin(d->count, asize); + x.d->offset = d->offset + d->count - x.d->count; + x.d->start = x.d->offset % x.d->alloc; + T *dest = x.p->array + (x.d->start + x.d->count-1) % x.d->alloc; + T *src = p->array + (d->start + d->count-1) % d->alloc; + int oldcount = x.d->count; + while (oldcount--) { + if (QTypeInfo::isComplex) { + new (dest) T(*src); + } else { + *dest = *src; + } + if (dest == x.p->array) + dest = x.p->array + x.d->alloc; + dest--; + if (src == p->array) + src = p->array + d->alloc; + src--; + } + /* free old */ + free(p); + d = x.d; +} + +template +void QContiguousCache::clear() +{ + if (d->ref == 1) { + if (QTypeInfo::isComplex) { + int oldcount = d->count; + T * i = p->array + d->start; + T * e = p->array + d->alloc; + while (oldcount--) { + i->~T(); + i++; + if (i == e) + i = p->array; + } + } + d->count = d->start = d->offset = 0; + } else { + union { QContiguousCacheData *d; QContiguousCacheTypedData *p; } x; + x.d = malloc(d->alloc); + x.d->ref = 1; + x.d->alloc = d->alloc; + x.d->count = x.d->start = x.d->offset = 0; + x.d->sharable = true; + if (!d->ref.deref()) free(p); + d = x.d; + } +} + +template +inline QContiguousCacheData *QContiguousCache::malloc(int aalloc) +{ + return QContiguousCacheData::allocate(sizeOfTypedData() + (aalloc - 1) * sizeof(T), alignOfTypedData()); +} + +template +QContiguousCache::QContiguousCache(int cap) +{ + d = malloc(cap); + d->ref = 1; + d->alloc = cap; + d->count = d->start = d->offset = 0; + d->sharable = true; +} + +template +QContiguousCache &QContiguousCache::operator=(const QContiguousCache &other) +{ + other.d->ref.ref(); + if (!d->ref.deref()) + free(d); + d = other.d; + if (!d->sharable) + detach_helper(); + return *this; +} + +template +bool QContiguousCache::operator==(const QContiguousCache &other) const +{ + if (other.d == d) + return true; + if (other.d->start != d->start + || other.d->count != d->count + || other.d->offset != d->offset + || other.d->alloc != d->alloc) + return false; + for (int i = firstIndex(); i <= lastIndex(); ++i) + if (!(at(i) == other.at(i))) + return false; + return true; +} + +template +void QContiguousCache::free(Data *x) +{ + if (QTypeInfo::isComplex) { + int oldcount = d->count; + T * i = p->array + d->start; + T * e = p->array + d->alloc; + while (oldcount--) { + i->~T(); + i++; + if (i == e) + i = p->array; + } + } + x->free(x); +} +template +void QContiguousCache::append(const T &value) +{ + detach(); + if (QTypeInfo::isComplex) { + if (d->count == d->alloc) + (p->array + (d->start+d->count) % d->alloc)->~T(); + new (p->array + (d->start+d->count) % d->alloc) T(value); + } else { + p->array[(d->start+d->count) % d->alloc] = value; + } + + if (d->count == d->alloc) { + d->start++; + d->start %= d->alloc; + d->offset++; + } else { + d->count++; + } +} + +template +void QContiguousCache::prepend(const T &value) +{ + detach(); + if (d->start) + d->start--; + else + d->start = d->alloc-1; + d->offset--; + + if (d->count != d->alloc) + d->count++; + else + if (d->count == d->alloc) + (p->array + d->start)->~T(); + + if (QTypeInfo::isComplex) + new (p->array + d->start) T(value); + else + p->array[d->start] = value; +} + +template +void QContiguousCache::insert(int pos, const T &value) +{ + Q_ASSERT_X(pos >= 0 && pos < INT_MAX, "QContiguousCache::insert", "index out of range"); + detach(); + if (containsIndex(pos)) { + if(QTypeInfo::isComplex) + new (p->array + pos % d->alloc) T(value); + else + p->array[pos % d->alloc] = value; + } else if (pos == d->offset-1) + prepend(value); + else if (pos == d->offset+d->count) + append(value); + else { + // we don't leave gaps. + clear(); + d->offset = pos; + d->start = pos % d->alloc; + d->count = 1; + if (QTypeInfo::isComplex) + new (p->array + d->start) T(value); + else + p->array[d->start] = value; + } +} + +template +inline const T &QContiguousCache::at(int pos) const +{ Q_ASSERT_X(pos >= d->offset && pos - d->offset < d->count, "QContiguousCache::at", "index out of range"); return p->array[pos % d->alloc]; } +template +inline const T &QContiguousCache::operator[](int pos) const +{ Q_ASSERT_X(pos >= d->offset && pos - d->offset < d->count, "QContiguousCache::at", "index out of range"); return p->array[pos % d->alloc]; } + +template +inline T &QContiguousCache::operator[](int pos) +{ + detach(); + if (!containsIndex(pos)) + insert(pos, T()); + return p->array[pos % d->alloc]; +} + +template +inline void QContiguousCache::removeFirst() +{ + Q_ASSERT(d->count > 0); + detach(); + d->count--; + if (QTypeInfo::isComplex) + (p->array + d->start)->~T(); + d->start = (d->start + 1) % d->alloc; + d->offset++; +} + +template +inline void QContiguousCache::removeLast() +{ + Q_ASSERT(d->count > 0); + detach(); + d->count--; + if (QTypeInfo::isComplex) + (p->array + (d->start + d->count) % d->alloc)->~T(); +} + +template +inline T QContiguousCache::takeFirst() +{ T t = first(); removeFirst(); return t; } + +template +inline T QContiguousCache::takeLast() +{ T t = last(); removeLast(); return t; } + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qcopchannel_qws.h b/qtinterface/qt4/Qt/qcopchannel_qws.h new file mode 100644 index 0000000..9b2e092 --- /dev/null +++ b/qtinterface/qt4/Qt/qcopchannel_qws.h @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOPCHANNEL_QWS_H +#define QCOPCHANNEL_QWS_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_COP + +class QWSClient; +class QCopChannelPrivate; + +class Q_GUI_EXPORT QCopChannel : public QObject +{ + Q_OBJECT +public: + explicit QCopChannel(const QString& channel, QObject *parent=0); +#ifdef QT3_SUPPORT + QT3_SUPPORT_CONSTRUCTOR QCopChannel(const QString& channel, QObject *parent, const char *name); +#endif + virtual ~QCopChannel(); + + QString channel() const; + + static bool isRegistered(const QString& channel); + static bool send(const QString& channel, const QString& msg); + static bool send(const QString& channel, const QString& msg, + const QByteArray &data); + + static bool flush(); + + static void sendLocally( const QString& ch, const QString& msg, + const QByteArray &data); + static void reregisterAll(); + + virtual void receive(const QString& msg, const QByteArray &data); + +Q_SIGNALS: + void received(const QString& msg, const QByteArray &data); + +private: + void init(const QString& channel); + + // server side + static void registerChannel(const QString& ch, QWSClient *cl); + static void detach(QWSClient *cl); + static void answer(QWSClient *cl, const QString& ch, + const QString& msg, const QByteArray &data); + // client side + QCopChannelPrivate* d; + + friend class QWSServer; + friend class QWSServerPrivate; + friend class QApplication; +}; + +#endif // QT_NO_COP + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOPCHANNEL_QWS_H diff --git a/qtinterface/qt4/Qt/qcoreapplication.h b/qtinterface/qt4/Qt/qcoreapplication.h new file mode 100644 index 0000000..e1adece --- /dev/null +++ b/qtinterface/qt4/Qt/qcoreapplication.h @@ -0,0 +1,281 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOREAPPLICATION_H +#define QCOREAPPLICATION_H + +#include +#include +#include + +#ifdef QT_INCLUDE_COMPAT +#include +#endif + +#if defined(Q_WS_WIN) && !defined(tagMSG) +typedef struct tagMSG MSG; +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QCoreApplicationPrivate; +class QTextCodec; +class QTranslator; +class QPostEventList; +class QStringList; + +#define qApp QCoreApplication::instance() + +class Q_CORE_EXPORT QCoreApplication : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString applicationName READ applicationName WRITE setApplicationName) + Q_PROPERTY(QString applicationVersion READ applicationVersion WRITE setApplicationVersion) + Q_PROPERTY(QString organizationName READ organizationName WRITE setOrganizationName) + Q_PROPERTY(QString organizationDomain READ organizationDomain WRITE setOrganizationDomain) + + Q_DECLARE_PRIVATE(QCoreApplication) +public: + QCoreApplication(int &argc, char **argv); + ~QCoreApplication(); + +#ifdef QT_DEPRECATED + QT_DEPRECATED static int argc(); + QT_DEPRECATED static char **argv(); +#endif + static QStringList arguments(); + + static void setAttribute(Qt::ApplicationAttribute attribute, bool on = true); + static bool testAttribute(Qt::ApplicationAttribute attribute); + + static void setOrganizationDomain(const QString &orgDomain); + static QString organizationDomain(); + static void setOrganizationName(const QString &orgName); + static QString organizationName(); + static void setApplicationName(const QString &application); + static QString applicationName(); + static void setApplicationVersion(const QString &version); + static QString applicationVersion(); + + static QCoreApplication *instance() { return self; } + + static int exec(); + static void processEvents(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents); + static void processEvents(QEventLoop::ProcessEventsFlags flags, int maxtime); + static void exit(int retcode=0); + + static bool sendEvent(QObject *receiver, QEvent *event); + static void postEvent(QObject *receiver, QEvent *event); + static void postEvent(QObject *receiver, QEvent *event, int priority); + static void sendPostedEvents(QObject *receiver, int event_type); + static void sendPostedEvents(); + static void removePostedEvents(QObject *receiver); + static void removePostedEvents(QObject *receiver, int eventType); + static bool hasPendingEvents(); + + virtual bool notify(QObject *, QEvent *); + + static bool startingUp(); + static bool closingDown(); + + static QString applicationDirPath(); + static QString applicationFilePath(); + static qint64 applicationPid(); + +#ifndef QT_NO_LIBRARY + static void setLibraryPaths(const QStringList &); + static QStringList libraryPaths(); + static void addLibraryPath(const QString &); + static void removeLibraryPath(const QString &); +#endif // QT_NO_LIBRARY + +#ifndef QT_NO_TRANSLATION + static void installTranslator(QTranslator * messageFile); + static void removeTranslator(QTranslator * messageFile); +#endif + enum Encoding { CodecForTr, UnicodeUTF8, DefaultCodec = CodecForTr }; + // ### Qt 5: merge + static QString translate(const char * context, + const char * key, + const char * disambiguation = 0, + Encoding encoding = CodecForTr); + static QString translate(const char * context, + const char * key, + const char * disambiguation, + Encoding encoding, int n); + + static void flush(); + +#if defined(QT3_SUPPORT) + inline QT3_SUPPORT void lock() {} + inline QT3_SUPPORT void unlock(bool = true) {} + inline QT3_SUPPORT bool locked() { return false; } + inline QT3_SUPPORT bool tryLock() { return false; } + + static inline QT3_SUPPORT void processOneEvent() + { processEvents(QEventLoop::WaitForMoreEvents); } + static QT3_SUPPORT int enter_loop(); + static QT3_SUPPORT void exit_loop(); + static QT3_SUPPORT int loopLevel(); +#endif + +#if defined(Q_WS_WIN) + virtual bool winEventFilter(MSG *message, long *result); +#endif + +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + static void watchUnixSignal(int signal, bool watch); +#endif + + typedef bool (*EventFilter)(void *message, long *result); + EventFilter setEventFilter(EventFilter filter); + bool filterEvent(void *message, long *result); + +public Q_SLOTS: + static void quit(); + +Q_SIGNALS: + void aboutToQuit(); + void unixSignal(int); + +protected: + bool event(QEvent *); + + virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *); + +protected: + QCoreApplication(QCoreApplicationPrivate &p); + +private: + static bool sendSpontaneousEvent(QObject *receiver, QEvent *event); + bool notifyInternal(QObject *receiver, QEvent *event); + + void init(); + + static QCoreApplication *self; + + Q_DISABLE_COPY(QCoreApplication) + + friend class QEventDispatcherUNIXPrivate; + friend class QApplication; + friend class QApplicationPrivate; + friend class QETWidget; + friend class Q3AccelManager; + friend class QShortcutMap; + friend class QWidget; + friend class QWidgetPrivate; + friend bool qt_sendSpontaneousEvent(QObject*, QEvent*); + friend Q_CORE_EXPORT QString qAppName(); + friend class QClassFactory; +}; + +inline bool QCoreApplication::sendEvent(QObject *receiver, QEvent *event) +{ if (event) event->spont = false; return self ? self->notifyInternal(receiver, event) : false; } + +inline bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *event) +{ if (event) event->spont = true; return self ? self->notifyInternal(receiver, event) : false; } + +inline void QCoreApplication::sendPostedEvents() { sendPostedEvents(0, 0); } + +#ifdef QT_NO_TRANSLATION +// Simple versions +inline QString QCoreApplication::translate(const char *, const char *sourceText, + const char *, Encoding encoding) +{ +#ifndef QT_NO_TEXTCODEC + if (encoding == UnicodeUTF8) + return QString::fromUtf8(sourceText); +#else + Q_UNUSED(encoding) +#endif + return QString::fromLatin1(sourceText); +} + +// Simple versions +inline QString QCoreApplication::translate(const char *, const char *sourceText, + const char *, Encoding encoding, int) +{ +#ifndef QT_NO_TEXTCODEC + if (encoding == UnicodeUTF8) + return QString::fromUtf8(sourceText); +#else + Q_UNUSED(encoding) +#endif + return QString::fromLatin1(sourceText); +} +#endif + +// ### merge the four functions into two (using "int n = -1") +#define Q_DECLARE_TR_FUNCTIONS(context) \ +public: \ + static inline QString tr(const char *sourceText, const char *disambiguation = 0) \ + { return QCoreApplication::translate(#context, sourceText, disambiguation); } \ + static inline QString trUtf8(const char *sourceText, const char *disambiguation = 0) \ + { return QCoreApplication::translate(#context, sourceText, disambiguation, \ + QCoreApplication::UnicodeUTF8); } \ + static inline QString tr(const char *sourceText, const char *disambiguation, int n) \ + { return QCoreApplication::translate(#context, sourceText, disambiguation, \ + QCoreApplication::CodecForTr, n); } \ + static inline QString trUtf8(const char *sourceText, const char *disambiguation, int n) \ + { return QCoreApplication::translate(#context, sourceText, disambiguation, \ + QCoreApplication::UnicodeUTF8, n); } \ +private: + +typedef void (*QtCleanUpFunction)(); + +Q_CORE_EXPORT void qAddPostRoutine(QtCleanUpFunction); +Q_CORE_EXPORT void qRemovePostRoutine(QtCleanUpFunction); +Q_CORE_EXPORT QString qAppName(); // get application name + +#if defined(Q_WS_WIN) && !defined(QT_NO_DEBUG_STREAM) +Q_CORE_EXPORT QString decodeMSG(const MSG &); +Q_CORE_EXPORT QDebug operator<<(QDebug, const MSG &); +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOREAPPLICATION_H diff --git a/qtinterface/qt4/Qt/qcoreevent.h b/qtinterface/qt4/Qt/qcoreevent.h new file mode 100644 index 0000000..9ead292 --- /dev/null +++ b/qtinterface/qt4/Qt/qcoreevent.h @@ -0,0 +1,389 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOREEVENT_H +#define QCOREEVENT_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QEventPrivate; +class Q_CORE_EXPORT QEvent // event base class +{ + Q_GADGET + QDOC_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) + Q_ENUMS(Type) +public: + enum Type { + /* + If you get a strange compiler error on the line with None, + it's probably because you're also including X11 headers, + which #define the symbol None. Put the X11 includes after + the Qt includes to solve this problem. + */ + None = 0, // invalid event + Timer = 1, // timer event + MouseButtonPress = 2, // mouse button pressed + MouseButtonRelease = 3, // mouse button released + MouseButtonDblClick = 4, // mouse button double click + MouseMove = 5, // mouse move + KeyPress = 6, // key pressed + KeyRelease = 7, // key released + FocusIn = 8, // keyboard focus received + FocusOut = 9, // keyboard focus lost + Enter = 10, // mouse enters widget + Leave = 11, // mouse leaves widget + Paint = 12, // paint widget + Move = 13, // move widget + Resize = 14, // resize widget + Create = 15, // after widget creation + Destroy = 16, // during widget destruction + Show = 17, // widget is shown + Hide = 18, // widget is hidden + Close = 19, // request to close widget + Quit = 20, // request to quit application + ParentChange = 21, // widget has been reparented + ParentAboutToChange = 131, // sent just before the parent change is done +#ifdef QT3_SUPPORT + Reparent = ParentChange, +#endif + ThreadChange = 22, // object has changed threads + WindowActivate = 24, // window was activated + WindowDeactivate = 25, // window was deactivated + ShowToParent = 26, // widget is shown to parent + HideToParent = 27, // widget is hidden to parent + Wheel = 31, // wheel event + WindowTitleChange = 33, // window title changed + WindowIconChange = 34, // icon changed + ApplicationWindowIconChange = 35, // application icon changed + ApplicationFontChange = 36, // application font changed + ApplicationLayoutDirectionChange = 37, // application layout direction changed + ApplicationPaletteChange = 38, // application palette changed + PaletteChange = 39, // widget palette changed + Clipboard = 40, // internal clipboard event + Speech = 42, // reserved for speech input + MetaCall = 43, // meta call event + SockAct = 50, // socket activation + WinEventAct = 132, // win event activation + DeferredDelete = 52, // deferred delete event + DragEnter = 60, // drag moves into widget + DragMove = 61, // drag moves in widget + DragLeave = 62, // drag leaves or is cancelled + Drop = 63, // actual drop + DragResponse = 64, // drag accepted/rejected + ChildAdded = 68, // new child widget + ChildPolished = 69, // polished child widget +#ifdef QT3_SUPPORT + ChildInsertedRequest = 67, // send ChildInserted compatibility events to receiver + ChildInserted = 70, // compatibility child inserted + LayoutHint = 72, // compatibility relayout request +#endif + ChildRemoved = 71, // deleted child widget + ShowWindowRequest = 73, // widget's window should be mapped + PolishRequest = 74, // widget should be polished + Polish = 75, // widget is polished + LayoutRequest = 76, // widget should be relayouted + UpdateRequest = 77, // widget should be repainted + UpdateLater = 78, // request update() later + + EmbeddingControl = 79, // ActiveX embedding + ActivateControl = 80, // ActiveX activation + DeactivateControl = 81, // ActiveX deactivation + ContextMenu = 82, // context popup menu + InputMethod = 83, // input method + AccessibilityPrepare = 86, // accessibility information is requested + TabletMove = 87, // Wacom tablet event + LocaleChange = 88, // the system locale changed + LanguageChange = 89, // the application language changed + LayoutDirectionChange = 90, // the layout direction changed + Style = 91, // internal style event + TabletPress = 92, // tablet press + TabletRelease = 93, // tablet release + OkRequest = 94, // CE (Ok) button pressed + HelpRequest = 95, // CE (?) button pressed + + IconDrag = 96, // proxy icon dragged + + FontChange = 97, // font has changed + EnabledChange = 98, // enabled state has changed + ActivationChange = 99, // window activation has changed + StyleChange = 100, // style has changed + IconTextChange = 101, // icon text has changed + ModifiedChange = 102, // modified state has changed + MouseTrackingChange = 109, // mouse tracking state has changed + + WindowBlocked = 103, // window is about to be blocked modally + WindowUnblocked = 104, // windows modal blocking has ended + WindowStateChange = 105, + + ToolTip = 110, + WhatsThis = 111, + StatusTip = 112, + + ActionChanged = 113, + ActionAdded = 114, + ActionRemoved = 115, + + FileOpen = 116, // file open request + + Shortcut = 117, // shortcut triggered + ShortcutOverride = 51, // shortcut override request + +#ifdef QT3_SUPPORT + Accel = 30, // accelerator event + AccelAvailable = 32, // accelerator available event + AccelOverride = ShortcutOverride, // accelerator override event +#endif + + WhatsThisClicked = 118, + +#ifdef QT3_SUPPORT + CaptionChange = WindowTitleChange, + IconChange = WindowIconChange, +#endif + ToolBarChange = 120, // toolbar visibility toggled + + ApplicationActivate = 121, // application has been changed to active + ApplicationActivated = ApplicationActivate, // deprecated + ApplicationDeactivate = 122, // application has been changed to inactive + ApplicationDeactivated = ApplicationDeactivate, // deprecated + + QueryWhatsThis = 123, // query what's this widget help + EnterWhatsThisMode = 124, + LeaveWhatsThisMode = 125, + + ZOrderChange = 126, // child widget has had its z-order changed + + HoverEnter = 127, // mouse cursor enters a hover widget + HoverLeave = 128, // mouse cursor leaves a hover widget + HoverMove = 129, // mouse cursor move inside a hover widget + + AccessibilityHelp = 119, // accessibility help text request + AccessibilityDescription = 130, // accessibility description text request + + // last event id used = 132 + +#ifdef QT_KEYPAD_NAVIGATION + EnterEditFocus = 150, // enter edit mode in keypad navigation + LeaveEditFocus = 151, // enter edit mode in keypad navigation +#endif + AcceptDropsChange = 152, + + MenubarUpdated = 153, // Support event for Q3MainWindow, which needs to + // knwow when QMenubar is updated. + + ZeroTimerEvent = 154, // Used for Windows Zero timer events + + GraphicsSceneMouseMove = 155, // GraphicsView + GraphicsSceneMousePress = 156, + GraphicsSceneMouseRelease = 157, + GraphicsSceneMouseDoubleClick = 158, + GraphicsSceneContextMenu = 159, + GraphicsSceneHoverEnter = 160, + GraphicsSceneHoverMove = 161, + GraphicsSceneHoverLeave = 162, + GraphicsSceneHelp = 163, + GraphicsSceneDragEnter = 164, + GraphicsSceneDragMove = 165, + GraphicsSceneDragLeave = 166, + GraphicsSceneDrop = 167, + GraphicsSceneWheel = 168, + + KeyboardLayoutChange = 169, // keyboard layout changed + + DynamicPropertyChange = 170, // A dynamic property was changed through setProperty/property + + TabletEnterProximity = 171, + TabletLeaveProximity = 172, + + NonClientAreaMouseMove = 173, + NonClientAreaMouseButtonPress = 174, + NonClientAreaMouseButtonRelease = 175, + NonClientAreaMouseButtonDblClick = 176, + + MacSizeChange = 177, // when the Qt::WA_Mac{Normal,Small,Mini}Size changes + + ContentsRectChange = 178, // sent by QWidget::setContentsMargins (internal) + + MacGLWindowChange = 179, // Internal! the window of the GLWidget has changed + + FutureCallOut = 180, + + GraphicsSceneResize = 181, + GraphicsSceneMove = 182, + + CursorChange = 183, + ToolTipChange = 184, + + NetworkReplyUpdated = 185, // Internal for QNetworkReply + + GrabMouse = 186, + UngrabMouse = 187, + GrabKeyboard = 188, + UngrabKeyboard = 189, + CocoaRequestModal = 190, // Internal for requesting an application modal Cocoa Window + MacGLClearDrawable = 191, // Internal Cocoa, the window has changed, so we must clear + + StateMachineSignal = 192, + StateMachineWrapped = 193, + + TouchBegin = 194, + TouchUpdate = 195, + TouchEnd = 196, + + NativeGesture = 197, // Internal for platform gesture support + + RequestSoftwareInputPanel = 199, + CloseSoftwareInputPanel = 200, + + UpdateSoftKeys = 201, // Internal for compressing soft key updates + + WinIdChange = 203, + Gesture = 198, + GestureOverride = 202, + + // 512 reserved for Qt Jambi's MetaCall event + // 513 reserved for Qt Jambi's DeleteOnMainThread event + + User = 1000, // first user event id + MaxUser = 65535 // last user event id + }; + + QEvent(Type type); + virtual ~QEvent(); + inline Type type() const { return static_cast(t); } + inline bool spontaneous() const { return spont; } + + inline void setAccepted(bool accepted) { m_accept = accepted; } + inline bool isAccepted() const { return m_accept; } + + inline void accept() { m_accept = true; } + inline void ignore() { m_accept = false; } + + static int registerEventType(int hint = -1); + +protected: + QEventPrivate *d; + ushort t; + +private: + ushort posted : 1; + ushort spont : 1; + ushort m_accept : 1; + ushort reserved : 13; + + friend class QCoreApplication; + friend class QCoreApplicationPrivate; + friend class QThreadData; + friend class QApplication; + friend class QApplicationPrivate; + friend class Q3AccelManager; + friend class QShortcutMap; + friend class QETWidget; + friend class QGraphicsView; + friend class QGraphicsViewPrivate; + friend class QGraphicsScenePrivate; + friend class QGestureManager; +}; + +class Q_CORE_EXPORT QTimerEvent : public QEvent +{ +public: + QTimerEvent( int timerId ); + ~QTimerEvent(); + int timerId() const { return id; } +protected: + int id; +}; + +class QObject; + +class Q_CORE_EXPORT QChildEvent : public QEvent +{ +public: + QChildEvent( Type type, QObject *child ); + ~QChildEvent(); + QObject *child() const { return c; } + bool added() const { return type() == ChildAdded; } +#ifdef QT3_SUPPORT + QT3_SUPPORT bool inserted() const { return type() == ChildInserted; } +#endif + bool polished() const { return type() == ChildPolished; } + bool removed() const { return type() == ChildRemoved; } +protected: + QObject *c; +}; + +#ifdef QT3_SUPPORT +class Q_CORE_EXPORT QCustomEvent : public QEvent +{ +public: + QT3_SUPPORT_CONSTRUCTOR QCustomEvent(int type, void *data = 0); + ~QCustomEvent(); + QT3_SUPPORT void *data() const { return d; } + QT3_SUPPORT void setData(void* aData) { d = reinterpret_cast(aData); } +}; +#endif + +class Q_CORE_EXPORT QDynamicPropertyChangeEvent : public QEvent +{ +public: + QDynamicPropertyChangeEvent(const QByteArray &name); + ~QDynamicPropertyChangeEvent(); + + inline QByteArray propertyName() const { return n; } + +private: + QByteArray n; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCOREEVENT_H diff --git a/qtinterface/qt4/Qt/qcryptographichash.h b/qtinterface/qt4/Qt/qcryptographichash.h new file mode 100644 index 0000000..6fe4191 --- /dev/null +++ b/qtinterface/qt4/Qt/qcryptographichash.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCRYPTOGRAPHICSHASH_H +#define QCRYPTOGRAPHICSHASH_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QCryptographicHashPrivate; + +class Q_CORE_EXPORT QCryptographicHash +{ +public: + enum Algorithm { + Md4, + Md5, + Sha1 + }; + + QCryptographicHash(Algorithm method); + ~QCryptographicHash(); + + void reset(); + + void addData(const char *data, int length); + void addData(const QByteArray &data); + + QByteArray result() const; + + static QByteArray hash(const QByteArray &data, Algorithm method); +private: + Q_DISABLE_COPY(QCryptographicHash) + QCryptographicHashPrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qcursor.h b/qtinterface/qt4/Qt/qcursor.h new file mode 100644 index 0000000..ac13893 --- /dev/null +++ b/qtinterface/qt4/Qt/qcursor.h @@ -0,0 +1,175 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCURSOR_H +#define QCURSOR_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QVariant; + +/* + ### The fake cursor has to go first with old qdoc. +*/ +#ifdef QT_NO_CURSOR + +class Q_GUI_EXPORT QCursor +{ +public: + static QPoint pos(); + static void setPos(int x, int y); + inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); } +private: + QCursor(); +}; + +#endif // QT_NO_CURSOR + +#ifndef QT_NO_CURSOR + +class QCursorData; +class QBitmap; +class QPixmap; + +#if defined(Q_WS_MAC) +void qt_mac_set_cursor(const QCursor *c, const QPoint &p); +#endif +#if defined(Q_OS_SYMBIAN) +extern void qt_symbian_show_pointer_sprite(); +extern void qt_symbian_hide_pointer_sprite(); +extern void qt_symbian_set_pointer_sprite(const QCursor& cursor); +extern void qt_symbian_move_cursor_sprite(); +#endif + +class Q_GUI_EXPORT QCursor +{ +public: + QCursor(); + QCursor(Qt::CursorShape shape); + QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX=-1, int hotY=-1); + QCursor(const QPixmap &pixmap, int hotX=-1, int hotY=-1); + QCursor(const QCursor &cursor); + ~QCursor(); + QCursor &operator=(const QCursor &cursor); + operator QVariant() const; + + Qt::CursorShape shape() const; + void setShape(Qt::CursorShape newShape); + + const QBitmap *bitmap() const; + const QBitmap *mask() const; + QPixmap pixmap() const; + QPoint hotSpot() const; + + static QPoint pos(); + static void setPos(int x, int y); + inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); } + +#ifdef qdoc + HCURSOR_or_HANDLE handle() const; + QCursor(HCURSOR cursor); + QCursor(Qt::HANDLE cursor); +#endif + +#ifndef qdoc +#if defined(Q_WS_WIN) + HCURSOR handle() const; + QCursor(HCURSOR cursor); +#elif defined(Q_WS_X11) + Qt::HANDLE handle() const; + QCursor(Qt::HANDLE cursor); + static int x11Screen(); +#elif defined(Q_WS_MAC) + Qt::HANDLE handle() const; +#elif defined(Q_WS_QWS) + int handle() const; +#elif defined(Q_OS_SYMBIAN) + Qt::HANDLE handle() const; +#endif +#endif + +private: + QCursorData *d; +#if defined(Q_WS_MAC) + friend void *qt_mac_nsCursorForQCursor(const QCursor &c); + friend void qt_mac_set_cursor(const QCursor *c, const QPoint &p); +#endif +#if defined(Q_OS_SYMBIAN) + friend void qt_symbian_show_pointer_sprite(); + friend void qt_symbian_hide_pointer_sprite(); + friend void qt_symbian_set_pointer_sprite(const QCursor& cursor); + friend void qt_symbian_move_cursor_sprite(); +#endif +}; + +#ifdef QT3_SUPPORT +// CursorShape is defined in X11/X.h +#ifdef CursorShape +#define X_CursorShape CursorShape +#undef CursorShape +#endif +typedef Qt::CursorShape QCursorShape; +#ifdef X_CursorShape +#define CursorShape X_CursorShape +#endif +#endif + +/***************************************************************************** + QCursor stream functions + *****************************************************************************/ +#ifndef QT_NO_DATASTREAM +Q_GUI_EXPORT QDataStream &operator<<(QDataStream &outS, const QCursor &cursor); +Q_GUI_EXPORT QDataStream &operator>>(QDataStream &inS, QCursor &cursor); +#endif +#endif // QT_NO_CURSOR + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QCURSOR_H diff --git a/qtinterface/qt4/Qt/qdatastream.h b/qtinterface/qt4/Qt/qdatastream.h new file mode 100644 index 0000000..a815bc5 --- /dev/null +++ b/qtinterface/qt4/Qt/qdatastream.h @@ -0,0 +1,436 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDATASTREAM_H +#define QDATASTREAM_H + +#include +#include +#include + +#ifdef Status +#error qdatastream.h must be included before any header file that defines Status +#endif + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class QByteArray; +class QIODevice; + +template class QList; +template class QLinkedList; +template class QVector; +template class QSet; +template class QHash; +template class QMap; + +#if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED) +class QDataStreamPrivate; +class Q_CORE_EXPORT QDataStream +{ +public: + enum Version { + Qt_1_0 = 1, + Qt_2_0 = 2, + Qt_2_1 = 3, + Qt_3_0 = 4, + Qt_3_1 = 5, + Qt_3_3 = 6, + Qt_4_0 = 7, + Qt_4_1 = Qt_4_0, + Qt_4_2 = 8, + Qt_4_3 = 9, + Qt_4_4 = 10, + Qt_4_5 = 11, + Qt_4_6 = 12 +#if QT_VERSION >= 0x040700 +#error Add the datastream version for this Qt version + Qt_4_7 = Qt_4_6 +#endif + }; + + enum ByteOrder { + BigEndian = QSysInfo::BigEndian, + LittleEndian = QSysInfo::LittleEndian + }; + + enum Status { + Ok, + ReadPastEnd, + ReadCorruptData + }; + + enum FloatingPointPrecision { + SinglePrecision, + DoublePrecision + }; + + QDataStream(); + explicit QDataStream(QIODevice *); +#ifdef QT3_SUPPORT + QDataStream(QByteArray *, int mode); +#endif + QDataStream(QByteArray *, QIODevice::OpenMode flags); + QDataStream(const QByteArray &); + virtual ~QDataStream(); + + QIODevice *device() const; + void setDevice(QIODevice *); + void unsetDevice(); + + bool atEnd() const; +#ifdef QT3_SUPPORT + inline QT3_SUPPORT bool eof() const { return atEnd(); } +#endif + + Status status() const; + void setStatus(Status status); + void resetStatus(); + + FloatingPointPrecision floatingPointPrecision() const; + void setFloatingPointPrecision(FloatingPointPrecision precision); + + ByteOrder byteOrder() const; + void setByteOrder(ByteOrder); + + int version() const; + void setVersion(int); + + QDataStream &operator>>(qint8 &i); + QDataStream &operator>>(quint8 &i); + QDataStream &operator>>(qint16 &i); + QDataStream &operator>>(quint16 &i); + QDataStream &operator>>(qint32 &i); + QDataStream &operator>>(quint32 &i); + QDataStream &operator>>(qint64 &i); + QDataStream &operator>>(quint64 &i); + + QDataStream &operator>>(bool &i); + QDataStream &operator>>(float &f); + QDataStream &operator>>(double &f); + QDataStream &operator>>(char *&str); + + QDataStream &operator<<(qint8 i); + QDataStream &operator<<(quint8 i); + QDataStream &operator<<(qint16 i); + QDataStream &operator<<(quint16 i); + QDataStream &operator<<(qint32 i); + QDataStream &operator<<(quint32 i); + QDataStream &operator<<(qint64 i); + QDataStream &operator<<(quint64 i); + QDataStream &operator<<(bool i); + QDataStream &operator<<(float f); + QDataStream &operator<<(double f); + QDataStream &operator<<(const char *str); + + QDataStream &readBytes(char *&, uint &len); + int readRawData(char *, int len); + + QDataStream &writeBytes(const char *, uint len); + int writeRawData(const char *, int len); + + int skipRawData(int len); + +#ifdef QT3_SUPPORT + inline QT3_SUPPORT QDataStream &readRawBytes(char *str, uint len) + { readRawData(str, static_cast(len)); return *this; } + inline QT3_SUPPORT QDataStream &writeRawBytes(const char *str, uint len) + { writeRawData(str, static_cast(len)); return *this; } + inline QT3_SUPPORT bool isPrintableData() const { return false; } + inline QT3_SUPPORT void setPrintableData(bool) {} +#endif + +private: + Q_DISABLE_COPY(QDataStream) + + QScopedPointer d; + + QIODevice *dev; + bool owndev; + bool noswap; + ByteOrder byteorder; + int ver; + Status q_status; +}; + + +/***************************************************************************** + QDataStream inline functions + *****************************************************************************/ + +inline QIODevice *QDataStream::device() const +{ return dev; } + +inline QDataStream::ByteOrder QDataStream::byteOrder() const +{ return byteorder; } + +inline int QDataStream::version() const +{ return ver; } + +inline void QDataStream::setVersion(int v) +{ ver = v; } + +inline QDataStream &QDataStream::operator>>(quint8 &i) +{ return *this >> reinterpret_cast(i); } + +inline QDataStream &QDataStream::operator>>(quint16 &i) +{ return *this >> reinterpret_cast(i); } + +inline QDataStream &QDataStream::operator>>(quint32 &i) +{ return *this >> reinterpret_cast(i); } + +inline QDataStream &QDataStream::operator>>(quint64 &i) +{ return *this >> reinterpret_cast(i); } + +inline QDataStream &QDataStream::operator<<(quint8 i) +{ return *this << qint8(i); } + +inline QDataStream &QDataStream::operator<<(quint16 i) +{ return *this << qint16(i); } + +inline QDataStream &QDataStream::operator<<(quint32 i) +{ return *this << qint32(i); } + +inline QDataStream &QDataStream::operator<<(quint64 i) +{ return *this << qint64(i); } + +template +QDataStream& operator>>(QDataStream& s, QList& l) +{ + l.clear(); + quint32 c; + s >> c; + for(quint32 i = 0; i < c; ++i) + { + T t; + s >> t; + l.append(t); + if (s.atEnd()) + break; + } + return s; +} + +template +QDataStream& operator<<(QDataStream& s, const QList& l) +{ + s << quint32(l.size()); + for (int i = 0; i < l.size(); ++i) + s << l.at(i); + return s; +} + +template +QDataStream& operator>>(QDataStream& s, QLinkedList& l) +{ + l.clear(); + quint32 c; + s >> c; + for(quint32 i = 0; i < c; ++i) + { + T t; + s >> t; + l.append(t); + if (s.atEnd()) + break; + } + return s; +} + +template +QDataStream& operator<<(QDataStream& s, const QLinkedList& l) +{ + s << quint32(l.size()); + typename QLinkedList::ConstIterator it = l.constBegin(); + for(; it != l.constEnd(); ++it) + s << *it; + return s; +} + +template +QDataStream& operator>>(QDataStream& s, QVector& v) +{ + v.clear(); + quint32 c; + s >> c; + v.resize(c); + for(quint32 i = 0; i < c; ++i) { + T t; + s >> t; + v[i] = t; + } + return s; +} + +template +QDataStream& operator<<(QDataStream& s, const QVector& v) +{ + s << quint32(v.size()); + for (typename QVector::const_iterator it = v.begin(); it != v.end(); ++it) + s << *it; + return s; +} + +template +QDataStream &operator>>(QDataStream &in, QSet &set) +{ + set.clear(); + quint32 c; + in >> c; + for (quint32 i = 0; i < c; ++i) { + T t; + in >> t; + set << t; + if (in.atEnd()) + break; + } + return in; +} + +template +QDataStream& operator<<(QDataStream &out, const QSet &set) +{ + out << quint32(set.size()); + typename QSet::const_iterator i = set.constBegin(); + while (i != set.constEnd()) { + out << *i; + ++i; + } + return out; +} + +template +Q_OUTOFLINE_TEMPLATE QDataStream &operator>>(QDataStream &in, QHash &hash) +{ + QDataStream::Status oldStatus = in.status(); + in.resetStatus(); + hash.clear(); + + quint32 n; + in >> n; + + for (quint32 i = 0; i < n; ++i) { + if (in.status() != QDataStream::Ok) + break; + + Key k; + T t; + in >> k >> t; + hash.insertMulti(k, t); + } + + if (in.status() != QDataStream::Ok) + hash.clear(); + if (oldStatus != QDataStream::Ok) + in.setStatus(oldStatus); + return in; +} + +template +Q_OUTOFLINE_TEMPLATE QDataStream &operator<<(QDataStream &out, const QHash& hash) +{ + out << quint32(hash.size()); + typename QHash::ConstIterator it = hash.end(); + typename QHash::ConstIterator begin = hash.begin(); + while (it != begin) { + --it; + out << it.key() << it.value(); + } + return out; +} +#ifdef qdoc +template +Q_OUTOFLINE_TEMPLATE QDataStream &operator>>(QDataStream &in, QMap &map) +#else +template +Q_OUTOFLINE_TEMPLATE QDataStream &operator>>(QDataStream &in, QMap &map) +#endif +{ + QDataStream::Status oldStatus = in.status(); + in.resetStatus(); + map.clear(); + + quint32 n; + in >> n; + + map.detach(); + map.setInsertInOrder(true); + for (quint32 i = 0; i < n; ++i) { + if (in.status() != QDataStream::Ok) + break; + + aKey key; + aT value; + in >> key >> value; + map.insertMulti(key, value); + } + map.setInsertInOrder(false); + if (in.status() != QDataStream::Ok) + map.clear(); + if (oldStatus != QDataStream::Ok) + in.setStatus(oldStatus); + return in; +} + +template +Q_OUTOFLINE_TEMPLATE QDataStream &operator<<(QDataStream &out, const QMap &map) +{ + out << quint32(map.size()); + typename QMap::ConstIterator it = map.end(); + typename QMap::ConstIterator begin = map.begin(); + while (it != begin) { + --it; + out << it.key() << it.value(); + } + return out; +} + +#endif // QT_NO_DATASTREAM + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDATASTREAM_H diff --git a/qtinterface/qt4/Qt/qdatawidgetmapper.h b/qtinterface/qt4/Qt/qdatawidgetmapper.h new file mode 100644 index 0000000..c8245a6 --- /dev/null +++ b/qtinterface/qt4/Qt/qdatawidgetmapper.h @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDATAWIDGETMAPPER_H +#define QDATAWIDGETMAPPER_H + +#include "QtCore/qobject.h" + +#ifndef QT_NO_DATAWIDGETMAPPER + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QAbstractItemDelegate; +class QAbstractItemModel; +class QModelIndex; +class QDataWidgetMapperPrivate; + +class Q_GUI_EXPORT QDataWidgetMapper: public QObject +{ + Q_OBJECT + + Q_ENUMS(SubmitPolicy) + Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) + Q_PROPERTY(SubmitPolicy submitPolicy READ submitPolicy WRITE setSubmitPolicy) + +public: + QDataWidgetMapper(QObject *parent = 0); + ~QDataWidgetMapper(); + + void setModel(QAbstractItemModel *model); + QAbstractItemModel *model() const; + + void setItemDelegate(QAbstractItemDelegate *delegate); + QAbstractItemDelegate *itemDelegate() const; + + void setRootIndex(const QModelIndex &index); + QModelIndex rootIndex() const; + + void setOrientation(Qt::Orientation aOrientation); + Qt::Orientation orientation() const; + + enum SubmitPolicy { AutoSubmit, ManualSubmit }; + void setSubmitPolicy(SubmitPolicy policy); + SubmitPolicy submitPolicy() const; + + void addMapping(QWidget *widget, int section); + void addMapping(QWidget *widget, int section, const QByteArray &propertyName); + void removeMapping(QWidget *widget); + int mappedSection(QWidget *widget) const; + QByteArray mappedPropertyName(QWidget *widget) const; + QWidget *mappedWidgetAt(int section) const; + void clearMapping(); + + int currentIndex() const; + +public Q_SLOTS: + void revert(); + bool submit(); + + void toFirst(); + void toLast(); + void toNext(); + void toPrevious(); + virtual void setCurrentIndex(int index); + void setCurrentModelIndex(const QModelIndex &index); + +Q_SIGNALS: + void currentIndexChanged(int index); + +private: + Q_DECLARE_PRIVATE(QDataWidgetMapper) + Q_DISABLE_COPY(QDataWidgetMapper) + Q_PRIVATE_SLOT(d_func(), void _q_dataChanged(const QModelIndex &, const QModelIndex &)) + Q_PRIVATE_SLOT(d_func(), void _q_commitData(QWidget *)) + Q_PRIVATE_SLOT(d_func(), void _q_closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint)) + Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed()) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QT_NO_DATAWIDGETMAPPER +#endif + diff --git a/qtinterface/qt4/Qt/qdatetime.h b/qtinterface/qt4/Qt/qdatetime.h new file mode 100644 index 0000000..8488811 --- /dev/null +++ b/qtinterface/qt4/Qt/qdatetime.h @@ -0,0 +1,334 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDATETIME_H +#define QDATETIME_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +class Q_CORE_EXPORT QDate +{ +public: + enum MonthNameType { + DateFormat = 0, + StandaloneFormat + }; +public: + QDate() { jd = 0; } + QDate(int y, int m, int d); + + bool isNull() const { return jd == 0; } + bool isValid() const; + + int year() const; + int month() const; + int day() const; + int dayOfWeek() const; + int dayOfYear() const; + int daysInMonth() const; + int daysInYear() const; + int weekNumber(int *yearNum = 0) const; + +#ifndef QT_NO_TEXTDATE +#ifdef QT3_SUPPORT + static QT3_SUPPORT QString monthName(int month) { return shortMonthName(month); } + static QT3_SUPPORT QString dayName(int weekday) { return shortDayName(weekday); } +#endif + // ### Qt 5: merge these functions. + static QString shortMonthName(int month); + static QString shortMonthName(int month, MonthNameType type); + static QString shortDayName(int weekday); + static QString shortDayName(int weekday, MonthNameType type); + static QString longMonthName(int month); + static QString longMonthName(int month, MonthNameType type); + static QString longDayName(int weekday); + static QString longDayName(int weekday, MonthNameType type); +#endif // QT_NO_TEXTDATE +#ifndef QT_NO_DATESTRING + QString toString(Qt::DateFormat f = Qt::TextDate) const; + QString toString(const QString &format) const; +#endif + bool setYMD(int y, int m, int d); + bool setDate(int year, int month, int day); + + void getDate(int *year, int *month, int *day); + + QDate addDays(int days) const; + QDate addMonths(int months) const; + QDate addYears(int years) const; + int daysTo(const QDate &) const; + + bool operator==(const QDate &other) const { return jd == other.jd; } + bool operator!=(const QDate &other) const { return jd != other.jd; } + bool operator<(const QDate &other) const { return jd < other.jd; } + bool operator<=(const QDate &other) const { return jd <= other.jd; } + bool operator>(const QDate &other) const { return jd > other.jd; } + bool operator>=(const QDate &other) const { return jd >= other.jd; } + + static QDate currentDate(); +#ifndef QT_NO_DATESTRING + static QDate fromString(const QString &s, Qt::DateFormat f = Qt::TextDate); + static QDate fromString(const QString &s, const QString &format); +#endif + static bool isValid(int y, int m, int d); + static bool isLeapYear(int year); +#ifdef QT3_SUPPORT + inline static QT3_SUPPORT bool leapYear(int year) { return isLeapYear(year); } +#endif + + // ### Qt 5: remove these two functions + static uint gregorianToJulian(int y, int m, int d); + static void julianToGregorian(uint jd, int &y, int &m, int &d); + +#ifdef QT3_SUPPORT + static QT3_SUPPORT QDate currentDate(Qt::TimeSpec spec); +#endif + + static inline QDate fromJulianDay(int jd) { QDate d; d.jd = jd; return d; } + inline int toJulianDay() const { return jd; } + +private: + uint jd; + + friend class QDateTime; + friend class QDateTimePrivate; +#ifndef QT_NO_DATASTREAM + friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDate &); + friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDate &); +#endif +}; +Q_DECLARE_TYPEINFO(QDate, Q_MOVABLE_TYPE); + +class Q_CORE_EXPORT QTime +{ +public: + QTime(): mds(NullTime) +#if defined(Q_OS_WINCE) + , startTick(NullTime) +#endif + {} + QTime(int h, int m, int s = 0, int ms = 0); + + bool isNull() const { return mds == NullTime; } + bool isValid() const; + + int hour() const; + int minute() const; + int second() const; + int msec() const; +#ifndef QT_NO_DATESTRING + QString toString(Qt::DateFormat f = Qt::TextDate) const; + QString toString(const QString &format) const; +#endif + bool setHMS(int h, int m, int s, int ms = 0); + + QTime addSecs(int secs) const; + int secsTo(const QTime &) const; + QTime addMSecs(int ms) const; + int msecsTo(const QTime &) const; + + bool operator==(const QTime &other) const { return mds == other.mds; } + bool operator!=(const QTime &other) const { return mds != other.mds; } + bool operator<(const QTime &other) const { return mds < other.mds; } + bool operator<=(const QTime &other) const { return mds <= other.mds; } + bool operator>(const QTime &other) const { return mds > other.mds; } + bool operator>=(const QTime &other) const { return mds >= other.mds; } + + static QTime currentTime(); +#ifndef QT_NO_DATESTRING + static QTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate); + static QTime fromString(const QString &s, const QString &format); +#endif + static bool isValid(int h, int m, int s, int ms = 0); + +#ifdef QT3_SUPPORT + static QT3_SUPPORT QTime currentTime(Qt::TimeSpec spec); +#endif + + void start(); + int restart(); + int elapsed() const; +private: + enum TimeFlag { NullTime = -1 }; + inline int ds() const { return mds == -1 ? 0 : mds; } + int mds; +#if defined(Q_OS_WINCE) + int startTick; +#endif + + friend class QDateTime; + friend class QDateTimePrivate; +#ifndef QT_NO_DATASTREAM + friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QTime &); + friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QTime &); +#endif +}; +Q_DECLARE_TYPEINFO(QTime, Q_MOVABLE_TYPE); + +class QDateTimePrivate; + +class Q_CORE_EXPORT QDateTime +{ +public: + QDateTime(); + explicit QDateTime(const QDate &); + QDateTime(const QDate &, const QTime &, Qt::TimeSpec spec = Qt::LocalTime); + QDateTime(const QDateTime &other); + ~QDateTime(); + + QDateTime &operator=(const QDateTime &other); + + bool isNull() const; + bool isValid() const; + + QDate date() const; + QTime time() const; + Qt::TimeSpec timeSpec() const; + uint toTime_t() const; + void setDate(const QDate &date); + void setTime(const QTime &time); + void setTimeSpec(Qt::TimeSpec spec); + void setTime_t(uint secsSince1Jan1970UTC); +#ifndef QT_NO_DATESTRING + QString toString(Qt::DateFormat f = Qt::TextDate) const; + QString toString(const QString &format) const; +#endif + QDateTime addDays(int days) const; + QDateTime addMonths(int months) const; + QDateTime addYears(int years) const; + QDateTime addSecs(int secs) const; + QDateTime addMSecs(qint64 msecs) const; + QDateTime toTimeSpec(Qt::TimeSpec spec) const; + inline QDateTime toLocalTime() const { return toTimeSpec(Qt::LocalTime); } + inline QDateTime toUTC() const { return toTimeSpec(Qt::UTC); } + int daysTo(const QDateTime &) const; + int secsTo(const QDateTime &) const; + + bool operator==(const QDateTime &other) const; + inline bool operator!=(const QDateTime &other) const { return !(*this == other); } + bool operator<(const QDateTime &other) const; + inline bool operator<=(const QDateTime &other) const { return !(other < *this); } + inline bool operator>(const QDateTime &other) const { return other < *this; } + inline bool operator>=(const QDateTime &other) const { return !(*this < other); } + + void setUtcOffset(int seconds); + int utcOffset() const; + + static QDateTime currentDateTime(); +#ifndef QT_NO_DATESTRING + static QDateTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate); + static QDateTime fromString(const QString &s, const QString &format); +#endif + static QDateTime fromTime_t(uint secsSince1Jan1970UTC); + +#ifdef QT3_SUPPORT + inline QT3_SUPPORT void setTime_t(uint secsSince1Jan1970UTC, Qt::TimeSpec spec) { + setTime_t(secsSince1Jan1970UTC); + if (spec == Qt::UTC) + *this = toUTC(); + } + static inline QT3_SUPPORT QDateTime currentDateTime(Qt::TimeSpec spec) { + if (spec == Qt::LocalTime) + return currentDateTime(); + else + return currentDateTime().toUTC(); + } + +#endif + +private: + friend class QDateTimePrivate; + void detach(); + QExplicitlySharedDataPointer d; + +#ifndef QT_NO_DATASTREAM + friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &); + friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &); +#endif +}; +Q_DECLARE_TYPEINFO(QDateTime, Q_MOVABLE_TYPE); + +#ifdef QT3_SUPPORT +inline QDate QDate::currentDate(Qt::TimeSpec spec) +{ + if (spec == Qt::LocalTime) + return currentDate(); + else + return QDateTime::currentDateTime().toUTC().date(); +} + +inline QTime QTime::currentTime(Qt::TimeSpec spec) +{ + if (spec == Qt::LocalTime) + return currentTime(); + else + return QDateTime::currentDateTime().toUTC().time(); +} +#endif + +#ifndef QT_NO_DATASTREAM +Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDate &); +Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDate &); +Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QTime &); +Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QTime &); +Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &); +Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QDateTime &); +#endif // QT_NO_DATASTREAM + +#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_DATESTRING) +Q_CORE_EXPORT QDebug operator<<(QDebug, const QDate &); +Q_CORE_EXPORT QDebug operator<<(QDebug, const QTime &); +Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &); +#endif + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDATETIME_H diff --git a/qtinterface/qt4/Qt/qdatetimeedit.h b/qtinterface/qt4/Qt/qdatetimeedit.h new file mode 100644 index 0000000..f87a4c3 --- /dev/null +++ b/qtinterface/qt4/Qt/qdatetimeedit.h @@ -0,0 +1,232 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDATETIMEEDIT_H +#define QDATETIMEEDIT_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#ifndef QT_NO_DATETIMEEDIT + +class QDateTimeEditPrivate; +class QStyleOptionSpinBox; +class QCalendarWidget; + +class Q_GUI_EXPORT QDateTimeEdit : public QAbstractSpinBox +{ + Q_OBJECT + + Q_ENUMS(Section) + Q_FLAGS(Sections) + Q_PROPERTY(QDateTime dateTime READ dateTime WRITE setDateTime NOTIFY dateTimeChanged USER true) + Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY dateChanged) + Q_PROPERTY(QTime time READ time WRITE setTime NOTIFY timeChanged) + Q_PROPERTY(QDateTime maximumDateTime READ maximumDateTime WRITE setMaximumDateTime RESET clearMaximumDateTime) + Q_PROPERTY(QDateTime minimumDateTime READ minimumDateTime WRITE setMinimumDateTime RESET clearMinimumDateTime) + Q_PROPERTY(QDate maximumDate READ maximumDate WRITE setMaximumDate RESET clearMaximumDate) + Q_PROPERTY(QDate minimumDate READ minimumDate WRITE setMinimumDate RESET clearMinimumDate) + Q_PROPERTY(QTime maximumTime READ maximumTime WRITE setMaximumTime RESET clearMaximumTime) + Q_PROPERTY(QTime minimumTime READ minimumTime WRITE setMinimumTime RESET clearMinimumTime) + Q_PROPERTY(Section currentSection READ currentSection WRITE setCurrentSection) + Q_PROPERTY(Sections displayedSections READ displayedSections) + Q_PROPERTY(QString displayFormat READ displayFormat WRITE setDisplayFormat) + Q_PROPERTY(bool calendarPopup READ calendarPopup WRITE setCalendarPopup) + Q_PROPERTY(int currentSectionIndex READ currentSectionIndex WRITE setCurrentSectionIndex) + Q_PROPERTY(int sectionCount READ sectionCount) + Q_PROPERTY(Qt::TimeSpec timeSpec READ timeSpec WRITE setTimeSpec) +public: + enum Section { + NoSection = 0x0000, + AmPmSection = 0x0001, + MSecSection = 0x0002, + SecondSection = 0x0004, + MinuteSection = 0x0008, + HourSection = 0x0010, + DaySection = 0x0100, + MonthSection = 0x0200, + YearSection = 0x0400, + TimeSections_Mask = AmPmSection|MSecSection|SecondSection|MinuteSection|HourSection, + DateSections_Mask = DaySection|MonthSection|YearSection + }; + + Q_DECLARE_FLAGS(Sections, Section) + + explicit QDateTimeEdit(QWidget *parent = 0); + explicit QDateTimeEdit(const QDateTime &dt, QWidget *parent = 0); + explicit QDateTimeEdit(const QDate &d, QWidget *parent = 0); + explicit QDateTimeEdit(const QTime &t, QWidget *parent = 0); + + QDateTime dateTime() const; + QDate date() const; + QTime time() const; + + QDateTime minimumDateTime() const; + void clearMinimumDateTime(); + void setMinimumDateTime(const QDateTime &dt); + + QDateTime maximumDateTime() const; + void clearMaximumDateTime(); + void setMaximumDateTime(const QDateTime &dt); + + void setDateTimeRange(const QDateTime &min, const QDateTime &max); + + QDate minimumDate() const; + void setMinimumDate(const QDate &min); + void clearMinimumDate(); + + QDate maximumDate() const; + void setMaximumDate(const QDate &max); + void clearMaximumDate(); + + void setDateRange(const QDate &min, const QDate &max); + + QTime minimumTime() const; + void setMinimumTime(const QTime &min); + void clearMinimumTime(); + + QTime maximumTime() const; + void setMaximumTime(const QTime &max); + void clearMaximumTime(); + + void setTimeRange(const QTime &min, const QTime &max); + + Sections displayedSections() const; + Section currentSection() const; + Section sectionAt(int index) const; + void setCurrentSection(Section section); + + int currentSectionIndex() const; + void setCurrentSectionIndex(int index); + + QCalendarWidget *calendarWidget() const; + void setCalendarWidget(QCalendarWidget *calendarWidget); + + int sectionCount() const; + + void setSelectedSection(Section section); + + QString sectionText(Section section) const; + + QString displayFormat() const; + void setDisplayFormat(const QString &format); + + bool calendarPopup() const; + void setCalendarPopup(bool enable); + + Qt::TimeSpec timeSpec() const; + void setTimeSpec(Qt::TimeSpec spec); + + QSize sizeHint() const; + + virtual void clear(); + virtual void stepBy(int steps); + + bool event(QEvent *event); +Q_SIGNALS: + void dateTimeChanged(const QDateTime &date); + void timeChanged(const QTime &date); + void dateChanged(const QDate &date); + +public Q_SLOTS: + void setDateTime(const QDateTime &dateTime); + void setDate(const QDate &date); + void setTime(const QTime &time); + +protected: + virtual void keyPressEvent(QKeyEvent *event); +#ifndef QT_NO_WHEELEVENT + virtual void wheelEvent(QWheelEvent *event); +#endif + virtual void focusInEvent(QFocusEvent *event); + virtual bool focusNextPrevChild(bool next); + virtual QValidator::State validate(QString &input, int &pos) const; + virtual void fixup(QString &input) const; + + virtual QDateTime dateTimeFromText(const QString &text) const; + virtual QString textFromDateTime(const QDateTime &dt) const; + virtual StepEnabled stepEnabled() const; + virtual void mousePressEvent(QMouseEvent *event); + virtual void paintEvent(QPaintEvent *event); + void initStyleOption(QStyleOptionSpinBox *option) const; + + QDateTimeEdit(const QVariant &val, QVariant::Type parserType, QWidget *parent = 0); +private: + Q_DECLARE_PRIVATE(QDateTimeEdit) + Q_DISABLE_COPY(QDateTimeEdit) + + Q_PRIVATE_SLOT(d_func(), void _q_resetButton()) +}; + +class Q_GUI_EXPORT QTimeEdit : public QDateTimeEdit +{ + Q_OBJECT + Q_PROPERTY(QTime time READ time WRITE setTime NOTIFY timeChanged USER true) +public: + QTimeEdit(QWidget *parent = 0); + QTimeEdit(const QTime &time, QWidget *parent = 0); +}; + +class Q_GUI_EXPORT QDateEdit : public QDateTimeEdit +{ + Q_OBJECT + Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY dateChanged USER true) +public: + QDateEdit(QWidget *parent = 0); + QDateEdit(const QDate &date, QWidget *parent = 0); +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeEdit::Sections) + +#endif // QT_NO_DATETIMEEDIT + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDATETIMEEDIT_H diff --git a/qtinterface/qt4/Qt/qdbusabstractadaptor.h b/qtinterface/qt4/Qt/qdbusabstractadaptor.h new file mode 100644 index 0000000..5edb91c --- /dev/null +++ b/qtinterface/qt4/Qt/qdbusabstractadaptor.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDBus module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDBUSABSTRACTADAPTOR_H +#define QDBUSABSTRACTADAPTOR_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(DBus) + +class QDBusAbstractAdaptorPrivate; +class QDBUS_EXPORT QDBusAbstractAdaptor: public QObject +{ + Q_OBJECT +protected: + QDBusAbstractAdaptor(QObject *parent); + +public: + ~QDBusAbstractAdaptor(); + +protected: + void setAutoRelaySignals(bool enable); + bool autoRelaySignals() const; + +private: + Q_DECLARE_PRIVATE(QDBusAbstractAdaptor) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qdbusabstractinterface.h b/qtinterface/qt4/Qt/qdbusabstractinterface.h new file mode 100644 index 0000000..c3be090 --- /dev/null +++ b/qtinterface/qt4/Qt/qdbusabstractinterface.h @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDBus module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDBUSABSTRACTINTERFACE_H +#define QDBUSABSTRACTINTERFACE_H + +#include +#include +#include +#include + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(DBus) + +class QDBusError; +class QDBusPendingCall; + +class QDBusAbstractInterfacePrivate; + +class QDBUS_EXPORT QDBusAbstractInterfaceBase: public QObject +{ +public: + int qt_metacall(QMetaObject::Call, int, void**); +protected: + QDBusAbstractInterfaceBase(QDBusAbstractInterfacePrivate &dd, QObject *parent); +private: + Q_DECLARE_PRIVATE(QDBusAbstractInterface) +}; + +class QDBUS_EXPORT QDBusAbstractInterface: +#ifdef Q_QDOC + public QObject +#else + public QDBusAbstractInterfaceBase +#endif +{ + Q_OBJECT + +public: + virtual ~QDBusAbstractInterface(); + bool isValid() const; + + QDBusConnection connection() const; + + QString service() const; + QString path() const; + QString interface() const; + + QDBusError lastError() const; + + QDBusMessage call(const QString &method, + const QVariant &arg1 = QVariant(), + const QVariant &arg2 = QVariant(), + const QVariant &arg3 = QVariant(), + const QVariant &arg4 = QVariant(), + const QVariant &arg5 = QVariant(), + const QVariant &arg6 = QVariant(), + const QVariant &arg7 = QVariant(), + const QVariant &arg8 = QVariant()); + + QDBusMessage call(QDBus::CallMode mode, + const QString &method, + const QVariant &arg1 = QVariant(), + const QVariant &arg2 = QVariant(), + const QVariant &arg3 = QVariant(), + const QVariant &arg4 = QVariant(), + const QVariant &arg5 = QVariant(), + const QVariant &arg6 = QVariant(), + const QVariant &arg7 = QVariant(), + const QVariant &arg8 = QVariant()); + + QDBusMessage callWithArgumentList(QDBus::CallMode mode, + const QString &method, + const QList &args); + + bool callWithCallback(const QString &method, + const QList &args, + QObject *receiver, const char *member, const char *errorSlot); + bool callWithCallback(const QString &method, + const QList &args, + QObject *receiver, const char *member); + + QDBusPendingCall asyncCall(const QString &method, + const QVariant &arg1 = QVariant(), + const QVariant &arg2 = QVariant(), + const QVariant &arg3 = QVariant(), + const QVariant &arg4 = QVariant(), + const QVariant &arg5 = QVariant(), + const QVariant &arg6 = QVariant(), + const QVariant &arg7 = QVariant(), + const QVariant &arg8 = QVariant()); + QDBusPendingCall asyncCallWithArgumentList(const QString &method, + const QList &args); + +protected: + QDBusAbstractInterface(const QString &service, const QString &path, const char *interface, + const QDBusConnection &connection, QObject *parent); + QDBusAbstractInterface(QDBusAbstractInterfacePrivate &, QObject *parent); + + void connectNotify(const char *signal); + void disconnectNotify(const char *signal); + QVariant internalPropGet(const char *propname) const; + void internalPropSet(const char *propname, const QVariant &value); + QDBusMessage internalConstCall(QDBus::CallMode mode, + const QString &method, + const QList &args = QList()) const; + +private: + Q_DECLARE_PRIVATE(QDBusAbstractInterface) + Q_PRIVATE_SLOT(d_func(), void _q_serviceOwnerChanged(QString,QString,QString)) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/qtinterface/qt4/Qt/qdbusargument.h b/qtinterface/qt4/Qt/qdbusargument.h new file mode 100644 index 0000000..c9cb4a8 --- /dev/null +++ b/qtinterface/qt4/Qt/qdbusargument.h @@ -0,0 +1,383 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDBus module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDBUSARGUMENT_H +#define QDBUSARGUMENT_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(DBus) + +class QDBusArgumentPrivate; +class QDBusDemarshaller; +class QDBusMarshaller; +class QDBUS_EXPORT QDBusArgument +{ +public: + enum ElementType { + BasicType, + VariantType, + ArrayType, + StructureType, + MapType, + MapEntryType, + UnknownType = -1 + }; + + QDBusArgument(); + QDBusArgument(const QDBusArgument &other); + QDBusArgument &operator=(const QDBusArgument &other); + ~QDBusArgument(); + + // used for marshalling (Qt -> D-BUS) + QDBusArgument &operator<<(uchar arg); + QDBusArgument &operator<<(bool arg); + QDBusArgument &operator<<(short arg); + QDBusArgument &operator<<(ushort arg); + QDBusArgument &operator<<(int arg); + QDBusArgument &operator<<(uint arg); + QDBusArgument &operator<<(qlonglong arg); + QDBusArgument &operator<<(qulonglong arg); + QDBusArgument &operator<<(double arg); + QDBusArgument &operator<<(const QString &arg); + QDBusArgument &operator<<(const QDBusVariant &arg); + QDBusArgument &operator<<(const QDBusObjectPath &arg); + QDBusArgument &operator<<(const QDBusSignature &arg); + QDBusArgument &operator<<(const QStringList &arg); + QDBusArgument &operator<<(const QByteArray &arg); + + void beginStructure(); + void endStructure(); + void beginArray(int elementMetaTypeId); + void endArray(); + void beginMap(int keyMetaTypeId, int valueMetaTypeId); + void endMap(); + void beginMapEntry(); + void endMapEntry(); + + void appendVariant(const QVariant &v); + + // used for de-marshalling (D-BUS -> Qt) + QString currentSignature() const; + ElementType currentType() const; + + const QDBusArgument &operator>>(uchar &arg) const; + const QDBusArgument &operator>>(bool &arg) const; + const QDBusArgument &operator>>(short &arg) const; + const QDBusArgument &operator>>(ushort &arg) const; + const QDBusArgument &operator>>(int &arg) const; + const QDBusArgument &operator>>(uint &arg) const; + const QDBusArgument &operator>>(qlonglong &arg) const; + const QDBusArgument &operator>>(qulonglong &arg) const; + const QDBusArgument &operator>>(double &arg) const; + const QDBusArgument &operator>>(QString &arg) const; + const QDBusArgument &operator>>(QDBusVariant &arg) const; + const QDBusArgument &operator>>(QDBusObjectPath &arg) const; + const QDBusArgument &operator>>(QDBusSignature &arg) const; + const QDBusArgument &operator>>(QStringList &arg) const; + const QDBusArgument &operator>>(QByteArray &arg) const; + + void beginStructure() const; + void endStructure() const; + void beginArray() const; + void endArray() const; + void beginMap() const; + void endMap() const; + void beginMapEntry() const; + void endMapEntry() const; + bool atEnd() const; + + QVariant asVariant() const; + +protected: + QDBusArgument(QDBusArgumentPrivate *d); + friend class QDBusArgumentPrivate; + mutable QDBusArgumentPrivate *d; +}; + +template inline T qdbus_cast(const QDBusArgument &arg +#ifndef Q_QDOC +, T * = 0 +#endif + ) +{ + T item; + arg >> item; + return item; +} + +template inline T qdbus_cast(const QVariant &v +#ifndef Q_QDOC +, T * = 0 +#endif + ) +{ + int id = v.userType(); + if (id == qMetaTypeId()) + return qdbus_cast(qvariant_cast(v)); + else + return qvariant_cast(v); +} + +// specialise for QVariant, allowing it to be used in place of QDBusVariant +template<> inline QVariant qdbus_cast(const QDBusArgument &arg, QVariant *) +{ + QDBusVariant item; + arg >> item; + return item.variant(); +} +template<> inline QVariant qdbus_cast(const QVariant &v, QVariant *) +{ + return qdbus_cast(v).variant(); +} + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QVariant &v); + +// QVariant types +#ifndef QDBUS_NO_SPECIALTYPES + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDate &date); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDate &date); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QTime &time); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QTime &time); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QDateTime &dt); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QDateTime &dt); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRect &rect); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRect &rect); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QRectF &rect); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QRectF &rect); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSize &size); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSize &size); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QSizeF &size); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QSizeF &size); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPoint &pt); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPoint &pt); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QPointF &pt); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QPointF &pt); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLine &line); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLine &line); + +QDBUS_EXPORT const QDBusArgument &operator>>(const QDBusArgument &a, QLineF &line); +QDBUS_EXPORT QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line); +#endif + +template