From 564894627debad93433f16506ccf32afeb23d004 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 30 Oct 2009 16:12:18 +1000 Subject: Make private headers _p --- src/declarative/3rdparty/3rdparty.pri | 2 +- src/declarative/3rdparty/qlistmodelinterface.cpp | 2 +- src/declarative/3rdparty/qlistmodelinterface.h | 86 ---- src/declarative/3rdparty/qlistmodelinterface_p.h | 86 ++++ src/declarative/debugger/debugger.pri | 10 +- src/declarative/debugger/qmldebug.cpp | 4 +- src/declarative/debugger/qmldebug.h | 314 ------------ src/declarative/debugger/qmldebug_p.h | 314 ++++++++++++ src/declarative/debugger/qmldebugclient.cpp | 4 +- src/declarative/debugger/qmldebugclient.h | 99 ---- src/declarative/debugger/qmldebugclient_p.h | 99 ++++ src/declarative/debugger/qmldebuggerstatus.cpp | 2 +- src/declarative/debugger/qmldebuggerstatus.h | 66 --- src/declarative/debugger/qmldebuggerstatus_p.h | 66 +++ src/declarative/debugger/qmldebugservice.cpp | 4 +- src/declarative/debugger/qmldebugservice.h | 88 ---- src/declarative/debugger/qmldebugservice_p.h | 88 ++++ src/declarative/debugger/qpacketprotocol.cpp | 2 +- src/declarative/debugger/qpacketprotocol.h | 122 ----- src/declarative/debugger/qpacketprotocol_p.h | 122 +++++ src/declarative/extra/extra.pri | 18 +- src/declarative/extra/qmlbehavior.cpp | 6 +- src/declarative/extra/qmlbehavior.h | 84 ---- src/declarative/extra/qmlbehavior_p.h | 84 ++++ src/declarative/extra/qmldatetimeformatter.cpp | 2 +- src/declarative/extra/qmldatetimeformatter.h | 116 ----- src/declarative/extra/qmldatetimeformatter_p.h | 116 +++++ src/declarative/extra/qmlfontloader.cpp | 2 +- src/declarative/extra/qmlfontloader.h | 94 ---- src/declarative/extra/qmlfontloader_p.h | 94 ++++ .../extra/qmlgraphicsanimatedimageitem.cpp | 2 +- .../extra/qmlgraphicsanimatedimageitem.h | 106 ---- .../extra/qmlgraphicsanimatedimageitem_p.h | 77 ++- .../extra/qmlgraphicsanimatedimageitem_p_p.h | 81 ++++ src/declarative/extra/qmlgraphicsintegermodel.cpp | 2 +- src/declarative/extra/qmlgraphicsintegermodel.h | 86 ---- src/declarative/extra/qmlgraphicsintegermodel_p.h | 86 ++++ src/declarative/extra/qmlgraphicsparticles.cpp | 8 +- src/declarative/extra/qmlgraphicsparticles.h | 230 --------- src/declarative/extra/qmlgraphicsparticles_p.h | 230 +++++++++ src/declarative/extra/qmlnumberformatter.cpp | 2 +- src/declarative/extra/qmlnumberformatter.h | 92 ---- src/declarative/extra/qmlnumberformatter_p.h | 92 ++++ src/declarative/extra/qmlxmllistmodel.cpp | 2 +- src/declarative/extra/qmlxmllistmodel.h | 134 ----- src/declarative/extra/qmlxmllistmodel_p.h | 134 +++++ src/declarative/extra/qnumberformat.cpp | 2 +- src/declarative/extra/qnumberformat.h | 173 ------- src/declarative/extra/qnumberformat_p.h | 173 +++++++ src/declarative/fx/fx.pri | 60 +-- src/declarative/fx/qmlgraphicsanchors.cpp | 6 +- src/declarative/fx/qmlgraphicsanchors.h | 180 ------- src/declarative/fx/qmlgraphicsanchors_p.h | 234 +++++---- src/declarative/fx/qmlgraphicsanchors_p_p.h | 160 ++++++ src/declarative/fx/qmlgraphicsborderimage.cpp | 2 +- src/declarative/fx/qmlgraphicsborderimage.h | 105 ---- src/declarative/fx/qmlgraphicsborderimage_p.h | 96 ++-- src/declarative/fx/qmlgraphicsborderimage_p_p.h | 97 ++++ src/declarative/fx/qmlgraphicsevents.cpp | 2 +- src/declarative/fx/qmlgraphicsevents_p.h | 137 ------ src/declarative/fx/qmlgraphicsevents_p_p.h | 137 ++++++ src/declarative/fx/qmlgraphicsflickable.cpp | 4 +- src/declarative/fx/qmlgraphicsflickable.h | 203 -------- src/declarative/fx/qmlgraphicsflickable_p.h | 245 ++++++---- src/declarative/fx/qmlgraphicsflickable_p_p.h | 156 ++++++ src/declarative/fx/qmlgraphicsflipable.cpp | 4 +- src/declarative/fx/qmlgraphicsflipable.h | 94 ---- src/declarative/fx/qmlgraphicsflipable_p.h | 94 ++++ src/declarative/fx/qmlgraphicsfocuspanel.cpp | 2 +- src/declarative/fx/qmlgraphicsfocuspanel.h | 77 --- src/declarative/fx/qmlgraphicsfocuspanel_p.h | 77 +++ src/declarative/fx/qmlgraphicsfocusscope.cpp | 2 +- src/declarative/fx/qmlgraphicsfocusscope.h | 68 --- src/declarative/fx/qmlgraphicsfocusscope_p.h | 68 +++ .../fx/qmlgraphicsgraphicsobjectcontainer.cpp | 6 +- .../fx/qmlgraphicsgraphicsobjectcontainer.h | 90 ---- .../fx/qmlgraphicsgraphicsobjectcontainer_p.h | 90 ++++ src/declarative/fx/qmlgraphicsgridview.cpp | 12 +- src/declarative/fx/qmlgraphicsgridview.h | 157 ------ src/declarative/fx/qmlgraphicsgridview_p.h | 157 ++++++ src/declarative/fx/qmlgraphicsimage.cpp | 2 +- src/declarative/fx/qmlgraphicsimage.h | 90 ---- src/declarative/fx/qmlgraphicsimage_p.h | 57 ++- src/declarative/fx/qmlgraphicsimage_p_p.h | 77 +++ src/declarative/fx/qmlgraphicsimagebase.cpp | 4 +- src/declarative/fx/qmlgraphicsimagebase.h | 90 ---- src/declarative/fx/qmlgraphicsimagebase_p.h | 67 +-- src/declarative/fx/qmlgraphicsimagebase_p_p.h | 83 ++++ src/declarative/fx/qmlgraphicsitem.cpp | 17 +- src/declarative/fx/qmlgraphicsitem_p.h | 6 +- src/declarative/fx/qmlgraphicslayoutitem.cpp | 2 +- src/declarative/fx/qmlgraphicslayoutitem.h | 93 ---- src/declarative/fx/qmlgraphicslayoutitem_p.h | 93 ++++ src/declarative/fx/qmlgraphicslistview.cpp | 13 +- src/declarative/fx/qmlgraphicslistview.h | 186 ------- src/declarative/fx/qmlgraphicslistview_p.h | 186 +++++++ src/declarative/fx/qmlgraphicsloader.cpp | 6 +- src/declarative/fx/qmlgraphicsloader.h | 107 ---- src/declarative/fx/qmlgraphicsloader_p.h | 83 ++-- src/declarative/fx/qmlgraphicsloader_p_p.h | 82 ++++ src/declarative/fx/qmlgraphicsmouseregion.cpp | 4 +- src/declarative/fx/qmlgraphicsmouseregion.h | 180 ------- src/declarative/fx/qmlgraphicsmouseregion_p.h | 192 +++++--- src/declarative/fx/qmlgraphicsmouseregion_p_p.h | 114 +++++ src/declarative/fx/qmlgraphicspainteditem.cpp | 2 +- src/declarative/fx/qmlgraphicspainteditem.h | 105 ---- src/declarative/fx/qmlgraphicspainteditem_p.h | 91 ++-- src/declarative/fx/qmlgraphicspainteditem_p_p.h | 88 ++++ src/declarative/fx/qmlgraphicspath.cpp | 4 +- src/declarative/fx/qmlgraphicspath.h | 259 ---------- src/declarative/fx/qmlgraphicspath_p.h | 234 +++++++-- src/declarative/fx/qmlgraphicspath_p_p.h | 79 +++ src/declarative/fx/qmlgraphicspathview.cpp | 12 +- src/declarative/fx/qmlgraphicspathview.h | 138 ------ src/declarative/fx/qmlgraphicspathview_p.h | 183 ++++--- src/declarative/fx/qmlgraphicspathview_p_p.h | 151 ++++++ src/declarative/fx/qmlgraphicspixmapcache.cpp | 4 +- src/declarative/fx/qmlgraphicspixmapcache.h | 72 --- src/declarative/fx/qmlgraphicspixmapcache_p.h | 72 +++ src/declarative/fx/qmlgraphicspositioners.cpp | 12 +- src/declarative/fx/qmlgraphicspositioners.h | 167 ------- src/declarative/fx/qmlgraphicspositioners_p.h | 168 +++++-- src/declarative/fx/qmlgraphicspositioners_p_p.h | 105 ++++ src/declarative/fx/qmlgraphicsrect.cpp | 2 +- src/declarative/fx/qmlgraphicsrect.h | 189 -------- src/declarative/fx/qmlgraphicsrect_p.h | 196 +++++--- src/declarative/fx/qmlgraphicsrect_p_p.h | 109 +++++ src/declarative/fx/qmlgraphicsrepeater.cpp | 8 +- src/declarative/fx/qmlgraphicsrepeater.h | 103 ---- src/declarative/fx/qmlgraphicsrepeater_p.h | 76 +-- src/declarative/fx/qmlgraphicsrepeater_p_p.h | 81 ++++ src/declarative/fx/qmlgraphicsscalegrid.cpp | 2 +- src/declarative/fx/qmlgraphicsscalegrid_p.h | 133 ----- src/declarative/fx/qmlgraphicsscalegrid_p_p.h | 133 +++++ src/declarative/fx/qmlgraphicstext.cpp | 4 +- src/declarative/fx/qmlgraphicstext.h | 151 ------ src/declarative/fx/qmlgraphicstext_p.h | 164 ++++--- src/declarative/fx/qmlgraphicstext_p_p.h | 113 +++++ src/declarative/fx/qmlgraphicstextedit.cpp | 6 +- src/declarative/fx/qmlgraphicstextedit.h | 234 --------- src/declarative/fx/qmlgraphicstextedit_p.h | 241 ++++++--- src/declarative/fx/qmlgraphicstextedit_p_p.h | 113 +++++ src/declarative/fx/qmlgraphicstextinput.cpp | 2 +- src/declarative/fx/qmlgraphicstextinput.h | 209 -------- src/declarative/fx/qmlgraphicstextinput_p.h | 212 +++++--- src/declarative/fx/qmlgraphicstextinput_p_p.h | 109 +++++ src/declarative/fx/qmlgraphicsvisualitemmodel.cpp | 13 +- src/declarative/fx/qmlgraphicsvisualitemmodel.h | 203 -------- src/declarative/fx/qmlgraphicsvisualitemmodel_p.h | 203 ++++++++ src/declarative/fx/qmlgraphicswebview.cpp | 10 +- src/declarative/fx/qmlgraphicswebview.h | 251 ---------- src/declarative/fx/qmlgraphicswebview_p.h | 251 ++++++++++ src/declarative/qml/qmlbasicscript.cpp | 2 +- src/declarative/qml/qmlbinding.cpp | 2 +- src/declarative/qml/qmlcompiler.cpp | 2 +- src/declarative/qml/qmlcomponent.cpp | 2 +- src/declarative/qml/qmlengine.cpp | 2 +- src/declarative/qml/qmlenginedebug_p.h | 2 +- src/declarative/qml/qmlmetaproperty.cpp | 2 +- src/declarative/qml/qmlparser.cpp | 2 +- src/declarative/qml/qmlscriptparser.cpp | 2 +- src/declarative/qml/qmlvme.cpp | 2 +- src/declarative/qml/qmlwatcher.cpp | 2 +- src/declarative/util/qfxperf.cpp | 2 +- src/declarative/util/qfxperf_p.h | 90 ---- src/declarative/util/qfxperf_p_p.h | 90 ++++ src/declarative/util/qmlanimation.cpp | 8 +- src/declarative/util/qmlanimation.h | 407 ---------------- src/declarative/util/qmlanimation_p.h | 539 +++++++++++---------- src/declarative/util/qmlanimation_p_p.h | 362 ++++++++++++++ src/declarative/util/qmlbind.cpp | 4 +- src/declarative/util/qmlbind.h | 92 ---- src/declarative/util/qmlbind_p.h | 92 ++++ src/declarative/util/qmlconnection.cpp | 2 +- src/declarative/util/qmlconnection.h | 92 ---- src/declarative/util/qmlconnection_p.h | 92 ++++ src/declarative/util/qmleasefollow.cpp | 4 +- src/declarative/util/qmleasefollow.h | 113 ----- src/declarative/util/qmleasefollow_p.h | 113 +++++ src/declarative/util/qmllistaccessor.cpp | 2 +- src/declarative/util/qmllistaccessor.h | 85 ---- src/declarative/util/qmllistaccessor_p.h | 85 ++++ src/declarative/util/qmllistmodel.cpp | 4 +- src/declarative/util/qmllistmodel.h | 103 ---- src/declarative/util/qmllistmodel_p.h | 103 ++++ src/declarative/util/qmlnullablevalue_p.h | 81 ---- src/declarative/util/qmlnullablevalue_p_p.h | 81 ++++ src/declarative/util/qmlopenmetaobject.cpp | 2 +- src/declarative/util/qmlopenmetaobject.h | 91 ---- src/declarative/util/qmlopenmetaobject_p.h | 91 ++++ src/declarative/util/qmlpackage.cpp | 2 +- src/declarative/util/qmlpackage.h | 88 ---- src/declarative/util/qmlpackage_p.h | 88 ++++ src/declarative/util/qmlpropertychanges.cpp | 4 +- src/declarative/util/qmlpropertychanges.h | 84 ---- src/declarative/util/qmlpropertychanges_p.h | 84 ++++ src/declarative/util/qmlpropertymap.cpp | 4 +- src/declarative/util/qmlpropertymap.h | 91 ---- src/declarative/util/qmlpropertymap_p.h | 91 ++++ src/declarative/util/qmlspringfollow.cpp | 4 +- src/declarative/util/qmlspringfollow.h | 113 ----- src/declarative/util/qmlspringfollow_p.h | 113 +++++ src/declarative/util/qmlstate.cpp | 12 +- src/declarative/util/qmlstate.h | 174 ------- src/declarative/util/qmlstate_p.h | 167 ++++--- src/declarative/util/qmlstate_p_p.h | 121 +++++ src/declarative/util/qmlstategroup.cpp | 4 +- src/declarative/util/qmlstategroup.h | 94 ---- src/declarative/util/qmlstategroup_p.h | 94 ++++ src/declarative/util/qmlstateoperations.cpp | 10 +- src/declarative/util/qmlstateoperations.h | 177 ------- src/declarative/util/qmlstateoperations_p.h | 177 +++++++ src/declarative/util/qmlsystempalette.cpp | 2 +- src/declarative/util/qmlsystempalette.h | 122 ----- src/declarative/util/qmlsystempalette_p.h | 122 +++++ src/declarative/util/qmltimeline.cpp | 2 +- src/declarative/util/qmltimeline_p.h | 224 --------- src/declarative/util/qmltimeline_p_p.h | 224 +++++++++ src/declarative/util/qmltimer.cpp | 2 +- src/declarative/util/qmltimer.h | 108 ----- src/declarative/util/qmltimer_p.h | 108 +++++ src/declarative/util/qmltransition.cpp | 10 +- src/declarative/util/qmltransition.h | 99 ---- src/declarative/util/qmltransition_p.h | 99 ++++ src/declarative/util/qmltransitionmanager.cpp | 4 +- src/declarative/util/qmltransitionmanager_p.h | 85 ---- src/declarative/util/qmltransitionmanager_p_p.h | 85 ++++ src/declarative/util/qmlview.cpp | 8 +- src/declarative/util/qperformancelog.cpp | 2 +- src/declarative/util/qperformancelog_p.h | 141 ------ src/declarative/util/qperformancelog_p_p.h | 141 ++++++ src/declarative/util/util.pri | 44 +- src/declarative/widgets/graphicslayouts.cpp | 2 +- src/declarative/widgets/graphicslayouts.h | 193 -------- src/declarative/widgets/graphicslayouts_p.h | 193 ++++++++ src/declarative/widgets/graphicswidgets.cpp | 2 +- src/declarative/widgets/graphicswidgets.h | 62 --- src/declarative/widgets/graphicswidgets_p.h | 62 +++ src/declarative/widgets/widgets.pri | 4 +- tests/auto/declarative/anchors/tst_anchors.cpp | 4 +- .../animatedimage/tst_animatedimage.cpp | 6 +- .../auto/declarative/animations/tst_animations.cpp | 2 +- tests/auto/declarative/behaviors/tst_behaviors.cpp | 2 +- .../datetimeformatter/tst_datetimeformatter.cpp | 2 +- tests/auto/declarative/layouts/tst_layouts.cpp | 4 +- tests/auto/declarative/listview/tst_listview.cpp | 6 +- .../numberformatter/tst_numberformatter.cpp | 4 +- tests/auto/declarative/pathview/tst_pathview.cpp | 8 +- tests/auto/declarative/qfxloader/tst_qfxloader.cpp | 2 +- .../qfxpixmapcache/tst_qfxpixmapcache.cpp | 2 +- tests/auto/declarative/qfxtext/tst_qfxtext.cpp | 2 +- .../declarative/qfxtextedit/tst_qfxtextedit.cpp | 2 +- .../auto/declarative/qfxwebview/tst_qfxwebview.cpp | 2 +- .../qmllistaccessor/tst_qmllistaccessor.cpp | 2 +- .../qmlpropertymap/tst_qmlpropertymap.cpp | 4 +- tests/auto/declarative/qmltimer/tst_qmltimer.cpp | 2 +- tests/auto/declarative/repeater/tst_repeater.cpp | 6 +- tests/auto/declarative/sql/tst_sql.cpp | 2 +- tests/auto/declarative/states/tst_states.cpp | 2 +- .../qmldebugger/creatorplugin/qmlinspectormode.cpp | 4 +- .../creatorplugin/qmlinspectorplugin.cpp | 4 +- tools/qmldebugger/standalone/canvasframerate.cpp | 2 +- tools/qmldebugger/standalone/canvasframerate.h | 2 +- tools/qmldebugger/standalone/engine.cpp | 4 +- tools/qmldebugger/standalone/engine.h | 2 +- .../qmldebugger/standalone/expressionquerywidget.h | 2 +- .../standalone/objectpropertiesview.cpp | 6 +- .../qmldebugger/standalone/objectpropertiesview.h | 2 +- tools/qmldebugger/standalone/objecttree.cpp | 6 +- tools/qmldebugger/standalone/qmldebugger.h | 2 +- tools/qmldebugger/standalone/watchtable.cpp | 2 +- tools/qmlviewer/qmlviewer.cpp | 2 +- 272 files changed, 10468 insertions(+), 10467 deletions(-) delete mode 100644 src/declarative/3rdparty/qlistmodelinterface.h create mode 100644 src/declarative/3rdparty/qlistmodelinterface_p.h delete mode 100644 src/declarative/debugger/qmldebug.h create mode 100644 src/declarative/debugger/qmldebug_p.h delete mode 100644 src/declarative/debugger/qmldebugclient.h create mode 100644 src/declarative/debugger/qmldebugclient_p.h delete mode 100644 src/declarative/debugger/qmldebuggerstatus.h create mode 100644 src/declarative/debugger/qmldebuggerstatus_p.h delete mode 100644 src/declarative/debugger/qmldebugservice.h create mode 100644 src/declarative/debugger/qmldebugservice_p.h delete mode 100644 src/declarative/debugger/qpacketprotocol.h create mode 100644 src/declarative/debugger/qpacketprotocol_p.h delete mode 100644 src/declarative/extra/qmlbehavior.h create mode 100644 src/declarative/extra/qmlbehavior_p.h delete mode 100644 src/declarative/extra/qmldatetimeformatter.h create mode 100644 src/declarative/extra/qmldatetimeformatter_p.h delete mode 100644 src/declarative/extra/qmlfontloader.h create mode 100644 src/declarative/extra/qmlfontloader_p.h delete mode 100644 src/declarative/extra/qmlgraphicsanimatedimageitem.h create mode 100644 src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h delete mode 100644 src/declarative/extra/qmlgraphicsintegermodel.h create mode 100644 src/declarative/extra/qmlgraphicsintegermodel_p.h delete mode 100644 src/declarative/extra/qmlgraphicsparticles.h create mode 100644 src/declarative/extra/qmlgraphicsparticles_p.h delete mode 100644 src/declarative/extra/qmlnumberformatter.h create mode 100644 src/declarative/extra/qmlnumberformatter_p.h delete mode 100644 src/declarative/extra/qmlxmllistmodel.h create mode 100644 src/declarative/extra/qmlxmllistmodel_p.h delete mode 100644 src/declarative/extra/qnumberformat.h create mode 100644 src/declarative/extra/qnumberformat_p.h delete mode 100644 src/declarative/fx/qmlgraphicsanchors.h create mode 100644 src/declarative/fx/qmlgraphicsanchors_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsborderimage.h create mode 100644 src/declarative/fx/qmlgraphicsborderimage_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsevents_p.h create mode 100644 src/declarative/fx/qmlgraphicsevents_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsflickable.h create mode 100644 src/declarative/fx/qmlgraphicsflickable_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsflipable.h create mode 100644 src/declarative/fx/qmlgraphicsflipable_p.h delete mode 100644 src/declarative/fx/qmlgraphicsfocuspanel.h create mode 100644 src/declarative/fx/qmlgraphicsfocuspanel_p.h delete mode 100644 src/declarative/fx/qmlgraphicsfocusscope.h create mode 100644 src/declarative/fx/qmlgraphicsfocusscope_p.h delete mode 100644 src/declarative/fx/qmlgraphicsgraphicsobjectcontainer.h create mode 100644 src/declarative/fx/qmlgraphicsgraphicsobjectcontainer_p.h delete mode 100644 src/declarative/fx/qmlgraphicsgridview.h create mode 100644 src/declarative/fx/qmlgraphicsgridview_p.h delete mode 100644 src/declarative/fx/qmlgraphicsimage.h create mode 100644 src/declarative/fx/qmlgraphicsimage_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsimagebase.h create mode 100644 src/declarative/fx/qmlgraphicsimagebase_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicslayoutitem.h create mode 100644 src/declarative/fx/qmlgraphicslayoutitem_p.h delete mode 100644 src/declarative/fx/qmlgraphicslistview.h create mode 100644 src/declarative/fx/qmlgraphicslistview_p.h delete mode 100644 src/declarative/fx/qmlgraphicsloader.h create mode 100644 src/declarative/fx/qmlgraphicsloader_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsmouseregion.h create mode 100644 src/declarative/fx/qmlgraphicsmouseregion_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicspainteditem.h create mode 100644 src/declarative/fx/qmlgraphicspainteditem_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicspath.h create mode 100644 src/declarative/fx/qmlgraphicspath_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicspathview.h create mode 100644 src/declarative/fx/qmlgraphicspathview_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicspixmapcache.h create mode 100644 src/declarative/fx/qmlgraphicspixmapcache_p.h delete mode 100644 src/declarative/fx/qmlgraphicspositioners.h create mode 100644 src/declarative/fx/qmlgraphicspositioners_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsrect.h create mode 100644 src/declarative/fx/qmlgraphicsrect_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsrepeater.h create mode 100644 src/declarative/fx/qmlgraphicsrepeater_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsscalegrid_p.h create mode 100644 src/declarative/fx/qmlgraphicsscalegrid_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicstext.h create mode 100644 src/declarative/fx/qmlgraphicstext_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicstextedit.h create mode 100644 src/declarative/fx/qmlgraphicstextedit_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicstextinput.h create mode 100644 src/declarative/fx/qmlgraphicstextinput_p_p.h delete mode 100644 src/declarative/fx/qmlgraphicsvisualitemmodel.h create mode 100644 src/declarative/fx/qmlgraphicsvisualitemmodel_p.h delete mode 100644 src/declarative/fx/qmlgraphicswebview.h create mode 100644 src/declarative/fx/qmlgraphicswebview_p.h delete mode 100644 src/declarative/util/qfxperf_p.h create mode 100644 src/declarative/util/qfxperf_p_p.h delete mode 100644 src/declarative/util/qmlanimation.h create mode 100644 src/declarative/util/qmlanimation_p_p.h delete mode 100644 src/declarative/util/qmlbind.h create mode 100644 src/declarative/util/qmlbind_p.h delete mode 100644 src/declarative/util/qmlconnection.h create mode 100644 src/declarative/util/qmlconnection_p.h delete mode 100644 src/declarative/util/qmleasefollow.h create mode 100644 src/declarative/util/qmleasefollow_p.h delete mode 100644 src/declarative/util/qmllistaccessor.h create mode 100644 src/declarative/util/qmllistaccessor_p.h delete mode 100644 src/declarative/util/qmllistmodel.h create mode 100644 src/declarative/util/qmllistmodel_p.h delete mode 100644 src/declarative/util/qmlnullablevalue_p.h create mode 100644 src/declarative/util/qmlnullablevalue_p_p.h delete mode 100644 src/declarative/util/qmlopenmetaobject.h create mode 100644 src/declarative/util/qmlopenmetaobject_p.h delete mode 100644 src/declarative/util/qmlpackage.h create mode 100644 src/declarative/util/qmlpackage_p.h delete mode 100644 src/declarative/util/qmlpropertychanges.h create mode 100644 src/declarative/util/qmlpropertychanges_p.h delete mode 100644 src/declarative/util/qmlpropertymap.h create mode 100644 src/declarative/util/qmlpropertymap_p.h delete mode 100644 src/declarative/util/qmlspringfollow.h create mode 100644 src/declarative/util/qmlspringfollow_p.h delete mode 100644 src/declarative/util/qmlstate.h create mode 100644 src/declarative/util/qmlstate_p_p.h delete mode 100644 src/declarative/util/qmlstategroup.h create mode 100644 src/declarative/util/qmlstategroup_p.h delete mode 100644 src/declarative/util/qmlstateoperations.h create mode 100644 src/declarative/util/qmlstateoperations_p.h delete mode 100644 src/declarative/util/qmlsystempalette.h create mode 100644 src/declarative/util/qmlsystempalette_p.h delete mode 100644 src/declarative/util/qmltimeline_p.h create mode 100644 src/declarative/util/qmltimeline_p_p.h delete mode 100644 src/declarative/util/qmltimer.h create mode 100644 src/declarative/util/qmltimer_p.h delete mode 100644 src/declarative/util/qmltransition.h create mode 100644 src/declarative/util/qmltransition_p.h delete mode 100644 src/declarative/util/qmltransitionmanager_p.h create mode 100644 src/declarative/util/qmltransitionmanager_p_p.h delete mode 100644 src/declarative/util/qperformancelog_p.h create mode 100644 src/declarative/util/qperformancelog_p_p.h delete mode 100644 src/declarative/widgets/graphicslayouts.h create mode 100644 src/declarative/widgets/graphicslayouts_p.h delete mode 100644 src/declarative/widgets/graphicswidgets.h create mode 100644 src/declarative/widgets/graphicswidgets_p.h diff --git a/src/declarative/3rdparty/3rdparty.pri b/src/declarative/3rdparty/3rdparty.pri index fc78cb2..09cf0bb 100644 --- a/src/declarative/3rdparty/3rdparty.pri +++ b/src/declarative/3rdparty/3rdparty.pri @@ -1,5 +1,5 @@ HEADERS += \ - 3rdparty/qlistmodelinterface.h\ + 3rdparty/qlistmodelinterface_p.h\ SOURCES += \ 3rdparty/qlistmodelinterface.cpp \ diff --git a/src/declarative/3rdparty/qlistmodelinterface.cpp b/src/declarative/3rdparty/qlistmodelinterface.cpp index b47ed8b..cfd4cff 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.cpp +++ b/src/declarative/3rdparty/qlistmodelinterface.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qlistmodelinterface.h" +#include "qlistmodelinterface_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/3rdparty/qlistmodelinterface.h b/src/declarative/3rdparty/qlistmodelinterface.h deleted file mode 100644 index 44c4a24..0000000 --- a/src/declarative/3rdparty/qlistmodelinterface.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QLISTMODELINTERFACE_H -#define QLISTMODELINTERFACE_H - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject -{ - Q_OBJECT - public: - QListModelInterface(QObject *parent = 0) : QObject(parent) {} - virtual ~QListModelInterface() {} - - virtual int count() const = 0; - virtual QHash data(int index, const QList& roles = QList()) const = 0; - virtual bool setData(int index, const QHash& values) - { Q_UNUSED(index); Q_UNUSED(values); return false; } - - virtual QList roles() const = 0; - virtual QString toString(int role) const = 0; - - Q_SIGNALS: - void itemsInserted(int index, int count); - void itemsRemoved(int index, int count); - void itemsMoved(int from, int to, int count); - void itemsChanged(int index, int count, const QList &roles); - - protected: - QListModelInterface(QObjectPrivate &dd, QObject *parent) - : QObject(dd, parent) {} -}; - - -QT_END_NAMESPACE - -QT_END_HEADER -#endif //QTREEMODELINTERFACE_H diff --git a/src/declarative/3rdparty/qlistmodelinterface_p.h b/src/declarative/3rdparty/qlistmodelinterface_p.h new file mode 100644 index 0000000..44c4a24 --- /dev/null +++ b/src/declarative/3rdparty/qlistmodelinterface_p.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QLISTMODELINTERFACE_H +#define QLISTMODELINTERFACE_H + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject +{ + Q_OBJECT + public: + QListModelInterface(QObject *parent = 0) : QObject(parent) {} + virtual ~QListModelInterface() {} + + virtual int count() const = 0; + virtual QHash data(int index, const QList& roles = QList()) const = 0; + virtual bool setData(int index, const QHash& values) + { Q_UNUSED(index); Q_UNUSED(values); return false; } + + virtual QList roles() const = 0; + virtual QString toString(int role) const = 0; + + Q_SIGNALS: + void itemsInserted(int index, int count); + void itemsRemoved(int index, int count); + void itemsMoved(int from, int to, int count); + void itemsChanged(int index, int count, const QList &roles); + + protected: + QListModelInterface(QObjectPrivate &dd, QObject *parent) + : QObject(dd, parent) {} +}; + + +QT_END_NAMESPACE + +QT_END_HEADER +#endif //QTREEMODELINTERFACE_H diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 82746fc..6cffb28 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -4,8 +4,8 @@ SOURCES += debugger/qmldebuggerstatus.cpp \ debugger/qmldebugclient.cpp \ debugger/qmldebug.cpp -HEADERS += debugger/qmldebuggerstatus.h \ - debugger/qpacketprotocol.h \ - debugger/qmldebugservice.h \ - debugger/qmldebugclient.h \ - debugger/qmldebug.h +HEADERS += debugger/qmldebuggerstatus_p.h \ + debugger/qpacketprotocol_p.h \ + debugger/qmldebugservice_p.h \ + debugger/qmldebugclient_p.h \ + debugger/qmldebug_p.h diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp index 5a8cda0..69a7326 100644 --- a/src/declarative/debugger/qmldebug.cpp +++ b/src/declarative/debugger/qmldebug.cpp @@ -1,5 +1,5 @@ -#include "qmldebug.h" -#include "qmldebugclient.h" +#include "qmldebug_p.h" +#include "qmldebugclient_p.h" #include #include diff --git a/src/declarative/debugger/qmldebug.h b/src/declarative/debugger/qmldebug.h deleted file mode 100644 index bd076ff..0000000 --- a/src/declarative/debugger/qmldebug.h +++ /dev/null @@ -1,314 +0,0 @@ -#ifndef QMLDEBUG_H -#define QMLDEBUG_H - -#include -#include -#include - -class QmlDebugConnection; -class QmlDebugWatch; -class QmlDebugPropertyWatch; -class QmlDebugObjectExpressionWatch; -class QmlDebugEnginesQuery; -class QmlDebugRootContextQuery; -class QmlDebugObjectQuery; -class QmlDebugExpressionQuery; -class QmlDebugPropertyReference; -class QmlDebugContextReference; -class QmlDebugObjectReference; -class QmlDebugFileReference; -class QmlDebugEngineReference; -class QmlEngineDebugPrivate; -class Q_DECLARATIVE_EXPORT QmlEngineDebug : public QObject -{ -Q_OBJECT -public: - QmlEngineDebug(QmlDebugConnection *, QObject * = 0); - - QmlDebugPropertyWatch *addWatch(const QmlDebugPropertyReference &, - QObject *parent = 0); - QmlDebugWatch *addWatch(const QmlDebugContextReference &, const QString &, - QObject *parent = 0); - QmlDebugObjectExpressionWatch *addWatch(const QmlDebugObjectReference &, const QString &, - QObject *parent = 0); - QmlDebugWatch *addWatch(const QmlDebugObjectReference &, - QObject *parent = 0); - QmlDebugWatch *addWatch(const QmlDebugFileReference &, - QObject *parent = 0); - - void removeWatch(QmlDebugWatch *watch); - - QmlDebugEnginesQuery *queryAvailableEngines(QObject *parent = 0); - QmlDebugRootContextQuery *queryRootContexts(const QmlDebugEngineReference &, - QObject *parent = 0); - QmlDebugObjectQuery *queryObject(const QmlDebugObjectReference &, - QObject *parent = 0); - QmlDebugObjectQuery *queryObjectRecursive(const QmlDebugObjectReference &, - QObject *parent = 0); - QmlDebugExpressionQuery *queryExpressionResult(int objectDebugId, - const QString &expr, - QObject *parent = 0); - -private: - Q_DECLARE_PRIVATE(QmlEngineDebug) -}; - -class Q_DECLARATIVE_EXPORT QmlDebugWatch : public QObject -{ -Q_OBJECT -public: - enum State { Waiting, Active, Inactive, Dead }; - - QmlDebugWatch(QObject *); - - int queryId() const; - int objectDebugId() const; - State state() const; - -signals: - void stateChanged(State); - //void objectChanged(int, const QmlDebugObjectReference &); - //void valueChanged(int, const QVariant &); - - // Server sends value as string if it is a user-type variant - void valueChanged(const QByteArray &name, const QVariant &value); - -private: - friend class QmlEngineDebug; - friend class QmlEngineDebugPrivate; - void setState(State); - State m_state; - int m_queryId; - int m_objectDebugId; -}; - -class Q_DECLARATIVE_EXPORT QmlDebugPropertyWatch : public QmlDebugWatch -{ - Q_OBJECT -public: - QmlDebugPropertyWatch(QObject *parent); - - QString name() const; - -private: - friend class QmlEngineDebug; - QString m_name; -}; - -class Q_DECLARATIVE_EXPORT QmlDebugObjectExpressionWatch : public QmlDebugWatch -{ - Q_OBJECT -public: - QmlDebugObjectExpressionWatch(QObject *parent); - - QString expression() const; - -private: - friend class QmlEngineDebug; - QString m_expr; - int m_debugId; -}; - - -class Q_DECLARATIVE_EXPORT QmlDebugQuery : public QObject -{ -Q_OBJECT -public: - enum State { Waiting, Error, Completed }; - - State state() const; - bool isWaiting() const; - -// bool waitUntilCompleted(); - -signals: - void stateChanged(State); - -protected: - QmlDebugQuery(QObject *); - -private: - friend class QmlEngineDebug; - friend class QmlEngineDebugPrivate; - void setState(State); - State m_state; -}; - -class Q_DECLARATIVE_EXPORT QmlDebugFileReference -{ -public: - QmlDebugFileReference(); - QmlDebugFileReference(const QmlDebugFileReference &); - QmlDebugFileReference &operator=(const QmlDebugFileReference &); - - QUrl url() const; - void setUrl(const QUrl &); - int lineNumber() const; - void setLineNumber(int); - int columnNumber() const; - void setColumnNumber(int); - -private: - friend class QmlEngineDebugPrivate; - QUrl m_url; - int m_lineNumber; - int m_columnNumber; -}; - -class Q_DECLARATIVE_EXPORT QmlDebugEngineReference -{ -public: - QmlDebugEngineReference(); - QmlDebugEngineReference(int); - QmlDebugEngineReference(const QmlDebugEngineReference &); - QmlDebugEngineReference &operator=(const QmlDebugEngineReference &); - - int debugId() const; - QString name() const; - -private: - friend class QmlEngineDebugPrivate; - int m_debugId; - QString m_name; -}; - -class Q_DECLARATIVE_EXPORT QmlDebugObjectReference -{ -public: - QmlDebugObjectReference(); - QmlDebugObjectReference(int); - QmlDebugObjectReference(const QmlDebugObjectReference &); - QmlDebugObjectReference &operator=(const QmlDebugObjectReference &); - - int debugId() const; - QString className() const; - QString name() const; - - QmlDebugFileReference source() const; - int contextDebugId() const; - - QList properties() const; - QList children() const; - -private: - friend class QmlEngineDebugPrivate; - int m_debugId; - QString m_class; - QString m_name; - QmlDebugFileReference m_source; - int m_contextDebugId; - QList m_properties; - QList m_children; -}; - -class Q_DECLARATIVE_EXPORT QmlDebugContextReference -{ -public: - QmlDebugContextReference(); - QmlDebugContextReference(const QmlDebugContextReference &); - QmlDebugContextReference &operator=(const QmlDebugContextReference &); - - int debugId() const; - QString name() const; - - QList objects() const; - QList contexts() const; - -private: - friend class QmlEngineDebugPrivate; - int m_debugId; - QString m_name; - QList m_objects; - QList m_contexts; -}; - -class Q_DECLARATIVE_EXPORT QmlDebugPropertyReference -{ -public: - QmlDebugPropertyReference(); - QmlDebugPropertyReference(const QmlDebugPropertyReference &); - QmlDebugPropertyReference &operator=(const QmlDebugPropertyReference &); - - int objectDebugId() const; - QString name() const; - QVariant value() const; - QString valueTypeName() const; - QString binding() const; - bool hasNotifySignal() const; - -private: - friend class QmlEngineDebugPrivate; - int m_objectDebugId; - QString m_name; - QVariant m_value; - QString m_valueTypeName; - QString m_binding; - bool m_hasNotifySignal; -}; - - -class Q_DECLARATIVE_EXPORT QmlDebugEnginesQuery : public QmlDebugQuery -{ -Q_OBJECT -public: - virtual ~QmlDebugEnginesQuery(); - QList engines() const; -private: - friend class QmlEngineDebug; - friend class QmlEngineDebugPrivate; - QmlDebugEnginesQuery(QObject *); - QmlEngineDebug *m_client; - int m_queryId; - QList m_engines; -}; - -class Q_DECLARATIVE_EXPORT QmlDebugRootContextQuery : public QmlDebugQuery -{ -Q_OBJECT -public: - virtual ~QmlDebugRootContextQuery(); - QmlDebugContextReference rootContext() const; -private: - friend class QmlEngineDebug; - friend class QmlEngineDebugPrivate; - QmlDebugRootContextQuery(QObject *); - QmlEngineDebug *m_client; - int m_queryId; - QmlDebugContextReference m_context; -}; - -class Q_DECLARATIVE_EXPORT QmlDebugObjectQuery : public QmlDebugQuery -{ -Q_OBJECT -public: - virtual ~QmlDebugObjectQuery(); - QmlDebugObjectReference object() const; -private: - friend class QmlEngineDebug; - friend class QmlEngineDebugPrivate; - QmlDebugObjectQuery(QObject *); - QmlEngineDebug *m_client; - int m_queryId; - QmlDebugObjectReference m_object; - -}; - -class Q_DECLARATIVE_EXPORT QmlDebugExpressionQuery : public QmlDebugQuery -{ -Q_OBJECT -public: - virtual ~QmlDebugExpressionQuery(); - QString expression() const; - QVariant result() const; -private: - friend class QmlEngineDebug; - friend class QmlEngineDebugPrivate; - QmlDebugExpressionQuery(QObject *); - QmlEngineDebug *m_client; - int m_queryId; - QString m_expr; - QVariant m_result; - -}; - -#endif // QMLDEBUG_H diff --git a/src/declarative/debugger/qmldebug_p.h b/src/declarative/debugger/qmldebug_p.h new file mode 100644 index 0000000..bd076ff --- /dev/null +++ b/src/declarative/debugger/qmldebug_p.h @@ -0,0 +1,314 @@ +#ifndef QMLDEBUG_H +#define QMLDEBUG_H + +#include +#include +#include + +class QmlDebugConnection; +class QmlDebugWatch; +class QmlDebugPropertyWatch; +class QmlDebugObjectExpressionWatch; +class QmlDebugEnginesQuery; +class QmlDebugRootContextQuery; +class QmlDebugObjectQuery; +class QmlDebugExpressionQuery; +class QmlDebugPropertyReference; +class QmlDebugContextReference; +class QmlDebugObjectReference; +class QmlDebugFileReference; +class QmlDebugEngineReference; +class QmlEngineDebugPrivate; +class Q_DECLARATIVE_EXPORT QmlEngineDebug : public QObject +{ +Q_OBJECT +public: + QmlEngineDebug(QmlDebugConnection *, QObject * = 0); + + QmlDebugPropertyWatch *addWatch(const QmlDebugPropertyReference &, + QObject *parent = 0); + QmlDebugWatch *addWatch(const QmlDebugContextReference &, const QString &, + QObject *parent = 0); + QmlDebugObjectExpressionWatch *addWatch(const QmlDebugObjectReference &, const QString &, + QObject *parent = 0); + QmlDebugWatch *addWatch(const QmlDebugObjectReference &, + QObject *parent = 0); + QmlDebugWatch *addWatch(const QmlDebugFileReference &, + QObject *parent = 0); + + void removeWatch(QmlDebugWatch *watch); + + QmlDebugEnginesQuery *queryAvailableEngines(QObject *parent = 0); + QmlDebugRootContextQuery *queryRootContexts(const QmlDebugEngineReference &, + QObject *parent = 0); + QmlDebugObjectQuery *queryObject(const QmlDebugObjectReference &, + QObject *parent = 0); + QmlDebugObjectQuery *queryObjectRecursive(const QmlDebugObjectReference &, + QObject *parent = 0); + QmlDebugExpressionQuery *queryExpressionResult(int objectDebugId, + const QString &expr, + QObject *parent = 0); + +private: + Q_DECLARE_PRIVATE(QmlEngineDebug) +}; + +class Q_DECLARATIVE_EXPORT QmlDebugWatch : public QObject +{ +Q_OBJECT +public: + enum State { Waiting, Active, Inactive, Dead }; + + QmlDebugWatch(QObject *); + + int queryId() const; + int objectDebugId() const; + State state() const; + +signals: + void stateChanged(State); + //void objectChanged(int, const QmlDebugObjectReference &); + //void valueChanged(int, const QVariant &); + + // Server sends value as string if it is a user-type variant + void valueChanged(const QByteArray &name, const QVariant &value); + +private: + friend class QmlEngineDebug; + friend class QmlEngineDebugPrivate; + void setState(State); + State m_state; + int m_queryId; + int m_objectDebugId; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugPropertyWatch : public QmlDebugWatch +{ + Q_OBJECT +public: + QmlDebugPropertyWatch(QObject *parent); + + QString name() const; + +private: + friend class QmlEngineDebug; + QString m_name; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugObjectExpressionWatch : public QmlDebugWatch +{ + Q_OBJECT +public: + QmlDebugObjectExpressionWatch(QObject *parent); + + QString expression() const; + +private: + friend class QmlEngineDebug; + QString m_expr; + int m_debugId; +}; + + +class Q_DECLARATIVE_EXPORT QmlDebugQuery : public QObject +{ +Q_OBJECT +public: + enum State { Waiting, Error, Completed }; + + State state() const; + bool isWaiting() const; + +// bool waitUntilCompleted(); + +signals: + void stateChanged(State); + +protected: + QmlDebugQuery(QObject *); + +private: + friend class QmlEngineDebug; + friend class QmlEngineDebugPrivate; + void setState(State); + State m_state; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugFileReference +{ +public: + QmlDebugFileReference(); + QmlDebugFileReference(const QmlDebugFileReference &); + QmlDebugFileReference &operator=(const QmlDebugFileReference &); + + QUrl url() const; + void setUrl(const QUrl &); + int lineNumber() const; + void setLineNumber(int); + int columnNumber() const; + void setColumnNumber(int); + +private: + friend class QmlEngineDebugPrivate; + QUrl m_url; + int m_lineNumber; + int m_columnNumber; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugEngineReference +{ +public: + QmlDebugEngineReference(); + QmlDebugEngineReference(int); + QmlDebugEngineReference(const QmlDebugEngineReference &); + QmlDebugEngineReference &operator=(const QmlDebugEngineReference &); + + int debugId() const; + QString name() const; + +private: + friend class QmlEngineDebugPrivate; + int m_debugId; + QString m_name; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugObjectReference +{ +public: + QmlDebugObjectReference(); + QmlDebugObjectReference(int); + QmlDebugObjectReference(const QmlDebugObjectReference &); + QmlDebugObjectReference &operator=(const QmlDebugObjectReference &); + + int debugId() const; + QString className() const; + QString name() const; + + QmlDebugFileReference source() const; + int contextDebugId() const; + + QList properties() const; + QList children() const; + +private: + friend class QmlEngineDebugPrivate; + int m_debugId; + QString m_class; + QString m_name; + QmlDebugFileReference m_source; + int m_contextDebugId; + QList m_properties; + QList m_children; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugContextReference +{ +public: + QmlDebugContextReference(); + QmlDebugContextReference(const QmlDebugContextReference &); + QmlDebugContextReference &operator=(const QmlDebugContextReference &); + + int debugId() const; + QString name() const; + + QList objects() const; + QList contexts() const; + +private: + friend class QmlEngineDebugPrivate; + int m_debugId; + QString m_name; + QList m_objects; + QList m_contexts; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugPropertyReference +{ +public: + QmlDebugPropertyReference(); + QmlDebugPropertyReference(const QmlDebugPropertyReference &); + QmlDebugPropertyReference &operator=(const QmlDebugPropertyReference &); + + int objectDebugId() const; + QString name() const; + QVariant value() const; + QString valueTypeName() const; + QString binding() const; + bool hasNotifySignal() const; + +private: + friend class QmlEngineDebugPrivate; + int m_objectDebugId; + QString m_name; + QVariant m_value; + QString m_valueTypeName; + QString m_binding; + bool m_hasNotifySignal; +}; + + +class Q_DECLARATIVE_EXPORT QmlDebugEnginesQuery : public QmlDebugQuery +{ +Q_OBJECT +public: + virtual ~QmlDebugEnginesQuery(); + QList engines() const; +private: + friend class QmlEngineDebug; + friend class QmlEngineDebugPrivate; + QmlDebugEnginesQuery(QObject *); + QmlEngineDebug *m_client; + int m_queryId; + QList m_engines; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugRootContextQuery : public QmlDebugQuery +{ +Q_OBJECT +public: + virtual ~QmlDebugRootContextQuery(); + QmlDebugContextReference rootContext() const; +private: + friend class QmlEngineDebug; + friend class QmlEngineDebugPrivate; + QmlDebugRootContextQuery(QObject *); + QmlEngineDebug *m_client; + int m_queryId; + QmlDebugContextReference m_context; +}; + +class Q_DECLARATIVE_EXPORT QmlDebugObjectQuery : public QmlDebugQuery +{ +Q_OBJECT +public: + virtual ~QmlDebugObjectQuery(); + QmlDebugObjectReference object() const; +private: + friend class QmlEngineDebug; + friend class QmlEngineDebugPrivate; + QmlDebugObjectQuery(QObject *); + QmlEngineDebug *m_client; + int m_queryId; + QmlDebugObjectReference m_object; + +}; + +class Q_DECLARATIVE_EXPORT QmlDebugExpressionQuery : public QmlDebugQuery +{ +Q_OBJECT +public: + virtual ~QmlDebugExpressionQuery(); + QString expression() const; + QVariant result() const; +private: + friend class QmlEngineDebug; + friend class QmlEngineDebugPrivate; + QmlDebugExpressionQuery(QObject *); + QmlEngineDebug *m_client; + int m_queryId; + QString m_expr; + QVariant m_result; + +}; + +#endif // QMLDEBUG_H diff --git a/src/declarative/debugger/qmldebugclient.cpp b/src/declarative/debugger/qmldebugclient.cpp index 3171808..7264e14 100644 --- a/src/declarative/debugger/qmldebugclient.cpp +++ b/src/declarative/debugger/qmldebugclient.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qmldebugclient.h" +#include "qmldebugclient_p.h" #include -#include +#include #include #include diff --git a/src/declarative/debugger/qmldebugclient.h b/src/declarative/debugger/qmldebugclient.h deleted file mode 100644 index 6397670..0000000 --- a/src/declarative/debugger/qmldebugclient.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLDEBUGCLIENT_H -#define QMLDEBUGCLIENT_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlDebugConnectionPrivate; -class Q_DECLARATIVE_EXPORT QmlDebugConnection : public QTcpSocket -{ - Q_OBJECT - Q_DISABLE_COPY(QmlDebugConnection) -public: - QmlDebugConnection(QObject * = 0); - - bool isConnected() const; -private: - QmlDebugConnectionPrivate *d; - friend class QmlDebugClient; - friend class QmlDebugClientPrivate; -}; - -class QmlDebugClientPrivate; -class Q_DECLARATIVE_EXPORT QmlDebugClient : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlDebugClient) - Q_DISABLE_COPY(QmlDebugClient) - -public: - QmlDebugClient(const QString &, QmlDebugConnection *parent); - - QString name() const; - - bool isEnabled() const; - void setEnabled(bool); - - bool isConnected() const; - - void sendMessage(const QByteArray &); - -protected: - virtual void messageReceived(const QByteArray &); - -private: - friend class QmlDebugConnection; - friend class QmlDebugConnectionPrivate; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLDEBUGCLIENT_H diff --git a/src/declarative/debugger/qmldebugclient_p.h b/src/declarative/debugger/qmldebugclient_p.h new file mode 100644 index 0000000..6397670 --- /dev/null +++ b/src/declarative/debugger/qmldebugclient_p.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLDEBUGCLIENT_H +#define QMLDEBUGCLIENT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlDebugConnectionPrivate; +class Q_DECLARATIVE_EXPORT QmlDebugConnection : public QTcpSocket +{ + Q_OBJECT + Q_DISABLE_COPY(QmlDebugConnection) +public: + QmlDebugConnection(QObject * = 0); + + bool isConnected() const; +private: + QmlDebugConnectionPrivate *d; + friend class QmlDebugClient; + friend class QmlDebugClientPrivate; +}; + +class QmlDebugClientPrivate; +class Q_DECLARATIVE_EXPORT QmlDebugClient : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlDebugClient) + Q_DISABLE_COPY(QmlDebugClient) + +public: + QmlDebugClient(const QString &, QmlDebugConnection *parent); + + QString name() const; + + bool isEnabled() const; + void setEnabled(bool); + + bool isConnected() const; + + void sendMessage(const QByteArray &); + +protected: + virtual void messageReceived(const QByteArray &); + +private: + friend class QmlDebugConnection; + friend class QmlDebugConnectionPrivate; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLDEBUGCLIENT_H diff --git a/src/declarative/debugger/qmldebuggerstatus.cpp b/src/declarative/debugger/qmldebuggerstatus.cpp index d46a21d..d4404a5 100644 --- a/src/declarative/debugger/qmldebuggerstatus.cpp +++ b/src/declarative/debugger/qmldebuggerstatus.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmldebuggerstatus.h" +#include "qmldebuggerstatus_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/debugger/qmldebuggerstatus.h b/src/declarative/debugger/qmldebuggerstatus.h deleted file mode 100644 index a8480f4..0000000 --- a/src/declarative/debugger/qmldebuggerstatus.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLDEBUGGERSTATUS_P_H -#define QMLDEBUGGERSTATUS_P_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class Q_DECLARATIVE_EXPORT QmlDebuggerStatus -{ -public: - virtual ~QmlDebuggerStatus(); - - virtual void setSelectedState(bool); -}; -Q_DECLARE_INTERFACE(QmlDebuggerStatus, "com.trolltech.qml.QmlDebuggerStatus") - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QLMDEBUGGERSTATUS_P_H diff --git a/src/declarative/debugger/qmldebuggerstatus_p.h b/src/declarative/debugger/qmldebuggerstatus_p.h new file mode 100644 index 0000000..a8480f4 --- /dev/null +++ b/src/declarative/debugger/qmldebuggerstatus_p.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLDEBUGGERSTATUS_P_H +#define QMLDEBUGGERSTATUS_P_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class Q_DECLARATIVE_EXPORT QmlDebuggerStatus +{ +public: + virtual ~QmlDebuggerStatus(); + + virtual void setSelectedState(bool); +}; +Q_DECLARE_INTERFACE(QmlDebuggerStatus, "com.trolltech.qml.QmlDebuggerStatus") + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QLMDEBUGGERSTATUS_P_H diff --git a/src/declarative/debugger/qmldebugservice.cpp b/src/declarative/debugger/qmldebugservice.cpp index 6913def..241eee2 100644 --- a/src/declarative/debugger/qmldebugservice.cpp +++ b/src/declarative/debugger/qmldebugservice.cpp @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#include "qmldebugservice.h" +#include "qmldebugservice_p.h" #include #include #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/declarative/debugger/qmldebugservice.h b/src/declarative/debugger/qmldebugservice.h deleted file mode 100644 index 5d20ba0..0000000 --- a/src/declarative/debugger/qmldebugservice.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLDEBUGSERVICE_H -#define QMLDEBUGSERVICE_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QmlDebugServicePrivate; -class Q_DECLARATIVE_EXPORT QmlDebugService : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlDebugService) - Q_DISABLE_COPY(QmlDebugService) -public: - QmlDebugService(const QString &, QObject *parent = 0); - - QString name() const; - - bool isEnabled() const; - - void sendMessage(const QByteArray &); - - static int idForObject(QObject *); - static QObject *objectForId(int); - - - static bool isDebuggingEnabled(); - static QString objectToString(QObject *obj); - - static void waitForClients(); - -protected: - virtual void enabledChanged(bool); - virtual void messageReceived(const QByteArray &); - -private: - friend class QmlDebugServer; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLDEBUGSERVICE_H - diff --git a/src/declarative/debugger/qmldebugservice_p.h b/src/declarative/debugger/qmldebugservice_p.h new file mode 100644 index 0000000..5d20ba0 --- /dev/null +++ b/src/declarative/debugger/qmldebugservice_p.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLDEBUGSERVICE_H +#define QMLDEBUGSERVICE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QmlDebugServicePrivate; +class Q_DECLARATIVE_EXPORT QmlDebugService : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlDebugService) + Q_DISABLE_COPY(QmlDebugService) +public: + QmlDebugService(const QString &, QObject *parent = 0); + + QString name() const; + + bool isEnabled() const; + + void sendMessage(const QByteArray &); + + static int idForObject(QObject *); + static QObject *objectForId(int); + + + static bool isDebuggingEnabled(); + static QString objectToString(QObject *obj); + + static void waitForClients(); + +protected: + virtual void enabledChanged(bool); + virtual void messageReceived(const QByteArray &); + +private: + friend class QmlDebugServer; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLDEBUGSERVICE_H + diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp index 84882dd..604c8f6 100644 --- a/src/declarative/debugger/qpacketprotocol.cpp +++ b/src/declarative/debugger/qpacketprotocol.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qpacketprotocol.h" +#include "qpacketprotocol_p.h" #include QT_BEGIN_NAMESPACE diff --git a/src/declarative/debugger/qpacketprotocol.h b/src/declarative/debugger/qpacketprotocol.h deleted file mode 100644 index f3fb44b..0000000 --- a/src/declarative/debugger/qpacketprotocol.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPACKETPROTOCOL_H -#define QPACKETPROTOCOL_H - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QIODevice; -class QBuffer; -class QPacket; -class QPacketAutoSend; -class QPacketProtocolPrivate; - -class Q_DECLARATIVE_EXPORT QPacketProtocol : public QObject -{ -Q_OBJECT -public: - explicit QPacketProtocol(QIODevice * dev, QObject * parent = 0); - virtual ~QPacketProtocol(); - - qint32 maximumPacketSize() const; - qint32 setMaximumPacketSize(qint32); - - QPacketAutoSend send(); - void send(const QPacket &); - - qint64 packetsAvailable() const; - QPacket read(); - - void clear(); - - QIODevice * device(); - -signals: - void readyRead(); - void invalidPacket(); - void packetWritten(); - -private: - QPacketProtocolPrivate * d; -}; - - -class Q_DECLARATIVE_EXPORT QPacket : public QDataStream -{ -public: - QPacket(); - QPacket(const QPacket &); - virtual ~QPacket(); - - void clear(); - bool isEmpty() const; - -protected: - friend class QPacketProtocol; - QPacket(const QByteArray & ba); - QByteArray b; - QBuffer * buf; -}; - -class Q_DECLARATIVE_EXPORT QPacketAutoSend : public QPacket -{ -public: - virtual ~QPacketAutoSend(); - -private: - friend class QPacketProtocol; - QPacketAutoSend(QPacketProtocol *); - QPacketProtocol * p; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/declarative/debugger/qpacketprotocol_p.h b/src/declarative/debugger/qpacketprotocol_p.h new file mode 100644 index 0000000..f3fb44b --- /dev/null +++ b/src/declarative/debugger/qpacketprotocol_p.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPACKETPROTOCOL_H +#define QPACKETPROTOCOL_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QIODevice; +class QBuffer; +class QPacket; +class QPacketAutoSend; +class QPacketProtocolPrivate; + +class Q_DECLARATIVE_EXPORT QPacketProtocol : public QObject +{ +Q_OBJECT +public: + explicit QPacketProtocol(QIODevice * dev, QObject * parent = 0); + virtual ~QPacketProtocol(); + + qint32 maximumPacketSize() const; + qint32 setMaximumPacketSize(qint32); + + QPacketAutoSend send(); + void send(const QPacket &); + + qint64 packetsAvailable() const; + QPacket read(); + + void clear(); + + QIODevice * device(); + +signals: + void readyRead(); + void invalidPacket(); + void packetWritten(); + +private: + QPacketProtocolPrivate * d; +}; + + +class Q_DECLARATIVE_EXPORT QPacket : public QDataStream +{ +public: + QPacket(); + QPacket(const QPacket &); + virtual ~QPacket(); + + void clear(); + bool isEmpty() const; + +protected: + friend class QPacketProtocol; + QPacket(const QByteArray & ba); + QByteArray b; + QBuffer * buf; +}; + +class Q_DECLARATIVE_EXPORT QPacketAutoSend : public QPacket +{ +public: + virtual ~QPacketAutoSend(); + +private: + friend class QPacketProtocol; + QPacketAutoSend(QPacketProtocol *); + QPacketProtocol * p; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/declarative/extra/extra.pri b/src/declarative/extra/extra.pri index 47cc8f8..9d0e760 100644 --- a/src/declarative/extra/extra.pri +++ b/src/declarative/extra/extra.pri @@ -9,19 +9,19 @@ SOURCES += \ extra/qmlfontloader.cpp HEADERS += \ - extra/qnumberformat.h \ - extra/qmlnumberformatter.h \ - extra/qmldatetimeformatter.h \ - extra/qmlgraphicsintegermodel.h \ - extra/qmlgraphicsanimatedimageitem.h \ + extra/qnumberformat_p.h \ + extra/qmlnumberformatter_p.h \ + extra/qmldatetimeformatter_p.h \ + extra/qmlgraphicsintegermodel_p.h \ extra/qmlgraphicsanimatedimageitem_p.h \ - extra/qmlgraphicsparticles.h \ - extra/qmlbehavior.h \ - extra/qmlfontloader.h + extra/qmlgraphicsanimatedimageitem_p_p.h \ + extra/qmlgraphicsparticles_p.h \ + extra/qmlbehavior_p.h \ + extra/qmlfontloader_p.h contains(QT_CONFIG, xmlpatterns) { QT+=xmlpatterns SOURCES += extra/qmlxmllistmodel.cpp - HEADERS += extra/qmlxmllistmodel.h + HEADERS += extra/qmlxmllistmodel_p.h } diff --git a/src/declarative/extra/qmlbehavior.cpp b/src/declarative/extra/qmlbehavior.cpp index 654cb4e..eac4220 100644 --- a/src/declarative/extra/qmlbehavior.cpp +++ b/src/declarative/extra/qmlbehavior.cpp @@ -40,9 +40,9 @@ ****************************************************************************/ #include -#include "qmlanimation.h" -#include "qmltransition.h" -#include "qmlbehavior.h" +#include +#include +#include "qmlbehavior_p.h" #include #include #include diff --git a/src/declarative/extra/qmlbehavior.h b/src/declarative/extra/qmlbehavior.h deleted file mode 100644 index 6508455..0000000 --- a/src/declarative/extra/qmlbehavior.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLBEHAVIOR_H -#define QMLBEHAVIOR_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlAbstractAnimation; -class QmlBehaviorPrivate; -class Q_DECLARATIVE_EXPORT QmlBehavior : public QObject, public QmlPropertyValueInterceptor -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlBehavior) - - Q_INTERFACES(QmlPropertyValueInterceptor) - Q_CLASSINFO("DefaultProperty", "animation") - Q_PROPERTY(QmlAbstractAnimation *animation READ animation WRITE setAnimation) - -public: - QmlBehavior(QObject *parent=0); - ~QmlBehavior(); - - virtual void setTarget(const QmlMetaProperty &); - virtual void write(const QVariant &value); - - QmlAbstractAnimation *animation(); - void setAnimation(QmlAbstractAnimation *); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlBehavior) - -QT_END_HEADER - -#endif // QMLBEHAVIOR_H diff --git a/src/declarative/extra/qmlbehavior_p.h b/src/declarative/extra/qmlbehavior_p.h new file mode 100644 index 0000000..0c8fdfd --- /dev/null +++ b/src/declarative/extra/qmlbehavior_p.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLBEHAVIOR_H +#define QMLBEHAVIOR_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlAbstractAnimation; +class QmlBehaviorPrivate; +class Q_DECLARATIVE_EXPORT QmlBehavior : public QObject, public QmlPropertyValueInterceptor +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlBehavior) + + Q_INTERFACES(QmlPropertyValueInterceptor) + Q_CLASSINFO("DefaultProperty", "animation") + Q_PROPERTY(QmlAbstractAnimation *animation READ animation WRITE setAnimation) + +public: + QmlBehavior(QObject *parent=0); + ~QmlBehavior(); + + virtual void setTarget(const QmlMetaProperty &); + virtual void write(const QVariant &value); + + QmlAbstractAnimation *animation(); + void setAnimation(QmlAbstractAnimation *); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlBehavior) + +QT_END_HEADER + +#endif // QMLBEHAVIOR_H diff --git a/src/declarative/extra/qmldatetimeformatter.cpp b/src/declarative/extra/qmldatetimeformatter.cpp index 9b3d37a..8d5deff 100644 --- a/src/declarative/extra/qmldatetimeformatter.cpp +++ b/src/declarative/extra/qmldatetimeformatter.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmldatetimeformatter.h" +#include "qmldatetimeformatter_p.h" #include "private/qobject_p.h" #include diff --git a/src/declarative/extra/qmldatetimeformatter.h b/src/declarative/extra/qmldatetimeformatter.h deleted file mode 100644 index be0ae02..0000000 --- a/src/declarative/extra/qmldatetimeformatter.h +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLDATETIMEFORMATTER_H -#define QMLDATETIMEFORMATTER_H - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlDateTimeFormatterPrivate; -class Q_DECLARATIVE_EXPORT QmlDateTimeFormatter : public QObject, public QmlParserStatus -{ - Q_OBJECT - Q_INTERFACES(QmlParserStatus) - - Q_PROPERTY(QString dateText READ dateText NOTIFY textChanged) - Q_PROPERTY(QString timeText READ timeText NOTIFY textChanged) - Q_PROPERTY(QString dateTimeText READ dateTimeText NOTIFY textChanged) - Q_PROPERTY(QDate date READ date WRITE setDate) - Q_PROPERTY(QTime time READ time WRITE setTime) - Q_PROPERTY(QDateTime dateTime READ dateTime WRITE setDateTime) - Q_PROPERTY(QString dateFormat READ dateFormat WRITE setDateFormat) - Q_PROPERTY(QString timeFormat READ timeFormat WRITE setTimeFormat) - Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat) - Q_PROPERTY(bool longStyle READ longStyle WRITE setLongStyle) -public: - QmlDateTimeFormatter(QObject *parent=0); - ~QmlDateTimeFormatter(); - - QString dateTimeText() const; - QString dateText() const; - QString timeText() const; - - QDate date() const; - void setDate(const QDate &); - - QTime time() const; - void setTime(const QTime &); - - QDateTime dateTime() const; - void setDateTime(const QDateTime &); - - QString dateTimeFormat() const; - void setDateTimeFormat(const QString &); - - QString dateFormat() const; - void setDateFormat(const QString &); - - QString timeFormat() const; - void setTimeFormat(const QString &); - - bool longStyle() const; - void setLongStyle(bool); - - virtual void classBegin(); - virtual void componentComplete(); - -Q_SIGNALS: - void textChanged(); - -private: - Q_DISABLE_COPY(QmlDateTimeFormatter) - Q_DECLARE_PRIVATE(QmlDateTimeFormatter) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlDateTimeFormatter) - -QT_END_HEADER - -#endif diff --git a/src/declarative/extra/qmldatetimeformatter_p.h b/src/declarative/extra/qmldatetimeformatter_p.h new file mode 100644 index 0000000..be0ae02 --- /dev/null +++ b/src/declarative/extra/qmldatetimeformatter_p.h @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLDATETIMEFORMATTER_H +#define QMLDATETIMEFORMATTER_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlDateTimeFormatterPrivate; +class Q_DECLARATIVE_EXPORT QmlDateTimeFormatter : public QObject, public QmlParserStatus +{ + Q_OBJECT + Q_INTERFACES(QmlParserStatus) + + Q_PROPERTY(QString dateText READ dateText NOTIFY textChanged) + Q_PROPERTY(QString timeText READ timeText NOTIFY textChanged) + Q_PROPERTY(QString dateTimeText READ dateTimeText NOTIFY textChanged) + Q_PROPERTY(QDate date READ date WRITE setDate) + Q_PROPERTY(QTime time READ time WRITE setTime) + Q_PROPERTY(QDateTime dateTime READ dateTime WRITE setDateTime) + Q_PROPERTY(QString dateFormat READ dateFormat WRITE setDateFormat) + Q_PROPERTY(QString timeFormat READ timeFormat WRITE setTimeFormat) + Q_PROPERTY(QString dateTimeFormat READ dateTimeFormat WRITE setDateTimeFormat) + Q_PROPERTY(bool longStyle READ longStyle WRITE setLongStyle) +public: + QmlDateTimeFormatter(QObject *parent=0); + ~QmlDateTimeFormatter(); + + QString dateTimeText() const; + QString dateText() const; + QString timeText() const; + + QDate date() const; + void setDate(const QDate &); + + QTime time() const; + void setTime(const QTime &); + + QDateTime dateTime() const; + void setDateTime(const QDateTime &); + + QString dateTimeFormat() const; + void setDateTimeFormat(const QString &); + + QString dateFormat() const; + void setDateFormat(const QString &); + + QString timeFormat() const; + void setTimeFormat(const QString &); + + bool longStyle() const; + void setLongStyle(bool); + + virtual void classBegin(); + virtual void componentComplete(); + +Q_SIGNALS: + void textChanged(); + +private: + Q_DISABLE_COPY(QmlDateTimeFormatter) + Q_DECLARE_PRIVATE(QmlDateTimeFormatter) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlDateTimeFormatter) + +QT_END_HEADER + +#endif diff --git a/src/declarative/extra/qmlfontloader.cpp b/src/declarative/extra/qmlfontloader.cpp index f9857f6..dffbc3f 100644 --- a/src/declarative/extra/qmlfontloader.cpp +++ b/src/declarative/extra/qmlfontloader.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "private/qobject_p.h" -#include "qmlfontloader.h" +#include "qmlfontloader_p.h" #include #include #include diff --git a/src/declarative/extra/qmlfontloader.h b/src/declarative/extra/qmlfontloader.h deleted file mode 100644 index c2c7a16..0000000 --- a/src/declarative/extra/qmlfontloader.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLFONTLOADER_H -#define QMLFONTLOADER_H - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlFontLoaderPrivate; -class Q_DECLARATIVE_EXPORT QmlFontLoader : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlFontLoader) - Q_ENUMS(Status) - - Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) - Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) - Q_PROPERTY(Status status READ status NOTIFY statusChanged) - -public: - enum Status { Null = 0, Ready, Loading, Error }; - - QmlFontLoader(QObject *parent = 0); - ~QmlFontLoader(); - - QUrl source() const; - void setSource(const QUrl &url); - - QString name() const; - void setName(const QString &name); - - Status status() const; - -private Q_SLOTS: - void replyFinished(); - -Q_SIGNALS: - void nameChanged(); - void statusChanged(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlFontLoader) - -QT_END_HEADER - -#endif // QMLFONTLOADER_H - diff --git a/src/declarative/extra/qmlfontloader_p.h b/src/declarative/extra/qmlfontloader_p.h new file mode 100644 index 0000000..c2c7a16 --- /dev/null +++ b/src/declarative/extra/qmlfontloader_p.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLFONTLOADER_H +#define QMLFONTLOADER_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlFontLoaderPrivate; +class Q_DECLARATIVE_EXPORT QmlFontLoader : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlFontLoader) + Q_ENUMS(Status) + + Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) + Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) + Q_PROPERTY(Status status READ status NOTIFY statusChanged) + +public: + enum Status { Null = 0, Ready, Loading, Error }; + + QmlFontLoader(QObject *parent = 0); + ~QmlFontLoader(); + + QUrl source() const; + void setSource(const QUrl &url); + + QString name() const; + void setName(const QString &name); + + Status status() const; + +private Q_SLOTS: + void replyFinished(); + +Q_SIGNALS: + void nameChanged(); + void statusChanged(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlFontLoader) + +QT_END_HEADER + +#endif // QMLFONTLOADER_H + diff --git a/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp b/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp index c22e56d..b781e75 100644 --- a/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp +++ b/src/declarative/extra/qmlgraphicsanimatedimageitem.cpp @@ -42,8 +42,8 @@ #include #include #include -#include "qmlgraphicsanimatedimageitem.h" #include "qmlgraphicsanimatedimageitem_p.h" +#include "qmlgraphicsanimatedimageitem_p_p.h" #include #include diff --git a/src/declarative/extra/qmlgraphicsanimatedimageitem.h b/src/declarative/extra/qmlgraphicsanimatedimageitem.h deleted file mode 100644 index c62a98e..0000000 --- a/src/declarative/extra/qmlgraphicsanimatedimageitem.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSANIMATEDIMAGEITEM_H -#define QMLGRAPHICSANIMATEDIMAGEITEM_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QMovie; -class QmlGraphicsAnimatedImageItemPrivate; - -class Q_DECLARATIVE_EXPORT QmlGraphicsAnimatedImageItem : public QmlGraphicsImage -{ - Q_OBJECT - - Q_PROPERTY(bool playing READ isPlaying WRITE setPlaying NOTIFY playingChanged) - Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged) - Q_PROPERTY(int currentFrame READ currentFrame WRITE setCurrentFrame NOTIFY frameChanged) - Q_PROPERTY(int frameCount READ frameCount) -public: - QmlGraphicsAnimatedImageItem(QmlGraphicsItem *parent=0); - ~QmlGraphicsAnimatedImageItem(); - - bool isPlaying() const; - void setPlaying(bool play); - - bool isPaused() const; - void setPaused(bool pause); - - int currentFrame() const; - void setCurrentFrame(int frame); - - int frameCount() const; - - // Extends QmlGraphicsImage's src property*/ - virtual void setSource(const QUrl&); - -Q_SIGNALS: - void playingChanged(); - void pausedChanged(); - void frameChanged(); - -private Q_SLOTS: - void movieUpdate(); - void movieRequestFinished(); - void playingStatusChanged(); - -protected: - QmlGraphicsAnimatedImageItem(QmlGraphicsAnimatedImageItemPrivate &dd, QmlGraphicsItem *parent); - -private: - Q_DISABLE_COPY(QmlGraphicsAnimatedImageItem) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsAnimatedImageItem) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsAnimatedImageItem) - -QT_END_HEADER - -#endif diff --git a/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h b/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h index 04f1b6e..b0b6f14 100644 --- a/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h +++ b/src/declarative/extra/qmlgraphicsanimatedimageitem_p.h @@ -39,43 +39,68 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSANIMATEDIMAGE_P_H -#define QMLGRAPHICSANIMATEDIMAGE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#ifndef QMLGRAPHICSANIMATEDIMAGEITEM_H +#define QMLGRAPHICSANIMATEDIMAGEITEM_H #include +QT_BEGIN_HEADER + QT_BEGIN_NAMESPACE +QT_MODULE(Declarative) + class QMovie; -class QNetworkReply; +class QmlGraphicsAnimatedImageItemPrivate; -class QmlGraphicsAnimatedImageItemPrivate : public QmlGraphicsImagePrivate +class Q_DECLARATIVE_EXPORT QmlGraphicsAnimatedImageItem : public QmlGraphicsImage { - Q_DECLARE_PUBLIC(QmlGraphicsAnimatedImageItem) + Q_OBJECT + Q_PROPERTY(bool playing READ isPlaying WRITE setPlaying NOTIFY playingChanged) + Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged) + Q_PROPERTY(int currentFrame READ currentFrame WRITE setCurrentFrame NOTIFY frameChanged) + Q_PROPERTY(int frameCount READ frameCount) public: - QmlGraphicsAnimatedImageItemPrivate() - : playing(true), paused(false), _movie(0), reply(0) - { - } - - bool playing; - bool paused; - QMovie *_movie; - QNetworkReply *reply; + QmlGraphicsAnimatedImageItem(QmlGraphicsItem *parent=0); + ~QmlGraphicsAnimatedImageItem(); + + bool isPlaying() const; + void setPlaying(bool play); + + bool isPaused() const; + void setPaused(bool pause); + + int currentFrame() const; + void setCurrentFrame(int frame); + + int frameCount() const; + + // Extends QmlGraphicsImage's src property*/ + virtual void setSource(const QUrl&); + +Q_SIGNALS: + void playingChanged(); + void pausedChanged(); + void frameChanged(); + +private Q_SLOTS: + void movieUpdate(); + void movieRequestFinished(); + void playingStatusChanged(); + +protected: + QmlGraphicsAnimatedImageItem(QmlGraphicsAnimatedImageItemPrivate &dd, QmlGraphicsItem *parent); + +private: + Q_DISABLE_COPY(QmlGraphicsAnimatedImageItem) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsAnimatedImageItem) }; QT_END_NAMESPACE -#endif // QMLGRAPHICSANIMATEDIMAGE_P_H +QML_DECLARE_TYPE(QmlGraphicsAnimatedImageItem) + +QT_END_HEADER + +#endif diff --git a/src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h b/src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h new file mode 100644 index 0000000..b43175f --- /dev/null +++ b/src/declarative/extra/qmlgraphicsanimatedimageitem_p_p.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSANIMATEDIMAGE_P_H +#define QMLGRAPHICSANIMATEDIMAGE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QMovie; +class QNetworkReply; + +class QmlGraphicsAnimatedImageItemPrivate : public QmlGraphicsImagePrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsAnimatedImageItem) + +public: + QmlGraphicsAnimatedImageItemPrivate() + : playing(true), paused(false), _movie(0), reply(0) + { + } + + bool playing; + bool paused; + QMovie *_movie; + QNetworkReply *reply; +}; + +QT_END_NAMESPACE + +#endif // QMLGRAPHICSANIMATEDIMAGE_P_H diff --git a/src/declarative/extra/qmlgraphicsintegermodel.cpp b/src/declarative/extra/qmlgraphicsintegermodel.cpp index e83b9c9..2bbb19d 100644 --- a/src/declarative/extra/qmlgraphicsintegermodel.cpp +++ b/src/declarative/extra/qmlgraphicsintegermodel.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlgraphicsintegermodel.h" +#include "qmlgraphicsintegermodel_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/extra/qmlgraphicsintegermodel.h b/src/declarative/extra/qmlgraphicsintegermodel.h deleted file mode 100644 index 3cad05e..0000000 --- a/src/declarative/extra/qmlgraphicsintegermodel.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSINTMODEL_H -#define QMLGRAPHICSINTMODEL_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsIntegerModelPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsIntegerModel : public QListModelInterface -{ - Q_OBJECT -public: - QmlGraphicsIntegerModel(QObject *parent=0); - ~QmlGraphicsIntegerModel(); - - Q_PROPERTY(int minimum READ minimum WRITE setMinimum) - int minimum() const; - void setMinimum(int); - - Q_PROPERTY(int maximum READ maximum WRITE setMaximum) - int maximum() const; - void setMaximum(int); - - int count() const; - QHash data(int index, const QList &roles) const; - QList roles() const; - QString toString(int role) const; - -private: - QmlGraphicsIntegerModelPrivate *d; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsIntegerModel) - -QT_END_HEADER - -#endif diff --git a/src/declarative/extra/qmlgraphicsintegermodel_p.h b/src/declarative/extra/qmlgraphicsintegermodel_p.h new file mode 100644 index 0000000..706e478 --- /dev/null +++ b/src/declarative/extra/qmlgraphicsintegermodel_p.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSINTMODEL_H +#define QMLGRAPHICSINTMODEL_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlGraphicsIntegerModelPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsIntegerModel : public QListModelInterface +{ + Q_OBJECT +public: + QmlGraphicsIntegerModel(QObject *parent=0); + ~QmlGraphicsIntegerModel(); + + Q_PROPERTY(int minimum READ minimum WRITE setMinimum) + int minimum() const; + void setMinimum(int); + + Q_PROPERTY(int maximum READ maximum WRITE setMaximum) + int maximum() const; + void setMaximum(int); + + int count() const; + QHash data(int index, const QList &roles) const; + QList roles() const; + QString toString(int role) const; + +private: + QmlGraphicsIntegerModelPrivate *d; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsIntegerModel) + +QT_END_HEADER + +#endif diff --git a/src/declarative/extra/qmlgraphicsparticles.cpp b/src/declarative/extra/qmlgraphicsparticles.cpp index dba3ac4..5a23126 100644 --- a/src/declarative/extra/qmlgraphicsparticles.cpp +++ b/src/declarative/extra/qmlgraphicsparticles.cpp @@ -50,12 +50,12 @@ #ifndef INT_MAX #define INT_MAX 2147483647 #endif -#include -#include -#include +#include +#include +#include #include -#include "qmlgraphicsparticles.h" +#include "qmlgraphicsparticles_p.h" #include #include #include diff --git a/src/declarative/extra/qmlgraphicsparticles.h b/src/declarative/extra/qmlgraphicsparticles.h deleted file mode 100644 index eed0d62..0000000 --- a/src/declarative/extra/qmlgraphicsparticles.h +++ /dev/null @@ -1,230 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSPARTICLES_H -#define QMLGRAPHICSPARTICLES_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsParticle; -class QmlGraphicsParticles; -class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotion : public QObject -{ - Q_OBJECT -public: - QmlGraphicsParticleMotion(QObject *parent=0); - - virtual void advance(QmlGraphicsParticle &, int interval); - virtual void created(QmlGraphicsParticle &); - virtual void destroy(QmlGraphicsParticle &); -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionLinear : public QmlGraphicsParticleMotion -{ - Q_OBJECT -public: - QmlGraphicsParticleMotionLinear(QObject *parent=0) - : QmlGraphicsParticleMotion(parent) {} - - virtual void advance(QmlGraphicsParticle &, int interval); -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionGravity : public QmlGraphicsParticleMotion -{ - Q_OBJECT - - Q_PROPERTY(int xattractor READ xAttractor WRITE setXAttractor) - Q_PROPERTY(int yattractor READ yAttractor WRITE setYAttractor) - Q_PROPERTY(int acceleration READ acceleration WRITE setAcceleration) -public: - QmlGraphicsParticleMotionGravity(QObject *parent=0) - : QmlGraphicsParticleMotion(parent), _xAttr(0), _yAttr(0), _accel(0.00005) {} - - int xAttractor() const { return _xAttr; } - void setXAttractor(int x) { _xAttr = x; } - - int yAttractor() const { return _yAttr; } - void setYAttractor(int y) { _yAttr = y; } - - int acceleration() const { return int(_accel * 1000000); } - void setAcceleration(int accel) { _accel = qreal(accel)/1000000.0; } - - virtual void advance(QmlGraphicsParticle &, int interval); - -private: - int _xAttr; - int _yAttr; - qreal _accel; -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionWander : public QmlGraphicsParticleMotion -{ - Q_OBJECT -public: - QmlGraphicsParticleMotionWander() - : QmlGraphicsParticleMotion(), particles(0), _xvariance(0), _yvariance(0) {} - - virtual void advance(QmlGraphicsParticle &, int interval); - virtual void created(QmlGraphicsParticle &); - virtual void destroy(QmlGraphicsParticle &); - - struct Data { - qreal x_targetV; - qreal y_targetV; - qreal x_peak; - qreal y_peak; - qreal x_var; - qreal y_var; - }; - - Q_PROPERTY(int xvariance READ xVariance WRITE setXVariance) - int xVariance() const { return int(_xvariance * 1000); } - void setXVariance(int var) { _xvariance = var / 1000.0; } - - Q_PROPERTY(int yvariance READ yVariance WRITE setYVariance) - int yVariance() const { return int(_yvariance * 1000); } - void setYVariance(int var) { _yvariance = var / 1000.0; } - - Q_PROPERTY(int pace READ pace WRITE setPace) - int pace() const { return int(_pace * 1000); } - void setPace(int pace) { _pace = pace / 1000.0; } - -private: - QmlGraphicsParticles *particles; - qreal _xvariance; - qreal _yvariance; - qreal _pace; -}; - -class QmlGraphicsParticlesPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsParticles : public QmlGraphicsItem -{ - Q_OBJECT - - Q_PROPERTY(QUrl source READ source WRITE setSource) - Q_PROPERTY(int count READ count WRITE setCount) - Q_PROPERTY(int lifeSpan READ lifeSpan WRITE setLifeSpan) - Q_PROPERTY(int lifeSpanDeviation READ lifeSpanDeviation WRITE setLifeSpanDeviation) - Q_PROPERTY(int fadeInDuration READ fadeInDuration WRITE setFadeInDuration) - Q_PROPERTY(int fadeOutDuration READ fadeOutDuration WRITE setFadeOutDuration) - Q_PROPERTY(qreal angle READ angle WRITE setAngle) - Q_PROPERTY(qreal angleDeviation READ angleDeviation WRITE setAngleDeviation) - Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity) - Q_PROPERTY(qreal velocityDeviation READ velocityDeviation WRITE setVelocityDeviation) - Q_PROPERTY(bool streamIn READ streamIn WRITE setStreamIn) - Q_PROPERTY(bool emitting READ emitting WRITE setEmitting) - Q_PROPERTY(QmlGraphicsParticleMotion *motion READ motion WRITE setMotion) - Q_CLASSINFO("DefaultProperty", "motion") - -public: - QmlGraphicsParticles(QmlGraphicsItem *parent=0); - ~QmlGraphicsParticles(); - - QUrl source() const; - void setSource(const QUrl &); - - int count() const; - void setCount(int cnt); - - int lifeSpan() const; - void setLifeSpan(int); - - int lifeSpanDeviation() const; - void setLifeSpanDeviation(int); - - int fadeInDuration() const; - void setFadeInDuration(int); - - int fadeOutDuration() const; - void setFadeOutDuration(int); - - qreal angle() const; - void setAngle(qreal); - - qreal angleDeviation() const; - void setAngleDeviation(qreal); - - qreal velocity() const; - void setVelocity(qreal); - - qreal velocityDeviation() const; - void setVelocityDeviation(qreal); - - bool streamIn() const; - void setStreamIn(bool); - - bool emitting() const; - void setEmitting(bool); - - QmlGraphicsParticleMotion *motion() const; - void setMotion(QmlGraphicsParticleMotion *); - - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); - -protected: - virtual void componentComplete(); - QmlGraphicsParticles(QmlGraphicsParticlesPrivate &dd, QmlGraphicsItem *parent); - -private Q_SLOTS: - void imageLoaded(); - -private: - Q_DISABLE_COPY(QmlGraphicsParticles) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsParticles) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsParticleMotion) -QML_DECLARE_TYPE(QmlGraphicsParticleMotionLinear) -QML_DECLARE_TYPE(QmlGraphicsParticleMotionGravity) -QML_DECLARE_TYPE(QmlGraphicsParticleMotionWander) -QML_DECLARE_TYPE(QmlGraphicsParticles) - -QT_END_HEADER - -#endif diff --git a/src/declarative/extra/qmlgraphicsparticles_p.h b/src/declarative/extra/qmlgraphicsparticles_p.h new file mode 100644 index 0000000..eed0d62 --- /dev/null +++ b/src/declarative/extra/qmlgraphicsparticles_p.h @@ -0,0 +1,230 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSPARTICLES_H +#define QMLGRAPHICSPARTICLES_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlGraphicsParticle; +class QmlGraphicsParticles; +class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotion : public QObject +{ + Q_OBJECT +public: + QmlGraphicsParticleMotion(QObject *parent=0); + + virtual void advance(QmlGraphicsParticle &, int interval); + virtual void created(QmlGraphicsParticle &); + virtual void destroy(QmlGraphicsParticle &); +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionLinear : public QmlGraphicsParticleMotion +{ + Q_OBJECT +public: + QmlGraphicsParticleMotionLinear(QObject *parent=0) + : QmlGraphicsParticleMotion(parent) {} + + virtual void advance(QmlGraphicsParticle &, int interval); +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionGravity : public QmlGraphicsParticleMotion +{ + Q_OBJECT + + Q_PROPERTY(int xattractor READ xAttractor WRITE setXAttractor) + Q_PROPERTY(int yattractor READ yAttractor WRITE setYAttractor) + Q_PROPERTY(int acceleration READ acceleration WRITE setAcceleration) +public: + QmlGraphicsParticleMotionGravity(QObject *parent=0) + : QmlGraphicsParticleMotion(parent), _xAttr(0), _yAttr(0), _accel(0.00005) {} + + int xAttractor() const { return _xAttr; } + void setXAttractor(int x) { _xAttr = x; } + + int yAttractor() const { return _yAttr; } + void setYAttractor(int y) { _yAttr = y; } + + int acceleration() const { return int(_accel * 1000000); } + void setAcceleration(int accel) { _accel = qreal(accel)/1000000.0; } + + virtual void advance(QmlGraphicsParticle &, int interval); + +private: + int _xAttr; + int _yAttr; + qreal _accel; +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionWander : public QmlGraphicsParticleMotion +{ + Q_OBJECT +public: + QmlGraphicsParticleMotionWander() + : QmlGraphicsParticleMotion(), particles(0), _xvariance(0), _yvariance(0) {} + + virtual void advance(QmlGraphicsParticle &, int interval); + virtual void created(QmlGraphicsParticle &); + virtual void destroy(QmlGraphicsParticle &); + + struct Data { + qreal x_targetV; + qreal y_targetV; + qreal x_peak; + qreal y_peak; + qreal x_var; + qreal y_var; + }; + + Q_PROPERTY(int xvariance READ xVariance WRITE setXVariance) + int xVariance() const { return int(_xvariance * 1000); } + void setXVariance(int var) { _xvariance = var / 1000.0; } + + Q_PROPERTY(int yvariance READ yVariance WRITE setYVariance) + int yVariance() const { return int(_yvariance * 1000); } + void setYVariance(int var) { _yvariance = var / 1000.0; } + + Q_PROPERTY(int pace READ pace WRITE setPace) + int pace() const { return int(_pace * 1000); } + void setPace(int pace) { _pace = pace / 1000.0; } + +private: + QmlGraphicsParticles *particles; + qreal _xvariance; + qreal _yvariance; + qreal _pace; +}; + +class QmlGraphicsParticlesPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsParticles : public QmlGraphicsItem +{ + Q_OBJECT + + Q_PROPERTY(QUrl source READ source WRITE setSource) + Q_PROPERTY(int count READ count WRITE setCount) + Q_PROPERTY(int lifeSpan READ lifeSpan WRITE setLifeSpan) + Q_PROPERTY(int lifeSpanDeviation READ lifeSpanDeviation WRITE setLifeSpanDeviation) + Q_PROPERTY(int fadeInDuration READ fadeInDuration WRITE setFadeInDuration) + Q_PROPERTY(int fadeOutDuration READ fadeOutDuration WRITE setFadeOutDuration) + Q_PROPERTY(qreal angle READ angle WRITE setAngle) + Q_PROPERTY(qreal angleDeviation READ angleDeviation WRITE setAngleDeviation) + Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity) + Q_PROPERTY(qreal velocityDeviation READ velocityDeviation WRITE setVelocityDeviation) + Q_PROPERTY(bool streamIn READ streamIn WRITE setStreamIn) + Q_PROPERTY(bool emitting READ emitting WRITE setEmitting) + Q_PROPERTY(QmlGraphicsParticleMotion *motion READ motion WRITE setMotion) + Q_CLASSINFO("DefaultProperty", "motion") + +public: + QmlGraphicsParticles(QmlGraphicsItem *parent=0); + ~QmlGraphicsParticles(); + + QUrl source() const; + void setSource(const QUrl &); + + int count() const; + void setCount(int cnt); + + int lifeSpan() const; + void setLifeSpan(int); + + int lifeSpanDeviation() const; + void setLifeSpanDeviation(int); + + int fadeInDuration() const; + void setFadeInDuration(int); + + int fadeOutDuration() const; + void setFadeOutDuration(int); + + qreal angle() const; + void setAngle(qreal); + + qreal angleDeviation() const; + void setAngleDeviation(qreal); + + qreal velocity() const; + void setVelocity(qreal); + + qreal velocityDeviation() const; + void setVelocityDeviation(qreal); + + bool streamIn() const; + void setStreamIn(bool); + + bool emitting() const; + void setEmitting(bool); + + QmlGraphicsParticleMotion *motion() const; + void setMotion(QmlGraphicsParticleMotion *); + + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + +protected: + virtual void componentComplete(); + QmlGraphicsParticles(QmlGraphicsParticlesPrivate &dd, QmlGraphicsItem *parent); + +private Q_SLOTS: + void imageLoaded(); + +private: + Q_DISABLE_COPY(QmlGraphicsParticles) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsParticles) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsParticleMotion) +QML_DECLARE_TYPE(QmlGraphicsParticleMotionLinear) +QML_DECLARE_TYPE(QmlGraphicsParticleMotionGravity) +QML_DECLARE_TYPE(QmlGraphicsParticleMotionWander) +QML_DECLARE_TYPE(QmlGraphicsParticles) + +QT_END_HEADER + +#endif diff --git a/src/declarative/extra/qmlnumberformatter.cpp b/src/declarative/extra/qmlnumberformatter.cpp index 5b76e45..8b477bb 100644 --- a/src/declarative/extra/qmlnumberformatter.cpp +++ b/src/declarative/extra/qmlnumberformatter.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlnumberformatter.h" +#include "qmlnumberformatter_p.h" #include "private/qobject_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/extra/qmlnumberformatter.h b/src/declarative/extra/qmlnumberformatter.h deleted file mode 100644 index d9abee7..0000000 --- a/src/declarative/extra/qmlnumberformatter.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLNUMBERFORMATTER_H -#define QMLNUMBERFORMATTER_H - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlNumberFormatterPrivate; -class Q_DECLARATIVE_EXPORT QmlNumberFormatter : public QObject, public QmlParserStatus -{ - Q_OBJECT - Q_INTERFACES(QmlParserStatus) - - Q_PROPERTY(QString text READ text NOTIFY textChanged) - Q_PROPERTY(QString format READ format WRITE setFormat) - Q_PROPERTY(qreal number READ number WRITE setNumber) -public: - QmlNumberFormatter(QObject *parent=0); - ~QmlNumberFormatter(); - - QString text() const; - - qreal number() const; - void setNumber(const qreal &); - - QString format() const; - void setFormat(const QString &); - - virtual void classBegin(); - virtual void componentComplete(); - -Q_SIGNALS: - void textChanged(); - -private: - Q_DISABLE_COPY(QmlNumberFormatter) - Q_DECLARE_PRIVATE(QmlNumberFormatter) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlNumberFormatter) - -QT_END_HEADER - -#endif diff --git a/src/declarative/extra/qmlnumberformatter_p.h b/src/declarative/extra/qmlnumberformatter_p.h new file mode 100644 index 0000000..515f71a --- /dev/null +++ b/src/declarative/extra/qmlnumberformatter_p.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLNUMBERFORMATTER_H +#define QMLNUMBERFORMATTER_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlNumberFormatterPrivate; +class Q_DECLARATIVE_EXPORT QmlNumberFormatter : public QObject, public QmlParserStatus +{ + Q_OBJECT + Q_INTERFACES(QmlParserStatus) + + Q_PROPERTY(QString text READ text NOTIFY textChanged) + Q_PROPERTY(QString format READ format WRITE setFormat) + Q_PROPERTY(qreal number READ number WRITE setNumber) +public: + QmlNumberFormatter(QObject *parent=0); + ~QmlNumberFormatter(); + + QString text() const; + + qreal number() const; + void setNumber(const qreal &); + + QString format() const; + void setFormat(const QString &); + + virtual void classBegin(); + virtual void componentComplete(); + +Q_SIGNALS: + void textChanged(); + +private: + Q_DISABLE_COPY(QmlNumberFormatter) + Q_DECLARE_PRIVATE(QmlNumberFormatter) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlNumberFormatter) + +QT_END_HEADER + +#endif diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp index a3c96fd..98d836b 100644 --- a/src/declarative/extra/qmlxmllistmodel.cpp +++ b/src/declarative/extra/qmlxmllistmodel.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlxmllistmodel.h" +#include "qmlxmllistmodel_p.h" #include "private/qobject_p.h" #include diff --git a/src/declarative/extra/qmlxmllistmodel.h b/src/declarative/extra/qmlxmllistmodel.h deleted file mode 100644 index 1bcc008..0000000 --- a/src/declarative/extra/qmlxmllistmodel.h +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLXMLLISTMODEL_H -#define QMLXMLLISTMODEL_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlContext; - -class QmlXmlListModelRole; - -class QmlXmlListModelPrivate; -class Q_DECLARATIVE_EXPORT QmlXmlListModel : public QListModelInterface, public QmlParserStatus -{ - Q_OBJECT - Q_INTERFACES(QmlParserStatus) - Q_ENUMS(Status) - - Q_PROPERTY(Status status READ status NOTIFY statusChanged) - Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) - Q_PROPERTY(QUrl source READ source WRITE setSource) - Q_PROPERTY(QString xml READ xml WRITE setXml) - Q_PROPERTY(QString query READ query WRITE setQuery) - Q_PROPERTY(QString namespaceDeclarations READ namespaceDeclarations WRITE setNamespaceDeclarations) - Q_PROPERTY(QmlList *roles READ roleObjects) - Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_CLASSINFO("DefaultProperty", "roles") - -public: - QmlXmlListModel(QObject *parent = 0); - ~QmlXmlListModel(); - - virtual QHash data(int index, const QList &roles = (QList())) const; - virtual int count() const; - virtual QList roles() const; - virtual QString toString(int role) const; - - QmlList *roleObjects(); - - QUrl source() const; - void setSource(const QUrl&); - - QString xml() const; - void setXml(const QString&); - - QString query() const; - void setQuery(const QString&); - - QString namespaceDeclarations() const; - void setNamespaceDeclarations(const QString&); - - enum Status { Null, Ready, Loading, Error }; - Status status() const; - qreal progress() const; - - virtual void classBegin(); - virtual void componentComplete(); - -signals: - void statusChanged(Status); - void progressChanged(qreal progress); - void countChanged(); - -public Q_SLOTS: - // ### need to use/expose Expiry to guess when to call this? - // ### property to auto-call this on reasonable Expiry? - // ### LastModified/Age also useful to guess. - // ### Probably also applies to other network-requesting types. - void reload(); - -private Q_SLOTS: - void requestFinished(); - void requestProgress(qint64,qint64); - void queryCompleted(int,int); - -private: - Q_DECLARE_PRIVATE(QmlXmlListModel) - Q_DISABLE_COPY(QmlXmlListModel) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlXmlListModel) - -QT_END_HEADER - -#endif // QMLXMLLISTMODEL_H diff --git a/src/declarative/extra/qmlxmllistmodel_p.h b/src/declarative/extra/qmlxmllistmodel_p.h new file mode 100644 index 0000000..1bcc008 --- /dev/null +++ b/src/declarative/extra/qmlxmllistmodel_p.h @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLXMLLISTMODEL_H +#define QMLXMLLISTMODEL_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlContext; + +class QmlXmlListModelRole; + +class QmlXmlListModelPrivate; +class Q_DECLARATIVE_EXPORT QmlXmlListModel : public QListModelInterface, public QmlParserStatus +{ + Q_OBJECT + Q_INTERFACES(QmlParserStatus) + Q_ENUMS(Status) + + Q_PROPERTY(Status status READ status NOTIFY statusChanged) + Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) + Q_PROPERTY(QUrl source READ source WRITE setSource) + Q_PROPERTY(QString xml READ xml WRITE setXml) + Q_PROPERTY(QString query READ query WRITE setQuery) + Q_PROPERTY(QString namespaceDeclarations READ namespaceDeclarations WRITE setNamespaceDeclarations) + Q_PROPERTY(QmlList *roles READ roleObjects) + Q_PROPERTY(int count READ count NOTIFY countChanged) + Q_CLASSINFO("DefaultProperty", "roles") + +public: + QmlXmlListModel(QObject *parent = 0); + ~QmlXmlListModel(); + + virtual QHash data(int index, const QList &roles = (QList())) const; + virtual int count() const; + virtual QList roles() const; + virtual QString toString(int role) const; + + QmlList *roleObjects(); + + QUrl source() const; + void setSource(const QUrl&); + + QString xml() const; + void setXml(const QString&); + + QString query() const; + void setQuery(const QString&); + + QString namespaceDeclarations() const; + void setNamespaceDeclarations(const QString&); + + enum Status { Null, Ready, Loading, Error }; + Status status() const; + qreal progress() const; + + virtual void classBegin(); + virtual void componentComplete(); + +signals: + void statusChanged(Status); + void progressChanged(qreal progress); + void countChanged(); + +public Q_SLOTS: + // ### need to use/expose Expiry to guess when to call this? + // ### property to auto-call this on reasonable Expiry? + // ### LastModified/Age also useful to guess. + // ### Probably also applies to other network-requesting types. + void reload(); + +private Q_SLOTS: + void requestFinished(); + void requestProgress(qint64,qint64); + void queryCompleted(int,int); + +private: + Q_DECLARE_PRIVATE(QmlXmlListModel) + Q_DISABLE_COPY(QmlXmlListModel) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlXmlListModel) + +QT_END_HEADER + +#endif // QMLXMLLISTMODEL_H diff --git a/src/declarative/extra/qnumberformat.cpp b/src/declarative/extra/qnumberformat.cpp index cde2fb0..7e28491 100644 --- a/src/declarative/extra/qnumberformat.cpp +++ b/src/declarative/extra/qnumberformat.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qnumberformat.h" +#include "qnumberformat_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/extra/qnumberformat.h b/src/declarative/extra/qnumberformat.h deleted file mode 100644 index 830cf79..0000000 --- a/src/declarative/extra/qnumberformat.h +++ /dev/null @@ -1,173 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef NUMBERFORMAT_H -#define NUMBERFORMAT_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -// TODO -// be able to set Locale, instead of default system for dynamic formatting -// add currency support -// add additional syntax, extend to format scientific, percentiles, significant digits etc - - -class QNumberFormat : public QObject -{ - Q_OBJECT - Q_ENUMS(NumberType) -public: - QNumberFormat(QObject *parent=0); - ~QNumberFormat(); - - enum NumberType { - Percent, - Scientific, - Currency, - Decimal - }; - - //external property, only visible - Q_PROPERTY(QString text READ text NOTIFY textChanged) - - //mutatable properties to modify the output (text) - Q_PROPERTY(qreal number READ number WRITE setNumber) - Q_PROPERTY(QString format READ format WRITE setFormat) - Q_PROPERTY(QLocale locale READ locale WRITE setLocale) - - //Format specific settings - Q_PROPERTY(unsigned short groupingSeparator READ groupingSeparator WRITE setGroupingSeparator) - Q_PROPERTY(unsigned short decimalSeperator READ decimalSeparator WRITE setDecimalSeparator) - Q_PROPERTY(unsigned int groupingSize READ groupingSize WRITE setGroupingSize) - Q_PROPERTY(unsigned short currencySymbol READ currencySymbol WRITE setCurrencySymbol) - - - QString text() const { return _text; } - - qreal number() const { return _number; } - void setNumber(qreal n) { - if (_number == n) - return; - _number = n; - updateText(); - } - - QString format() const { return _format; } - void setFormat(const QString &format) { - if (format.isEmpty()) - _format = QString::null; - else if (_format == format) - return; - - _format = format; - updateText(); - } - - QLocale locale() const { return _locale; } - void setLocale(const QLocale &locale) { _locale = locale; updateText(); } - - //Do we deal with unicode standard? or create our own - // ### since this is the backend for the number conversions, we will use the unicode - // the front-end will handle the QChar/QString -> short int - - unsigned short groupingSeparator() { return _groupingSeparator.unicode(); } - void setGroupingSeparator(unsigned short unicodeSymbol) - { - _groupingSeparator = QChar(unicodeSymbol); - } - - unsigned short decimalSeparator() { return _decimalSeparator.unicode(); } - void setDecimalSeparator(unsigned short unicodeSymbol) - { - _decimalSeparator = QChar(unicodeSymbol); - } - - unsigned short currencySymbol() { return _currencySymbol.unicode(); } - void setCurrencySymbol(unsigned short unicodeSymbol) - { - _currencySymbol = QChar(unicodeSymbol); - } - - unsigned int groupingSize() { return _groupingSize; } - void setGroupingSize(unsigned int size) - { - _groupingSize = size; - } - -Q_SIGNALS: - void textChanged(); - -private: - void updateText(); - void handleFormat(); - QString formatInteger(const QString &formatInt, const QString &integer); - QString formatDecimal(const QString &formatDec, const QString &decimal); - - qreal _number; - NumberType _type; - QChar _groupingSeparator; - QChar _decimalSeparator; - QChar _currencySymbol; - unsigned int _groupingSize; - - QLocale _locale; - QString _format; - - // only hooked member at the moment - QString _text; - -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QNumberFormat) - -QT_END_HEADER - -#endif diff --git a/src/declarative/extra/qnumberformat_p.h b/src/declarative/extra/qnumberformat_p.h new file mode 100644 index 0000000..830cf79 --- /dev/null +++ b/src/declarative/extra/qnumberformat_p.h @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef NUMBERFORMAT_H +#define NUMBERFORMAT_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +// TODO +// be able to set Locale, instead of default system for dynamic formatting +// add currency support +// add additional syntax, extend to format scientific, percentiles, significant digits etc + + +class QNumberFormat : public QObject +{ + Q_OBJECT + Q_ENUMS(NumberType) +public: + QNumberFormat(QObject *parent=0); + ~QNumberFormat(); + + enum NumberType { + Percent, + Scientific, + Currency, + Decimal + }; + + //external property, only visible + Q_PROPERTY(QString text READ text NOTIFY textChanged) + + //mutatable properties to modify the output (text) + Q_PROPERTY(qreal number READ number WRITE setNumber) + Q_PROPERTY(QString format READ format WRITE setFormat) + Q_PROPERTY(QLocale locale READ locale WRITE setLocale) + + //Format specific settings + Q_PROPERTY(unsigned short groupingSeparator READ groupingSeparator WRITE setGroupingSeparator) + Q_PROPERTY(unsigned short decimalSeperator READ decimalSeparator WRITE setDecimalSeparator) + Q_PROPERTY(unsigned int groupingSize READ groupingSize WRITE setGroupingSize) + Q_PROPERTY(unsigned short currencySymbol READ currencySymbol WRITE setCurrencySymbol) + + + QString text() const { return _text; } + + qreal number() const { return _number; } + void setNumber(qreal n) { + if (_number == n) + return; + _number = n; + updateText(); + } + + QString format() const { return _format; } + void setFormat(const QString &format) { + if (format.isEmpty()) + _format = QString::null; + else if (_format == format) + return; + + _format = format; + updateText(); + } + + QLocale locale() const { return _locale; } + void setLocale(const QLocale &locale) { _locale = locale; updateText(); } + + //Do we deal with unicode standard? or create our own + // ### since this is the backend for the number conversions, we will use the unicode + // the front-end will handle the QChar/QString -> short int + + unsigned short groupingSeparator() { return _groupingSeparator.unicode(); } + void setGroupingSeparator(unsigned short unicodeSymbol) + { + _groupingSeparator = QChar(unicodeSymbol); + } + + unsigned short decimalSeparator() { return _decimalSeparator.unicode(); } + void setDecimalSeparator(unsigned short unicodeSymbol) + { + _decimalSeparator = QChar(unicodeSymbol); + } + + unsigned short currencySymbol() { return _currencySymbol.unicode(); } + void setCurrencySymbol(unsigned short unicodeSymbol) + { + _currencySymbol = QChar(unicodeSymbol); + } + + unsigned int groupingSize() { return _groupingSize; } + void setGroupingSize(unsigned int size) + { + _groupingSize = size; + } + +Q_SIGNALS: + void textChanged(); + +private: + void updateText(); + void handleFormat(); + QString formatInteger(const QString &formatInt, const QString &integer); + QString formatDecimal(const QString &formatDec, const QString &decimal); + + qreal _number; + NumberType _type; + QChar _groupingSeparator; + QChar _decimalSeparator; + QChar _currencySymbol; + unsigned int _groupingSize; + + QLocale _locale; + QString _format; + + // only hooked member at the moment + QString _text; + +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QNumberFormat) + +QT_END_HEADER + +#endif diff --git a/src/declarative/fx/fx.pri b/src/declarative/fx/fx.pri index 7759ab1..20e1503 100644 --- a/src/declarative/fx/fx.pri +++ b/src/declarative/fx/fx.pri @@ -1,49 +1,49 @@ HEADERS += \ - fx/qmlgraphicsanchors.h \ fx/qmlgraphicsanchors_p.h \ - fx/qmlgraphicsevents_p.h \ - fx/qmlgraphicsflickable.h \ + fx/qmlgraphicsanchors_p_p.h \ + fx/qmlgraphicsevents_p_p.h \ fx/qmlgraphicsflickable_p.h \ - fx/qmlgraphicsflipable.h \ - fx/qmlgraphicsgridview.h \ - fx/qmlgraphicsimage.h \ - fx/qmlgraphicsimagebase.h \ - fx/qmlgraphicsborderimage.h \ - fx/qmlgraphicspainteditem.h \ - fx/qmlgraphicspainteditem_p.h \ + fx/qmlgraphicsflickable_p_p.h \ + fx/qmlgraphicsflipable_p.h \ + fx/qmlgraphicsgridview_p.h \ fx/qmlgraphicsimage_p.h \ - fx/qmlgraphicsborderimage_p.h \ fx/qmlgraphicsimagebase_p.h \ + fx/qmlgraphicsborderimage_p.h \ + fx/qmlgraphicspainteditem_p.h \ + fx/qmlgraphicspainteditem_p_p.h \ + fx/qmlgraphicsimage_p_p.h \ + fx/qmlgraphicsborderimage_p_p.h \ + fx/qmlgraphicsimagebase_p_p.h \ fx/qmlgraphicsitem.h \ fx/qmlgraphicsitem_p.h \ - fx/qmlgraphicsfocuspanel.h \ - fx/qmlgraphicsfocusscope.h \ - fx/qmlgraphicspositioners.h \ + fx/qmlgraphicsfocuspanel_p.h \ + fx/qmlgraphicsfocusscope_p.h \ fx/qmlgraphicspositioners_p.h \ - fx/qmlgraphicsloader.h \ + fx/qmlgraphicspositioners_p_p.h \ fx/qmlgraphicsloader_p.h \ - fx/qmlgraphicsmouseregion.h \ + fx/qmlgraphicsloader_p_p.h \ fx/qmlgraphicsmouseregion_p.h \ - fx/qmlgraphicspath.h \ + fx/qmlgraphicsmouseregion_p_p.h \ fx/qmlgraphicspath_p.h \ - fx/qmlgraphicspathview.h \ + fx/qmlgraphicspath_p_p.h \ fx/qmlgraphicspathview_p.h \ - fx/qmlgraphicsrect.h \ + fx/qmlgraphicspathview_p_p.h \ fx/qmlgraphicsrect_p.h \ - fx/qmlgraphicsrepeater.h \ + fx/qmlgraphicsrect_p_p.h \ fx/qmlgraphicsrepeater_p.h \ - fx/qmlgraphicsscalegrid_p.h \ - fx/qmlgraphicstextinput.h \ + fx/qmlgraphicsrepeater_p_p.h \ + fx/qmlgraphicsscalegrid_p_p.h \ fx/qmlgraphicstextinput_p.h \ - fx/qmlgraphicstextedit.h \ + fx/qmlgraphicstextinput_p_p.h \ fx/qmlgraphicstextedit_p.h \ - fx/qmlgraphicstext.h \ + fx/qmlgraphicstextedit_p_p.h \ fx/qmlgraphicstext_p.h \ - fx/qmlgraphicspixmapcache.h \ - fx/qmlgraphicsvisualitemmodel.h \ - fx/qmlgraphicslistview.h \ - fx/qmlgraphicsgraphicsobjectcontainer.h \ - fx/qmlgraphicslayoutitem.h \ + fx/qmlgraphicstext_p_p.h \ + fx/qmlgraphicspixmapcache_p.h \ + fx/qmlgraphicsvisualitemmodel_p.h \ + fx/qmlgraphicslistview_p.h \ + fx/qmlgraphicsgraphicsobjectcontainer_p.h \ + fx/qmlgraphicslayoutitem_p.h \ fx/qmlgraphicseffects.cpp SOURCES += \ @@ -79,6 +79,6 @@ SOURCES += \ contains(QT_CONFIG, webkit) { QT+=webkit SOURCES += fx/qmlgraphicswebview.cpp - HEADERS += fx/qmlgraphicswebview.h + HEADERS += fx/qmlgraphicswebview_p.h } diff --git a/src/declarative/fx/qmlgraphicsanchors.cpp b/src/declarative/fx/qmlgraphicsanchors.cpp index d0e26d8..fc1a1c6 100644 --- a/src/declarative/fx/qmlgraphicsanchors.cpp +++ b/src/declarative/fx/qmlgraphicsanchors.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlgraphicsanchors_p.h" +#include "qmlgraphicsanchors_p_p.h" #include "qmlgraphicsitem.h" #include "qmlgraphicsitem_p.h" #include @@ -956,7 +956,7 @@ bool QmlGraphicsAnchorsPrivate::checkVAnchorValid(QmlGraphicsAnchorLine anchor) return true; } -QT_END_NAMESPACE +#include "moc_qmlgraphicsanchors_p.cpp" -#include "moc_qmlgraphicsanchors.cpp" +QT_END_NAMESPACE diff --git a/src/declarative/fx/qmlgraphicsanchors.h b/src/declarative/fx/qmlgraphicsanchors.h deleted file mode 100644 index de7214d..0000000 --- a/src/declarative/fx/qmlgraphicsanchors.h +++ /dev/null @@ -1,180 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSANCHORS_H -#define QMLGRAPHICSANCHORS_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsAnchorsPrivate; -class QmlGraphicsAnchorLine; -class Q_DECLARATIVE_EXPORT QmlGraphicsAnchors : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QmlGraphicsAnchorLine left READ left WRITE setLeft RESET resetLeft) - Q_PROPERTY(QmlGraphicsAnchorLine right READ right WRITE setRight RESET resetRight) - Q_PROPERTY(QmlGraphicsAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter) - Q_PROPERTY(QmlGraphicsAnchorLine top READ top WRITE setTop RESET resetTop) - Q_PROPERTY(QmlGraphicsAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom) - Q_PROPERTY(QmlGraphicsAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter) - Q_PROPERTY(QmlGraphicsAnchorLine baseline READ baseline WRITE setBaseline RESET resetBaseline) - Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) - Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) - Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged()) - Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) - Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) - Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged()) - Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged()) - Q_PROPERTY(QmlGraphicsItem *fill READ fill WRITE setFill) - Q_PROPERTY(QmlGraphicsItem *centerIn READ centerIn WRITE setCenterIn) - -public: - QmlGraphicsAnchors(QObject *parent=0); - virtual ~QmlGraphicsAnchors(); - - enum UsedAnchor { - HasLeftAnchor = 0x01, - HasRightAnchor = 0x02, - HasTopAnchor = 0x04, - HasBottomAnchor = 0x08, - HasHCenterAnchor = 0x10, - HasVCenterAnchor = 0x20, - HasBaselineAnchor = 0x40, - Horizontal_Mask = HasLeftAnchor | HasRightAnchor | HasHCenterAnchor, - Vertical_Mask = HasTopAnchor | HasBottomAnchor | HasVCenterAnchor | HasBaselineAnchor - }; - Q_DECLARE_FLAGS(UsedAnchors, UsedAnchor) - - QmlGraphicsAnchorLine left() const; - void setLeft(const QmlGraphicsAnchorLine &edge); - void resetLeft(); - - QmlGraphicsAnchorLine right() const; - void setRight(const QmlGraphicsAnchorLine &edge); - void resetRight(); - - QmlGraphicsAnchorLine horizontalCenter() const; - void setHorizontalCenter(const QmlGraphicsAnchorLine &edge); - void resetHorizontalCenter(); - - QmlGraphicsAnchorLine top() const; - void setTop(const QmlGraphicsAnchorLine &edge); - void resetTop(); - - QmlGraphicsAnchorLine bottom() const; - void setBottom(const QmlGraphicsAnchorLine &edge); - void resetBottom(); - - QmlGraphicsAnchorLine verticalCenter() const; - void setVerticalCenter(const QmlGraphicsAnchorLine &edge); - void resetVerticalCenter(); - - QmlGraphicsAnchorLine baseline() const; - void setBaseline(const QmlGraphicsAnchorLine &edge); - void resetBaseline(); - - qreal leftMargin() const; - void setLeftMargin(qreal); - - qreal rightMargin() const; - void setRightMargin(qreal); - - qreal horizontalCenterOffset() const; - void setHorizontalCenterOffset(qreal); - - qreal topMargin() const; - void setTopMargin(qreal); - - qreal bottomMargin() const; - void setBottomMargin(qreal); - - qreal verticalCenterOffset() const; - void setVerticalCenterOffset(qreal); - - qreal baselineOffset() const; - void setBaselineOffset(qreal); - - QmlGraphicsItem *fill() const; - void setFill(QmlGraphicsItem *); - - QmlGraphicsItem *centerIn() const; - void setCenterIn(QmlGraphicsItem *); - - UsedAnchors usedAnchors() const; - - void setItem(QmlGraphicsItem *item); - - void classBegin(); - void componentComplete(); - -Q_SIGNALS: - void leftMarginChanged(); - void rightMarginChanged(); - void topMarginChanged(); - void bottomMarginChanged(); - void verticalCenterOffsetChanged(); - void horizontalCenterOffsetChanged(); - void baselineOffsetChanged(); - -private: - friend class QmlGraphicsItem; - Q_DISABLE_COPY(QmlGraphicsAnchors) - Q_DECLARE_PRIVATE(QmlGraphicsAnchors) -}; -Q_DECLARE_OPERATORS_FOR_FLAGS(QmlGraphicsAnchors::UsedAnchors) - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsAnchors) - -QT_END_HEADER - -#endif diff --git a/src/declarative/fx/qmlgraphicsanchors_p.h b/src/declarative/fx/qmlgraphicsanchors_p.h index 3986cd6..de7214d 100644 --- a/src/declarative/fx/qmlgraphicsanchors_p.h +++ b/src/declarative/fx/qmlgraphicsanchors_p.h @@ -39,122 +39,142 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSANCHORS_P_H -#define QMLGRAPHICSANCHORS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qmlgraphicsanchors.h" -#include "private/qobject_p.h" +#ifndef QMLGRAPHICSANCHORS_H +#define QMLGRAPHICSANCHORS_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlGraphicsAnchorLine +QT_MODULE(Declarative) + +class QmlGraphicsAnchorsPrivate; +class QmlGraphicsAnchorLine; +class Q_DECLARATIVE_EXPORT QmlGraphicsAnchors : public QObject { + Q_OBJECT + + Q_PROPERTY(QmlGraphicsAnchorLine left READ left WRITE setLeft RESET resetLeft) + Q_PROPERTY(QmlGraphicsAnchorLine right READ right WRITE setRight RESET resetRight) + Q_PROPERTY(QmlGraphicsAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter) + Q_PROPERTY(QmlGraphicsAnchorLine top READ top WRITE setTop RESET resetTop) + Q_PROPERTY(QmlGraphicsAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom) + Q_PROPERTY(QmlGraphicsAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter) + Q_PROPERTY(QmlGraphicsAnchorLine baseline READ baseline WRITE setBaseline RESET resetBaseline) + Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) + Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) + Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged()) + Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) + Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) + Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged()) + Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged()) + Q_PROPERTY(QmlGraphicsItem *fill READ fill WRITE setFill) + Q_PROPERTY(QmlGraphicsItem *centerIn READ centerIn WRITE setCenterIn) + public: - QmlGraphicsAnchorLine() : item(0), anchorLine(Invalid) - { - } - - enum AnchorLine { - Invalid = 0x0, - Left = 0x01, - Right = 0x02, - Top = 0x04, - Bottom = 0x08, - HCenter = 0x10, - VCenter = 0x20, - Baseline = 0x40, - Horizontal_Mask = Left | Right | HCenter, - Vertical_Mask = Top | Bottom | VCenter | Baseline + QmlGraphicsAnchors(QObject *parent=0); + virtual ~QmlGraphicsAnchors(); + + enum UsedAnchor { + HasLeftAnchor = 0x01, + HasRightAnchor = 0x02, + HasTopAnchor = 0x04, + HasBottomAnchor = 0x08, + HasHCenterAnchor = 0x10, + HasVCenterAnchor = 0x20, + HasBaselineAnchor = 0x40, + Horizontal_Mask = HasLeftAnchor | HasRightAnchor | HasHCenterAnchor, + Vertical_Mask = HasTopAnchor | HasBottomAnchor | HasVCenterAnchor | HasBaselineAnchor }; + Q_DECLARE_FLAGS(UsedAnchors, UsedAnchor) - QmlGraphicsItem *item; - AnchorLine anchorLine; -}; -Q_DECLARE_METATYPE(QmlGraphicsAnchorLine) + QmlGraphicsAnchorLine left() const; + void setLeft(const QmlGraphicsAnchorLine &edge); + void resetLeft(); -class QmlGraphicsAnchorsPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QmlGraphicsAnchors) -public: - QmlGraphicsAnchorsPrivate() - : updatingMe(false), updatingHorizontalAnchor(0), - updatingVerticalAnchor(0), item(0), usedAnchors(0), fill(0), - centerIn(0), leftMargin(0), rightMargin(0), topMargin(0), - bottomMargin(0), vCenterOffset(0), hCenterOffset(0), baselineOffset(0), - componentComplete(true) - { - } - - void init() - { - } - - void clearItem(QmlGraphicsItem *); - - void addDepend(QmlGraphicsItem *); - void remDepend(QmlGraphicsItem *); - bool isItemComplete() const; - - bool updatingMe; - int updatingHorizontalAnchor; - int updatingVerticalAnchor; - - void setItemHeight(qreal); - void setItemWidth(qreal); - void setItemX(qreal); - void setItemY(qreal); - void setItemPos(const QPointF &); - - void updateOnComplete(); - void updateMe(); - void update(QmlGraphicsItem *, const QRectF &, const QRectF &); - - bool checkHValid() const; - bool checkVValid() const; - bool checkHAnchorValid(QmlGraphicsAnchorLine anchor) const; - bool checkVAnchorValid(QmlGraphicsAnchorLine anchor) const; - bool calcStretch(const QmlGraphicsAnchorLine &edge1, const QmlGraphicsAnchorLine &edge2, int offset1, int offset2, QmlGraphicsAnchorLine::AnchorLine line, int &stretch); - - void updateHorizontalAnchors(); - void updateVerticalAnchors(); - void fillChanged(); - void centerInChanged(); - - QmlGraphicsItem *item; - QmlGraphicsAnchors::UsedAnchors usedAnchors; - - QmlGraphicsItem *fill; - QmlGraphicsItem *centerIn; - - QmlGraphicsAnchorLine left; - QmlGraphicsAnchorLine right; - QmlGraphicsAnchorLine top; - QmlGraphicsAnchorLine bottom; - QmlGraphicsAnchorLine vCenter; - QmlGraphicsAnchorLine hCenter; - QmlGraphicsAnchorLine baseline; - - qreal leftMargin; - qreal rightMargin; - qreal topMargin; - qreal bottomMargin; - qreal vCenterOffset; - qreal hCenterOffset; - qreal baselineOffset; - - bool componentComplete; + QmlGraphicsAnchorLine right() const; + void setRight(const QmlGraphicsAnchorLine &edge); + void resetRight(); + + QmlGraphicsAnchorLine horizontalCenter() const; + void setHorizontalCenter(const QmlGraphicsAnchorLine &edge); + void resetHorizontalCenter(); + + QmlGraphicsAnchorLine top() const; + void setTop(const QmlGraphicsAnchorLine &edge); + void resetTop(); + + QmlGraphicsAnchorLine bottom() const; + void setBottom(const QmlGraphicsAnchorLine &edge); + void resetBottom(); + + QmlGraphicsAnchorLine verticalCenter() const; + void setVerticalCenter(const QmlGraphicsAnchorLine &edge); + void resetVerticalCenter(); + + QmlGraphicsAnchorLine baseline() const; + void setBaseline(const QmlGraphicsAnchorLine &edge); + void resetBaseline(); + + qreal leftMargin() const; + void setLeftMargin(qreal); + + qreal rightMargin() const; + void setRightMargin(qreal); + + qreal horizontalCenterOffset() const; + void setHorizontalCenterOffset(qreal); + + qreal topMargin() const; + void setTopMargin(qreal); + + qreal bottomMargin() const; + void setBottomMargin(qreal); + + qreal verticalCenterOffset() const; + void setVerticalCenterOffset(qreal); + + qreal baselineOffset() const; + void setBaselineOffset(qreal); + + QmlGraphicsItem *fill() const; + void setFill(QmlGraphicsItem *); + + QmlGraphicsItem *centerIn() const; + void setCenterIn(QmlGraphicsItem *); + + UsedAnchors usedAnchors() const; + + void setItem(QmlGraphicsItem *item); + + void classBegin(); + void componentComplete(); + +Q_SIGNALS: + void leftMarginChanged(); + void rightMarginChanged(); + void topMarginChanged(); + void bottomMarginChanged(); + void verticalCenterOffsetChanged(); + void horizontalCenterOffsetChanged(); + void baselineOffsetChanged(); + +private: + friend class QmlGraphicsItem; + Q_DISABLE_COPY(QmlGraphicsAnchors) + Q_DECLARE_PRIVATE(QmlGraphicsAnchors) }; +Q_DECLARE_OPERATORS_FOR_FLAGS(QmlGraphicsAnchors::UsedAnchors) QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsAnchors) + +QT_END_HEADER + #endif diff --git a/src/declarative/fx/qmlgraphicsanchors_p_p.h b/src/declarative/fx/qmlgraphicsanchors_p_p.h new file mode 100644 index 0000000..7a3a9d2 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsanchors_p_p.h @@ -0,0 +1,160 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSANCHORS_P_H +#define QMLGRAPHICSANCHORS_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlgraphicsanchors_p.h" +#include "private/qobject_p.h" + +QT_BEGIN_NAMESPACE + +class QmlGraphicsAnchorLine +{ +public: + QmlGraphicsAnchorLine() : item(0), anchorLine(Invalid) + { + } + + enum AnchorLine { + Invalid = 0x0, + Left = 0x01, + Right = 0x02, + Top = 0x04, + Bottom = 0x08, + HCenter = 0x10, + VCenter = 0x20, + Baseline = 0x40, + Horizontal_Mask = Left | Right | HCenter, + Vertical_Mask = Top | Bottom | VCenter | Baseline + }; + + QmlGraphicsItem *item; + AnchorLine anchorLine; +}; +Q_DECLARE_METATYPE(QmlGraphicsAnchorLine) + +class QmlGraphicsAnchorsPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsAnchors) +public: + QmlGraphicsAnchorsPrivate() + : updatingMe(false), updatingHorizontalAnchor(0), + updatingVerticalAnchor(0), item(0), usedAnchors(0), fill(0), + centerIn(0), leftMargin(0), rightMargin(0), topMargin(0), + bottomMargin(0), vCenterOffset(0), hCenterOffset(0), baselineOffset(0), + componentComplete(true) + { + } + + void init() + { + } + + void clearItem(QmlGraphicsItem *); + + void addDepend(QmlGraphicsItem *); + void remDepend(QmlGraphicsItem *); + bool isItemComplete() const; + + bool updatingMe; + int updatingHorizontalAnchor; + int updatingVerticalAnchor; + + void setItemHeight(qreal); + void setItemWidth(qreal); + void setItemX(qreal); + void setItemY(qreal); + void setItemPos(const QPointF &); + + void updateOnComplete(); + void updateMe(); + void update(QmlGraphicsItem *, const QRectF &, const QRectF &); + + bool checkHValid() const; + bool checkVValid() const; + bool checkHAnchorValid(QmlGraphicsAnchorLine anchor) const; + bool checkVAnchorValid(QmlGraphicsAnchorLine anchor) const; + bool calcStretch(const QmlGraphicsAnchorLine &edge1, const QmlGraphicsAnchorLine &edge2, int offset1, int offset2, QmlGraphicsAnchorLine::AnchorLine line, int &stretch); + + void updateHorizontalAnchors(); + void updateVerticalAnchors(); + void fillChanged(); + void centerInChanged(); + + QmlGraphicsItem *item; + QmlGraphicsAnchors::UsedAnchors usedAnchors; + + QmlGraphicsItem *fill; + QmlGraphicsItem *centerIn; + + QmlGraphicsAnchorLine left; + QmlGraphicsAnchorLine right; + QmlGraphicsAnchorLine top; + QmlGraphicsAnchorLine bottom; + QmlGraphicsAnchorLine vCenter; + QmlGraphicsAnchorLine hCenter; + QmlGraphicsAnchorLine baseline; + + qreal leftMargin; + qreal rightMargin; + qreal topMargin; + qreal bottomMargin; + qreal vCenterOffset; + qreal hCenterOffset; + qreal baselineOffset; + + bool componentComplete; +}; + +QT_END_NAMESPACE +#endif diff --git a/src/declarative/fx/qmlgraphicsborderimage.cpp b/src/declarative/fx/qmlgraphicsborderimage.cpp index c346366..daa8085 100644 --- a/src/declarative/fx/qmlgraphicsborderimage.cpp +++ b/src/declarative/fx/qmlgraphicsborderimage.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qmlgraphicsborderimage.h" #include "qmlgraphicsborderimage_p.h" +#include "qmlgraphicsborderimage_p_p.h" #include #include #include diff --git a/src/declarative/fx/qmlgraphicsborderimage.h b/src/declarative/fx/qmlgraphicsborderimage.h deleted file mode 100644 index e3c50bb..0000000 --- a/src/declarative/fx/qmlgraphicsborderimage.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSBORDERIMAGE_H -#define QMLGRAPHICSBORDERIMAGE_H - -#include -#include "qmlgraphicsimagebase.h" - -QT_BEGIN_HEADER -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsScaleGrid; -class QmlGraphicsGridScaledImage; -class QmlGraphicsBorderImagePrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsBorderImage : public QmlGraphicsImageBase -{ - Q_OBJECT - Q_ENUMS(TileMode) - - Q_PROPERTY(QmlGraphicsScaleGrid *border READ border CONSTANT) - Q_PROPERTY(TileMode horizontalTileMode READ horizontalTileMode WRITE setHorizontalTileMode NOTIFY horizontalTileModeChanged) - Q_PROPERTY(TileMode verticalTileMode READ verticalTileMode WRITE setVerticalTileMode NOTIFY verticalTileModeChanged) - -public: - QmlGraphicsBorderImage(QmlGraphicsItem *parent=0); - ~QmlGraphicsBorderImage(); - - QmlGraphicsScaleGrid *border(); - - enum TileMode { Stretch = Qt::StretchTile, Repeat = Qt::RepeatTile, Round = Qt::RoundTile }; - - TileMode horizontalTileMode() const; - void setHorizontalTileMode(TileMode); - - TileMode verticalTileMode() const; - void setVerticalTileMode(TileMode); - - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); - void setSource(const QUrl &url); - -Q_SIGNALS: - void horizontalTileModeChanged(); - void verticalTileModeChanged(); - -protected: - QmlGraphicsBorderImage(QmlGraphicsBorderImagePrivate &dd, QmlGraphicsItem *parent); - -private: - void setGridScaledImage(const QmlGraphicsGridScaledImage& sci); - -private Q_SLOTS: - void requestFinished(); - void sciRequestFinished(); - -private: - Q_DISABLE_COPY(QmlGraphicsBorderImage) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsBorderImage) -}; - -QT_END_NAMESPACE -QML_DECLARE_TYPE(QmlGraphicsBorderImage) -QT_END_HEADER - -#endif // QMLGRAPHICSBORDERIMAGE_H diff --git a/src/declarative/fx/qmlgraphicsborderimage_p.h b/src/declarative/fx/qmlgraphicsborderimage_p.h index fb905cd..da43a23 100644 --- a/src/declarative/fx/qmlgraphicsborderimage_p.h +++ b/src/declarative/fx/qmlgraphicsborderimage_p.h @@ -39,59 +39,67 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSBORDERIMAGE_P_H -#define QMLGRAPHICSBORDERIMAGE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#ifndef QMLGRAPHICSBORDERIMAGE_H +#define QMLGRAPHICSBORDERIMAGE_H +#include #include "qmlgraphicsimagebase_p.h" -#include "qmlgraphicsscalegrid_p.h" +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QNetworkReply; -class QmlGraphicsBorderImagePrivate : public QmlGraphicsImageBasePrivate +QT_MODULE(Declarative) + +class QmlGraphicsScaleGrid; +class QmlGraphicsGridScaledImage; +class QmlGraphicsBorderImagePrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsBorderImage : public QmlGraphicsImageBase { - Q_DECLARE_PUBLIC(QmlGraphicsBorderImage) + Q_OBJECT + Q_ENUMS(TileMode) + + Q_PROPERTY(QmlGraphicsScaleGrid *border READ border CONSTANT) + Q_PROPERTY(TileMode horizontalTileMode READ horizontalTileMode WRITE setHorizontalTileMode NOTIFY horizontalTileModeChanged) + Q_PROPERTY(TileMode verticalTileMode READ verticalTileMode WRITE setVerticalTileMode NOTIFY verticalTileModeChanged) public: - QmlGraphicsBorderImagePrivate() - : border(0), sciReply(0), - sciPendingPixmapCache(false), - horizontalTileMode(QmlGraphicsBorderImage::Stretch), - verticalTileMode(QmlGraphicsBorderImage::Stretch) - { - } - - ~QmlGraphicsBorderImagePrivate() - { - } - - QmlGraphicsScaleGrid *getScaleGrid() - { - Q_Q(QmlGraphicsBorderImage); - if (!border) - border = new QmlGraphicsScaleGrid(q); - return border; - } - - QmlGraphicsScaleGrid *border; - QUrl sciurl; - QNetworkReply *sciReply; - bool sciPendingPixmapCache; - QmlGraphicsBorderImage::TileMode horizontalTileMode; - QmlGraphicsBorderImage::TileMode verticalTileMode; + QmlGraphicsBorderImage(QmlGraphicsItem *parent=0); + ~QmlGraphicsBorderImage(); + + QmlGraphicsScaleGrid *border(); + + enum TileMode { Stretch = Qt::StretchTile, Repeat = Qt::RepeatTile, Round = Qt::RoundTile }; + + TileMode horizontalTileMode() const; + void setHorizontalTileMode(TileMode); + + TileMode verticalTileMode() const; + void setVerticalTileMode(TileMode); + + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + void setSource(const QUrl &url); + +Q_SIGNALS: + void horizontalTileModeChanged(); + void verticalTileModeChanged(); + +protected: + QmlGraphicsBorderImage(QmlGraphicsBorderImagePrivate &dd, QmlGraphicsItem *parent); + +private: + void setGridScaledImage(const QmlGraphicsGridScaledImage& sci); + +private Q_SLOTS: + void requestFinished(); + void sciRequestFinished(); + +private: + Q_DISABLE_COPY(QmlGraphicsBorderImage) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsBorderImage) }; QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlGraphicsBorderImage) +QT_END_HEADER -#endif // QMLGRAPHICSBORDERIMAGE_P_H +#endif // QMLGRAPHICSBORDERIMAGE_H diff --git a/src/declarative/fx/qmlgraphicsborderimage_p_p.h b/src/declarative/fx/qmlgraphicsborderimage_p_p.h new file mode 100644 index 0000000..06ac38b --- /dev/null +++ b/src/declarative/fx/qmlgraphicsborderimage_p_p.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSBORDERIMAGE_P_H +#define QMLGRAPHICSBORDERIMAGE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlgraphicsimagebase_p_p.h" +#include "qmlgraphicsscalegrid_p_p.h" + +QT_BEGIN_NAMESPACE + +class QNetworkReply; +class QmlGraphicsBorderImagePrivate : public QmlGraphicsImageBasePrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsBorderImage) + +public: + QmlGraphicsBorderImagePrivate() + : border(0), sciReply(0), + sciPendingPixmapCache(false), + horizontalTileMode(QmlGraphicsBorderImage::Stretch), + verticalTileMode(QmlGraphicsBorderImage::Stretch) + { + } + + ~QmlGraphicsBorderImagePrivate() + { + } + + QmlGraphicsScaleGrid *getScaleGrid() + { + Q_Q(QmlGraphicsBorderImage); + if (!border) + border = new QmlGraphicsScaleGrid(q); + return border; + } + + QmlGraphicsScaleGrid *border; + QUrl sciurl; + QNetworkReply *sciReply; + bool sciPendingPixmapCache; + QmlGraphicsBorderImage::TileMode horizontalTileMode; + QmlGraphicsBorderImage::TileMode verticalTileMode; +}; + +QT_END_NAMESPACE + +#endif // QMLGRAPHICSBORDERIMAGE_P_H diff --git a/src/declarative/fx/qmlgraphicsevents.cpp b/src/declarative/fx/qmlgraphicsevents.cpp index 468b223..a4d243f 100644 --- a/src/declarative/fx/qmlgraphicsevents.cpp +++ b/src/declarative/fx/qmlgraphicsevents.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlgraphicsevents_p.h" +#include "qmlgraphicsevents_p_p.h" QT_BEGIN_NAMESPACE /*! diff --git a/src/declarative/fx/qmlgraphicsevents_p.h b/src/declarative/fx/qmlgraphicsevents_p.h deleted file mode 100644 index f093932..0000000 --- a/src/declarative/fx/qmlgraphicsevents_p.h +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSEVENTS_P_H -#define QMLGRAPHICSEVENTS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QmlGraphicsKeyEvent : public QObject -{ - Q_OBJECT - Q_PROPERTY(int key READ key) - Q_PROPERTY(QString text READ text) - Q_PROPERTY(int modifiers READ modifiers) - Q_PROPERTY(bool isAutoRepeat READ isAutoRepeat) - Q_PROPERTY(int count READ count) - Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) - -public: - QmlGraphicsKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text=QString(), bool autorep=false, ushort count=1) - : event(type, key, modifiers, text, autorep, count) { event.setAccepted(false); } - QmlGraphicsKeyEvent(const QKeyEvent &ke) - : event(ke) { event.setAccepted(false); } - - int key() const { return event.key(); } - QString text() const { return event.text(); } - int modifiers() const { return event.modifiers(); } - bool isAutoRepeat() const { return event.isAutoRepeat(); } - int count() const { return event.count(); } - - bool isAccepted() { return event.isAccepted(); } - void setAccepted(bool accepted) { event.setAccepted(accepted); } - -private: - QKeyEvent event; -}; - -class QmlGraphicsMouseEvent : public QObject -{ - Q_OBJECT - Q_PROPERTY(int x READ x) - Q_PROPERTY(int y READ y) - Q_PROPERTY(int button READ button) - Q_PROPERTY(int buttons READ buttons) - Q_PROPERTY(int modifiers READ modifiers) - Q_PROPERTY(bool wasHeld READ wasHeld) - Q_PROPERTY(bool isClick READ isClick) - Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) - -public: - QmlGraphicsMouseEvent(int x, int y, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers - , bool isClick=false, bool wasHeld=false) - : _x(x), _y(y), _button(button), _buttons(buttons), _modifiers(modifiers) - , _wasHeld(wasHeld), _isClick(isClick), _accepted(true) {} - - int x() const { return _x; } - int y() const { return _y; } - int button() const { return _button; } - int buttons() const { return _buttons; } - int modifiers() const { return _modifiers; } - bool wasHeld() const { return _wasHeld; } - bool isClick() const { return _isClick; } - - bool isAccepted() { return _accepted; } - void setAccepted(bool accepted) { _accepted = accepted; } - -private: - int _x; - int _y; - Qt::MouseButton _button; - Qt::MouseButtons _buttons; - Qt::KeyboardModifiers _modifiers; - bool _wasHeld; - bool _isClick; - bool _accepted; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsKeyEvent) -QML_DECLARE_TYPE(QmlGraphicsMouseEvent) - -#endif // QMLGRAPHICSEVENTS_P_H diff --git a/src/declarative/fx/qmlgraphicsevents_p_p.h b/src/declarative/fx/qmlgraphicsevents_p_p.h new file mode 100644 index 0000000..f093932 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsevents_p_p.h @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSEVENTS_P_H +#define QMLGRAPHICSEVENTS_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QmlGraphicsKeyEvent : public QObject +{ + Q_OBJECT + Q_PROPERTY(int key READ key) + Q_PROPERTY(QString text READ text) + Q_PROPERTY(int modifiers READ modifiers) + Q_PROPERTY(bool isAutoRepeat READ isAutoRepeat) + Q_PROPERTY(int count READ count) + Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) + +public: + QmlGraphicsKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text=QString(), bool autorep=false, ushort count=1) + : event(type, key, modifiers, text, autorep, count) { event.setAccepted(false); } + QmlGraphicsKeyEvent(const QKeyEvent &ke) + : event(ke) { event.setAccepted(false); } + + int key() const { return event.key(); } + QString text() const { return event.text(); } + int modifiers() const { return event.modifiers(); } + bool isAutoRepeat() const { return event.isAutoRepeat(); } + int count() const { return event.count(); } + + bool isAccepted() { return event.isAccepted(); } + void setAccepted(bool accepted) { event.setAccepted(accepted); } + +private: + QKeyEvent event; +}; + +class QmlGraphicsMouseEvent : public QObject +{ + Q_OBJECT + Q_PROPERTY(int x READ x) + Q_PROPERTY(int y READ y) + Q_PROPERTY(int button READ button) + Q_PROPERTY(int buttons READ buttons) + Q_PROPERTY(int modifiers READ modifiers) + Q_PROPERTY(bool wasHeld READ wasHeld) + Q_PROPERTY(bool isClick READ isClick) + Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted) + +public: + QmlGraphicsMouseEvent(int x, int y, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers + , bool isClick=false, bool wasHeld=false) + : _x(x), _y(y), _button(button), _buttons(buttons), _modifiers(modifiers) + , _wasHeld(wasHeld), _isClick(isClick), _accepted(true) {} + + int x() const { return _x; } + int y() const { return _y; } + int button() const { return _button; } + int buttons() const { return _buttons; } + int modifiers() const { return _modifiers; } + bool wasHeld() const { return _wasHeld; } + bool isClick() const { return _isClick; } + + bool isAccepted() { return _accepted; } + void setAccepted(bool accepted) { _accepted = accepted; } + +private: + int _x; + int _y; + Qt::MouseButton _button; + Qt::MouseButtons _buttons; + Qt::KeyboardModifiers _modifiers; + bool _wasHeld; + bool _isClick; + bool _accepted; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsKeyEvent) +QML_DECLARE_TYPE(QmlGraphicsMouseEvent) + +#endif // QMLGRAPHICSEVENTS_P_H diff --git a/src/declarative/fx/qmlgraphicsflickable.cpp b/src/declarative/fx/qmlgraphicsflickable.cpp index ed964aa..3f317d1 100644 --- a/src/declarative/fx/qmlgraphicsflickable.cpp +++ b/src/declarative/fx/qmlgraphicsflickable.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qmlgraphicsflickable.h" #include "qmlgraphicsflickable_p.h" +#include "qmlgraphicsflickable_p_p.h" #include #include @@ -1280,4 +1280,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QmlGraphicsFlickableVisibleArea) QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,VisibleArea,QmlGraphicsFlickableVisibleArea) -#include "qfxflickable.moc" +#include "qmlgraphicsflickable.moc" diff --git a/src/declarative/fx/qmlgraphicsflickable.h b/src/declarative/fx/qmlgraphicsflickable.h deleted file mode 100644 index f7ef0088..0000000 --- a/src/declarative/fx/qmlgraphicsflickable.h +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSFLICKABLE_H -#define QMLGRAPHICSFLICKABLE_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsFlickablePrivate; -class QmlGraphicsFlickableVisibleArea; -class Q_DECLARATIVE_EXPORT QmlGraphicsFlickable : public QmlGraphicsItem -{ - Q_OBJECT - - Q_PROPERTY(qreal viewportWidth READ viewportWidth WRITE setViewportWidth NOTIFY viewportWidthChanged) - Q_PROPERTY(qreal viewportHeight READ viewportHeight WRITE setViewportHeight NOTIFY viewportHeightChanged) - Q_PROPERTY(qreal viewportX READ viewportX WRITE setViewportX NOTIFY positionXChanged) - Q_PROPERTY(qreal viewportY READ viewportY WRITE setViewportY NOTIFY positionYChanged) - - Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged) - Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged) - Q_PROPERTY(qreal reportedVelocitySmoothing READ reportedVelocitySmoothing WRITE setReportedVelocitySmoothing NOTIFY reportedVelocitySmoothingChanged) - - Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot) - Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity) - Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration) - Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged) - Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged) - - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive) - Q_PROPERTY(int pressDelay READ pressDelay WRITE setPressDelay) - - Q_PROPERTY(bool atXEnd READ isAtXEnd NOTIFY isAtBoundaryChanged) - Q_PROPERTY(bool atYEnd READ isAtYEnd NOTIFY isAtBoundaryChanged) - Q_PROPERTY(bool atXBeginning READ isAtXBeginning NOTIFY isAtBoundaryChanged) - Q_PROPERTY(bool atYBeginning READ isAtYBeginning NOTIFY isAtBoundaryChanged) - - Q_PROPERTY(QmlGraphicsFlickableVisibleArea *visibleArea READ visibleArea CONSTANT) - - Q_PROPERTY(QmlList* flickableData READ flickableData) - Q_PROPERTY(QmlList* flickableChildren READ flickableChildren) - Q_CLASSINFO("DefaultProperty", "flickableData") - -public: - QmlGraphicsFlickable(QmlGraphicsItem *parent=0); - ~QmlGraphicsFlickable(); - - QmlList *flickableData(); - QmlList *flickableChildren(); - - bool overShoot() const; - void setOverShoot(bool); - - qreal viewportWidth() const; - void setViewportWidth(qreal); - - qreal viewportHeight() const; - void setViewportHeight(qreal); - - qreal viewportX() const; - void setViewportX(qreal pos); - - qreal viewportY() const; - void setViewportY(qreal pos); - - bool isMoving() const; - bool isFlicking() const; - - int pressDelay() const; - void setPressDelay(int delay); - - qreal reportedVelocitySmoothing() const; - void setReportedVelocitySmoothing(qreal); - - qreal maximumFlickVelocity() const; - void setMaximumFlickVelocity(qreal); - - qreal flickDeceleration() const; - void setFlickDeceleration(qreal); - - bool isInteractive() const; - void setInteractive(bool); - - qreal horizontalVelocity() const; - qreal verticalVelocity() const; - - bool isAtXEnd() const; - bool isAtXBeginning() const; - bool isAtYEnd() const; - bool isAtYBeginning() const; - - QmlGraphicsItem *viewport(); - -Q_SIGNALS: - void viewportWidthChanged(); - void viewportHeightChanged(); - void positionXChanged(); - void positionYChanged(); - void movingChanged(); - void flickingChanged(); - void movementStarted(); - void movementEnded(); - void flickStarted(); - void flickEnded(); - void reportedVelocitySmoothingChanged(int); - void horizontalVelocityChanged(); - void verticalVelocityChanged(); - void isAtBoundaryChanged(); - void pageChanged(); - -protected: - virtual bool sceneEventFilter(QGraphicsItem *, QEvent *); - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void timerEvent(QTimerEvent *event); - - qreal visibleX() const; - qreal visibleY() const; - - QmlGraphicsFlickableVisibleArea *visibleArea(); - -protected Q_SLOTS: - virtual void ticked(); - void movementStarting(); - void movementEnding(); - void heightChange(); - void widthChange(); - -protected: - virtual qreal minXExtent() const; - virtual qreal minYExtent() const; - virtual qreal maxXExtent() const; - virtual qreal maxYExtent() const; - qreal vWidth() const; - qreal vHeight() const; - virtual void viewportMoved(); - bool sendMouseEvent(QGraphicsSceneMouseEvent *event); - - bool xflick() const; - bool yflick() const; - void cancelFlick(); - -protected: - QmlGraphicsFlickable(QmlGraphicsFlickablePrivate &dd, QmlGraphicsItem *parent); - -private: - Q_DISABLE_COPY(QmlGraphicsFlickable) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsFlickable) - friend class QmlGraphicsFlickableVisibleArea; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsFlickable) - -QT_END_HEADER - -#endif diff --git a/src/declarative/fx/qmlgraphicsflickable_p.h b/src/declarative/fx/qmlgraphicsflickable_p.h index d9f917d..f7ef0088 100644 --- a/src/declarative/fx/qmlgraphicsflickable_p.h +++ b/src/declarative/fx/qmlgraphicsflickable_p.h @@ -39,118 +39,165 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSFLICKABLE_P_H -#define QMLGRAPHICSFLICKABLE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qdatetime.h" -#include "qmlgraphicsflickable.h" -#include "qmlgraphicsitem_p.h" -#include "qml.h" -#include "private/qmltimeline_p.h" -#include "private/qmlanimation_p.h" +#ifndef QMLGRAPHICSFLICKABLE_H +#define QMLGRAPHICSFLICKABLE_H + +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +QT_MODULE(Declarative) + +class QmlGraphicsFlickablePrivate; class QmlGraphicsFlickableVisibleArea; -class QmlGraphicsFlickablePrivate : public QmlGraphicsItemPrivate +class Q_DECLARATIVE_EXPORT QmlGraphicsFlickable : public QmlGraphicsItem { - Q_DECLARE_PUBLIC(QmlGraphicsFlickable) + Q_OBJECT -public: - QmlGraphicsFlickablePrivate(); - void init(); - virtual void flickX(qreal velocity); - virtual void flickY(qreal velocity); - virtual void fixupX(); - virtual void fixupY(); - void updateBeginningEnd(); + Q_PROPERTY(qreal viewportWidth READ viewportWidth WRITE setViewportWidth NOTIFY viewportWidthChanged) + Q_PROPERTY(qreal viewportHeight READ viewportHeight WRITE setViewportHeight NOTIFY viewportHeightChanged) + Q_PROPERTY(qreal viewportX READ viewportX WRITE setViewportX NOTIFY positionXChanged) + Q_PROPERTY(qreal viewportY READ viewportY WRITE setViewportY NOTIFY positionYChanged) + + Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged) + Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged) + Q_PROPERTY(qreal reportedVelocitySmoothing READ reportedVelocitySmoothing WRITE setReportedVelocitySmoothing NOTIFY reportedVelocitySmoothingChanged) + + Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot) + Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity) + Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration) + Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged) + Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged) + + Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive) + Q_PROPERTY(int pressDelay READ pressDelay WRITE setPressDelay) + + Q_PROPERTY(bool atXEnd READ isAtXEnd NOTIFY isAtBoundaryChanged) + Q_PROPERTY(bool atYEnd READ isAtYEnd NOTIFY isAtBoundaryChanged) + Q_PROPERTY(bool atXBeginning READ isAtXBeginning NOTIFY isAtBoundaryChanged) + Q_PROPERTY(bool atYBeginning READ isAtYBeginning NOTIFY isAtBoundaryChanged) + + Q_PROPERTY(QmlGraphicsFlickableVisibleArea *visibleArea READ visibleArea CONSTANT) - void captureDelayedPress(QGraphicsSceneMouseEvent *event); - void clearDelayedPress(); + Q_PROPERTY(QmlList* flickableData READ flickableData) + Q_PROPERTY(QmlList* flickableChildren READ flickableChildren) + Q_CLASSINFO("DefaultProperty", "flickableData") public: - QmlGraphicsItem *viewport; - QmlTimeLineValueProxy _moveX; - QmlTimeLineValueProxy _moveY; - QmlTimeLine timeline; - qreal vWidth; - qreal vHeight; - bool overShoot : 1; - bool flicked : 1; - bool moving : 1; - bool stealMouse : 1; - bool pressed : 1; - bool atXEnd : 1; - bool atXBeginning : 1; - bool atYEnd : 1; - bool atYBeginning : 1; - bool interactive : 1; - QTime lastPosTime; - QPointF lastPos; - QPointF pressPos; - qreal pressX; - qreal pressY; - qreal velocityX; - qreal velocityY; - QTime pressTime; - QmlTimeLineEvent fixupXEvent; - QmlTimeLineEvent fixupYEvent; - qreal deceleration; - qreal maxVelocity; - QTime velocityTime; - QPointF lastFlickablePosition; - qreal reportedVelocitySmoothing; - int flickTargetX; - int flickTargetY; - QGraphicsSceneMouseEvent *delayedPressEvent; - QGraphicsItem *delayedPressTarget; - QBasicTimer delayedPressTimer; - int pressDelay; - - void updateVelocity(); - struct Velocity : public QmlTimeLineValue - { - Velocity(QmlGraphicsFlickablePrivate *p) - : parent(p) {} - virtual void setValue(qreal v) { - QmlTimeLineValue::setValue(v); - parent->updateVelocity(); - } - QmlGraphicsFlickablePrivate *parent; - }; - Velocity horizontalVelocity; - Velocity verticalVelocity; - int vTime; - QmlTimeLine velocityTimeline; - QmlGraphicsFlickableVisibleArea *visibleArea; - - void handleMousePressEvent(QGraphicsSceneMouseEvent *); - void handleMouseMoveEvent(QGraphicsSceneMouseEvent *); - void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *); - - // flickableData property - void data_removeAt(int); - int data_count() const; - void data_append(QObject *); - void data_insert(int, QObject *); - QObject *data_at(int) const; - void data_clear(); + QmlGraphicsFlickable(QmlGraphicsItem *parent=0); + ~QmlGraphicsFlickable(); + + QmlList *flickableData(); + QmlList *flickableChildren(); + + bool overShoot() const; + void setOverShoot(bool); + + qreal viewportWidth() const; + void setViewportWidth(qreal); + + qreal viewportHeight() const; + void setViewportHeight(qreal); + + qreal viewportX() const; + void setViewportX(qreal pos); + + qreal viewportY() const; + void setViewportY(qreal pos); + + bool isMoving() const; + bool isFlicking() const; + + int pressDelay() const; + void setPressDelay(int delay); + qreal reportedVelocitySmoothing() const; + void setReportedVelocitySmoothing(qreal); + + qreal maximumFlickVelocity() const; + void setMaximumFlickVelocity(qreal); + + qreal flickDeceleration() const; + void setFlickDeceleration(qreal); + + bool isInteractive() const; + void setInteractive(bool); + + qreal horizontalVelocity() const; + qreal verticalVelocity() const; + + bool isAtXEnd() const; + bool isAtXBeginning() const; + bool isAtYEnd() const; + bool isAtYBeginning() const; + + QmlGraphicsItem *viewport(); + +Q_SIGNALS: + void viewportWidthChanged(); + void viewportHeightChanged(); + void positionXChanged(); + void positionYChanged(); + void movingChanged(); + void flickingChanged(); + void movementStarted(); + void movementEnded(); + void flickStarted(); + void flickEnded(); + void reportedVelocitySmoothingChanged(int); + void horizontalVelocityChanged(); + void verticalVelocityChanged(); + void isAtBoundaryChanged(); + void pageChanged(); + +protected: + virtual bool sceneEventFilter(QGraphicsItem *, QEvent *); + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void timerEvent(QTimerEvent *event); + + qreal visibleX() const; + qreal visibleY() const; + + QmlGraphicsFlickableVisibleArea *visibleArea(); + +protected Q_SLOTS: + virtual void ticked(); + void movementStarting(); + void movementEnding(); + void heightChange(); + void widthChange(); + +protected: + virtual qreal minXExtent() const; + virtual qreal minYExtent() const; + virtual qreal maxXExtent() const; + virtual qreal maxYExtent() const; + qreal vWidth() const; + qreal vHeight() const; + virtual void viewportMoved(); + bool sendMouseEvent(QGraphicsSceneMouseEvent *event); + + bool xflick() const; + bool yflick() const; + void cancelFlick(); + +protected: + QmlGraphicsFlickable(QmlGraphicsFlickablePrivate &dd, QmlGraphicsItem *parent); + +private: + Q_DISABLE_COPY(QmlGraphicsFlickable) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsFlickable) friend class QmlGraphicsFlickableVisibleArea; - QML_DECLARE_LIST_PROXY(QmlGraphicsFlickablePrivate, QObject *, data) }; QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlGraphicsFlickable) + +QT_END_HEADER + #endif diff --git a/src/declarative/fx/qmlgraphicsflickable_p_p.h b/src/declarative/fx/qmlgraphicsflickable_p_p.h new file mode 100644 index 0000000..6b8bf9f --- /dev/null +++ b/src/declarative/fx/qmlgraphicsflickable_p_p.h @@ -0,0 +1,156 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSFLICKABLE_P_H +#define QMLGRAPHICSFLICKABLE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qdatetime.h" +#include "qmlgraphicsflickable_p.h" +#include "qmlgraphicsitem_p.h" +#include "qml.h" +#include "private/qmltimeline_p_p.h" +#include "private/qmlanimation_p_p.h" + +QT_BEGIN_NAMESPACE + +class QmlGraphicsFlickableVisibleArea; +class QmlGraphicsFlickablePrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsFlickable) + +public: + QmlGraphicsFlickablePrivate(); + void init(); + virtual void flickX(qreal velocity); + virtual void flickY(qreal velocity); + virtual void fixupX(); + virtual void fixupY(); + void updateBeginningEnd(); + + void captureDelayedPress(QGraphicsSceneMouseEvent *event); + void clearDelayedPress(); + +public: + QmlGraphicsItem *viewport; + QmlTimeLineValueProxy _moveX; + QmlTimeLineValueProxy _moveY; + QmlTimeLine timeline; + qreal vWidth; + qreal vHeight; + bool overShoot : 1; + bool flicked : 1; + bool moving : 1; + bool stealMouse : 1; + bool pressed : 1; + bool atXEnd : 1; + bool atXBeginning : 1; + bool atYEnd : 1; + bool atYBeginning : 1; + bool interactive : 1; + QTime lastPosTime; + QPointF lastPos; + QPointF pressPos; + qreal pressX; + qreal pressY; + qreal velocityX; + qreal velocityY; + QTime pressTime; + QmlTimeLineEvent fixupXEvent; + QmlTimeLineEvent fixupYEvent; + qreal deceleration; + qreal maxVelocity; + QTime velocityTime; + QPointF lastFlickablePosition; + qreal reportedVelocitySmoothing; + int flickTargetX; + int flickTargetY; + QGraphicsSceneMouseEvent *delayedPressEvent; + QGraphicsItem *delayedPressTarget; + QBasicTimer delayedPressTimer; + int pressDelay; + + void updateVelocity(); + struct Velocity : public QmlTimeLineValue + { + Velocity(QmlGraphicsFlickablePrivate *p) + : parent(p) {} + virtual void setValue(qreal v) { + QmlTimeLineValue::setValue(v); + parent->updateVelocity(); + } + QmlGraphicsFlickablePrivate *parent; + }; + Velocity horizontalVelocity; + Velocity verticalVelocity; + int vTime; + QmlTimeLine velocityTimeline; + QmlGraphicsFlickableVisibleArea *visibleArea; + + void handleMousePressEvent(QGraphicsSceneMouseEvent *); + void handleMouseMoveEvent(QGraphicsSceneMouseEvent *); + void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *); + + // flickableData property + void data_removeAt(int); + int data_count() const; + void data_append(QObject *); + void data_insert(int, QObject *); + QObject *data_at(int) const; + void data_clear(); + + friend class QmlGraphicsFlickableVisibleArea; + QML_DECLARE_LIST_PROXY(QmlGraphicsFlickablePrivate, QObject *, data) +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/fx/qmlgraphicsflipable.cpp b/src/declarative/fx/qmlgraphicsflipable.cpp index 4df35f1..bec39ac 100644 --- a/src/declarative/fx/qmlgraphicsflipable.cpp +++ b/src/declarative/fx/qmlgraphicsflipable.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlgraphicsflipable.h" +#include "qmlgraphicsflipable_p.h" #include "private/qmlgraphicsitem_p.h" #include "QtGui/qgraphicstransform.h" #include @@ -232,5 +232,3 @@ void QmlGraphicsFlipablePrivate::updateSceneTransformFromParent() } QT_END_NAMESPACE - -#include "moc_qmlgraphicsflipable.cpp" diff --git a/src/declarative/fx/qmlgraphicsflipable.h b/src/declarative/fx/qmlgraphicsflipable.h deleted file mode 100644 index 7f92d65..0000000 --- a/src/declarative/fx/qmlgraphicsflipable.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSFLIPABLE_H -#define QMLGRAPHICSFLIPABLE_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsFlipablePrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsFlipable : public QmlGraphicsItem -{ - Q_OBJECT - - Q_ENUMS(Side) - Q_PROPERTY(QmlGraphicsItem *front READ front WRITE setFront) - Q_PROPERTY(QmlGraphicsItem *back READ back WRITE setBack) - Q_PROPERTY(Side side READ side NOTIFY sideChanged) - //### flipAxis - //### flipRotation -public: - QmlGraphicsFlipable(QmlGraphicsItem *parent=0); - ~QmlGraphicsFlipable(); - - QmlGraphicsItem *front(); - void setFront(QmlGraphicsItem *); - - QmlGraphicsItem *back(); - void setBack(QmlGraphicsItem *); - - enum Side { Front, Back }; - Side side() const; - -Q_SIGNALS: - void sideChanged(); - -private: - Q_DISABLE_COPY(QmlGraphicsFlipable) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsFlipable) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsFlipable) - -QT_END_HEADER - -#endif // QMLGRAPHICSFLIPABLE_H diff --git a/src/declarative/fx/qmlgraphicsflipable_p.h b/src/declarative/fx/qmlgraphicsflipable_p.h new file mode 100644 index 0000000..7f92d65 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsflipable_p.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSFLIPABLE_H +#define QMLGRAPHICSFLIPABLE_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlGraphicsFlipablePrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsFlipable : public QmlGraphicsItem +{ + Q_OBJECT + + Q_ENUMS(Side) + Q_PROPERTY(QmlGraphicsItem *front READ front WRITE setFront) + Q_PROPERTY(QmlGraphicsItem *back READ back WRITE setBack) + Q_PROPERTY(Side side READ side NOTIFY sideChanged) + //### flipAxis + //### flipRotation +public: + QmlGraphicsFlipable(QmlGraphicsItem *parent=0); + ~QmlGraphicsFlipable(); + + QmlGraphicsItem *front(); + void setFront(QmlGraphicsItem *); + + QmlGraphicsItem *back(); + void setBack(QmlGraphicsItem *); + + enum Side { Front, Back }; + Side side() const; + +Q_SIGNALS: + void sideChanged(); + +private: + Q_DISABLE_COPY(QmlGraphicsFlipable) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsFlipable) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsFlipable) + +QT_END_HEADER + +#endif // QMLGRAPHICSFLIPABLE_H diff --git a/src/declarative/fx/qmlgraphicsfocuspanel.cpp b/src/declarative/fx/qmlgraphicsfocuspanel.cpp index db8fcdb..8de8832 100644 --- a/src/declarative/fx/qmlgraphicsfocuspanel.cpp +++ b/src/declarative/fx/qmlgraphicsfocuspanel.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlgraphicsfocuspanel.h" +#include "qmlgraphicsfocuspanel_p.h" #include #include diff --git a/src/declarative/fx/qmlgraphicsfocuspanel.h b/src/declarative/fx/qmlgraphicsfocuspanel.h deleted file mode 100644 index 2c4f792..0000000 --- a/src/declarative/fx/qmlgraphicsfocuspanel.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSFOCUSPANEL_H -#define QMLGRAPHICSFOCUSPANEL_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class Q_DECLARATIVE_EXPORT QmlGraphicsFocusPanel : public QmlGraphicsItem -{ - Q_OBJECT - Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged) -public: - QmlGraphicsFocusPanel(QmlGraphicsItem *parent=0); - virtual ~QmlGraphicsFocusPanel(); - -Q_SIGNALS: - void activeChanged(); - -protected: - bool sceneEvent(QEvent *event); - -private: - Q_DISABLE_COPY(QmlGraphicsFocusPanel) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsFocusPanel) - -QT_END_HEADER - -#endif // QMLGRAPHICSFOCUSPANEL_H diff --git a/src/declarative/fx/qmlgraphicsfocuspanel_p.h b/src/declarative/fx/qmlgraphicsfocuspanel_p.h new file mode 100644 index 0000000..2c4f792 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsfocuspanel_p.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSFOCUSPANEL_H +#define QMLGRAPHICSFOCUSPANEL_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class Q_DECLARATIVE_EXPORT QmlGraphicsFocusPanel : public QmlGraphicsItem +{ + Q_OBJECT + Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged) +public: + QmlGraphicsFocusPanel(QmlGraphicsItem *parent=0); + virtual ~QmlGraphicsFocusPanel(); + +Q_SIGNALS: + void activeChanged(); + +protected: + bool sceneEvent(QEvent *event); + +private: + Q_DISABLE_COPY(QmlGraphicsFocusPanel) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsFocusPanel) + +QT_END_HEADER + +#endif // QMLGRAPHICSFOCUSPANEL_H diff --git a/src/declarative/fx/qmlgraphicsfocusscope.cpp b/src/declarative/fx/qmlgraphicsfocusscope.cpp index e957085..e7b01b0 100644 --- a/src/declarative/fx/qmlgraphicsfocusscope.cpp +++ b/src/declarative/fx/qmlgraphicsfocusscope.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlgraphicsfocusscope.h" +#include "qmlgraphicsfocusscope_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/fx/qmlgraphicsfocusscope.h b/src/declarative/fx/qmlgraphicsfocusscope.h deleted file mode 100644 index 28d1f4f..0000000 --- a/src/declarative/fx/qmlgraphicsfocusscope.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSFOCUSSCOPE_H -#define QMLGRAPHICSFOCUSSCOPE_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -//### set component root as focusscope -class Q_DECLARATIVE_EXPORT QmlGraphicsFocusScope : public QmlGraphicsItem -{ - Q_OBJECT -public: - QmlGraphicsFocusScope(QmlGraphicsItem *parent=0); - virtual ~QmlGraphicsFocusScope(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsFocusScope) - -QT_END_HEADER - -#endif // QMLGRAPHICSFOCUSSCOPE_H diff --git a/src/declarative/fx/qmlgraphicsfocusscope_p.h b/src/declarative/fx/qmlgraphicsfocusscope_p.h new file mode 100644 index 0000000..28d1f4f --- /dev/null +++ b/src/declarative/fx/qmlgraphicsfocusscope_p.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSFOCUSSCOPE_H +#define QMLGRAPHICSFOCUSSCOPE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +//### set component root as focusscope +class Q_DECLARATIVE_EXPORT QmlGraphicsFocusScope : public QmlGraphicsItem +{ + Q_OBJECT +public: + QmlGraphicsFocusScope(QmlGraphicsItem *parent=0); + virtual ~QmlGraphicsFocusScope(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsFocusScope) + +QT_END_HEADER + +#endif // QMLGRAPHICSFOCUSSCOPE_H diff --git a/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer.cpp b/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer.cpp index 87193cd..e1f16d5 100644 --- a/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer.cpp +++ b/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlgraphicsgraphicsobjectcontainer.h" +#include "qmlgraphicsgraphicsobjectcontainer_p.h" #include #include #include @@ -225,6 +225,6 @@ void QmlGraphicsGraphicsObjectContainerPrivate::_q_updateSize() }*/ } -QT_END_NAMESPACE +#include "moc_qmlgraphicsgraphicsobjectcontainer_p.cpp" -#include "moc_qmlgraphicsgraphicsobjectcontainer.cpp" +QT_END_NAMESPACE diff --git a/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer.h b/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer.h deleted file mode 100644 index 0189e2f..0000000 --- a/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSGRAPHICSOBJECTCONTAINER_H -#define QMLGRAPHICSGRAPHICSOBJECTCONTAINER_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QGraphicsObject; -class QmlGraphicsGraphicsObjectContainerPrivate; - -class Q_DECLARATIVE_EXPORT QmlGraphicsGraphicsObjectContainer : public QmlGraphicsItem -{ - Q_OBJECT - - Q_CLASSINFO("DefaultProperty", "graphicsObject") - Q_PROPERTY(QGraphicsObject *graphicsObject READ graphicsObject WRITE setGraphicsObject) - Q_PROPERTY(bool synchronizedResizing READ synchronizedResizing WRITE setSynchronizedResizing) - -public: - QmlGraphicsGraphicsObjectContainer(QmlGraphicsItem *parent = 0); - ~QmlGraphicsGraphicsObjectContainer(); - - QGraphicsObject *graphicsObject() const; - void setGraphicsObject(QGraphicsObject *); - - bool synchronizedResizing() const; - void setSynchronizedResizing(bool on); - -protected: - QVariant itemChange(GraphicsItemChange change, const QVariant &value); - bool eventFilter(QObject *watched, QEvent *e); - -private: - Q_PRIVATE_SLOT(d_func(), void _q_updateSize()) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsGraphicsObjectContainer) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QGraphicsObject) -QML_DECLARE_TYPE(QmlGraphicsGraphicsObjectContainer) - -QT_END_HEADER - -#endif // QMLGRAPHICSGRAPHICSOBJECTCONTAINER_H diff --git a/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer_p.h b/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer_p.h new file mode 100644 index 0000000..0189e2f --- /dev/null +++ b/src/declarative/fx/qmlgraphicsgraphicsobjectcontainer_p.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSGRAPHICSOBJECTCONTAINER_H +#define QMLGRAPHICSGRAPHICSOBJECTCONTAINER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QGraphicsObject; +class QmlGraphicsGraphicsObjectContainerPrivate; + +class Q_DECLARATIVE_EXPORT QmlGraphicsGraphicsObjectContainer : public QmlGraphicsItem +{ + Q_OBJECT + + Q_CLASSINFO("DefaultProperty", "graphicsObject") + Q_PROPERTY(QGraphicsObject *graphicsObject READ graphicsObject WRITE setGraphicsObject) + Q_PROPERTY(bool synchronizedResizing READ synchronizedResizing WRITE setSynchronizedResizing) + +public: + QmlGraphicsGraphicsObjectContainer(QmlGraphicsItem *parent = 0); + ~QmlGraphicsGraphicsObjectContainer(); + + QGraphicsObject *graphicsObject() const; + void setGraphicsObject(QGraphicsObject *); + + bool synchronizedResizing() const; + void setSynchronizedResizing(bool on); + +protected: + QVariant itemChange(GraphicsItemChange change, const QVariant &value); + bool eventFilter(QObject *watched, QEvent *e); + +private: + Q_PRIVATE_SLOT(d_func(), void _q_updateSize()) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsGraphicsObjectContainer) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QGraphicsObject) +QML_DECLARE_TYPE(QmlGraphicsGraphicsObjectContainer) + +QT_END_HEADER + +#endif // QMLGRAPHICSGRAPHICSOBJECTCONTAINER_H diff --git a/src/declarative/fx/qmlgraphicsgridview.cpp b/src/declarative/fx/qmlgraphicsgridview.cpp index d512b8c..c191a84 100644 --- a/src/declarative/fx/qmlgraphicsgridview.cpp +++ b/src/declarative/fx/qmlgraphicsgridview.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "qmlgraphicsvisualitemmodel.h" -#include "qlistmodelinterface.h" -#include "qmleasefollow.h" -#include "private/qmlgraphicsflickable_p.h" -#include "qmlgraphicsgridview.h" +#include "qmlgraphicsgridview_p.h" +#include +#include +#include +#include #include @@ -1582,4 +1582,4 @@ QML_DEFINE_TYPE(Qt, 4,6, (QT_VERSION&0x00ff00)>>8, GridView, QmlGraphicsGridView QT_END_NAMESPACE -#include "qfxgridview.moc" +#include "qmlgraphicsgridview.moc" diff --git a/src/declarative/fx/qmlgraphicsgridview.h b/src/declarative/fx/qmlgraphicsgridview.h deleted file mode 100644 index 1582529..0000000 --- a/src/declarative/fx/qmlgraphicsgridview.h +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSGRIDVIEW_H -#define QMLGRAPHICSGRIDVIEW_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) -class QmlGraphicsVisualModel; -class QmlGraphicsGridViewAttached; -class QmlGraphicsGridViewPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsGridView : public QmlGraphicsFlickable -{ - Q_OBJECT - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsGridView) - - Q_PROPERTY(QVariant model READ model WRITE setModel) - Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) - Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) - Q_PROPERTY(QmlGraphicsItem *currentItem READ currentItem NOTIFY currentIndexChanged) - Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_PROPERTY(QmlComponent *highlight READ highlight WRITE setHighlight) - Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem) - Q_PROPERTY(Flow flow READ flow WRITE setFlow) - Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled) - Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer) - Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged) - Q_PROPERTY(int cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged) - Q_CLASSINFO("DefaultProperty", "data") - -public: - QmlGraphicsGridView(QmlGraphicsItem *parent=0); - ~QmlGraphicsGridView(); - - QVariant model() const; - void setModel(const QVariant &); - - QmlComponent *delegate() const; - void setDelegate(QmlComponent *); - - int currentIndex() const; - void setCurrentIndex(int idx); - - QmlGraphicsItem *currentItem(); - int count() const; - - QmlComponent *highlight() const; - void setHighlight(QmlComponent *highlight); - - bool highlightFollowsCurrentItem() const; - void setHighlightFollowsCurrentItem(bool); - - Q_ENUMS(Flow) - enum Flow { LeftToRight, TopToBottom }; - Flow flow() const; - void setFlow(Flow); - - bool isWrapEnabled() const; - void setWrapEnabled(bool); - - int cacheBuffer() const; - void setCacheBuffer(int); - - int cellWidth() const; - void setCellWidth(int); - - int cellHeight() const; - void setCellHeight(int); - - static QmlGraphicsGridViewAttached *qmlAttachedProperties(QObject *); - -public Q_SLOTS: - void moveCurrentIndexUp(); - void moveCurrentIndexDown(); - void moveCurrentIndexLeft(); - void moveCurrentIndexRight(); - -Q_SIGNALS: - void countChanged(); - void currentIndexChanged(); - void cellWidthChanged(); - void cellHeightChanged(); - -protected: - virtual void viewportMoved(); - virtual qreal minYExtent() const; - virtual qreal maxYExtent() const; - virtual qreal minXExtent() const; - virtual qreal maxXExtent() const; - virtual void keyPressEvent(QKeyEvent *); - virtual void componentComplete(); - -private Q_SLOTS: - void trackedPositionChanged(); - void itemsInserted(int index, int count); - void itemsRemoved(int index, int count); - void itemsMoved(int from, int to, int count); - void destroyRemoved(); - void createdItem(int index, QmlGraphicsItem *item); - void destroyingItem(QmlGraphicsItem *item); - void sizeChange(); - -private: - void refill(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsGridView) -QML_DECLARE_TYPEINFO(QmlGraphicsGridView, QML_HAS_ATTACHED_PROPERTIES) - -QT_END_HEADER - -#endif diff --git a/src/declarative/fx/qmlgraphicsgridview_p.h b/src/declarative/fx/qmlgraphicsgridview_p.h new file mode 100644 index 0000000..d1aebf5 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsgridview_p.h @@ -0,0 +1,157 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSGRIDVIEW_H +#define QMLGRAPHICSGRIDVIEW_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) +class QmlGraphicsVisualModel; +class QmlGraphicsGridViewAttached; +class QmlGraphicsGridViewPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsGridView : public QmlGraphicsFlickable +{ + Q_OBJECT + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsGridView) + + Q_PROPERTY(QVariant model READ model WRITE setModel) + Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) + Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) + Q_PROPERTY(QmlGraphicsItem *currentItem READ currentItem NOTIFY currentIndexChanged) + Q_PROPERTY(int count READ count NOTIFY countChanged) + Q_PROPERTY(QmlComponent *highlight READ highlight WRITE setHighlight) + Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem) + Q_PROPERTY(Flow flow READ flow WRITE setFlow) + Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled) + Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer) + Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged) + Q_PROPERTY(int cellHeight READ cellHeight WRITE setCellHeight NOTIFY cellHeightChanged) + Q_CLASSINFO("DefaultProperty", "data") + +public: + QmlGraphicsGridView(QmlGraphicsItem *parent=0); + ~QmlGraphicsGridView(); + + QVariant model() const; + void setModel(const QVariant &); + + QmlComponent *delegate() const; + void setDelegate(QmlComponent *); + + int currentIndex() const; + void setCurrentIndex(int idx); + + QmlGraphicsItem *currentItem(); + int count() const; + + QmlComponent *highlight() const; + void setHighlight(QmlComponent *highlight); + + bool highlightFollowsCurrentItem() const; + void setHighlightFollowsCurrentItem(bool); + + Q_ENUMS(Flow) + enum Flow { LeftToRight, TopToBottom }; + Flow flow() const; + void setFlow(Flow); + + bool isWrapEnabled() const; + void setWrapEnabled(bool); + + int cacheBuffer() const; + void setCacheBuffer(int); + + int cellWidth() const; + void setCellWidth(int); + + int cellHeight() const; + void setCellHeight(int); + + static QmlGraphicsGridViewAttached *qmlAttachedProperties(QObject *); + +public Q_SLOTS: + void moveCurrentIndexUp(); + void moveCurrentIndexDown(); + void moveCurrentIndexLeft(); + void moveCurrentIndexRight(); + +Q_SIGNALS: + void countChanged(); + void currentIndexChanged(); + void cellWidthChanged(); + void cellHeightChanged(); + +protected: + virtual void viewportMoved(); + virtual qreal minYExtent() const; + virtual qreal maxYExtent() const; + virtual qreal minXExtent() const; + virtual qreal maxXExtent() const; + virtual void keyPressEvent(QKeyEvent *); + virtual void componentComplete(); + +private Q_SLOTS: + void trackedPositionChanged(); + void itemsInserted(int index, int count); + void itemsRemoved(int index, int count); + void itemsMoved(int from, int to, int count); + void destroyRemoved(); + void createdItem(int index, QmlGraphicsItem *item); + void destroyingItem(QmlGraphicsItem *item); + void sizeChange(); + +private: + void refill(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsGridView) +QML_DECLARE_TYPEINFO(QmlGraphicsGridView, QML_HAS_ATTACHED_PROPERTIES) + +QT_END_HEADER + +#endif diff --git a/src/declarative/fx/qmlgraphicsimage.cpp b/src/declarative/fx/qmlgraphicsimage.cpp index a6156ce..bc0db30 100644 --- a/src/declarative/fx/qmlgraphicsimage.cpp +++ b/src/declarative/fx/qmlgraphicsimage.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qmlgraphicsimage.h" #include "qmlgraphicsimage_p.h" +#include "qmlgraphicsimage_p_p.h" #include #include diff --git a/src/declarative/fx/qmlgraphicsimage.h b/src/declarative/fx/qmlgraphicsimage.h deleted file mode 100644 index 167ecd4..0000000 --- a/src/declarative/fx/qmlgraphicsimage.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSIMAGE_H -#define QMLGRAPHICSIMAGE_H - -#include -#include "qmlgraphicsimagebase.h" - -QT_BEGIN_HEADER -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsImagePrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsImage : public QmlGraphicsImageBase -{ - Q_OBJECT - Q_ENUMS(FillMode) - - Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap DESIGNABLE false) - Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged) - -public: - QmlGraphicsImage(QmlGraphicsItem *parent=0); - ~QmlGraphicsImage(); - - enum FillMode { Stretch, PreserveAspectFit, PreserveAspectCrop, Tile, TileVertically, TileHorizontally }; - FillMode fillMode() const; - void setFillMode(FillMode); - - QPixmap pixmap() const; - void setPixmap(const QPixmap &); - - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); - -Q_SIGNALS: - void fillModeChanged(); - -protected: - QmlGraphicsImage(QmlGraphicsImagePrivate &dd, QmlGraphicsItem *parent); - -private: - Q_DISABLE_COPY(QmlGraphicsImage) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsImage) -}; - -QT_END_NAMESPACE -QML_DECLARE_TYPE(QmlGraphicsImage) -QT_END_HEADER - -#endif // QMLGRAPHICSIMAGE_H diff --git a/src/declarative/fx/qmlgraphicsimage_p.h b/src/declarative/fx/qmlgraphicsimage_p.h index c5bcf8e..0a00e99 100644 --- a/src/declarative/fx/qmlgraphicsimage_p.h +++ b/src/declarative/fx/qmlgraphicsimage_p.h @@ -39,39 +39,52 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSIMAGE_P_H -#define QMLGRAPHICSIMAGE_P_H +#ifndef QMLGRAPHICSIMAGE_H +#define QMLGRAPHICSIMAGE_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qmlgraphicsitem_p.h" +#include #include "qmlgraphicsimagebase_p.h" +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlGraphicsImagePrivate : public QmlGraphicsImageBasePrivate +QT_MODULE(Declarative) + +class QmlGraphicsImagePrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsImage : public QmlGraphicsImageBase { - Q_DECLARE_PUBLIC(QmlGraphicsImage) + Q_OBJECT + Q_ENUMS(FillMode) + + Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap DESIGNABLE false) + Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged) public: - QmlGraphicsImagePrivate() - : fillMode(QmlGraphicsImage::Stretch) - { - } + QmlGraphicsImage(QmlGraphicsItem *parent=0); + ~QmlGraphicsImage(); + + enum FillMode { Stretch, PreserveAspectFit, PreserveAspectCrop, Tile, TileVertically, TileHorizontally }; + FillMode fillMode() const; + void setFillMode(FillMode); + + QPixmap pixmap() const; + void setPixmap(const QPixmap &); + + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + +Q_SIGNALS: + void fillModeChanged(); - QmlGraphicsImage::FillMode fillMode; +protected: + QmlGraphicsImage(QmlGraphicsImagePrivate &dd, QmlGraphicsItem *parent); +private: + Q_DISABLE_COPY(QmlGraphicsImage) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsImage) }; QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlGraphicsImage) +QT_END_HEADER -#endif // QMLGRAPHICSIMAGE_P_H +#endif // QMLGRAPHICSIMAGE_H diff --git a/src/declarative/fx/qmlgraphicsimage_p_p.h b/src/declarative/fx/qmlgraphicsimage_p_p.h new file mode 100644 index 0000000..51c6096 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsimage_p_p.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSIMAGE_P_H +#define QMLGRAPHICSIMAGE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlgraphicsitem_p.h" +#include "qmlgraphicsimagebase_p_p.h" + +QT_BEGIN_NAMESPACE + +class QmlGraphicsImagePrivate : public QmlGraphicsImageBasePrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsImage) + +public: + QmlGraphicsImagePrivate() + : fillMode(QmlGraphicsImage::Stretch) + { + } + + QmlGraphicsImage::FillMode fillMode; + +}; + +QT_END_NAMESPACE + +#endif // QMLGRAPHICSIMAGE_P_H diff --git a/src/declarative/fx/qmlgraphicsimagebase.cpp b/src/declarative/fx/qmlgraphicsimagebase.cpp index d71438d..ccc5045 100644 --- a/src/declarative/fx/qmlgraphicsimagebase.cpp +++ b/src/declarative/fx/qmlgraphicsimagebase.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include "qmlgraphicsimagebase.h" #include "qmlgraphicsimagebase_p.h" +#include "qmlgraphicsimagebase_p_p.h" #include #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/declarative/fx/qmlgraphicsimagebase.h b/src/declarative/fx/qmlgraphicsimagebase.h deleted file mode 100644 index 3ad0e4b..0000000 --- a/src/declarative/fx/qmlgraphicsimagebase.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSIMAGEBASE_H -#define QMLGRAPHICSIMAGEBASE_H - -#include - -QT_BEGIN_HEADER -QT_BEGIN_NAMESPACE - -class QmlGraphicsImageBasePrivate; -class QmlGraphicsImageBase : public QmlGraphicsItem -{ - Q_OBJECT - Q_ENUMS(Status) - - Q_PROPERTY(Status status READ status NOTIFY statusChanged) - Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) - Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) - -public: - QmlGraphicsImageBase(QmlGraphicsItem *parent = 0); - ~QmlGraphicsImageBase(); - enum Status { Null, Ready, Loading, Error }; - Status status() const; - qreal progress() const; - - QUrl source() const; - virtual void setSource(const QUrl &url); - -Q_SIGNALS: - void sourceChanged(const QUrl &); - void statusChanged(Status); - void progressChanged(qreal progress); - -protected: - QmlGraphicsImageBase(QmlGraphicsImageBasePrivate &dd, QmlGraphicsItem *parent); - -private Q_SLOTS: - virtual void requestFinished(); - void requestProgress(qint64,qint64); - -private: - Q_DISABLE_COPY(QmlGraphicsImageBase) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsImageBase) -}; - -QT_END_NAMESPACE -QT_END_HEADER - -#endif // QMLGRAPHICSIMAGEBASE_H diff --git a/src/declarative/fx/qmlgraphicsimagebase_p.h b/src/declarative/fx/qmlgraphicsimagebase_p.h index 5fd5f11..3ad0e4b 100644 --- a/src/declarative/fx/qmlgraphicsimagebase_p.h +++ b/src/declarative/fx/qmlgraphicsimagebase_p.h @@ -39,45 +39,52 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSIMAGEBASE_P_H -#define QMLGRAPHICSIMAGEBASE_P_H +#ifndef QMLGRAPHICSIMAGEBASE_H +#define QMLGRAPHICSIMAGEBASE_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qmlgraphicsitem_p.h" -#include +#include +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QNetworkReply; -class QmlGraphicsImageBasePrivate : public QmlGraphicsItemPrivate +class QmlGraphicsImageBasePrivate; +class QmlGraphicsImageBase : public QmlGraphicsItem { - Q_DECLARE_PUBLIC(QmlGraphicsImageBase) + Q_OBJECT + Q_ENUMS(Status) + + Q_PROPERTY(Status status READ status NOTIFY statusChanged) + Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) + Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) public: - QmlGraphicsImageBasePrivate() - : status(QmlGraphicsImageBase::Null), - progress(0.0), - pendingPixmapCache(false) - { - } + QmlGraphicsImageBase(QmlGraphicsItem *parent = 0); + ~QmlGraphicsImageBase(); + enum Status { Null, Ready, Loading, Error }; + Status status() const; + qreal progress() const; + + QUrl source() const; + virtual void setSource(const QUrl &url); + +Q_SIGNALS: + void sourceChanged(const QUrl &); + void statusChanged(Status); + void progressChanged(qreal progress); + +protected: + QmlGraphicsImageBase(QmlGraphicsImageBasePrivate &dd, QmlGraphicsItem *parent); + +private Q_SLOTS: + virtual void requestFinished(); + void requestProgress(qint64,qint64); - QPixmap pix; - QmlGraphicsImageBase::Status status; - QUrl url; - qreal progress; - bool pendingPixmapCache; +private: + Q_DISABLE_COPY(QmlGraphicsImageBase) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsImageBase) }; QT_END_NAMESPACE +QT_END_HEADER -#endif +#endif // QMLGRAPHICSIMAGEBASE_H diff --git a/src/declarative/fx/qmlgraphicsimagebase_p_p.h b/src/declarative/fx/qmlgraphicsimagebase_p_p.h new file mode 100644 index 0000000..5fd5f11 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsimagebase_p_p.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSIMAGEBASE_P_H +#define QMLGRAPHICSIMAGEBASE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlgraphicsitem_p.h" +#include + +QT_BEGIN_NAMESPACE + +class QNetworkReply; +class QmlGraphicsImageBasePrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsImageBase) + +public: + QmlGraphicsImageBasePrivate() + : status(QmlGraphicsImageBase::Null), + progress(0.0), + pendingPixmapCache(false) + { + } + + QPixmap pix; + QmlGraphicsImageBase::Status status; + QUrl url; + qreal progress; + bool pendingPixmapCache; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/fx/qmlgraphicsitem.cpp b/src/declarative/fx/qmlgraphicsitem.cpp index d5b31d0..b689c41 100644 --- a/src/declarative/fx/qmlgraphicsitem.cpp +++ b/src/declarative/fx/qmlgraphicsitem.cpp @@ -47,21 +47,21 @@ #include #include #include -#include +#include #include #include #include -#include -#include "qmlstate.h" -#include "qlistmodelinterface.h" +#include +#include +#include #include "qmlview.h" -#include "qmlstategroup.h" +#include #include "qmlgraphicsitem_p.h" #include "qmlgraphicsitem.h" -#include "qmlgraphicsevents_p.h" +#include #include QT_BEGIN_NAMESPACE @@ -2909,6 +2909,9 @@ int QmlGraphicsItemPrivate::restart(QTime &t) return n; } +#include "qmlgraphicsitem.moc" +#include "moc_qmlgraphicsitem.cpp" + QT_END_NAMESPACE QML_DECLARE_TYPE(QmlGraphicsKeysAttached) @@ -2917,5 +2920,3 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Keys,QmlGraphicsKeysAttached) QML_DECLARE_TYPE(QmlGraphicsKeyNavigationAttached) QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,KeyNavigation,QmlGraphicsKeyNavigationAttached) -#include "moc_qmlgraphicsitem.cpp" -#include "qfxitem.moc" diff --git a/src/declarative/fx/qmlgraphicsitem_p.h b/src/declarative/fx/qmlgraphicsitem_p.h index 799374a..83d87a7 100644 --- a/src/declarative/fx/qmlgraphicsitem_p.h +++ b/src/declarative/fx/qmlgraphicsitem_p.h @@ -54,10 +54,10 @@ // #include -#include -#include -#include +#include #include +#include +#include #include #include #include diff --git a/src/declarative/fx/qmlgraphicslayoutitem.cpp b/src/declarative/fx/qmlgraphicslayoutitem.cpp index b75f787..940b4bd 100644 --- a/src/declarative/fx/qmlgraphicslayoutitem.cpp +++ b/src/declarative/fx/qmlgraphicslayoutitem.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlgraphicslayoutitem.h" +#include "qmlgraphicslayoutitem_p.h" #include #include diff --git a/src/declarative/fx/qmlgraphicslayoutitem.h b/src/declarative/fx/qmlgraphicslayoutitem.h deleted file mode 100644 index 184001a..0000000 --- a/src/declarative/fx/qmlgraphicslayoutitem.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSGRAPHICSLAYOUTITEM_H -#define QMLGRAPHICSGRAPHICSLAYOUTITEM_H -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsLayoutItem : public QmlGraphicsItem, public QGraphicsLayoutItem -{ - Q_OBJECT - Q_INTERFACES(QGraphicsLayoutItem) - Q_PROPERTY(QSizeF maximumSize READ maximumSize WRITE setMaximumSize NOTIFY maximumSizeChanged) - Q_PROPERTY(QSizeF minimumSize READ minimumSize WRITE setMinimumSize NOTIFY minimumSizeChanged) - Q_PROPERTY(QSizeF preferredSize READ preferredSize WRITE setPreferredSize NOTIFY preferredSizeChanged) -public: - QmlGraphicsLayoutItem(QmlGraphicsItem* parent=0); - - QSizeF maximumSize() const { return m_maximumSize; } - void setMaximumSize(const QSizeF &s) { if(s==m_maximumSize) return; m_maximumSize = s; emit maximumSizeChanged(); } - - QSizeF minimumSize() const { return m_minimumSize; } - void setMinimumSize(const QSizeF &s) { if(s==m_minimumSize) return; m_minimumSize = s; emit minimumSizeChanged(); } - - QSizeF preferredSize() const { return m_preferredSize; } - void setPreferredSize(const QSizeF &s) { if(s==m_preferredSize) return; m_preferredSize = s; emit preferredSizeChanged(); } - - virtual void setGeometry(const QRectF & rect); -protected: - virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; - -Q_SIGNALS: - void maximumSizeChanged(); - void minimumSizeChanged(); - void preferredSizeChanged(); - -private: - QSizeF m_maximumSize; - QSizeF m_minimumSize; - QSizeF m_preferredSize; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsLayoutItem) - -QT_END_HEADER -#endif diff --git a/src/declarative/fx/qmlgraphicslayoutitem_p.h b/src/declarative/fx/qmlgraphicslayoutitem_p.h new file mode 100644 index 0000000..184001a --- /dev/null +++ b/src/declarative/fx/qmlgraphicslayoutitem_p.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSGRAPHICSLAYOUTITEM_H +#define QMLGRAPHICSGRAPHICSLAYOUTITEM_H +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlGraphicsLayoutItem : public QmlGraphicsItem, public QGraphicsLayoutItem +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayoutItem) + Q_PROPERTY(QSizeF maximumSize READ maximumSize WRITE setMaximumSize NOTIFY maximumSizeChanged) + Q_PROPERTY(QSizeF minimumSize READ minimumSize WRITE setMinimumSize NOTIFY minimumSizeChanged) + Q_PROPERTY(QSizeF preferredSize READ preferredSize WRITE setPreferredSize NOTIFY preferredSizeChanged) +public: + QmlGraphicsLayoutItem(QmlGraphicsItem* parent=0); + + QSizeF maximumSize() const { return m_maximumSize; } + void setMaximumSize(const QSizeF &s) { if(s==m_maximumSize) return; m_maximumSize = s; emit maximumSizeChanged(); } + + QSizeF minimumSize() const { return m_minimumSize; } + void setMinimumSize(const QSizeF &s) { if(s==m_minimumSize) return; m_minimumSize = s; emit minimumSizeChanged(); } + + QSizeF preferredSize() const { return m_preferredSize; } + void setPreferredSize(const QSizeF &s) { if(s==m_preferredSize) return; m_preferredSize = s; emit preferredSizeChanged(); } + + virtual void setGeometry(const QRectF & rect); +protected: + virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; + +Q_SIGNALS: + void maximumSizeChanged(); + void minimumSizeChanged(); + void preferredSizeChanged(); + +private: + QSizeF m_maximumSize; + QSizeF m_minimumSize; + QSizeF m_preferredSize; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsLayoutItem) + +QT_END_HEADER +#endif diff --git a/src/declarative/fx/qmlgraphicslistview.cpp b/src/declarative/fx/qmlgraphicslistview.cpp index 62ca23d..f92b755 100644 --- a/src/declarative/fx/qmlgraphicslistview.cpp +++ b/src/declarative/fx/qmlgraphicslistview.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "private/qmlgraphicsflickable_p.h" -#include "qmleasefollow.h" -#include "qlistmodelinterface.h" -#include "qmlgraphicsvisualitemmodel.h" -#include "qmlgraphicslistview.h" +#include "private/qmlgraphicsflickable_p_p.h" +#include +#include +#include "qmlgraphicsvisualitemmodel_p.h" +#include "qmlgraphicslistview_p.h" #include #include @@ -2032,4 +2032,5 @@ QmlGraphicsListViewAttached *QmlGraphicsListView::qmlAttachedProperties(QObject QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ListView,QmlGraphicsListView) QT_END_NAMESPACE -#include "qfxlistview.moc" + +#include "qmlgraphicslistview.moc" diff --git a/src/declarative/fx/qmlgraphicslistview.h b/src/declarative/fx/qmlgraphicslistview.h deleted file mode 100644 index 1c19c38..0000000 --- a/src/declarative/fx/qmlgraphicslistview.h +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSLISTVIEW_H -#define QMLGRAPHICSLISTVIEW_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - - -class QmlGraphicsVisualModel; -class QmlGraphicsListViewAttached; -class QmlGraphicsListViewPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsListView : public QmlGraphicsFlickable -{ - Q_OBJECT - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsListView) - - Q_PROPERTY(QVariant model READ model WRITE setModel) - Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) - Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) - Q_PROPERTY(QmlGraphicsItem *currentItem READ currentItem NOTIFY currentIndexChanged) - Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_PROPERTY(QmlComponent *highlight READ highlight WRITE setHighlight) - Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem) - - Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin) - Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd) - Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode) - - Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) - Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged) - Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled) - Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer) - Q_PROPERTY(QString sectionExpression READ sectionExpression WRITE setSectionExpression NOTIFY sectionExpressionChanged) - Q_PROPERTY(QString currentSection READ currentSection NOTIFY currentSectionChanged) - - Q_PROPERTY(qreal highlightMoveSpeed READ highlightMoveSpeed WRITE setHighlightMoveSpeed NOTIFY highlightMoveSpeedChanged) - Q_PROPERTY(qreal highlightResizeSpeed READ highlightResizeSpeed WRITE setHighlightResizeSpeed NOTIFY highlightResizeSpeedChanged) - Q_ENUMS(HighlightRangeMode) - Q_ENUMS(Orientation) - Q_CLASSINFO("DefaultProperty", "data") - -public: - QmlGraphicsListView(QmlGraphicsItem *parent=0); - ~QmlGraphicsListView(); - - QVariant model() const; - void setModel(const QVariant &); - - QmlComponent *delegate() const; - void setDelegate(QmlComponent *); - - int currentIndex() const; - void setCurrentIndex(int idx); - - QmlGraphicsItem *currentItem(); - int count() const; - - QmlComponent *highlight() const; - void setHighlight(QmlComponent *highlight); - - bool highlightFollowsCurrentItem() const; - void setHighlightFollowsCurrentItem(bool); - - enum HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange }; - HighlightRangeMode highlightRangeMode() const; - void setHighlightRangeMode(HighlightRangeMode mode); - - qreal preferredHighlightBegin() const; - void setPreferredHighlightBegin(qreal); - - qreal preferredHighlightEnd() const; - void setPreferredHighlightEnd(qreal); - - qreal spacing() const; - void setSpacing(qreal spacing); - - enum Orientation { Horizontal = Qt::Horizontal, Vertical = Qt::Vertical }; - Orientation orientation() const; - void setOrientation(Orientation); - - bool isWrapEnabled() const; - void setWrapEnabled(bool); - - int cacheBuffer() const; - void setCacheBuffer(int); - - QString sectionExpression() const; - void setSectionExpression(const QString &); - QString currentSection() const; - - qreal highlightMoveSpeed() const; - void setHighlightMoveSpeed(qreal); - - qreal highlightResizeSpeed() const; - void setHighlightResizeSpeed(qreal); - - static QmlGraphicsListViewAttached *qmlAttachedProperties(QObject *); - -public Q_SLOTS: - void incrementCurrentIndex(); - void decrementCurrentIndex(); - -Q_SIGNALS: - void countChanged(); - void spacingChanged(); - void orientationChanged(); - void currentIndexChanged(); - void currentSectionChanged(); - void sectionExpressionChanged(); - void highlightMoveSpeedChanged(); - void highlightResizeSpeedChanged(); - -protected: - virtual void viewportMoved(); - virtual qreal minYExtent() const; - virtual qreal maxYExtent() const; - virtual qreal minXExtent() const; - virtual qreal maxXExtent() const; - virtual void keyPressEvent(QKeyEvent *); - virtual void componentComplete(); - -private Q_SLOTS: - void refill(); - void trackedPositionChanged(); - void itemResized(); - void itemsInserted(int index, int count); - void itemsRemoved(int index, int count); - void itemsMoved(int from, int to, int count); - void destroyRemoved(); - void createdItem(int index, QmlGraphicsItem *item); - void destroyingItem(QmlGraphicsItem *item); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPEINFO(QmlGraphicsListView, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(QmlGraphicsListView) - -QT_END_HEADER - -#endif diff --git a/src/declarative/fx/qmlgraphicslistview_p.h b/src/declarative/fx/qmlgraphicslistview_p.h new file mode 100644 index 0000000..212d4f4 --- /dev/null +++ b/src/declarative/fx/qmlgraphicslistview_p.h @@ -0,0 +1,186 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSLISTVIEW_H +#define QMLGRAPHICSLISTVIEW_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + + +class QmlGraphicsVisualModel; +class QmlGraphicsListViewAttached; +class QmlGraphicsListViewPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsListView : public QmlGraphicsFlickable +{ + Q_OBJECT + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsListView) + + Q_PROPERTY(QVariant model READ model WRITE setModel) + Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) + Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) + Q_PROPERTY(QmlGraphicsItem *currentItem READ currentItem NOTIFY currentIndexChanged) + Q_PROPERTY(int count READ count NOTIFY countChanged) + Q_PROPERTY(QmlComponent *highlight READ highlight WRITE setHighlight) + Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem) + + Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin) + Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd) + Q_PROPERTY(HighlightRangeMode highlightRangeMode READ highlightRangeMode WRITE setHighlightRangeMode) + + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) + Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged) + Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled) + Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer) + Q_PROPERTY(QString sectionExpression READ sectionExpression WRITE setSectionExpression NOTIFY sectionExpressionChanged) + Q_PROPERTY(QString currentSection READ currentSection NOTIFY currentSectionChanged) + + Q_PROPERTY(qreal highlightMoveSpeed READ highlightMoveSpeed WRITE setHighlightMoveSpeed NOTIFY highlightMoveSpeedChanged) + Q_PROPERTY(qreal highlightResizeSpeed READ highlightResizeSpeed WRITE setHighlightResizeSpeed NOTIFY highlightResizeSpeedChanged) + Q_ENUMS(HighlightRangeMode) + Q_ENUMS(Orientation) + Q_CLASSINFO("DefaultProperty", "data") + +public: + QmlGraphicsListView(QmlGraphicsItem *parent=0); + ~QmlGraphicsListView(); + + QVariant model() const; + void setModel(const QVariant &); + + QmlComponent *delegate() const; + void setDelegate(QmlComponent *); + + int currentIndex() const; + void setCurrentIndex(int idx); + + QmlGraphicsItem *currentItem(); + int count() const; + + QmlComponent *highlight() const; + void setHighlight(QmlComponent *highlight); + + bool highlightFollowsCurrentItem() const; + void setHighlightFollowsCurrentItem(bool); + + enum HighlightRangeMode { NoHighlightRange, ApplyRange, StrictlyEnforceRange }; + HighlightRangeMode highlightRangeMode() const; + void setHighlightRangeMode(HighlightRangeMode mode); + + qreal preferredHighlightBegin() const; + void setPreferredHighlightBegin(qreal); + + qreal preferredHighlightEnd() const; + void setPreferredHighlightEnd(qreal); + + qreal spacing() const; + void setSpacing(qreal spacing); + + enum Orientation { Horizontal = Qt::Horizontal, Vertical = Qt::Vertical }; + Orientation orientation() const; + void setOrientation(Orientation); + + bool isWrapEnabled() const; + void setWrapEnabled(bool); + + int cacheBuffer() const; + void setCacheBuffer(int); + + QString sectionExpression() const; + void setSectionExpression(const QString &); + QString currentSection() const; + + qreal highlightMoveSpeed() const; + void setHighlightMoveSpeed(qreal); + + qreal highlightResizeSpeed() const; + void setHighlightResizeSpeed(qreal); + + static QmlGraphicsListViewAttached *qmlAttachedProperties(QObject *); + +public Q_SLOTS: + void incrementCurrentIndex(); + void decrementCurrentIndex(); + +Q_SIGNALS: + void countChanged(); + void spacingChanged(); + void orientationChanged(); + void currentIndexChanged(); + void currentSectionChanged(); + void sectionExpressionChanged(); + void highlightMoveSpeedChanged(); + void highlightResizeSpeedChanged(); + +protected: + virtual void viewportMoved(); + virtual qreal minYExtent() const; + virtual qreal maxYExtent() const; + virtual qreal minXExtent() const; + virtual qreal maxXExtent() const; + virtual void keyPressEvent(QKeyEvent *); + virtual void componentComplete(); + +private Q_SLOTS: + void refill(); + void trackedPositionChanged(); + void itemResized(); + void itemsInserted(int index, int count); + void itemsRemoved(int index, int count); + void itemsMoved(int from, int to, int count); + void destroyRemoved(); + void createdItem(int index, QmlGraphicsItem *item); + void destroyingItem(QmlGraphicsItem *item); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPEINFO(QmlGraphicsListView, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPE(QmlGraphicsListView) + +QT_END_HEADER + +#endif diff --git a/src/declarative/fx/qmlgraphicsloader.cpp b/src/declarative/fx/qmlgraphicsloader.cpp index b2a9c4f..70839e1 100644 --- a/src/declarative/fx/qmlgraphicsloader.cpp +++ b/src/declarative/fx/qmlgraphicsloader.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlgraphicsloader_p.h" +#include "qmlgraphicsloader_p_p.h" #include QT_BEGIN_NAMESPACE @@ -385,6 +385,6 @@ QmlGraphicsItem *QmlGraphicsLoader::item() const return d->item; } -QT_END_NAMESPACE +#include "moc_qmlgraphicsloader_p.cpp" -#include "moc_qmlgraphicsloader.cpp" +QT_END_NAMESPACE diff --git a/src/declarative/fx/qmlgraphicsloader.h b/src/declarative/fx/qmlgraphicsloader.h deleted file mode 100644 index 98f764f..0000000 --- a/src/declarative/fx/qmlgraphicsloader.h +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSLOADER_H -#define QMLGRAPHICSLOADER_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsLoaderPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsLoader : public QmlGraphicsItem -{ - Q_OBJECT - Q_ENUMS(Status) - Q_ENUMS(ResizeMode) - - Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) - Q_PROPERTY(QmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent NOTIFY sourceChanged) - Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode) - Q_PROPERTY(QmlGraphicsItem *item READ item NOTIFY itemChanged) - Q_PROPERTY(Status status READ status NOTIFY statusChanged) - Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) - //### sourceItem - -public: - QmlGraphicsLoader(QmlGraphicsItem *parent=0); - virtual ~QmlGraphicsLoader(); - - QUrl source() const; - void setSource(const QUrl &); - - QmlComponent *sourceComponent() const; - void setSourceComponent(QmlComponent *); - - enum Status { Null, Ready, Loading, Error }; - Status status() const; - qreal progress() const; - - enum ResizeMode { NoResize, SizeLoaderToItem, SizeItemToLoader }; - ResizeMode resizeMode() const; - void setResizeMode(ResizeMode mode); - - QmlGraphicsItem *item() const; - -Q_SIGNALS: - void itemChanged(); - void sourceChanged(); - void statusChanged(); - void progressChanged(); - -private: - Q_DISABLE_COPY(QmlGraphicsLoader) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsLoader) - Q_PRIVATE_SLOT(d_func(), void _q_sourceLoaded()) - Q_PRIVATE_SLOT(d_func(), void _q_updateSize()) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsLoader) - -QT_END_HEADER - -#endif // QMLGRAPHICSLOADER_H diff --git a/src/declarative/fx/qmlgraphicsloader_p.h b/src/declarative/fx/qmlgraphicsloader_p.h index ea55334..98f764f 100644 --- a/src/declarative/fx/qmlgraphicsloader_p.h +++ b/src/declarative/fx/qmlgraphicsloader_p.h @@ -39,44 +39,69 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSLOADER_P_H -#define QMLGRAPHICSLOADER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qmlgraphicsitem_p.h" -#include "qmlgraphicsloader.h" +#ifndef QMLGRAPHICSLOADER_H +#define QMLGRAPHICSLOADER_H + +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlContext; -class QmlGraphicsLoaderPrivate : public QmlGraphicsItemPrivate +QT_MODULE(Declarative) + +class QmlGraphicsLoaderPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsLoader : public QmlGraphicsItem { - Q_DECLARE_PUBLIC(QmlGraphicsLoader) + Q_OBJECT + Q_ENUMS(Status) + Q_ENUMS(ResizeMode) + + Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) + Q_PROPERTY(QmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent NOTIFY sourceChanged) + Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode) + Q_PROPERTY(QmlGraphicsItem *item READ item NOTIFY itemChanged) + Q_PROPERTY(Status status READ status NOTIFY statusChanged) + Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) + //### sourceItem public: - QmlGraphicsLoaderPrivate(); - ~QmlGraphicsLoaderPrivate(); + QmlGraphicsLoader(QmlGraphicsItem *parent=0); + virtual ~QmlGraphicsLoader(); + + QUrl source() const; + void setSource(const QUrl &); + + QmlComponent *sourceComponent() const; + void setSourceComponent(QmlComponent *); - QUrl source; - QmlGraphicsItem *item; - QmlComponent *component; - bool ownComponent; - QmlGraphicsLoader::ResizeMode resizeMode; + enum Status { Null, Ready, Loading, Error }; + Status status() const; + qreal progress() const; - void _q_sourceLoaded(); - void _q_updateSize(); + enum ResizeMode { NoResize, SizeLoaderToItem, SizeItemToLoader }; + ResizeMode resizeMode() const; + void setResizeMode(ResizeMode mode); + + QmlGraphicsItem *item() const; + +Q_SIGNALS: + void itemChanged(); + void sourceChanged(); + void statusChanged(); + void progressChanged(); + +private: + Q_DISABLE_COPY(QmlGraphicsLoader) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsLoader) + Q_PRIVATE_SLOT(d_func(), void _q_sourceLoaded()) + Q_PRIVATE_SLOT(d_func(), void _q_updateSize()) }; QT_END_NAMESPACE -#endif // QMLGRAPHICSLOADER_P_H +QML_DECLARE_TYPE(QmlGraphicsLoader) + +QT_END_HEADER + +#endif // QMLGRAPHICSLOADER_H diff --git a/src/declarative/fx/qmlgraphicsloader_p_p.h b/src/declarative/fx/qmlgraphicsloader_p_p.h new file mode 100644 index 0000000..8761d5c --- /dev/null +++ b/src/declarative/fx/qmlgraphicsloader_p_p.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSLOADER_P_H +#define QMLGRAPHICSLOADER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlgraphicsitem_p.h" +#include "qmlgraphicsloader_p.h" + +QT_BEGIN_NAMESPACE + +class QmlContext; +class QmlGraphicsLoaderPrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsLoader) + +public: + QmlGraphicsLoaderPrivate(); + ~QmlGraphicsLoaderPrivate(); + + QUrl source; + QmlGraphicsItem *item; + QmlComponent *component; + bool ownComponent; + QmlGraphicsLoader::ResizeMode resizeMode; + + void _q_sourceLoaded(); + void _q_updateSize(); +}; + +QT_END_NAMESPACE + +#endif // QMLGRAPHICSLOADER_P_H diff --git a/src/declarative/fx/qmlgraphicsmouseregion.cpp b/src/declarative/fx/qmlgraphicsmouseregion.cpp index 7ad1ac2..5bdb5f0 100644 --- a/src/declarative/fx/qmlgraphicsmouseregion.cpp +++ b/src/declarative/fx/qmlgraphicsmouseregion.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qmlgraphicsmouseregion.h" #include "qmlgraphicsmouseregion_p.h" -#include "qmlgraphicsevents_p.h" +#include "qmlgraphicsmouseregion_p_p.h" +#include "qmlgraphicsevents_p_p.h" #include diff --git a/src/declarative/fx/qmlgraphicsmouseregion.h b/src/declarative/fx/qmlgraphicsmouseregion.h deleted file mode 100644 index 9874fbf..0000000 --- a/src/declarative/fx/qmlgraphicsmouseregion.h +++ /dev/null @@ -1,180 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSMOUSEREGION_H -#define QMLGRAPHICSMOUSEREGION_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class Q_DECLARATIVE_EXPORT QmlGraphicsDrag : public QObject -{ - Q_OBJECT - - Q_ENUMS(Axis) - Q_PROPERTY(QmlGraphicsItem *target READ target WRITE setTarget) - Q_PROPERTY(Axis axis READ axis WRITE setAxis) - Q_PROPERTY(qreal minimumX READ xmin WRITE setXmin) - Q_PROPERTY(qreal maximumX READ xmax WRITE setXmax) - Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin) - Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax) - //### consider drag and drop - -public: - QmlGraphicsDrag(QObject *parent=0); - ~QmlGraphicsDrag(); - - QmlGraphicsItem *target() const; - void setTarget(QmlGraphicsItem *); - - enum Axis { XAxis=0x01, YAxis=0x02, XandYAxis=0x03 }; - Axis axis() const; - void setAxis(Axis); - - qreal xmin() const; - void setXmin(qreal); - qreal xmax() const; - void setXmax(qreal); - qreal ymin() const; - void setYmin(qreal); - qreal ymax() const; - void setYmax(qreal); - -private: - QmlGraphicsItem *_target; - Axis _axis; - qreal _xmin; - qreal _xmax; - qreal _ymin; - qreal _ymax; - Q_DISABLE_COPY(QmlGraphicsDrag) -}; - -class QmlGraphicsMouseEvent; -class QmlGraphicsMouseRegionPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsMouseRegion : public QmlGraphicsItem -{ - Q_OBJECT - - Q_PROPERTY(qreal mouseX READ mouseX NOTIFY positionChanged) - Q_PROPERTY(qreal mouseY READ mouseY NOTIFY positionChanged) - Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged) - Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(Qt::MouseButtons pressedButtons READ pressedButtons NOTIFY pressedChanged) - Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged) - Q_PROPERTY(bool hoverEnabled READ acceptHoverEvents WRITE setAcceptHoverEvents) - Q_PROPERTY(QmlGraphicsDrag *drag READ drag) //### add flicking to QmlGraphicsDrag or add a QmlGraphicsFlick ??? - -public: - QmlGraphicsMouseRegion(QmlGraphicsItem *parent=0); - ~QmlGraphicsMouseRegion(); - - qreal mouseX() const; - qreal mouseY() const; - - bool isEnabled() const; - void setEnabled(bool); - - bool hovered() const; - bool pressed() const; - - Qt::MouseButtons pressedButtons() const; - - Qt::MouseButtons acceptedButtons() const; - void setAcceptedButtons(Qt::MouseButtons buttons); - - QmlGraphicsDrag *drag(); - -Q_SIGNALS: - void hoveredChanged(); - void pressedChanged(); - void enabledChanged(); - void acceptedButtonsChanged(); - void positionChanged(QmlGraphicsMouseEvent *mouse); - - void pressed(QmlGraphicsMouseEvent *mouse); - void pressAndHold(QmlGraphicsMouseEvent *mouse); - void released(QmlGraphicsMouseEvent *mouse); - void clicked(QmlGraphicsMouseEvent *mouse); - void doubleClicked(QmlGraphicsMouseEvent *mouse); - void entered(); - void exited(); - -protected: - void setHovered(bool); - bool setPressed(bool); - - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - void hoverEnterEvent(QGraphicsSceneHoverEvent *event); - void hoverMoveEvent(QGraphicsSceneHoverEvent *event); - void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); - bool sceneEvent(QEvent *); - void timerEvent(QTimerEvent *event); - -private: - void handlePress(); - void handleRelease(); - -protected: - QmlGraphicsMouseRegion(QmlGraphicsMouseRegionPrivate &dd, QmlGraphicsItem *parent); - -private: - Q_DISABLE_COPY(QmlGraphicsMouseRegion) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsMouseRegion) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsDrag) -QML_DECLARE_TYPE(QmlGraphicsMouseRegion) - -QT_END_HEADER - -#endif // QMLGRAPHICSMOUSEREGION_H diff --git a/src/declarative/fx/qmlgraphicsmouseregion_p.h b/src/declarative/fx/qmlgraphicsmouseregion_p.h index 71b31b4..9874fbf 100644 --- a/src/declarative/fx/qmlgraphicsmouseregion_p.h +++ b/src/declarative/fx/qmlgraphicsmouseregion_p.h @@ -39,76 +39,142 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSMOUSEREGION_P_H -#define QMLGRAPHICSMOUSEREGION_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qdatetime.h" -#include "qbasictimer.h" -#include "qgraphicssceneevent.h" -#include "qmlgraphicsitem_p.h" +#ifndef QMLGRAPHICSMOUSEREGION_H +#define QMLGRAPHICSMOUSEREGION_H + +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlGraphicsMouseRegionPrivate : public QmlGraphicsItemPrivate +QT_MODULE(Declarative) + +class Q_DECLARATIVE_EXPORT QmlGraphicsDrag : public QObject { - Q_DECLARE_PUBLIC(QmlGraphicsMouseRegion) + Q_OBJECT + + Q_ENUMS(Axis) + Q_PROPERTY(QmlGraphicsItem *target READ target WRITE setTarget) + Q_PROPERTY(Axis axis READ axis WRITE setAxis) + Q_PROPERTY(qreal minimumX READ xmin WRITE setXmin) + Q_PROPERTY(qreal maximumX READ xmax WRITE setXmax) + Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin) + Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax) + //### consider drag and drop public: - QmlGraphicsMouseRegionPrivate() - : absorb(true), hovered(false), pressed(false), longPress(false), drag(0) - { - } - - void init() - { - Q_Q(QmlGraphicsMouseRegion); - q->setAcceptedMouseButtons(Qt::LeftButton); - } - - void saveEvent(QGraphicsSceneMouseEvent *event) { - lastPos = event->pos(); - lastButton = event->button(); - lastButtons = event->buttons(); - lastModifiers = event->modifiers(); - } - - bool isConnected(const char *signal) { - Q_Q(QmlGraphicsMouseRegion); - int idx = QObjectPrivate::get(q)->signalIndex(signal); - return QObjectPrivate::get(q)->isSignalConnected(idx); - } - - bool absorb : 1; - bool hovered : 1; - bool pressed : 1; - bool longPress : 1; - bool moved : 1; - bool dragX : 1; - bool dragY : 1; - bool dragged : 1; - QmlGraphicsDrag drag; - QPointF start; - QPointF startScene; - qreal startX; - qreal startY; - QPointF lastPos; - Qt::MouseButton lastButton; - Qt::MouseButtons lastButtons; - Qt::KeyboardModifiers lastModifiers; - QBasicTimer pressAndHoldTimer; + QmlGraphicsDrag(QObject *parent=0); + ~QmlGraphicsDrag(); + + QmlGraphicsItem *target() const; + void setTarget(QmlGraphicsItem *); + + enum Axis { XAxis=0x01, YAxis=0x02, XandYAxis=0x03 }; + Axis axis() const; + void setAxis(Axis); + + qreal xmin() const; + void setXmin(qreal); + qreal xmax() const; + void setXmax(qreal); + qreal ymin() const; + void setYmin(qreal); + qreal ymax() const; + void setYmax(qreal); + +private: + QmlGraphicsItem *_target; + Axis _axis; + qreal _xmin; + qreal _xmax; + qreal _ymin; + qreal _ymax; + Q_DISABLE_COPY(QmlGraphicsDrag) +}; + +class QmlGraphicsMouseEvent; +class QmlGraphicsMouseRegionPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsMouseRegion : public QmlGraphicsItem +{ + Q_OBJECT + + Q_PROPERTY(qreal mouseX READ mouseX NOTIFY positionChanged) + Q_PROPERTY(qreal mouseY READ mouseY NOTIFY positionChanged) + Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged) + Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) + Q_PROPERTY(Qt::MouseButtons pressedButtons READ pressedButtons NOTIFY pressedChanged) + Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged) + Q_PROPERTY(bool hoverEnabled READ acceptHoverEvents WRITE setAcceptHoverEvents) + Q_PROPERTY(QmlGraphicsDrag *drag READ drag) //### add flicking to QmlGraphicsDrag or add a QmlGraphicsFlick ??? + +public: + QmlGraphicsMouseRegion(QmlGraphicsItem *parent=0); + ~QmlGraphicsMouseRegion(); + + qreal mouseX() const; + qreal mouseY() const; + + bool isEnabled() const; + void setEnabled(bool); + + bool hovered() const; + bool pressed() const; + + Qt::MouseButtons pressedButtons() const; + + Qt::MouseButtons acceptedButtons() const; + void setAcceptedButtons(Qt::MouseButtons buttons); + + QmlGraphicsDrag *drag(); + +Q_SIGNALS: + void hoveredChanged(); + void pressedChanged(); + void enabledChanged(); + void acceptedButtonsChanged(); + void positionChanged(QmlGraphicsMouseEvent *mouse); + + void pressed(QmlGraphicsMouseEvent *mouse); + void pressAndHold(QmlGraphicsMouseEvent *mouse); + void released(QmlGraphicsMouseEvent *mouse); + void clicked(QmlGraphicsMouseEvent *mouse); + void doubleClicked(QmlGraphicsMouseEvent *mouse); + void entered(); + void exited(); + +protected: + void setHovered(bool); + bool setPressed(bool); + + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void hoverEnterEvent(QGraphicsSceneHoverEvent *event); + void hoverMoveEvent(QGraphicsSceneHoverEvent *event); + void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); + bool sceneEvent(QEvent *); + void timerEvent(QTimerEvent *event); + +private: + void handlePress(); + void handleRelease(); + +protected: + QmlGraphicsMouseRegion(QmlGraphicsMouseRegionPrivate &dd, QmlGraphicsItem *parent); + +private: + Q_DISABLE_COPY(QmlGraphicsMouseRegion) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsMouseRegion) }; QT_END_NAMESPACE -#endif // QMLGRAPHICSMOUSEREGION_P_H +QML_DECLARE_TYPE(QmlGraphicsDrag) +QML_DECLARE_TYPE(QmlGraphicsMouseRegion) + +QT_END_HEADER + +#endif // QMLGRAPHICSMOUSEREGION_H diff --git a/src/declarative/fx/qmlgraphicsmouseregion_p_p.h b/src/declarative/fx/qmlgraphicsmouseregion_p_p.h new file mode 100644 index 0000000..71b31b4 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsmouseregion_p_p.h @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSMOUSEREGION_P_H +#define QMLGRAPHICSMOUSEREGION_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qdatetime.h" +#include "qbasictimer.h" +#include "qgraphicssceneevent.h" +#include "qmlgraphicsitem_p.h" + +QT_BEGIN_NAMESPACE + +class QmlGraphicsMouseRegionPrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsMouseRegion) + +public: + QmlGraphicsMouseRegionPrivate() + : absorb(true), hovered(false), pressed(false), longPress(false), drag(0) + { + } + + void init() + { + Q_Q(QmlGraphicsMouseRegion); + q->setAcceptedMouseButtons(Qt::LeftButton); + } + + void saveEvent(QGraphicsSceneMouseEvent *event) { + lastPos = event->pos(); + lastButton = event->button(); + lastButtons = event->buttons(); + lastModifiers = event->modifiers(); + } + + bool isConnected(const char *signal) { + Q_Q(QmlGraphicsMouseRegion); + int idx = QObjectPrivate::get(q)->signalIndex(signal); + return QObjectPrivate::get(q)->isSignalConnected(idx); + } + + bool absorb : 1; + bool hovered : 1; + bool pressed : 1; + bool longPress : 1; + bool moved : 1; + bool dragX : 1; + bool dragY : 1; + bool dragged : 1; + QmlGraphicsDrag drag; + QPointF start; + QPointF startScene; + qreal startX; + qreal startY; + QPointF lastPos; + Qt::MouseButton lastButton; + Qt::MouseButtons lastButtons; + Qt::KeyboardModifiers lastModifiers; + QBasicTimer pressAndHoldTimer; +}; + +QT_END_NAMESPACE + +#endif // QMLGRAPHICSMOUSEREGION_P_H diff --git a/src/declarative/fx/qmlgraphicspainteditem.cpp b/src/declarative/fx/qmlgraphicspainteditem.cpp index 43d0318..5a8e711 100644 --- a/src/declarative/fx/qmlgraphicspainteditem.cpp +++ b/src/declarative/fx/qmlgraphicspainteditem.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qmlgraphicspainteditem.h" #include "qmlgraphicspainteditem_p.h" +#include "qmlgraphicspainteditem_p_p.h" #include #include diff --git a/src/declarative/fx/qmlgraphicspainteditem.h b/src/declarative/fx/qmlgraphicspainteditem.h deleted file mode 100644 index 7ff55a5..0000000 --- a/src/declarative/fx/qmlgraphicspainteditem.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSIMAGEITEM_H -#define QMLGRAPHICSIMAGEITEM_H - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsPaintedItemPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsPaintedItem : public QmlGraphicsItem -{ - Q_OBJECT - - Q_PROPERTY(QSize contentsSize READ contentsSize WRITE setContentsSize) - Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged) - Q_PROPERTY(int cacheSize READ cacheSize WRITE setCacheSize) - -public: - QmlGraphicsPaintedItem(QmlGraphicsItem *parent=0); - ~QmlGraphicsPaintedItem(); - - QSize contentsSize() const; - void setContentsSize(const QSize &); - - int cacheSize() const; - void setCacheSize(int pixels); - - QColor fillColor() const; - void setFillColor(const QColor&); - - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); - -protected: - QmlGraphicsPaintedItem(QmlGraphicsPaintedItemPrivate &dd, QmlGraphicsItem *parent); - - virtual void drawContents(QPainter *p, const QRect &) = 0; - - void setCacheFrozen(bool); - -Q_SIGNALS: - void fillColorChanged(); - -protected Q_SLOTS: - void dirtyCache(const QRect &); - void clearCache(); - -private: - void init(); - Q_DISABLE_COPY(QmlGraphicsPaintedItem) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsPaintedItem) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsPaintedItem) - -QT_END_HEADER - -#endif diff --git a/src/declarative/fx/qmlgraphicspainteditem_p.h b/src/declarative/fx/qmlgraphicspainteditem_p.h index d5cd673..7ff55a5 100644 --- a/src/declarative/fx/qmlgraphicspainteditem_p.h +++ b/src/declarative/fx/qmlgraphicspainteditem_p.h @@ -39,50 +39,67 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSIMAGEITEM_P_H -#define QMLGRAPHICSIMAGEITEM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include +#ifndef QMLGRAPHICSIMAGEITEM_H +#define QMLGRAPHICSIMAGEITEM_H + +#include +#include + + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlGraphicsPaintedItemPrivate : public QmlGraphicsItemPrivate +QT_MODULE(Declarative) + +class QmlGraphicsPaintedItemPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsPaintedItem : public QmlGraphicsItem { - Q_DECLARE_PUBLIC(QmlGraphicsPaintedItem) + Q_OBJECT + + Q_PROPERTY(QSize contentsSize READ contentsSize WRITE setContentsSize) + Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged) + Q_PROPERTY(int cacheSize READ cacheSize WRITE setCacheSize) public: - QmlGraphicsPaintedItemPrivate() - : max_imagecache_size(100000), fillColor(Qt::transparent), cachefrozen(false) - { - } - - struct ImageCacheItem { - ImageCacheItem() : age(0) {} - ~ImageCacheItem() { } - int age; - QRect area; - QRect dirty; // one dirty area (allows optimization of common cases) - QPixmap image; - }; - - QList imagecache; - - int max_imagecache_size; - QSize contentsSize; - QColor fillColor; - bool cachefrozen; + QmlGraphicsPaintedItem(QmlGraphicsItem *parent=0); + ~QmlGraphicsPaintedItem(); + + QSize contentsSize() const; + void setContentsSize(const QSize &); + + int cacheSize() const; + void setCacheSize(int pixels); + + QColor fillColor() const; + void setFillColor(const QColor&); + + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + +protected: + QmlGraphicsPaintedItem(QmlGraphicsPaintedItemPrivate &dd, QmlGraphicsItem *parent); + + virtual void drawContents(QPainter *p, const QRect &) = 0; + + void setCacheFrozen(bool); + +Q_SIGNALS: + void fillColorChanged(); + +protected Q_SLOTS: + void dirtyCache(const QRect &); + void clearCache(); + +private: + void init(); + Q_DISABLE_COPY(QmlGraphicsPaintedItem) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsPaintedItem) }; QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsPaintedItem) + +QT_END_HEADER + #endif diff --git a/src/declarative/fx/qmlgraphicspainteditem_p_p.h b/src/declarative/fx/qmlgraphicspainteditem_p_p.h new file mode 100644 index 0000000..d5cd673 --- /dev/null +++ b/src/declarative/fx/qmlgraphicspainteditem_p_p.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSIMAGEITEM_P_H +#define QMLGRAPHICSIMAGEITEM_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QmlGraphicsPaintedItemPrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsPaintedItem) + +public: + QmlGraphicsPaintedItemPrivate() + : max_imagecache_size(100000), fillColor(Qt::transparent), cachefrozen(false) + { + } + + struct ImageCacheItem { + ImageCacheItem() : age(0) {} + ~ImageCacheItem() { } + int age; + QRect area; + QRect dirty; // one dirty area (allows optimization of common cases) + QPixmap image; + }; + + QList imagecache; + + int max_imagecache_size; + QSize contentsSize; + QColor fillColor; + bool cachefrozen; +}; + +QT_END_NAMESPACE +#endif diff --git a/src/declarative/fx/qmlgraphicspath.cpp b/src/declarative/fx/qmlgraphicspath.cpp index 15dbfef..193a2c6 100644 --- a/src/declarative/fx/qmlgraphicspath.cpp +++ b/src/declarative/fx/qmlgraphicspath.cpp @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include "qmlgraphicspath.h" #include "qmlgraphicspath_p.h" -#include +#include "qmlgraphicspath_p_p.h" +#include #include #include diff --git a/src/declarative/fx/qmlgraphicspath.h b/src/declarative/fx/qmlgraphicspath.h deleted file mode 100644 index db6c84f..0000000 --- a/src/declarative/fx/qmlgraphicspath.h +++ /dev/null @@ -1,259 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSPATH_H -#define QMLGRAPHICSPATH_H - -#include -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) -class Q_DECLARATIVE_EXPORT QmlGraphicsPathElement : public QObject -{ - Q_OBJECT -public: - QmlGraphicsPathElement(QObject *parent=0) : QObject(parent) {} -Q_SIGNALS: - void changed(); -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsPathAttribute : public QmlGraphicsPathElement -{ - Q_OBJECT - - Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY changed) -public: - QmlGraphicsPathAttribute(QObject *parent=0) : QmlGraphicsPathElement(parent), _value(0) {} - - - QString name() const; - void setName(const QString &name); - - qreal value() const; - void setValue(qreal value); - -private: - QString _name; - qreal _value; -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsCurve : public QmlGraphicsPathElement -{ - Q_OBJECT - - Q_PROPERTY(qreal x READ x WRITE setX NOTIFY changed) - Q_PROPERTY(qreal y READ y WRITE setY NOTIFY changed) -public: - QmlGraphicsCurve(QObject *parent=0) : QmlGraphicsPathElement(parent), _x(0), _y(0) {} - - qreal x() const; - void setX(qreal x); - - qreal y() const; - void setY(qreal y); - - virtual void addToPath(QPainterPath &) {} - -private: - qreal _x; - qreal _y; -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsPathLine : public QmlGraphicsCurve -{ - Q_OBJECT -public: - QmlGraphicsPathLine(QObject *parent=0) : QmlGraphicsCurve(parent) {} - - void addToPath(QPainterPath &path); -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsPathQuad : public QmlGraphicsCurve -{ - Q_OBJECT - - Q_PROPERTY(qreal controlX READ controlX WRITE setControlX NOTIFY changed) - Q_PROPERTY(qreal controlY READ controlY WRITE setControlY NOTIFY changed) -public: - QmlGraphicsPathQuad(QObject *parent=0) : QmlGraphicsCurve(parent), _controlX(0), _controlY(0) {} - - qreal controlX() const; - void setControlX(qreal x); - - qreal controlY() const; - void setControlY(qreal y); - - void addToPath(QPainterPath &path); - -private: - qreal _controlX; - qreal _controlY; -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsPathCubic : public QmlGraphicsCurve -{ - Q_OBJECT - - Q_PROPERTY(qreal control1X READ control1X WRITE setControl1X NOTIFY changed) - Q_PROPERTY(qreal control1Y READ control1Y WRITE setControl1Y NOTIFY changed) - Q_PROPERTY(qreal control2X READ control2X WRITE setControl2X NOTIFY changed) - Q_PROPERTY(qreal control2Y READ control2Y WRITE setControl2Y NOTIFY changed) -public: - QmlGraphicsPathCubic(QObject *parent=0) : QmlGraphicsCurve(parent), _control1X(0), _control1Y(0), _control2X(0), _control2Y(0) {} - - qreal control1X() const; - void setControl1X(qreal x); - - qreal control1Y() const; - void setControl1Y(qreal y); - - qreal control2X() const; - void setControl2X(qreal x); - - qreal control2Y() const; - void setControl2Y(qreal y); - - void addToPath(QPainterPath &path); - -private: - int _control1X; - int _control1Y; - int _control2X; - int _control2Y; -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsPathPercent : public QmlGraphicsPathElement -{ - Q_OBJECT - Q_PROPERTY(qreal value READ value WRITE setValue) -public: - QmlGraphicsPathPercent(QObject *parent=0) : QmlGraphicsPathElement(parent) {} - - qreal value() const; - void setValue(qreal value); - -private: - qreal _value; -}; - -class QmlGraphicsPathPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsPath : public QObject, public QmlParserStatus -{ - Q_OBJECT - - Q_INTERFACES(QmlParserStatus) - Q_PROPERTY(QList* pathElements READ pathElements) - Q_PROPERTY(qreal startX READ startX WRITE setStartX) - Q_PROPERTY(qreal startY READ startY WRITE setStartY) - Q_CLASSINFO("DefaultProperty", "pathElements") - Q_INTERFACES(QmlParserStatus) -public: - QmlGraphicsPath(QObject *parent=0); - ~QmlGraphicsPath(); - - QList* pathElements(); - - qreal startX() const; - void setStartX(qreal x); - - qreal startY() const; - void setStartY(qreal y); - - QPainterPath path() const; - QStringList attributes() const; - qreal attributeAt(const QString &, qreal) const; - QPointF pointAt(qreal) const; - -Q_SIGNALS: - void changed(); - -protected: - virtual void componentComplete(); - QmlGraphicsPath(QmlGraphicsPathPrivate &dd, QObject *parent); - -private Q_SLOTS: - void processPath(); - -private: - struct AttributePoint { - AttributePoint() : percent(0), scale(1), origpercent(0) {} - AttributePoint(const AttributePoint &other) - : percent(other.percent), scale(other.scale), origpercent(other.origpercent), values(other.values) {} - AttributePoint &operator=(const AttributePoint &other) { - percent = other.percent; scale = other.scale; origpercent = other.origpercent; values = other.values; return *this; - } - qreal percent; //massaged percent along the painter path - qreal scale; - qreal origpercent; //'real' percent along the painter path - QHash values; - }; - - void interpolate(int idx, const QString &name, qreal value); - void endpoint(const QString &name); - void createPointCache() const; - -private: - Q_DISABLE_COPY(QmlGraphicsPath) - Q_DECLARE_PRIVATE(QmlGraphicsPath) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsPathElement) -QML_DECLARE_TYPE(QmlGraphicsPathAttribute) -QML_DECLARE_TYPE(QmlGraphicsCurve) -QML_DECLARE_TYPE(QmlGraphicsPathLine) -QML_DECLARE_TYPE(QmlGraphicsPathQuad) -QML_DECLARE_TYPE(QmlGraphicsPathCubic) -QML_DECLARE_TYPE(QmlGraphicsPathPercent) -QML_DECLARE_TYPE(QmlGraphicsPath) - -QT_END_HEADER - -#endif // QMLGRAPHICSPATH_H diff --git a/src/declarative/fx/qmlgraphicspath_p.h b/src/declarative/fx/qmlgraphicspath_p.h index 7c0e1ea..db6c84f 100644 --- a/src/declarative/fx/qmlgraphicspath_p.h +++ b/src/declarative/fx/qmlgraphicspath_p.h @@ -39,41 +39,221 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSPATH_P_H -#define QMLGRAPHICSPATH_P_H +#ifndef QMLGRAPHICSPATH_H +#define QMLGRAPHICSPATH_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#include +#include +#include +#include -#include "private/qobject_p.h" -#include "qmlgraphicspath.h" -#include "qml.h" +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlGraphicsPathPrivate : public QObjectPrivate + +QT_MODULE(Declarative) +class Q_DECLARATIVE_EXPORT QmlGraphicsPathElement : public QObject +{ + Q_OBJECT +public: + QmlGraphicsPathElement(QObject *parent=0) : QObject(parent) {} +Q_SIGNALS: + void changed(); +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsPathAttribute : public QmlGraphicsPathElement +{ + Q_OBJECT + + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY changed) +public: + QmlGraphicsPathAttribute(QObject *parent=0) : QmlGraphicsPathElement(parent), _value(0) {} + + + QString name() const; + void setName(const QString &name); + + qreal value() const; + void setValue(qreal value); + +private: + QString _name; + qreal _value; +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsCurve : public QmlGraphicsPathElement +{ + Q_OBJECT + + Q_PROPERTY(qreal x READ x WRITE setX NOTIFY changed) + Q_PROPERTY(qreal y READ y WRITE setY NOTIFY changed) +public: + QmlGraphicsCurve(QObject *parent=0) : QmlGraphicsPathElement(parent), _x(0), _y(0) {} + + qreal x() const; + void setX(qreal x); + + qreal y() const; + void setY(qreal y); + + virtual void addToPath(QPainterPath &) {} + +private: + qreal _x; + qreal _y; +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsPathLine : public QmlGraphicsCurve { - Q_DECLARE_PUBLIC(QmlGraphicsPath) + Q_OBJECT +public: + QmlGraphicsPathLine(QObject *parent=0) : QmlGraphicsCurve(parent) {} + + void addToPath(QPainterPath &path); +}; +class Q_DECLARATIVE_EXPORT QmlGraphicsPathQuad : public QmlGraphicsCurve +{ + Q_OBJECT + + Q_PROPERTY(qreal controlX READ controlX WRITE setControlX NOTIFY changed) + Q_PROPERTY(qreal controlY READ controlY WRITE setControlY NOTIFY changed) public: - QmlGraphicsPathPrivate() : startX(0), startY(0) { } - - QPainterPath _path; - QList _pathElements; - mutable QVector _pointCache; - QList _attributePoints; - QStringList _attributes; - int startX; - int startY; + QmlGraphicsPathQuad(QObject *parent=0) : QmlGraphicsCurve(parent), _controlX(0), _controlY(0) {} + + qreal controlX() const; + void setControlX(qreal x); + + qreal controlY() const; + void setControlY(qreal y); + + void addToPath(QPainterPath &path); + +private: + qreal _controlX; + qreal _controlY; +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsPathCubic : public QmlGraphicsCurve +{ + Q_OBJECT + + Q_PROPERTY(qreal control1X READ control1X WRITE setControl1X NOTIFY changed) + Q_PROPERTY(qreal control1Y READ control1Y WRITE setControl1Y NOTIFY changed) + Q_PROPERTY(qreal control2X READ control2X WRITE setControl2X NOTIFY changed) + Q_PROPERTY(qreal control2Y READ control2Y WRITE setControl2Y NOTIFY changed) +public: + QmlGraphicsPathCubic(QObject *parent=0) : QmlGraphicsCurve(parent), _control1X(0), _control1Y(0), _control2X(0), _control2Y(0) {} + + qreal control1X() const; + void setControl1X(qreal x); + + qreal control1Y() const; + void setControl1Y(qreal y); + + qreal control2X() const; + void setControl2X(qreal x); + + qreal control2Y() const; + void setControl2Y(qreal y); + + void addToPath(QPainterPath &path); + +private: + int _control1X; + int _control1Y; + int _control2X; + int _control2Y; +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsPathPercent : public QmlGraphicsPathElement +{ + Q_OBJECT + Q_PROPERTY(qreal value READ value WRITE setValue) +public: + QmlGraphicsPathPercent(QObject *parent=0) : QmlGraphicsPathElement(parent) {} + + qreal value() const; + void setValue(qreal value); + +private: + qreal _value; +}; + +class QmlGraphicsPathPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsPath : public QObject, public QmlParserStatus +{ + Q_OBJECT + + Q_INTERFACES(QmlParserStatus) + Q_PROPERTY(QList* pathElements READ pathElements) + Q_PROPERTY(qreal startX READ startX WRITE setStartX) + Q_PROPERTY(qreal startY READ startY WRITE setStartY) + Q_CLASSINFO("DefaultProperty", "pathElements") + Q_INTERFACES(QmlParserStatus) +public: + QmlGraphicsPath(QObject *parent=0); + ~QmlGraphicsPath(); + + QList* pathElements(); + + qreal startX() const; + void setStartX(qreal x); + + qreal startY() const; + void setStartY(qreal y); + + QPainterPath path() const; + QStringList attributes() const; + qreal attributeAt(const QString &, qreal) const; + QPointF pointAt(qreal) const; + +Q_SIGNALS: + void changed(); + +protected: + virtual void componentComplete(); + QmlGraphicsPath(QmlGraphicsPathPrivate &dd, QObject *parent); + +private Q_SLOTS: + void processPath(); + +private: + struct AttributePoint { + AttributePoint() : percent(0), scale(1), origpercent(0) {} + AttributePoint(const AttributePoint &other) + : percent(other.percent), scale(other.scale), origpercent(other.origpercent), values(other.values) {} + AttributePoint &operator=(const AttributePoint &other) { + percent = other.percent; scale = other.scale; origpercent = other.origpercent; values = other.values; return *this; + } + qreal percent; //massaged percent along the painter path + qreal scale; + qreal origpercent; //'real' percent along the painter path + QHash values; + }; + + void interpolate(int idx, const QString &name, qreal value); + void endpoint(const QString &name); + void createPointCache() const; + +private: + Q_DISABLE_COPY(QmlGraphicsPath) + Q_DECLARE_PRIVATE(QmlGraphicsPath) }; QT_END_NAMESPACE -#endif + +QML_DECLARE_TYPE(QmlGraphicsPathElement) +QML_DECLARE_TYPE(QmlGraphicsPathAttribute) +QML_DECLARE_TYPE(QmlGraphicsCurve) +QML_DECLARE_TYPE(QmlGraphicsPathLine) +QML_DECLARE_TYPE(QmlGraphicsPathQuad) +QML_DECLARE_TYPE(QmlGraphicsPathCubic) +QML_DECLARE_TYPE(QmlGraphicsPathPercent) +QML_DECLARE_TYPE(QmlGraphicsPath) + +QT_END_HEADER + +#endif // QMLGRAPHICSPATH_H diff --git a/src/declarative/fx/qmlgraphicspath_p_p.h b/src/declarative/fx/qmlgraphicspath_p_p.h new file mode 100644 index 0000000..c974318 --- /dev/null +++ b/src/declarative/fx/qmlgraphicspath_p_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSPATH_P_H +#define QMLGRAPHICSPATH_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "private/qobject_p.h" +#include "qmlgraphicspath_p.h" +#include "qml.h" + + +QT_BEGIN_NAMESPACE +class QmlGraphicsPathPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsPath) + +public: + QmlGraphicsPathPrivate() : startX(0), startY(0) { } + + QPainterPath _path; + QList _pathElements; + mutable QVector _pointCache; + QList _attributePoints; + QStringList _attributes; + int startX; + int startY; +}; + +QT_END_NAMESPACE +#endif diff --git a/src/declarative/fx/qmlgraphicspathview.cpp b/src/declarative/fx/qmlgraphicspathview.cpp index 48d9fc8..74b8a97 100644 --- a/src/declarative/fx/qmlgraphicspathview.cpp +++ b/src/declarative/fx/qmlgraphicspathview.cpp @@ -42,12 +42,12 @@ #include #include #include -#include "qmlstate.h" -#include "qlistmodelinterface.h" -#include "qmlopenmetaobject.h" +#include +#include +#include -#include "qmlgraphicspathview.h" -#include "qmlgraphicspathview_p.h" +#include +#include #include static const int FlickThreshold = 5; @@ -910,4 +910,4 @@ QObject *QmlGraphicsPathView::qmlAttachedProperties(QObject *obj) QT_END_NAMESPACE -#include "qfxpathview.moc" +#include "qmlgraphicspathview.moc" diff --git a/src/declarative/fx/qmlgraphicspathview.h b/src/declarative/fx/qmlgraphicspathview.h deleted file mode 100644 index 3bb5d1f..0000000 --- a/src/declarative/fx/qmlgraphicspathview.h +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSPATHVIEW_H -#define QMLGRAPHICSPATHVIEW_H - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QListModelInterface; -class QmlGraphicsPathViewPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsPathView : public QmlGraphicsItem -{ - Q_OBJECT - - Q_PROPERTY(QVariant model READ model WRITE setModel) - Q_PROPERTY(QmlGraphicsPath *path READ path WRITE setPath) - Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) - Q_PROPERTY(qreal offset READ offset WRITE setOffset NOTIFY offsetChanged) - Q_PROPERTY(qreal snapPosition READ snapPosition WRITE setSnapPosition) - Q_PROPERTY(qreal dragMargin READ dragMargin WRITE setDragMargin) - Q_PROPERTY(int count READ count) - Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) - Q_PROPERTY(int pathItemCount READ pathItemCount WRITE setPathItemCount) - -public: - QmlGraphicsPathView(QmlGraphicsItem *parent=0); - virtual ~QmlGraphicsPathView(); - - QVariant model() const; - void setModel(const QVariant &); - - QmlGraphicsPath *path() const; - void setPath(QmlGraphicsPath *); - - int currentIndex() const; - void setCurrentIndex(int idx); - - qreal offset() const; - void setOffset(qreal offset); - - qreal snapPosition() const; - void setSnapPosition(qreal pos); - - qreal dragMargin() const; - void setDragMargin(qreal margin); - - int count() const; - - QmlComponent *delegate() const; - void setDelegate(QmlComponent *); - - int pathItemCount() const; - void setPathItemCount(int); - - static QObject *qmlAttachedProperties(QObject *); - -Q_SIGNALS: - void currentIndexChanged(); - void offsetChanged(); - -protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *); - bool sendMouseEvent(QGraphicsSceneMouseEvent *event); - bool sceneEventFilter(QGraphicsItem *, QEvent *); - void componentComplete(); - -private Q_SLOTS: - void refill(); - void ticked(); - void itemsInserted(int index, int count); - void itemsRemoved(int index, int count); - void createdItem(int index, QmlGraphicsItem *item); - void destroyingItem(QmlGraphicsItem *item); - -protected: - QmlGraphicsPathView(QmlGraphicsPathViewPrivate &dd, QmlGraphicsItem *parent); - -private: - friend class QmlGraphicsPathViewAttached; - static QHash attachedProperties; - Q_DISABLE_COPY(QmlGraphicsPathView) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsPathView) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsPathView) -QML_DECLARE_TYPEINFO(QmlGraphicsPathView, QML_HAS_ATTACHED_PROPERTIES) -QT_END_HEADER - -#endif // QMLGRAPHICSPATHVIEW_H diff --git a/src/declarative/fx/qmlgraphicspathview_p.h b/src/declarative/fx/qmlgraphicspathview_p.h index 22ee075..e2edcc9 100644 --- a/src/declarative/fx/qmlgraphicspathview_p.h +++ b/src/declarative/fx/qmlgraphicspathview_p.h @@ -39,113 +39,100 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSPATHVIEW_P_H -#define QMLGRAPHICSPATHVIEW_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qdatetime.h" -#include "qmlgraphicspathview.h" -#include "qmlgraphicsitem_p.h" -#include "qmlgraphicsvisualitemmodel.h" -#include "qml.h" -#include "private/qmlanimation_p.h" +#ifndef QMLGRAPHICSPATHVIEW_H +#define QMLGRAPHICSPATHVIEW_H + +#include +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -typedef struct PathViewItem{ - int index; - QmlGraphicsItem* item; -}PathViewItem; +QT_MODULE(Declarative) -class QmlGraphicsPathViewPrivate : public QmlGraphicsItemPrivate +class QListModelInterface; +class QmlGraphicsPathViewPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsPathView : public QmlGraphicsItem { - Q_DECLARE_PUBLIC(QmlGraphicsPathView) + Q_OBJECT + + Q_PROPERTY(QVariant model READ model WRITE setModel) + Q_PROPERTY(QmlGraphicsPath *path READ path WRITE setPath) + Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) + Q_PROPERTY(qreal offset READ offset WRITE setOffset NOTIFY offsetChanged) + Q_PROPERTY(qreal snapPosition READ snapPosition WRITE setSnapPosition) + Q_PROPERTY(qreal dragMargin READ dragMargin WRITE setDragMargin) + Q_PROPERTY(int count READ count) + Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) + Q_PROPERTY(int pathItemCount READ pathItemCount WRITE setPathItemCount) public: - QmlGraphicsPathViewPrivate() - : path(0), currentIndex(0), startPc(0), lastDist(0) - , lastElapsed(0), stealMouse(false), ownModel(false), activeItem(0) - , snapPos(0), dragMargin(0), moveOffset(this, &QmlGraphicsPathViewPrivate::setOffset) - , firstIndex(0), pathItems(-1), pathOffset(0), requestedIndex(-1), model(0) - , moveReason(Other) - { - fixupOffsetEvent = QmlTimeLineEvent::timeLineEvent(&moveOffset, this); - } - - void init() - { - Q_Q(QmlGraphicsPathView); - _offset = 0; - q->setAcceptedMouseButtons(Qt::LeftButton); - q->setFlag(QGraphicsItem::ItemIsFocusScope); - q->setFiltersChildEvents(true); - q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked())); - } - - QmlGraphicsItem *getItem(int modelIndex) { - Q_Q(QmlGraphicsPathView); - requestedIndex = modelIndex; - QmlGraphicsItem *item = model->item(modelIndex); - if (item) - item->setParentItem(q); - requestedIndex = -1; - return item; - } - void releaseItem(QmlGraphicsItem *item) { - model->release(item); - } - - bool isValid() const { - return model && model->count() > 0 && model->isValid() && path; - } - - int calcCurrentIndex(); - void updateCurrent(); - void fixOffset(); + QmlGraphicsPathView(QmlGraphicsItem *parent=0); + virtual ~QmlGraphicsPathView(); + + QVariant model() const; + void setModel(const QVariant &); + + QmlGraphicsPath *path() const; + void setPath(QmlGraphicsPath *); + + int currentIndex() const; + void setCurrentIndex(int idx); + + qreal offset() const; void setOffset(qreal offset); - void regenerate(); - void updateItem(QmlGraphicsItem *, qreal); - void snapToCurrent(); - QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const; - - QmlGraphicsPath *path; - int currentIndex; - qreal startPc; - QPointF startPoint; - qreal lastDist; - int lastElapsed; - qreal _offset; - bool stealMouse : 1; - bool ownModel : 1; - QTime lastPosTime; - QPointF lastPos; - QmlGraphicsItem *activeItem; - qreal snapPos; - qreal dragMargin; - QmlTimeLine tl; - QmlTimeLineValueProxy moveOffset; - QmlTimeLineEvent fixupOffsetEvent; - int firstIndex; - int pathItems; - int pathOffset; - int requestedIndex; - QList items; - QmlGraphicsVisualModel *model; - QVariant modelVariant; - enum MovementReason { Other, Key, Mouse }; - MovementReason moveReason; + + qreal snapPosition() const; + void setSnapPosition(qreal pos); + + qreal dragMargin() const; + void setDragMargin(qreal margin); + + int count() const; + + QmlComponent *delegate() const; + void setDelegate(QmlComponent *); + + int pathItemCount() const; + void setPathItemCount(int); + + static QObject *qmlAttachedProperties(QObject *); + +Q_SIGNALS: + void currentIndexChanged(); + void offsetChanged(); + +protected: + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *); + bool sendMouseEvent(QGraphicsSceneMouseEvent *event); + bool sceneEventFilter(QGraphicsItem *, QEvent *); + void componentComplete(); + +private Q_SLOTS: + void refill(); + void ticked(); + void itemsInserted(int index, int count); + void itemsRemoved(int index, int count); + void createdItem(int index, QmlGraphicsItem *item); + void destroyingItem(QmlGraphicsItem *item); + +protected: + QmlGraphicsPathView(QmlGraphicsPathViewPrivate &dd, QmlGraphicsItem *parent); + +private: + friend class QmlGraphicsPathViewAttached; + static QHash attachedProperties; + Q_DISABLE_COPY(QmlGraphicsPathView) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsPathView) }; QT_END_NAMESPACE -#endif +QML_DECLARE_TYPE(QmlGraphicsPathView) +QML_DECLARE_TYPEINFO(QmlGraphicsPathView, QML_HAS_ATTACHED_PROPERTIES) +QT_END_HEADER + +#endif // QMLGRAPHICSPATHVIEW_H diff --git a/src/declarative/fx/qmlgraphicspathview_p_p.h b/src/declarative/fx/qmlgraphicspathview_p_p.h new file mode 100644 index 0000000..87a5090 --- /dev/null +++ b/src/declarative/fx/qmlgraphicspathview_p_p.h @@ -0,0 +1,151 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSPATHVIEW_P_H +#define QMLGRAPHICSPATHVIEW_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qdatetime.h" +#include "qmlgraphicspathview_p.h" +#include "qmlgraphicsitem_p.h" +#include "qmlgraphicsvisualitemmodel_p.h" +#include "qml.h" +#include "private/qmlanimation_p_p.h" + +QT_BEGIN_NAMESPACE + +typedef struct PathViewItem{ + int index; + QmlGraphicsItem* item; +}PathViewItem; + +class QmlGraphicsPathViewPrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsPathView) + +public: + QmlGraphicsPathViewPrivate() + : path(0), currentIndex(0), startPc(0), lastDist(0) + , lastElapsed(0), stealMouse(false), ownModel(false), activeItem(0) + , snapPos(0), dragMargin(0), moveOffset(this, &QmlGraphicsPathViewPrivate::setOffset) + , firstIndex(0), pathItems(-1), pathOffset(0), requestedIndex(-1), model(0) + , moveReason(Other) + { + fixupOffsetEvent = QmlTimeLineEvent::timeLineEvent(&moveOffset, this); + } + + void init() + { + Q_Q(QmlGraphicsPathView); + _offset = 0; + q->setAcceptedMouseButtons(Qt::LeftButton); + q->setFlag(QGraphicsItem::ItemIsFocusScope); + q->setFiltersChildEvents(true); + q->connect(&tl, SIGNAL(updated()), q, SLOT(ticked())); + } + + QmlGraphicsItem *getItem(int modelIndex) { + Q_Q(QmlGraphicsPathView); + requestedIndex = modelIndex; + QmlGraphicsItem *item = model->item(modelIndex); + if (item) + item->setParentItem(q); + requestedIndex = -1; + return item; + } + void releaseItem(QmlGraphicsItem *item) { + model->release(item); + } + + bool isValid() const { + return model && model->count() > 0 && model->isValid() && path; + } + + int calcCurrentIndex(); + void updateCurrent(); + void fixOffset(); + void setOffset(qreal offset); + void regenerate(); + void updateItem(QmlGraphicsItem *, qreal); + void snapToCurrent(); + QPointF pointNear(const QPointF &point, qreal *nearPercent=0) const; + + QmlGraphicsPath *path; + int currentIndex; + qreal startPc; + QPointF startPoint; + qreal lastDist; + int lastElapsed; + qreal _offset; + bool stealMouse : 1; + bool ownModel : 1; + QTime lastPosTime; + QPointF lastPos; + QmlGraphicsItem *activeItem; + qreal snapPos; + qreal dragMargin; + QmlTimeLine tl; + QmlTimeLineValueProxy moveOffset; + QmlTimeLineEvent fixupOffsetEvent; + int firstIndex; + int pathItems; + int pathOffset; + int requestedIndex; + QList items; + QmlGraphicsVisualModel *model; + QVariant modelVariant; + enum MovementReason { Other, Key, Mouse }; + MovementReason moveReason; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/fx/qmlgraphicspixmapcache.cpp b/src/declarative/fx/qmlgraphicspixmapcache.cpp index e347a8b..37a1e20 100644 --- a/src/declarative/fx/qmlgraphicspixmapcache.cpp +++ b/src/declarative/fx/qmlgraphicspixmapcache.cpp @@ -39,12 +39,12 @@ ** ****************************************************************************/ -#include "qmlgraphicspixmapcache.h" +#include "qmlgraphicspixmapcache_p.h" #include #include #include #include -#include +#include #include #include #include diff --git a/src/declarative/fx/qmlgraphicspixmapcache.h b/src/declarative/fx/qmlgraphicspixmapcache.h deleted file mode 100644 index 5094665..0000000 --- a/src/declarative/fx/qmlgraphicspixmapcache.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSPIXMAPCACHE_H -#define QMLGRAPHICSPIXMAPCACHE_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) -class QmlEngine; -class QNetworkReply; -class Q_DECLARATIVE_EXPORT QmlGraphicsPixmapCache -{ -public: - static QNetworkReply *get(QmlEngine *, const QUrl& url, QPixmap *pixmap); - static void cancelGet(const QUrl& url, QObject* obj); - - static bool find(const QUrl& url, QPixmap *pixmap); // url must have been passed to QmlGraphicsPixmapCache::get, and any returned reply finished. - - static int pendingRequests(); // mainly for test verification -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLGRAPHICSPIXMAPCACHE_H diff --git a/src/declarative/fx/qmlgraphicspixmapcache_p.h b/src/declarative/fx/qmlgraphicspixmapcache_p.h new file mode 100644 index 0000000..5094665 --- /dev/null +++ b/src/declarative/fx/qmlgraphicspixmapcache_p.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSPIXMAPCACHE_H +#define QMLGRAPHICSPIXMAPCACHE_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) +class QmlEngine; +class QNetworkReply; +class Q_DECLARATIVE_EXPORT QmlGraphicsPixmapCache +{ +public: + static QNetworkReply *get(QmlEngine *, const QUrl& url, QPixmap *pixmap); + static void cancelGet(const QUrl& url, QObject* obj); + + static bool find(const QUrl& url, QPixmap *pixmap); // url must have been passed to QmlGraphicsPixmapCache::get, and any returned reply finished. + + static int pendingRequests(); // mainly for test verification +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLGRAPHICSPIXMAPCACHE_H diff --git a/src/declarative/fx/qmlgraphicspositioners.cpp b/src/declarative/fx/qmlgraphicspositioners.cpp index 31950e6..3f8a915 100644 --- a/src/declarative/fx/qmlgraphicspositioners.cpp +++ b/src/declarative/fx/qmlgraphicspositioners.cpp @@ -42,12 +42,12 @@ #include #include #include "qml.h" -#include "qmlstate.h" -#include "qmlstategroup.h" -#include "qmlstateoperations.h" -#include "private/qfxperf_p.h" -#include "qmlgraphicspositioners.h" -#include "qmlgraphicspositioners_p.h" +#include +#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/declarative/fx/qmlgraphicspositioners.h b/src/declarative/fx/qmlgraphicspositioners.h deleted file mode 100644 index e252ed8..0000000 --- a/src/declarative/fx/qmlgraphicspositioners.h +++ /dev/null @@ -1,167 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSLAYOUTS_H -#define QMLGRAPHICSLAYOUTS_H - -#include -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) -class QmlGraphicsBasePositionerPrivate; - -class Q_DECLARATIVE_EXPORT QmlGraphicsBasePositioner : public QmlGraphicsItem -{ - Q_OBJECT - - Q_PROPERTY(int spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) - Q_PROPERTY(QmlTransition *move READ move WRITE setMove) - Q_PROPERTY(QmlTransition *add READ add WRITE setAdd) - Q_PROPERTY(QmlTransition *remove READ remove WRITE setRemove) -public: - enum AutoUpdateType { None = 0x0, Horizontal = 0x1, Vertical = 0x2, Both = 0x3 }; - QmlGraphicsBasePositioner(AutoUpdateType, QmlGraphicsItem *parent); - - int spacing() const; - void setSpacing(int); - - QmlTransition *move() const; - void setMove(QmlTransition *); - - QmlTransition *add() const; - void setAdd(QmlTransition *); - - QmlTransition *remove() const; - void setRemove(QmlTransition *); - -protected: - virtual void componentComplete(); - virtual QVariant itemChange(GraphicsItemChange, const QVariant &); - virtual bool event(QEvent *); - QSet* newItems(); - QSet* leavingItems(); - QSet* items(); - void applyAdd(const QList >& changes, QmlGraphicsItem* target); - void applyMove(const QList >& changes, QmlGraphicsItem* target); - void applyRemove(const QList >& changes, QmlGraphicsItem* target); - void finishApplyTransitions(); - -Q_SIGNALS: - void layoutItemChanged(); - void spacingChanged(); - -protected Q_SLOTS: - virtual void doPositioning()=0; - -private Q_SLOTS: - void prePositioning(); - -protected: - QmlGraphicsBasePositioner(QmlGraphicsBasePositionerPrivate &dd, AutoUpdateType at, QmlGraphicsItem *parent); - void setMovingItem(QmlGraphicsItem *); - -private: - void applyTransition(const QList >& changes, QmlGraphicsItem* target, - QmlStateOperation::ActionList &actions); - Q_DISABLE_COPY(QmlGraphicsBasePositioner) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsBasePositioner) -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsColumn : public QmlGraphicsBasePositioner -{ - Q_OBJECT -public: - QmlGraphicsColumn(QmlGraphicsItem *parent=0); -protected Q_SLOTS: - virtual void doPositioning(); -private: - Q_DISABLE_COPY(QmlGraphicsColumn) -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsRow: public QmlGraphicsBasePositioner -{ - Q_OBJECT -public: - QmlGraphicsRow(QmlGraphicsItem *parent=0); -protected Q_SLOTS: - virtual void doPositioning(); -private: - Q_DISABLE_COPY(QmlGraphicsRow) -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsGrid : public QmlGraphicsBasePositioner -{ - Q_OBJECT - Q_PROPERTY(int rows READ rows WRITE setRows) - Q_PROPERTY(int columns READ columns WRITE setcolumns) -public: - QmlGraphicsGrid(QmlGraphicsItem *parent=0); - - int rows() const {return _rows;} - void setRows(const int rows){_rows = rows;} - - int columns() const {return _columns;} - void setcolumns(const int columns){_columns = columns;} -protected Q_SLOTS: - virtual void doPositioning(); - -private: - int _rows; - int _columns; - Q_DISABLE_COPY(QmlGraphicsGrid) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsColumn) -QML_DECLARE_TYPE(QmlGraphicsRow) -QML_DECLARE_TYPE(QmlGraphicsGrid) - -QT_END_HEADER - -#endif diff --git a/src/declarative/fx/qmlgraphicspositioners_p.h b/src/declarative/fx/qmlgraphicspositioners_p.h index f8ca6fd..3304e76 100644 --- a/src/declarative/fx/qmlgraphicspositioners_p.h +++ b/src/declarative/fx/qmlgraphicspositioners_p.h @@ -39,67 +39,129 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSLAYOUTS_P_H -#define QMLGRAPHICSLAYOUTS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include +#ifndef QMLGRAPHICSLAYOUTS_H +#define QMLGRAPHICSLAYOUTS_H + #include #include -#include -#include -#include -#include +#include +#include + + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlGraphicsBasePositionerPrivate : public QmlGraphicsItemPrivate + +QT_MODULE(Declarative) +class QmlGraphicsBasePositionerPrivate; + +class Q_DECLARATIVE_EXPORT QmlGraphicsBasePositioner : public QmlGraphicsItem { - Q_DECLARE_PUBLIC(QmlGraphicsBasePositioner) + Q_OBJECT + Q_PROPERTY(int spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) + Q_PROPERTY(QmlTransition *move READ move WRITE setMove) + Q_PROPERTY(QmlTransition *add READ add WRITE setAdd) + Q_PROPERTY(QmlTransition *remove READ remove WRITE setRemove) public: - QmlGraphicsBasePositionerPrivate() - : _ep(false), _componentComplete(false), _spacing(0), - aut(QmlGraphicsBasePositioner::None), moveTransition(0), addTransition(0), - removeTransition(0), _movingItem(0) - { - } - - void init(QmlGraphicsBasePositioner::AutoUpdateType at) - { - aut = at; - } - - bool _ep; - bool _componentComplete; - int _spacing; - QmlGraphicsBasePositioner::AutoUpdateType aut; - QmlTransition *moveTransition; - QmlTransition *addTransition; - QmlTransition *removeTransition; - QSet _items; - QSet _leavingItems; - QSet _stableItems; - QSet _newItems; - QSet _animated; - QmlStateOperation::ActionList addActions; - QmlStateOperation::ActionList moveActions; - QmlStateOperation::ActionList removeActions; - QmlTransitionManager addTransitionManager; - QmlTransitionManager moveTransitionManager; - QmlTransitionManager removeTransitionManager; -// QmlStateGroup *stateGroup; - QmlGraphicsItem *_movingItem; + enum AutoUpdateType { None = 0x0, Horizontal = 0x1, Vertical = 0x2, Both = 0x3 }; + QmlGraphicsBasePositioner(AutoUpdateType, QmlGraphicsItem *parent); + + int spacing() const; + void setSpacing(int); + + QmlTransition *move() const; + void setMove(QmlTransition *); + + QmlTransition *add() const; + void setAdd(QmlTransition *); + + QmlTransition *remove() const; + void setRemove(QmlTransition *); + +protected: + virtual void componentComplete(); + virtual QVariant itemChange(GraphicsItemChange, const QVariant &); + virtual bool event(QEvent *); + QSet* newItems(); + QSet* leavingItems(); + QSet* items(); + void applyAdd(const QList >& changes, QmlGraphicsItem* target); + void applyMove(const QList >& changes, QmlGraphicsItem* target); + void applyRemove(const QList >& changes, QmlGraphicsItem* target); + void finishApplyTransitions(); + +Q_SIGNALS: + void layoutItemChanged(); + void spacingChanged(); + +protected Q_SLOTS: + virtual void doPositioning()=0; + +private Q_SLOTS: + void prePositioning(); + +protected: + QmlGraphicsBasePositioner(QmlGraphicsBasePositionerPrivate &dd, AutoUpdateType at, QmlGraphicsItem *parent); + void setMovingItem(QmlGraphicsItem *); + +private: + void applyTransition(const QList >& changes, QmlGraphicsItem* target, + QmlStateOperation::ActionList &actions); + Q_DISABLE_COPY(QmlGraphicsBasePositioner) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsBasePositioner) +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsColumn : public QmlGraphicsBasePositioner +{ + Q_OBJECT +public: + QmlGraphicsColumn(QmlGraphicsItem *parent=0); +protected Q_SLOTS: + virtual void doPositioning(); +private: + Q_DISABLE_COPY(QmlGraphicsColumn) +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsRow: public QmlGraphicsBasePositioner +{ + Q_OBJECT +public: + QmlGraphicsRow(QmlGraphicsItem *parent=0); +protected Q_SLOTS: + virtual void doPositioning(); +private: + Q_DISABLE_COPY(QmlGraphicsRow) +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsGrid : public QmlGraphicsBasePositioner +{ + Q_OBJECT + Q_PROPERTY(int rows READ rows WRITE setRows) + Q_PROPERTY(int columns READ columns WRITE setcolumns) +public: + QmlGraphicsGrid(QmlGraphicsItem *parent=0); + + int rows() const {return _rows;} + void setRows(const int rows){_rows = rows;} + + int columns() const {return _columns;} + void setcolumns(const int columns){_columns = columns;} +protected Q_SLOTS: + virtual void doPositioning(); + +private: + int _rows; + int _columns; + Q_DISABLE_COPY(QmlGraphicsGrid) }; QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsColumn) +QML_DECLARE_TYPE(QmlGraphicsRow) +QML_DECLARE_TYPE(QmlGraphicsGrid) + +QT_END_HEADER + #endif diff --git a/src/declarative/fx/qmlgraphicspositioners_p_p.h b/src/declarative/fx/qmlgraphicspositioners_p_p.h new file mode 100644 index 0000000..571b815 --- /dev/null +++ b/src/declarative/fx/qmlgraphicspositioners_p_p.h @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSLAYOUTS_P_H +#define QMLGRAPHICSLAYOUTS_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE +class QmlGraphicsBasePositionerPrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsBasePositioner) + +public: + QmlGraphicsBasePositionerPrivate() + : _ep(false), _componentComplete(false), _spacing(0), + aut(QmlGraphicsBasePositioner::None), moveTransition(0), addTransition(0), + removeTransition(0), _movingItem(0) + { + } + + void init(QmlGraphicsBasePositioner::AutoUpdateType at) + { + aut = at; + } + + bool _ep; + bool _componentComplete; + int _spacing; + QmlGraphicsBasePositioner::AutoUpdateType aut; + QmlTransition *moveTransition; + QmlTransition *addTransition; + QmlTransition *removeTransition; + QSet _items; + QSet _leavingItems; + QSet _stableItems; + QSet _newItems; + QSet _animated; + QmlStateOperation::ActionList addActions; + QmlStateOperation::ActionList moveActions; + QmlStateOperation::ActionList removeActions; + QmlTransitionManager addTransitionManager; + QmlTransitionManager moveTransitionManager; + QmlTransitionManager removeTransitionManager; +// QmlStateGroup *stateGroup; + QmlGraphicsItem *_movingItem; +}; + +QT_END_NAMESPACE +#endif diff --git a/src/declarative/fx/qmlgraphicsrect.cpp b/src/declarative/fx/qmlgraphicsrect.cpp index 1784ae1..e5c226c 100644 --- a/src/declarative/fx/qmlgraphicsrect.cpp +++ b/src/declarative/fx/qmlgraphicsrect.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qmlgraphicsrect.h" #include "qmlgraphicsrect_p.h" +#include "qmlgraphicsrect_p_p.h" #include #include diff --git a/src/declarative/fx/qmlgraphicsrect.h b/src/declarative/fx/qmlgraphicsrect.h deleted file mode 100644 index 454b2f1..0000000 --- a/src/declarative/fx/qmlgraphicsrect.h +++ /dev/null @@ -1,189 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSRECT_H -#define QMLGRAPHICSRECT_H - -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) -class Q_DECLARATIVE_EXPORT QmlGraphicsPen : public QObject -{ - Q_OBJECT - - Q_PROPERTY(int width READ width WRITE setWidth NOTIFY penChanged) - Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY penChanged) -public: - QmlGraphicsPen(QObject *parent=0) - : QObject(parent), _width(1), _color("#000000"), _valid(false) - {} - - int width() const { return _width; } - void setWidth(int w); - - QColor color() const { return _color; } - void setColor(const QColor &c); - - bool isValid() { return _valid; }; - -Q_SIGNALS: - void penChanged(); - -private: - int _width; - QColor _color; - bool _valid; -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsGradientStop : public QObject -{ - Q_OBJECT - - Q_PROPERTY(qreal position READ position WRITE setPosition) - Q_PROPERTY(QColor color READ color WRITE setColor) - -public: - QmlGraphicsGradientStop(QObject *parent=0) : QObject(parent) {} - - qreal position() const { return m_position; } - void setPosition(qreal position) { m_position = position; updateGradient(); } - - QColor color() const { return m_color; } - void setColor(const QColor &color) { m_color = color; updateGradient(); } - -private: - void updateGradient(); - -private: - qreal m_position; - QColor m_color; -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsGradient : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QList *stops READ stops) - Q_CLASSINFO("DefaultProperty", "stops") - -public: - QmlGraphicsGradient(QObject *parent=0) : QObject(parent), m_gradient(0) {} - ~QmlGraphicsGradient() { delete m_gradient; } - - QList *stops() { return &m_stops; } - - const QGradient *gradient() const; - -Q_SIGNALS: - void updated(); - -private: - void doUpdate(); - -private: - QList m_stops; - mutable QGradient *m_gradient; - friend class QmlGraphicsGradientStop; -}; - -class QmlGraphicsRectPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsRect : public QmlGraphicsItem -{ - Q_OBJECT - - Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) - Q_PROPERTY(QmlGraphicsGradient *gradient READ gradient WRITE setGradient) - Q_PROPERTY(QmlGraphicsPen * border READ border CONSTANT) - Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged) -public: - QmlGraphicsRect(QmlGraphicsItem *parent=0); - - QColor color() const; - void setColor(const QColor &); - - QmlGraphicsPen *border(); - - QmlGraphicsGradient *gradient() const; - void setGradient(QmlGraphicsGradient *gradient); - - qreal radius() const; - void setRadius(qreal radius); - - QRectF boundingRect() const; - - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); - -Q_SIGNALS: - void colorChanged(); - void radiusChanged(); - -private Q_SLOTS: - void doUpdate(); - -private: - void generateRoundedRect(); - void generateBorderedRect(); - void drawRect(QPainter &painter); - -protected: - QmlGraphicsRect(QmlGraphicsRectPrivate &dd, QmlGraphicsItem *parent); - -private: - Q_DISABLE_COPY(QmlGraphicsRect) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsRect) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsPen) -QML_DECLARE_TYPE(QmlGraphicsGradientStop) -QML_DECLARE_TYPE(QmlGraphicsGradient) -QML_DECLARE_TYPE(QmlGraphicsRect) - -QT_END_HEADER - -#endif // QMLGRAPHICSRECT_H diff --git a/src/declarative/fx/qmlgraphicsrect_p.h b/src/declarative/fx/qmlgraphicsrect_p.h index f44e8de..454b2f1 100644 --- a/src/declarative/fx/qmlgraphicsrect_p.h +++ b/src/declarative/fx/qmlgraphicsrect_p.h @@ -39,71 +39,151 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSRECT_P_H -#define QMLGRAPHICSRECT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qmlgraphicsitem_p.h" +#ifndef QMLGRAPHICSRECT_H +#define QMLGRAPHICSRECT_H + +#include +#include + + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlGraphicsGradient; -class QmlGraphicsRect; -class QmlGraphicsRectPrivate : public QmlGraphicsItemPrivate +QT_MODULE(Declarative) +class Q_DECLARATIVE_EXPORT QmlGraphicsPen : public QObject +{ + Q_OBJECT + + Q_PROPERTY(int width READ width WRITE setWidth NOTIFY penChanged) + Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY penChanged) +public: + QmlGraphicsPen(QObject *parent=0) + : QObject(parent), _width(1), _color("#000000"), _valid(false) + {} + + int width() const { return _width; } + void setWidth(int w); + + QColor color() const { return _color; } + void setColor(const QColor &c); + + bool isValid() { return _valid; }; + +Q_SIGNALS: + void penChanged(); + +private: + int _width; + QColor _color; + bool _valid; +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsGradientStop : public QObject { - Q_DECLARE_PUBLIC(QmlGraphicsRect) + Q_OBJECT + + Q_PROPERTY(qreal position READ position WRITE setPosition) + Q_PROPERTY(QColor color READ color WRITE setColor) public: - QmlGraphicsRectPrivate() : - color(Qt::white), gradient(0), pen(0), radius(0), paintmargin(0) - { - } - - ~QmlGraphicsRectPrivate() - { - delete pen; - } - - void init() - { - } - - QColor getColor(); - QColor color; - QmlGraphicsGradient *gradient; - QmlGraphicsPen *getPen() { - if (!pen) { - Q_Q(QmlGraphicsRect); - pen = new QmlGraphicsPen; - QObject::connect(pen, SIGNAL(penChanged()), q, SLOT(doUpdate())); - } - return pen; - } - QmlGraphicsPen *pen; - qreal radius; - qreal paintmargin; - QPixmap rectImage; - - void setPaintMargin(qreal margin) - { - Q_Q(QmlGraphicsRect); - if (margin == paintmargin) - return; - q->prepareGeometryChange(); - paintmargin = margin; - } + QmlGraphicsGradientStop(QObject *parent=0) : QObject(parent) {} + + qreal position() const { return m_position; } + void setPosition(qreal position) { m_position = position; updateGradient(); } + + QColor color() const { return m_color; } + void setColor(const QColor &color) { m_color = color; updateGradient(); } + +private: + void updateGradient(); + +private: + qreal m_position; + QColor m_color; +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsGradient : public QObject +{ + Q_OBJECT + + Q_PROPERTY(QList *stops READ stops) + Q_CLASSINFO("DefaultProperty", "stops") + +public: + QmlGraphicsGradient(QObject *parent=0) : QObject(parent), m_gradient(0) {} + ~QmlGraphicsGradient() { delete m_gradient; } + + QList *stops() { return &m_stops; } + + const QGradient *gradient() const; + +Q_SIGNALS: + void updated(); + +private: + void doUpdate(); + +private: + QList m_stops; + mutable QGradient *m_gradient; + friend class QmlGraphicsGradientStop; +}; + +class QmlGraphicsRectPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsRect : public QmlGraphicsItem +{ + Q_OBJECT + + Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) + Q_PROPERTY(QmlGraphicsGradient *gradient READ gradient WRITE setGradient) + Q_PROPERTY(QmlGraphicsPen * border READ border CONSTANT) + Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged) +public: + QmlGraphicsRect(QmlGraphicsItem *parent=0); + + QColor color() const; + void setColor(const QColor &); + + QmlGraphicsPen *border(); + + QmlGraphicsGradient *gradient() const; + void setGradient(QmlGraphicsGradient *gradient); + + qreal radius() const; + void setRadius(qreal radius); + + QRectF boundingRect() const; + + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + +Q_SIGNALS: + void colorChanged(); + void radiusChanged(); + +private Q_SLOTS: + void doUpdate(); + +private: + void generateRoundedRect(); + void generateBorderedRect(); + void drawRect(QPainter &painter); + +protected: + QmlGraphicsRect(QmlGraphicsRectPrivate &dd, QmlGraphicsItem *parent); + +private: + Q_DISABLE_COPY(QmlGraphicsRect) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsRect) }; QT_END_NAMESPACE -#endif // QMLGRAPHICSRECT_P_H +QML_DECLARE_TYPE(QmlGraphicsPen) +QML_DECLARE_TYPE(QmlGraphicsGradientStop) +QML_DECLARE_TYPE(QmlGraphicsGradient) +QML_DECLARE_TYPE(QmlGraphicsRect) + +QT_END_HEADER + +#endif // QMLGRAPHICSRECT_H diff --git a/src/declarative/fx/qmlgraphicsrect_p_p.h b/src/declarative/fx/qmlgraphicsrect_p_p.h new file mode 100644 index 0000000..f44e8de --- /dev/null +++ b/src/declarative/fx/qmlgraphicsrect_p_p.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSRECT_P_H +#define QMLGRAPHICSRECT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlgraphicsitem_p.h" + +QT_BEGIN_NAMESPACE + +class QmlGraphicsGradient; +class QmlGraphicsRect; +class QmlGraphicsRectPrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsRect) + +public: + QmlGraphicsRectPrivate() : + color(Qt::white), gradient(0), pen(0), radius(0), paintmargin(0) + { + } + + ~QmlGraphicsRectPrivate() + { + delete pen; + } + + void init() + { + } + + QColor getColor(); + QColor color; + QmlGraphicsGradient *gradient; + QmlGraphicsPen *getPen() { + if (!pen) { + Q_Q(QmlGraphicsRect); + pen = new QmlGraphicsPen; + QObject::connect(pen, SIGNAL(penChanged()), q, SLOT(doUpdate())); + } + return pen; + } + QmlGraphicsPen *pen; + qreal radius; + qreal paintmargin; + QPixmap rectImage; + + void setPaintMargin(qreal margin) + { + Q_Q(QmlGraphicsRect); + if (margin == paintmargin) + return; + q->prepareGeometryChange(); + paintmargin = margin; + } +}; + +QT_END_NAMESPACE + +#endif // QMLGRAPHICSRECT_P_H diff --git a/src/declarative/fx/qmlgraphicsrepeater.cpp b/src/declarative/fx/qmlgraphicsrepeater.cpp index 608f948..c50c220 100644 --- a/src/declarative/fx/qmlgraphicsrepeater.cpp +++ b/src/declarative/fx/qmlgraphicsrepeater.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "qmlgraphicsrepeater.h" #include "qmlgraphicsrepeater_p.h" -#include "qmllistaccessor.h" -#include "qmlgraphicsvisualitemmodel.h" -#include +#include "qmlgraphicsrepeater_p_p.h" +#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/declarative/fx/qmlgraphicsrepeater.h b/src/declarative/fx/qmlgraphicsrepeater.h deleted file mode 100644 index 9cb7d45..0000000 --- a/src/declarative/fx/qmlgraphicsrepeater.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSREPEATER_H -#define QMLGRAPHICSREPEATER_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsRepeaterPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsRepeater : public QmlGraphicsItem -{ - Q_OBJECT - - Q_PROPERTY(QVariant model READ model WRITE setModel) - Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) - Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_CLASSINFO("DefaultProperty", "delegate") - -public: - QmlGraphicsRepeater(QmlGraphicsItem *parent=0); - virtual ~QmlGraphicsRepeater(); - - QVariant model() const; - void setModel(const QVariant &); - - QmlComponent *delegate() const; - void setDelegate(QmlComponent *); - - int count() const; - -Q_SIGNALS: - void countChanged(); - -private: - void clear(); - void regenerate(); - -protected: - virtual void componentComplete(); - QVariant itemChange(GraphicsItemChange change, const QVariant &value); - QmlGraphicsRepeater(QmlGraphicsRepeaterPrivate &dd, QmlGraphicsItem *parent); - -private Q_SLOTS: - void itemsInserted(int,int); - void itemsRemoved(int,int); - void itemsMoved(int,int,int); - -private: - Q_DISABLE_COPY(QmlGraphicsRepeater) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsRepeater) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsRepeater) - -QT_END_HEADER - -#endif // QMLGRAPHICSREPEATER_H diff --git a/src/declarative/fx/qmlgraphicsrepeater_p.h b/src/declarative/fx/qmlgraphicsrepeater_p.h index 7c111da..9cb7d45 100644 --- a/src/declarative/fx/qmlgraphicsrepeater_p.h +++ b/src/declarative/fx/qmlgraphicsrepeater_p.h @@ -39,43 +39,65 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSREPEATER_P_H -#define QMLGRAPHICSREPEATER_P_H +#ifndef QMLGRAPHICSREPEATER_H +#define QMLGRAPHICSREPEATER_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qmlgraphicsitem_p.h" -#include "qmlgraphicsrepeater.h" -#include +#include +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlContext; -class QmlGraphicsVisualModel; -class QmlGraphicsRepeaterPrivate : public QmlGraphicsItemPrivate +QT_MODULE(Declarative) + +class QmlGraphicsRepeaterPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsRepeater : public QmlGraphicsItem { - Q_DECLARE_PUBLIC(QmlGraphicsRepeater) + Q_OBJECT + + Q_PROPERTY(QVariant model READ model WRITE setModel) + Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) + Q_PROPERTY(int count READ count NOTIFY countChanged) + Q_CLASSINFO("DefaultProperty", "delegate") public: - QmlGraphicsRepeaterPrivate(); - ~QmlGraphicsRepeaterPrivate(); + QmlGraphicsRepeater(QmlGraphicsItem *parent=0); + virtual ~QmlGraphicsRepeater(); + + QVariant model() const; + void setModel(const QVariant &); + + QmlComponent *delegate() const; + void setDelegate(QmlComponent *); + + int count() const; - QmlGraphicsVisualModel *model; - QVariant dataSource; - bool ownModel; +Q_SIGNALS: + void countChanged(); - QList > deletables; +private: + void clear(); + void regenerate(); + +protected: + virtual void componentComplete(); + QVariant itemChange(GraphicsItemChange change, const QVariant &value); + QmlGraphicsRepeater(QmlGraphicsRepeaterPrivate &dd, QmlGraphicsItem *parent); + +private Q_SLOTS: + void itemsInserted(int,int); + void itemsRemoved(int,int); + void itemsMoved(int,int,int); + +private: + Q_DISABLE_COPY(QmlGraphicsRepeater) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsRepeater) }; QT_END_NAMESPACE -#endif // QMLGRAPHICSREPEATER_P_H + +QML_DECLARE_TYPE(QmlGraphicsRepeater) + +QT_END_HEADER + +#endif // QMLGRAPHICSREPEATER_H diff --git a/src/declarative/fx/qmlgraphicsrepeater_p_p.h b/src/declarative/fx/qmlgraphicsrepeater_p_p.h new file mode 100644 index 0000000..d8b83be --- /dev/null +++ b/src/declarative/fx/qmlgraphicsrepeater_p_p.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSREPEATER_P_H +#define QMLGRAPHICSREPEATER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlgraphicsitem_p.h" +#include "qmlgraphicsrepeater_p.h" +#include + + +QT_BEGIN_NAMESPACE + +class QmlContext; +class QmlGraphicsVisualModel; +class QmlGraphicsRepeaterPrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsRepeater) + +public: + QmlGraphicsRepeaterPrivate(); + ~QmlGraphicsRepeaterPrivate(); + + QmlGraphicsVisualModel *model; + QVariant dataSource; + bool ownModel; + + QList > deletables; +}; + +QT_END_NAMESPACE +#endif // QMLGRAPHICSREPEATER_P_H diff --git a/src/declarative/fx/qmlgraphicsscalegrid.cpp b/src/declarative/fx/qmlgraphicsscalegrid.cpp index fdf44cf..251f823 100644 --- a/src/declarative/fx/qmlgraphicsscalegrid.cpp +++ b/src/declarative/fx/qmlgraphicsscalegrid.cpp @@ -42,7 +42,7 @@ #include #include #include -#include "qmlgraphicsscalegrid_p.h" +#include "qmlgraphicsscalegrid_p_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/fx/qmlgraphicsscalegrid_p.h b/src/declarative/fx/qmlgraphicsscalegrid_p.h deleted file mode 100644 index 040db4c..0000000 --- a/src/declarative/fx/qmlgraphicsscalegrid_p.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSSCALEGRID_H -#define QMLGRAPHICSSCALEGRID_H - -#include -#include -#include -#include -#include -#include "qmlgraphicsborderimage.h" - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class Q_DECLARATIVE_EXPORT QmlGraphicsScaleGrid : public QObject -{ - Q_OBJECT - Q_ENUMS(TileRule) - - Q_PROPERTY(int left READ left WRITE setLeft NOTIFY borderChanged) - Q_PROPERTY(int top READ top WRITE setTop NOTIFY borderChanged) - Q_PROPERTY(int right READ right WRITE setRight NOTIFY borderChanged) - Q_PROPERTY(int bottom READ bottom WRITE setBottom NOTIFY borderChanged) - -public: - QmlGraphicsScaleGrid(QObject *parent=0); - ~QmlGraphicsScaleGrid(); - - bool isNull() const; - - int left() const { return _left; } - void setLeft(int); - - int top() const { return _top; } - void setTop(int); - - int right() const { return _right; } - void setRight(int); - - int bottom() const { return _bottom; } - void setBottom(int); - -Q_SIGNALS: - void borderChanged(); - -private: - int _left; - int _top; - int _right; - int _bottom; -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsGridScaledImage -{ -public: - QmlGraphicsGridScaledImage(); - QmlGraphicsGridScaledImage(const QmlGraphicsGridScaledImage &); - QmlGraphicsGridScaledImage(QIODevice*); - QmlGraphicsGridScaledImage &operator=(const QmlGraphicsGridScaledImage &); - bool isValid() const; - int gridLeft() const; - int gridRight() const; - int gridTop() const; - int gridBottom() const; - QmlGraphicsBorderImage::TileMode horizontalTileRule() const { return _h; } - QmlGraphicsBorderImage::TileMode verticalTileRule() const { return _v; } - - QString pixmapUrl() const; - -private: - static QmlGraphicsBorderImage::TileMode stringToRule(const QString &); - -private: - int _l; - int _r; - int _t; - int _b; - QmlGraphicsBorderImage::TileMode _h; - QmlGraphicsBorderImage::TileMode _v; - QString _pix; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsScaleGrid) - -QT_END_HEADER - -#endif // QMLGRAPHICSSCALEGRID_H diff --git a/src/declarative/fx/qmlgraphicsscalegrid_p_p.h b/src/declarative/fx/qmlgraphicsscalegrid_p_p.h new file mode 100644 index 0000000..d5acca2 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsscalegrid_p_p.h @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSSCALEGRID_H +#define QMLGRAPHICSSCALEGRID_H + +#include +#include +#include +#include +#include +#include "qmlgraphicsborderimage_p.h" + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class Q_DECLARATIVE_EXPORT QmlGraphicsScaleGrid : public QObject +{ + Q_OBJECT + Q_ENUMS(TileRule) + + Q_PROPERTY(int left READ left WRITE setLeft NOTIFY borderChanged) + Q_PROPERTY(int top READ top WRITE setTop NOTIFY borderChanged) + Q_PROPERTY(int right READ right WRITE setRight NOTIFY borderChanged) + Q_PROPERTY(int bottom READ bottom WRITE setBottom NOTIFY borderChanged) + +public: + QmlGraphicsScaleGrid(QObject *parent=0); + ~QmlGraphicsScaleGrid(); + + bool isNull() const; + + int left() const { return _left; } + void setLeft(int); + + int top() const { return _top; } + void setTop(int); + + int right() const { return _right; } + void setRight(int); + + int bottom() const { return _bottom; } + void setBottom(int); + +Q_SIGNALS: + void borderChanged(); + +private: + int _left; + int _top; + int _right; + int _bottom; +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsGridScaledImage +{ +public: + QmlGraphicsGridScaledImage(); + QmlGraphicsGridScaledImage(const QmlGraphicsGridScaledImage &); + QmlGraphicsGridScaledImage(QIODevice*); + QmlGraphicsGridScaledImage &operator=(const QmlGraphicsGridScaledImage &); + bool isValid() const; + int gridLeft() const; + int gridRight() const; + int gridTop() const; + int gridBottom() const; + QmlGraphicsBorderImage::TileMode horizontalTileRule() const { return _h; } + QmlGraphicsBorderImage::TileMode verticalTileRule() const { return _v; } + + QString pixmapUrl() const; + +private: + static QmlGraphicsBorderImage::TileMode stringToRule(const QString &); + +private: + int _l; + int _r; + int _t; + int _b; + QmlGraphicsBorderImage::TileMode _h; + QmlGraphicsBorderImage::TileMode _v; + QString _pix; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsScaleGrid) + +QT_END_HEADER + +#endif // QMLGRAPHICSSCALEGRID_H diff --git a/src/declarative/fx/qmlgraphicstext.cpp b/src/declarative/fx/qmlgraphicstext.cpp index f5ea55f..0b88cc5 100644 --- a/src/declarative/fx/qmlgraphicstext.cpp +++ b/src/declarative/fx/qmlgraphicstext.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "qmlgraphicstext.h" #include "qmlgraphicstext_p.h" +#include "qmlgraphicstext_p_p.h" #include -#include +#include #include #include #include diff --git a/src/declarative/fx/qmlgraphicstext.h b/src/declarative/fx/qmlgraphicstext.h deleted file mode 100644 index 619de87..0000000 --- a/src/declarative/fx/qmlgraphicstext.h +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSTEXT_H -#define QMLGRAPHICSTEXT_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) -class QmlGraphicsTextPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsText : public QmlGraphicsItem -{ - Q_OBJECT - Q_ENUMS(HAlignment) - Q_ENUMS(VAlignment) - Q_ENUMS(TextStyle) - Q_ENUMS(TextFormat) - Q_ENUMS(TextElideMode) - - Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) - Q_PROPERTY(QFont font READ font WRITE setFont) - Q_PROPERTY(QColor color READ color WRITE setColor) - Q_PROPERTY(TextStyle style READ style WRITE setStyle) - Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor) - Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign) - Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign) - Q_PROPERTY(bool wrap READ wrap WRITE setWrap) //### there are several wrap modes in Qt - Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat) - Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode) //### elideMode? - -public: - QmlGraphicsText(QmlGraphicsItem *parent=0); - ~QmlGraphicsText(); - - enum HAlignment { AlignLeft = Qt::AlignLeft, - AlignRight = Qt::AlignRight, - AlignHCenter = Qt::AlignHCenter }; - enum VAlignment { AlignTop = Qt::AlignTop, - AlignBottom = Qt::AlignBottom, - AlignVCenter = Qt::AlignVCenter }; - enum TextStyle { Normal, - Outline, - Raised, - Sunken }; - enum TextFormat { PlainText = Qt::PlainText, - RichText = Qt::RichText, - AutoText = Qt::AutoText }; - enum TextElideMode { ElideLeft = Qt::ElideLeft, - ElideRight = Qt::ElideRight, - ElideMiddle = Qt::ElideMiddle, - ElideNone = Qt::ElideNone }; - - QString text() const; - void setText(const QString &); - - QFont font() const; - void setFont(const QFont &font); - - QColor color() const; - void setColor(const QColor &c); - - TextStyle style() const; - void setStyle(TextStyle style); - - QColor styleColor() const; - void setStyleColor(const QColor &c); - - HAlignment hAlign() const; - void setHAlign(HAlignment align); - - VAlignment vAlign() const; - void setVAlign(VAlignment align); - - bool wrap() const; - void setWrap(bool w); - - TextFormat textFormat() const; - void setTextFormat(TextFormat format); - - TextElideMode elideMode() const; - void setElideMode(TextElideMode); - - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); - - virtual void componentComplete(); - -Q_SIGNALS: - void textChanged(const QString &text); - void linkActivated(const QString &link); - -protected: - QmlGraphicsText(QmlGraphicsTextPrivate &dd, QmlGraphicsItem *parent); - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - virtual void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry); - -private: - Q_DISABLE_COPY(QmlGraphicsText) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsText) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsText) - -QT_END_HEADER - -#endif diff --git a/src/declarative/fx/qmlgraphicstext_p.h b/src/declarative/fx/qmlgraphicstext_p.h index bf14c6f..619de87 100644 --- a/src/declarative/fx/qmlgraphicstext_p.h +++ b/src/declarative/fx/qmlgraphicstext_p.h @@ -39,75 +39,113 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSTEXT_P_H -#define QMLGRAPHICSTEXT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qmlgraphicsitem.h" -#include "qmlgraphicsitem_p.h" -#include "qml.h" -#include +#ifndef QMLGRAPHICSTEXT_H +#define QMLGRAPHICSTEXT_H -QT_BEGIN_NAMESPACE +#include + +QT_BEGIN_HEADER -class QTextLayout; -class QTextDocument; -class QTextControl; +QT_BEGIN_NAMESPACE -class QmlGraphicsTextPrivate : public QmlGraphicsItemPrivate +QT_MODULE(Declarative) +class QmlGraphicsTextPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsText : public QmlGraphicsItem { - Q_DECLARE_PUBLIC(QmlGraphicsText) + Q_OBJECT + Q_ENUMS(HAlignment) + Q_ENUMS(VAlignment) + Q_ENUMS(TextStyle) + Q_ENUMS(TextFormat) + Q_ENUMS(TextElideMode) + + Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) + Q_PROPERTY(QFont font READ font WRITE setFont) + Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(TextStyle style READ style WRITE setStyle) + Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor) + Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign) + Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign) + Q_PROPERTY(bool wrap READ wrap WRITE setWrap) //### there are several wrap modes in Qt + Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat) + Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode) //### elideMode? + public: - QmlGraphicsTextPrivate() - : color((QRgb)0), style(QmlGraphicsText::Normal), imgDirty(true), - hAlign(QmlGraphicsText::AlignLeft), vAlign(QmlGraphicsText::AlignTop), elideMode(QmlGraphicsText::ElideNone), - dirty(true), wrap(false), richText(false), singleline(false), control(0), doc(0), - format(QmlGraphicsText::AutoText) - { - } - - void updateSize(); - void checkImgCache(); - - void drawOutline(); - void drawOutline(int yOffset); - - QPixmap wrappedTextImage(bool drawStyle); - QPixmap richTextImage(bool drawStyle); - QSize setupTextLayout(QTextLayout *layout); - - QString text; - QFont font; - QColor color; - QmlGraphicsText::TextStyle style; - QColor styleColor; - QString activeLink; - bool imgDirty; - QPixmap imgCache; - QPixmap imgStyleCache; - QmlGraphicsText::HAlignment hAlign; - QmlGraphicsText::VAlignment vAlign; - QmlGraphicsText::TextElideMode elideMode; - bool dirty; - bool wrap; - bool richText; - bool singleline; - QTextControl *control; - QTextDocument *doc; - QTextLayout layout; - QSize cachedLayoutSize; - QmlGraphicsText::TextFormat format; + QmlGraphicsText(QmlGraphicsItem *parent=0); + ~QmlGraphicsText(); + + enum HAlignment { AlignLeft = Qt::AlignLeft, + AlignRight = Qt::AlignRight, + AlignHCenter = Qt::AlignHCenter }; + enum VAlignment { AlignTop = Qt::AlignTop, + AlignBottom = Qt::AlignBottom, + AlignVCenter = Qt::AlignVCenter }; + enum TextStyle { Normal, + Outline, + Raised, + Sunken }; + enum TextFormat { PlainText = Qt::PlainText, + RichText = Qt::RichText, + AutoText = Qt::AutoText }; + enum TextElideMode { ElideLeft = Qt::ElideLeft, + ElideRight = Qt::ElideRight, + ElideMiddle = Qt::ElideMiddle, + ElideNone = Qt::ElideNone }; + + QString text() const; + void setText(const QString &); + + QFont font() const; + void setFont(const QFont &font); + + QColor color() const; + void setColor(const QColor &c); + + TextStyle style() const; + void setStyle(TextStyle style); + + QColor styleColor() const; + void setStyleColor(const QColor &c); + + HAlignment hAlign() const; + void setHAlign(HAlignment align); + + VAlignment vAlign() const; + void setVAlign(VAlignment align); + + bool wrap() const; + void setWrap(bool w); + + TextFormat textFormat() const; + void setTextFormat(TextFormat format); + + TextElideMode elideMode() const; + void setElideMode(TextElideMode); + + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + + virtual void componentComplete(); + +Q_SIGNALS: + void textChanged(const QString &text); + void linkActivated(const QString &link); + +protected: + QmlGraphicsText(QmlGraphicsTextPrivate &dd, QmlGraphicsItem *parent); + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + +private: + Q_DISABLE_COPY(QmlGraphicsText) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsText) }; QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsText) + +QT_END_HEADER + #endif diff --git a/src/declarative/fx/qmlgraphicstext_p_p.h b/src/declarative/fx/qmlgraphicstext_p_p.h new file mode 100644 index 0000000..bf14c6f --- /dev/null +++ b/src/declarative/fx/qmlgraphicstext_p_p.h @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSTEXT_P_H +#define QMLGRAPHICSTEXT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlgraphicsitem.h" +#include "qmlgraphicsitem_p.h" +#include "qml.h" +#include + +QT_BEGIN_NAMESPACE + +class QTextLayout; +class QTextDocument; +class QTextControl; + +class QmlGraphicsTextPrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsText) +public: + QmlGraphicsTextPrivate() + : color((QRgb)0), style(QmlGraphicsText::Normal), imgDirty(true), + hAlign(QmlGraphicsText::AlignLeft), vAlign(QmlGraphicsText::AlignTop), elideMode(QmlGraphicsText::ElideNone), + dirty(true), wrap(false), richText(false), singleline(false), control(0), doc(0), + format(QmlGraphicsText::AutoText) + { + } + + void updateSize(); + void checkImgCache(); + + void drawOutline(); + void drawOutline(int yOffset); + + QPixmap wrappedTextImage(bool drawStyle); + QPixmap richTextImage(bool drawStyle); + QSize setupTextLayout(QTextLayout *layout); + + QString text; + QFont font; + QColor color; + QmlGraphicsText::TextStyle style; + QColor styleColor; + QString activeLink; + bool imgDirty; + QPixmap imgCache; + QPixmap imgStyleCache; + QmlGraphicsText::HAlignment hAlign; + QmlGraphicsText::VAlignment vAlign; + QmlGraphicsText::TextElideMode elideMode; + bool dirty; + bool wrap; + bool richText; + bool singleline; + QTextControl *control; + QTextDocument *doc; + QTextLayout layout; + QSize cachedLayoutSize; + QmlGraphicsText::TextFormat format; +}; + +QT_END_NAMESPACE +#endif diff --git a/src/declarative/fx/qmlgraphicstextedit.cpp b/src/declarative/fx/qmlgraphicstextedit.cpp index 24c64c1..a42ccdd 100644 --- a/src/declarative/fx/qmlgraphicstextedit.cpp +++ b/src/declarative/fx/qmlgraphicstextedit.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include #include "qmlgraphicstextedit_p.h" +#include "qmlgraphicstextedit_p_p.h" #include -#include -#include "qmlgraphicsevents_p.h" +#include +#include #include #include #include diff --git a/src/declarative/fx/qmlgraphicstextedit.h b/src/declarative/fx/qmlgraphicstextedit.h deleted file mode 100644 index 57f7449..0000000 --- a/src/declarative/fx/qmlgraphicstextedit.h +++ /dev/null @@ -1,234 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSTEXTEDIT_H -#define QMLGRAPHICSTEXTEDIT_H - -#include -#include - -#include -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - - -class QmlGraphicsTextEditPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsTextEdit : public QmlGraphicsPaintedItem -{ - Q_OBJECT - Q_ENUMS(VAlignment) - Q_ENUMS(HAlignment) - Q_ENUMS(TextFormat) - - Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) - Q_PROPERTY(QColor color READ color WRITE setColor) - Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor) - Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor) - Q_PROPERTY(QFont font READ font WRITE setFont) - Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign) - Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign) - Q_PROPERTY(bool wrap READ wrap WRITE setWrap) //### other wrap modes - Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat) - Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) - Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible) - Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) - Q_PROPERTY(QmlComponent* cursorDelegate READ cursorDelegate WRITE setCursorDelegate) - Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) - Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) - Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged) - Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress) - Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection) - Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin) - -public: - QmlGraphicsTextEdit(QmlGraphicsItem *parent=0); - - enum HAlignment { - AlignLeft = Qt::AlignLeft, - AlignRight = Qt::AlignRight, - AlignHCenter = Qt::AlignHCenter - }; - - enum VAlignment { - AlignTop = Qt::AlignTop, - AlignBottom = Qt::AlignBottom, - AlignVCenter = Qt::AlignVCenter - }; - - enum TextFormat { - PlainText = Qt::PlainText, - RichText = Qt::RichText, - AutoText = Qt::AutoText - }; - - QString text() const; - void setText(const QString &); - - TextFormat textFormat() const; - void setTextFormat(TextFormat format); - - QFont font() const; - void setFont(const QFont &font); - - QColor color() const; - void setColor(const QColor &c); - - QColor selectionColor() const; - void setSelectionColor(const QColor &c); - - QColor selectedTextColor() const; - void setSelectedTextColor(const QColor &c); - - HAlignment hAlign() const; - void setHAlign(HAlignment align); - - VAlignment vAlign() const; - void setVAlign(VAlignment align); - - bool wrap() const; - void setWrap(bool w); - - bool isCursorVisible() const; - void setCursorVisible(bool on); - - int cursorPosition() const; - void setCursorPosition(int pos); - - QmlComponent* cursorDelegate() const; - void setCursorDelegate(QmlComponent*); - - int selectionStart() const; - void setSelectionStart(int); - - int selectionEnd() const; - void setSelectionEnd(int); - - QString selectedText() const; - - bool focusOnPress() const; - void setFocusOnPress(bool on); - - bool persistentSelection() const; - void setPersistentSelection(bool on); - - qreal textMargin() const; - void setTextMargin(qreal margin); - - virtual void componentComplete(); - - /* FROM EDIT */ - void setReadOnly(bool); - bool isReadOnly() const; - - void setTextInteractionFlags(Qt::TextInteractionFlags flags); - Qt::TextInteractionFlags textInteractionFlags() const; - - QTextCursor cursorForPosition(const QPoint &pos) const; - QRect cursorRect(const QTextCursor &cursor) const; - QRect cursorRect() const; - - void setTextCursor(const QTextCursor &cursor); - QTextCursor textCursor() const; - - void moveCursor(QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor); - - QVariant inputMethodQuery(Qt::InputMethodQuery property) const; - -Q_SIGNALS: - void textChanged(const QString &); - void cursorPositionChanged(); - void selectionStartChanged(); - void selectionEndChanged(); - void selectionChanged(); - -public Q_SLOTS: - void selectAll(); - -private Q_SLOTS: - void updateImgCache(const QRectF &rect); - void q_textChanged(); - void updateSelectionMarkers(); - void moveCursorDelegate(); - void loadCursorDelegate(); - -private: - void updateSize(); - -protected: - QmlGraphicsTextEdit(QmlGraphicsTextEditPrivate &dd, QmlGraphicsItem *parent); - virtual void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry); - - bool event(QEvent *); - void keyPressEvent(QKeyEvent *); - void keyReleaseEvent(QKeyEvent *); - - void focusChanged(bool); - - // mouse filter? - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - - void inputMethodEvent(QInputMethodEvent *e); - - void drawContents(QPainter *, const QRect &); -private: - Q_DISABLE_COPY(QmlGraphicsTextEdit) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsTextEdit) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsTextEdit) - -QT_END_HEADER - -#endif diff --git a/src/declarative/fx/qmlgraphicstextedit_p.h b/src/declarative/fx/qmlgraphicstextedit_p.h index 7a163f8..57a9327 100644 --- a/src/declarative/fx/qmlgraphicstextedit_p.h +++ b/src/declarative/fx/qmlgraphicstextedit_p.h @@ -39,75 +39,196 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSTEXTEDIT_P_H -#define QMLGRAPHICSTEXTEDIT_P_H +#ifndef QMLGRAPHICSTEXTEDIT_H +#define QMLGRAPHICSTEXTEDIT_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#include +#include -#include "qmlgraphicsitem.h" -#include "qmlgraphicspainteditem_p.h" -#include "qml.h" +#include +#include +#include +#include +QT_BEGIN_HEADER + QT_BEGIN_NAMESPACE -class QTextLayout; -class QTextDocument; -class QTextControl; -class QmlGraphicsTextEditPrivate : public QmlGraphicsPaintedItemPrivate + +QT_MODULE(Declarative) + + +class QmlGraphicsTextEditPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsTextEdit : public QmlGraphicsPaintedItem { - Q_DECLARE_PUBLIC(QmlGraphicsTextEdit) + Q_OBJECT + Q_ENUMS(VAlignment) + Q_ENUMS(HAlignment) + Q_ENUMS(TextFormat) + + Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) + Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor) + Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor) + Q_PROPERTY(QFont font READ font WRITE setFont) + Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign) + Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign) + Q_PROPERTY(bool wrap READ wrap WRITE setWrap) //### other wrap modes + Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat) + Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) + Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible) + Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) + Q_PROPERTY(QmlComponent* cursorDelegate READ cursorDelegate WRITE setCursorDelegate) + Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) + Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) + Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged) + Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress) + Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection) + Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin) public: - QmlGraphicsTextEditPrivate() - : color("black"), imgDirty(true), hAlign(QmlGraphicsTextEdit::AlignLeft), vAlign(QmlGraphicsTextEdit::AlignTop), - dirty(false), wrap(false), richText(false), cursorVisible(false), focusOnPress(false), - persistentSelection(true), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0), - cursorComponent(0), cursor(0), format(QmlGraphicsTextEdit::AutoText), document(0) - { - } - - void init(); - - void updateDefaultTextOption(); - void relayoutDocument(); - void updateSelection(); - - QString text; - QFont font; - QColor color; - QColor selectionColor; - QColor selectedTextColor; - QString style; - QColor styleColor; - bool imgDirty; - QPixmap imgCache; - QPixmap imgStyleCache; - QmlGraphicsTextEdit::HAlignment hAlign; - QmlGraphicsTextEdit::VAlignment vAlign; - bool dirty; - bool wrap; - bool richText; - bool cursorVisible; - bool focusOnPress; - bool persistentSelection; - qreal textMargin; - int lastSelectionStart; - int lastSelectionEnd; - QmlComponent* cursorComponent; - QmlGraphicsItem* cursor; - QmlGraphicsTextEdit::TextFormat format; - QTextDocument *document; - QTextControl *control; + QmlGraphicsTextEdit(QmlGraphicsItem *parent=0); + + enum HAlignment { + AlignLeft = Qt::AlignLeft, + AlignRight = Qt::AlignRight, + AlignHCenter = Qt::AlignHCenter + }; + + enum VAlignment { + AlignTop = Qt::AlignTop, + AlignBottom = Qt::AlignBottom, + AlignVCenter = Qt::AlignVCenter + }; + + enum TextFormat { + PlainText = Qt::PlainText, + RichText = Qt::RichText, + AutoText = Qt::AutoText + }; + + QString text() const; + void setText(const QString &); + + TextFormat textFormat() const; + void setTextFormat(TextFormat format); + + QFont font() const; + void setFont(const QFont &font); + + QColor color() const; + void setColor(const QColor &c); + + QColor selectionColor() const; + void setSelectionColor(const QColor &c); + + QColor selectedTextColor() const; + void setSelectedTextColor(const QColor &c); + + HAlignment hAlign() const; + void setHAlign(HAlignment align); + + VAlignment vAlign() const; + void setVAlign(VAlignment align); + + bool wrap() const; + void setWrap(bool w); + + bool isCursorVisible() const; + void setCursorVisible(bool on); + + int cursorPosition() const; + void setCursorPosition(int pos); + + QmlComponent* cursorDelegate() const; + void setCursorDelegate(QmlComponent*); + + int selectionStart() const; + void setSelectionStart(int); + + int selectionEnd() const; + void setSelectionEnd(int); + + QString selectedText() const; + + bool focusOnPress() const; + void setFocusOnPress(bool on); + + bool persistentSelection() const; + void setPersistentSelection(bool on); + + qreal textMargin() const; + void setTextMargin(qreal margin); + + virtual void componentComplete(); + + /* FROM EDIT */ + void setReadOnly(bool); + bool isReadOnly() const; + + void setTextInteractionFlags(Qt::TextInteractionFlags flags); + Qt::TextInteractionFlags textInteractionFlags() const; + + QTextCursor cursorForPosition(const QPoint &pos) const; + QRect cursorRect(const QTextCursor &cursor) const; + QRect cursorRect() const; + + void setTextCursor(const QTextCursor &cursor); + QTextCursor textCursor() const; + + void moveCursor(QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor); + + QVariant inputMethodQuery(Qt::InputMethodQuery property) const; + +Q_SIGNALS: + void textChanged(const QString &); + void cursorPositionChanged(); + void selectionStartChanged(); + void selectionEndChanged(); + void selectionChanged(); + +public Q_SLOTS: + void selectAll(); + +private Q_SLOTS: + void updateImgCache(const QRectF &rect); + void q_textChanged(); + void updateSelectionMarkers(); + void moveCursorDelegate(); + void loadCursorDelegate(); + +private: + void updateSize(); + +protected: + QmlGraphicsTextEdit(QmlGraphicsTextEditPrivate &dd, QmlGraphicsItem *parent); + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + + bool event(QEvent *); + void keyPressEvent(QKeyEvent *); + void keyReleaseEvent(QKeyEvent *); + + void focusChanged(bool); + + // mouse filter? + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + + void inputMethodEvent(QInputMethodEvent *e); + + void drawContents(QPainter *, const QRect &); +private: + Q_DISABLE_COPY(QmlGraphicsTextEdit) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsTextEdit) }; QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsTextEdit) + +QT_END_HEADER + #endif diff --git a/src/declarative/fx/qmlgraphicstextedit_p_p.h b/src/declarative/fx/qmlgraphicstextedit_p_p.h new file mode 100644 index 0000000..9cba17e --- /dev/null +++ b/src/declarative/fx/qmlgraphicstextedit_p_p.h @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSTEXTEDIT_P_H +#define QMLGRAPHICSTEXTEDIT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qmlgraphicsitem.h" +#include "qmlgraphicspainteditem_p_p.h" +#include "qml.h" + + +QT_BEGIN_NAMESPACE +class QTextLayout; +class QTextDocument; +class QTextControl; +class QmlGraphicsTextEditPrivate : public QmlGraphicsPaintedItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsTextEdit) + +public: + QmlGraphicsTextEditPrivate() + : color("black"), imgDirty(true), hAlign(QmlGraphicsTextEdit::AlignLeft), vAlign(QmlGraphicsTextEdit::AlignTop), + dirty(false), wrap(false), richText(false), cursorVisible(false), focusOnPress(false), + persistentSelection(true), textMargin(0.0), lastSelectionStart(0), lastSelectionEnd(0), + cursorComponent(0), cursor(0), format(QmlGraphicsTextEdit::AutoText), document(0) + { + } + + void init(); + + void updateDefaultTextOption(); + void relayoutDocument(); + void updateSelection(); + + QString text; + QFont font; + QColor color; + QColor selectionColor; + QColor selectedTextColor; + QString style; + QColor styleColor; + bool imgDirty; + QPixmap imgCache; + QPixmap imgStyleCache; + QmlGraphicsTextEdit::HAlignment hAlign; + QmlGraphicsTextEdit::VAlignment vAlign; + bool dirty; + bool wrap; + bool richText; + bool cursorVisible; + bool focusOnPress; + bool persistentSelection; + qreal textMargin; + int lastSelectionStart; + int lastSelectionEnd; + QmlComponent* cursorComponent; + QmlGraphicsItem* cursor; + QmlGraphicsTextEdit::TextFormat format; + QTextDocument *document; + QTextControl *control; +}; + +QT_END_NAMESPACE +#endif diff --git a/src/declarative/fx/qmlgraphicstextinput.cpp b/src/declarative/fx/qmlgraphicstextinput.cpp index 17e6f7c..5df2484 100644 --- a/src/declarative/fx/qmlgraphicstextinput.cpp +++ b/src/declarative/fx/qmlgraphicstextinput.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qmlgraphicstextinput.h" #include "qmlgraphicstextinput_p.h" +#include "qmlgraphicstextinput_p_p.h" #include "qmlinfo.h" #include #include diff --git a/src/declarative/fx/qmlgraphicstextinput.h b/src/declarative/fx/qmlgraphicstextinput.h deleted file mode 100644 index 1b143e0..0000000 --- a/src/declarative/fx/qmlgraphicstextinput.h +++ /dev/null @@ -1,209 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSTEXTINPUT_H -#define QMLGRAPHICSTEXTINPUT_H - -#include "qmlgraphicstext.h" -#include "qmlgraphicspainteditem.h" -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsTextInputPrivate; -class QValidator; -class Q_DECLARATIVE_EXPORT QmlGraphicsTextInput : public QmlGraphicsPaintedItem -{ - Q_OBJECT - Q_ENUMS(HAlignment) - Q_ENUMS(EchoMode) - - Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) - Q_PROPERTY(QColor color READ color WRITE setColor) - Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor) - Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor) - Q_PROPERTY(QFont font READ font WRITE setFont) - Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign) - - Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) - Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible) - Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) - Q_PROPERTY(QmlComponent *cursorDelegate READ cursorDelegate WRITE setCursorDelegate) - Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) - Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) - Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged) - - Q_PROPERTY(int maximumLength READ maxLength WRITE setMaxLength) - Q_PROPERTY(QValidator* validator READ validator WRITE setValidator) - Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask) - Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged) - Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode) - Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress) - -public: - QmlGraphicsTextInput(QmlGraphicsItem* parent=0); - ~QmlGraphicsTextInput(); - - enum EchoMode {//To match QLineEdit::EchoMode - Normal, - NoEcho, - Password, - PasswordEchoOnEdit - }; - - enum HAlignment { - AlignLeft = Qt::AlignLeft, - AlignRight = Qt::AlignRight, - AlignHCenter = Qt::AlignHCenter - }; - - //### Should we have this function, x based properties, - //### or copy TextEdit with x instead of QTextCursor? - Q_INVOKABLE int xToPos(int x); - - QString text() const; - void setText(const QString &); - - QFont font() const; - void setFont(const QFont &font); - - QColor color() const; - void setColor(const QColor &c); - - QColor selectionColor() const; - void setSelectionColor(const QColor &c); - - QColor selectedTextColor() const; - void setSelectedTextColor(const QColor &c); - - HAlignment hAlign() const; - void setHAlign(HAlignment align); - - bool isReadOnly() const; - void setReadOnly(bool); - - bool isCursorVisible() const; - void setCursorVisible(bool on); - - int cursorPosition() const; - void setCursorPosition(int cp); - - QRect cursorRect() const; - - int selectionStart() const; - void setSelectionStart(int); - - int selectionEnd() const; - void setSelectionEnd(int); - - QString selectedText() const; - - int maxLength() const; - void setMaxLength(int ml); - - QValidator * validator() const; - void setValidator(QValidator* v); - - QString inputMask() const; - void setInputMask(const QString &im); - - EchoMode echoMode() const; - void setEchoMode(EchoMode echo); - - QmlComponent* cursorDelegate() const; - void setCursorDelegate(QmlComponent*); - - bool focusOnPress() const; - void setFocusOnPress(bool); - - bool hasAcceptableInput() const; - - void drawContents(QPainter *p,const QRect &r); -Q_SIGNALS: - void textChanged(); - void cursorPositionChanged(); - void selectionStartChanged(); - void selectionEndChanged(); - void selectedTextChanged(); - void accepted(); - void acceptableInputChanged(); - -protected: - QmlGraphicsTextInput(QmlGraphicsTextInputPrivate &dd, QmlGraphicsItem *parent); - virtual void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry); - - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void keyPressEvent(QKeyEvent* ev); - bool event(QEvent *e); - - void focusChanged(bool hasFocus); - -public Q_SLOTS: - void selectAll(); - -private Q_SLOTS: - void updateSize(bool needsRedraw = true); - void q_textChanged(); - void selectionChanged(); - void createCursor(); - void moveCursor(); - void cursorPosChanged(); - void updateRect(const QRect &r = QRect()); - -private: - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsTextInput) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsTextInput) -QML_DECLARE_TYPE(QValidator) -QML_DECLARE_TYPE(QIntValidator) - -QT_END_HEADER - -#endif // QMLGRAPHICSTEXTINPUT_H diff --git a/src/declarative/fx/qmlgraphicstextinput_p.h b/src/declarative/fx/qmlgraphicstextinput_p.h index 010dfe1..10939a8 100644 --- a/src/declarative/fx/qmlgraphicstextinput_p.h +++ b/src/declarative/fx/qmlgraphicstextinput_p.h @@ -39,71 +39,171 @@ ** ****************************************************************************/ -#ifndef QMLGRAPHICSTEXTINPUT_P_H -#define QMLGRAPHICSTEXTINPUT_P_H +#ifndef QMLGRAPHICSTEXTINPUT_H +#define QMLGRAPHICSTEXTINPUT_H -#include "qmlgraphicstextinput.h" -#include "qml.h" +#include "qmlgraphicstext_p.h" #include "qmlgraphicspainteditem_p.h" -#include "private/qlinecontrol_p.h" -#include -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. +#include +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QmlGraphicsTextInputPrivate : public QmlGraphicsPaintedItemPrivate +QT_MODULE(Declarative) + +class QmlGraphicsTextInputPrivate; +class QValidator; +class Q_DECLARATIVE_EXPORT QmlGraphicsTextInput : public QmlGraphicsPaintedItem { - Q_DECLARE_PUBLIC(QmlGraphicsTextInput) + Q_OBJECT + Q_ENUMS(HAlignment) + Q_ENUMS(EchoMode) + + Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) + Q_PROPERTY(QColor color READ color WRITE setColor) + Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor) + Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor) + Q_PROPERTY(QFont font READ font WRITE setFont) + Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign) + + Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly) + Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible) + Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) + Q_PROPERTY(QmlComponent *cursorDelegate READ cursorDelegate WRITE setCursorDelegate) + Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) + Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) + Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged) + + Q_PROPERTY(int maximumLength READ maxLength WRITE setMaxLength) + Q_PROPERTY(QValidator* validator READ validator WRITE setValidator) + Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask) + Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged) + Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode) + Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress) + public: - QmlGraphicsTextInputPrivate() : control(new QLineControl(QString())), - color((QRgb)0), style(QmlGraphicsText::Normal), - styleColor((QRgb)0), hAlign(QmlGraphicsTextInput::AlignLeft), - hscroll(0), oldScroll(0), focused(false), focusOnPress(true), - cursorVisible(false) - { - } - - ~QmlGraphicsTextInputPrivate() - { - delete control; - } - - void init(); - void startCreatingCursor(); - - QLineControl* control; - - QFont font; - QColor color; - QColor selectionColor; - QColor selectedTextColor; - QmlGraphicsText::TextStyle style; - QColor styleColor; - QmlGraphicsTextInput::HAlignment hAlign; - QPointer cursorComponent; - QPointer cursorItem; - - int lastSelectionStart; - int lastSelectionEnd; - int oldHeight; - int oldWidth; - bool oldValidity; - int hscroll; - int oldScroll; - bool focused; - bool focusOnPress; - bool cursorVisible; + QmlGraphicsTextInput(QmlGraphicsItem* parent=0); + ~QmlGraphicsTextInput(); + + enum EchoMode {//To match QLineEdit::EchoMode + Normal, + NoEcho, + Password, + PasswordEchoOnEdit + }; + + enum HAlignment { + AlignLeft = Qt::AlignLeft, + AlignRight = Qt::AlignRight, + AlignHCenter = Qt::AlignHCenter + }; + + //### Should we have this function, x based properties, + //### or copy TextEdit with x instead of QTextCursor? + Q_INVOKABLE int xToPos(int x); + + QString text() const; + void setText(const QString &); + + QFont font() const; + void setFont(const QFont &font); + + QColor color() const; + void setColor(const QColor &c); + + QColor selectionColor() const; + void setSelectionColor(const QColor &c); + + QColor selectedTextColor() const; + void setSelectedTextColor(const QColor &c); + + HAlignment hAlign() const; + void setHAlign(HAlignment align); + + bool isReadOnly() const; + void setReadOnly(bool); + + bool isCursorVisible() const; + void setCursorVisible(bool on); + + int cursorPosition() const; + void setCursorPosition(int cp); + + QRect cursorRect() const; + + int selectionStart() const; + void setSelectionStart(int); + + int selectionEnd() const; + void setSelectionEnd(int); + + QString selectedText() const; + + int maxLength() const; + void setMaxLength(int ml); + + QValidator * validator() const; + void setValidator(QValidator* v); + + QString inputMask() const; + void setInputMask(const QString &im); + + EchoMode echoMode() const; + void setEchoMode(EchoMode echo); + + QmlComponent* cursorDelegate() const; + void setCursorDelegate(QmlComponent*); + + bool focusOnPress() const; + void setFocusOnPress(bool); + + bool hasAcceptableInput() const; + + void drawContents(QPainter *p,const QRect &r); +Q_SIGNALS: + void textChanged(); + void cursorPositionChanged(); + void selectionStartChanged(); + void selectionEndChanged(); + void selectedTextChanged(); + void accepted(); + void acceptableInputChanged(); + +protected: + QmlGraphicsTextInput(QmlGraphicsTextInputPrivate &dd, QmlGraphicsItem *parent); + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void keyPressEvent(QKeyEvent* ev); + bool event(QEvent *e); + + void focusChanged(bool hasFocus); + +public Q_SLOTS: + void selectAll(); + +private Q_SLOTS: + void updateSize(bool needsRedraw = true); + void q_textChanged(); + void selectionChanged(); + void createCursor(); + void moveCursor(); + void cursorPosChanged(); + void updateRect(const QRect &r = QRect()); + +private: + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsTextInput) }; QT_END_NAMESPACE -#endif +QML_DECLARE_TYPE(QmlGraphicsTextInput) +QML_DECLARE_TYPE(QValidator) +QML_DECLARE_TYPE(QIntValidator) + +QT_END_HEADER +#endif // QMLGRAPHICSTEXTINPUT_H diff --git a/src/declarative/fx/qmlgraphicstextinput_p_p.h b/src/declarative/fx/qmlgraphicstextinput_p_p.h new file mode 100644 index 0000000..d17707f --- /dev/null +++ b/src/declarative/fx/qmlgraphicstextinput_p_p.h @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSTEXTINPUT_P_H +#define QMLGRAPHICSTEXTINPUT_P_H + +#include "qmlgraphicstextinput_p.h" +#include "qml.h" +#include "qmlgraphicspainteditem_p_p.h" +#include "private/qlinecontrol_p.h" +#include +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +QT_BEGIN_NAMESPACE + +class QmlGraphicsTextInputPrivate : public QmlGraphicsPaintedItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsTextInput) +public: + QmlGraphicsTextInputPrivate() : control(new QLineControl(QString())), + color((QRgb)0), style(QmlGraphicsText::Normal), + styleColor((QRgb)0), hAlign(QmlGraphicsTextInput::AlignLeft), + hscroll(0), oldScroll(0), focused(false), focusOnPress(true), + cursorVisible(false) + { + } + + ~QmlGraphicsTextInputPrivate() + { + delete control; + } + + void init(); + void startCreatingCursor(); + + QLineControl* control; + + QFont font; + QColor color; + QColor selectionColor; + QColor selectedTextColor; + QmlGraphicsText::TextStyle style; + QColor styleColor; + QmlGraphicsTextInput::HAlignment hAlign; + QPointer cursorComponent; + QPointer cursorItem; + + int lastSelectionStart; + int lastSelectionEnd; + int oldHeight; + int oldWidth; + bool oldValidity; + int hscroll; + int oldScroll; + bool focused; + bool focusOnPress; + bool cursorVisible; +}; + +QT_END_NAMESPACE + +#endif + diff --git a/src/declarative/fx/qmlgraphicsvisualitemmodel.cpp b/src/declarative/fx/qmlgraphicsvisualitemmodel.cpp index b9b0237..3e8dfb4 100644 --- a/src/declarative/fx/qmlgraphicsvisualitemmodel.cpp +++ b/src/declarative/fx/qmlgraphicsvisualitemmodel.cpp @@ -39,19 +39,19 @@ ** ****************************************************************************/ -#include "qlistmodelinterface.h" +#include #include "qmlgraphicsitem.h" #include #include -#include "qmlpackage.h" +#include #include "qhash.h" #include "qlist.h" #include "private/qobject_p.h" #include "private/qmetaobjectbuilder_p.h" -#include "qmlopenmetaobject.h" -#include "qmllistaccessor.h" +#include +#include #include "qmlinfo.h" -#include "qmlgraphicsvisualitemmodel.h" +#include "qmlgraphicsvisualitemmodel_p.h" #include "private/qguard_p.h" #include @@ -1029,4 +1029,5 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,VisualItemModel,QmlGraphicsVisua QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,VisualDataModel,QmlGraphicsVisualDataModel) QT_END_NAMESPACE -#include "qfxvisualitemmodel.moc" + +#include "qmlgraphicsvisualitemmodel.moc" diff --git a/src/declarative/fx/qmlgraphicsvisualitemmodel.h b/src/declarative/fx/qmlgraphicsvisualitemmodel.h deleted file mode 100644 index fb36531..0000000 --- a/src/declarative/fx/qmlgraphicsvisualitemmodel.h +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSVISUALDATAMODEL_H -#define QMLGRAPHICSVISUALDATAMODEL_H - -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) -/***************************************************************************** - ***************************************************************************** - XXX Experimental - ***************************************************************************** -*****************************************************************************/ - -class QmlGraphicsItem; -class QmlComponent; -class QmlPackage; -class QmlGraphicsVisualDataModelPrivate; - -class Q_DECLARATIVE_EXPORT QmlGraphicsVisualModel : public QObject -{ - Q_OBJECT - - Q_PROPERTY(int count READ count NOTIFY countChanged) - -public: - QmlGraphicsVisualModel() {} - virtual ~QmlGraphicsVisualModel() {} - - enum ReleaseFlag { Referenced = 0x01, Destroyed = 0x02 }; - Q_DECLARE_FLAGS(ReleaseFlags, ReleaseFlag) - - virtual int count() const = 0; - virtual bool isValid() const = 0; - virtual QmlGraphicsItem *item(int index, bool complete=true) = 0; - virtual ReleaseFlags release(QmlGraphicsItem *item) = 0; - virtual void completeItem() = 0; - virtual QVariant evaluate(int index, const QString &expression, QObject *objectContext) = 0; - - virtual int indexOf(QmlGraphicsItem *item, QObject *objectContext) const = 0; - -Q_SIGNALS: - void countChanged(); - void itemsInserted(int index, int count); - void itemsRemoved(int index, int count); - void itemsMoved(int from, int to, int count); - void createdItem(int index, QmlGraphicsItem *item); - void destroyingItem(QmlGraphicsItem *item); - -protected: - QmlGraphicsVisualModel(QObjectPrivate &dd, QObject *parent = 0) - : QObject(dd, parent) {} - -private: - Q_DISABLE_COPY(QmlGraphicsVisualModel) -}; - -class QmlGraphicsVisualItemModelAttached; -class QmlGraphicsVisualItemModelPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsVisualItemModel : public QmlGraphicsVisualModel -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlGraphicsVisualItemModel) - - Q_PROPERTY(QmlList* children READ children NOTIFY childrenChanged DESIGNABLE false) - Q_CLASSINFO("DefaultProperty", "children") - -public: - QmlGraphicsVisualItemModel(); - virtual ~QmlGraphicsVisualItemModel() {} - - virtual int count() const; - virtual bool isValid() const; - virtual QmlGraphicsItem *item(int index, bool complete=true); - virtual ReleaseFlags release(QmlGraphicsItem *item); - virtual void completeItem(); - virtual QVariant evaluate(int index, const QString &expression, QObject *objectContext); - - virtual int indexOf(QmlGraphicsItem *item, QObject *objectContext) const; - - QmlList *children(); - - static QmlGraphicsVisualItemModelAttached *qmlAttachedProperties(QObject *obj); - -signals: - void childrenChanged(); - -private: - Q_DISABLE_COPY(QmlGraphicsVisualItemModel) -}; - - -class Q_DECLARATIVE_EXPORT QmlGraphicsVisualDataModel : public QmlGraphicsVisualModel -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlGraphicsVisualDataModel) - - Q_PROPERTY(QVariant model READ model WRITE setModel) - Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) - Q_PROPERTY(QString part READ part WRITE setPart) - Q_PROPERTY(QObject *parts READ parts CONSTANT) - Q_CLASSINFO("DefaultProperty", "delegate") -public: - QmlGraphicsVisualDataModel(); - QmlGraphicsVisualDataModel(QmlContext *); - virtual ~QmlGraphicsVisualDataModel(); - - QVariant model() const; - void setModel(const QVariant &); - - QmlComponent *delegate() const; - void setDelegate(QmlComponent *); - - QString part() const; - void setPart(const QString &); - - int count() const; - bool isValid() const { return delegate() != 0; } - QmlGraphicsItem *item(int index, bool complete=true); - QmlGraphicsItem *item(int index, const QByteArray &, bool complete=true); - ReleaseFlags release(QmlGraphicsItem *item); - void completeItem(); - QVariant evaluate(int index, const QString &expression, QObject *objectContext); - - int indexOf(QmlGraphicsItem *item, QObject *objectContext) const; - - QObject *parts(); - -Q_SIGNALS: - void createdPackage(int index, QmlPackage *package); - void destroyingPackage(QmlPackage *package); - -private Q_SLOTS: - void _q_itemsChanged(int, int, const QList &); - void _q_itemsInserted(int index, int count); - void _q_itemsRemoved(int index, int count); - void _q_itemsMoved(int from, int to, int count); - void _q_rowsInserted(const QModelIndex &,int,int); - void _q_rowsRemoved(const QModelIndex &,int,int); - void _q_dataChanged(const QModelIndex&,const QModelIndex&); - void _q_createdPackage(int index, QmlPackage *package); - void _q_destroyingPackage(QmlPackage *package); - -private: - Q_DISABLE_COPY(QmlGraphicsVisualDataModel) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsVisualModel) -QML_DECLARE_TYPE(QmlGraphicsVisualItemModel) -QML_DECLARE_TYPEINFO(QmlGraphicsVisualItemModel, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(QmlGraphicsVisualDataModel) - -QT_END_HEADER - -#endif // QMLGRAPHICSVISUALDATAMODEL_H diff --git a/src/declarative/fx/qmlgraphicsvisualitemmodel_p.h b/src/declarative/fx/qmlgraphicsvisualitemmodel_p.h new file mode 100644 index 0000000..fb36531 --- /dev/null +++ b/src/declarative/fx/qmlgraphicsvisualitemmodel_p.h @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSVISUALDATAMODEL_H +#define QMLGRAPHICSVISUALDATAMODEL_H + +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) +/***************************************************************************** + ***************************************************************************** + XXX Experimental + ***************************************************************************** +*****************************************************************************/ + +class QmlGraphicsItem; +class QmlComponent; +class QmlPackage; +class QmlGraphicsVisualDataModelPrivate; + +class Q_DECLARATIVE_EXPORT QmlGraphicsVisualModel : public QObject +{ + Q_OBJECT + + Q_PROPERTY(int count READ count NOTIFY countChanged) + +public: + QmlGraphicsVisualModel() {} + virtual ~QmlGraphicsVisualModel() {} + + enum ReleaseFlag { Referenced = 0x01, Destroyed = 0x02 }; + Q_DECLARE_FLAGS(ReleaseFlags, ReleaseFlag) + + virtual int count() const = 0; + virtual bool isValid() const = 0; + virtual QmlGraphicsItem *item(int index, bool complete=true) = 0; + virtual ReleaseFlags release(QmlGraphicsItem *item) = 0; + virtual void completeItem() = 0; + virtual QVariant evaluate(int index, const QString &expression, QObject *objectContext) = 0; + + virtual int indexOf(QmlGraphicsItem *item, QObject *objectContext) const = 0; + +Q_SIGNALS: + void countChanged(); + void itemsInserted(int index, int count); + void itemsRemoved(int index, int count); + void itemsMoved(int from, int to, int count); + void createdItem(int index, QmlGraphicsItem *item); + void destroyingItem(QmlGraphicsItem *item); + +protected: + QmlGraphicsVisualModel(QObjectPrivate &dd, QObject *parent = 0) + : QObject(dd, parent) {} + +private: + Q_DISABLE_COPY(QmlGraphicsVisualModel) +}; + +class QmlGraphicsVisualItemModelAttached; +class QmlGraphicsVisualItemModelPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsVisualItemModel : public QmlGraphicsVisualModel +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlGraphicsVisualItemModel) + + Q_PROPERTY(QmlList* children READ children NOTIFY childrenChanged DESIGNABLE false) + Q_CLASSINFO("DefaultProperty", "children") + +public: + QmlGraphicsVisualItemModel(); + virtual ~QmlGraphicsVisualItemModel() {} + + virtual int count() const; + virtual bool isValid() const; + virtual QmlGraphicsItem *item(int index, bool complete=true); + virtual ReleaseFlags release(QmlGraphicsItem *item); + virtual void completeItem(); + virtual QVariant evaluate(int index, const QString &expression, QObject *objectContext); + + virtual int indexOf(QmlGraphicsItem *item, QObject *objectContext) const; + + QmlList *children(); + + static QmlGraphicsVisualItemModelAttached *qmlAttachedProperties(QObject *obj); + +signals: + void childrenChanged(); + +private: + Q_DISABLE_COPY(QmlGraphicsVisualItemModel) +}; + + +class Q_DECLARATIVE_EXPORT QmlGraphicsVisualDataModel : public QmlGraphicsVisualModel +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlGraphicsVisualDataModel) + + Q_PROPERTY(QVariant model READ model WRITE setModel) + Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate) + Q_PROPERTY(QString part READ part WRITE setPart) + Q_PROPERTY(QObject *parts READ parts CONSTANT) + Q_CLASSINFO("DefaultProperty", "delegate") +public: + QmlGraphicsVisualDataModel(); + QmlGraphicsVisualDataModel(QmlContext *); + virtual ~QmlGraphicsVisualDataModel(); + + QVariant model() const; + void setModel(const QVariant &); + + QmlComponent *delegate() const; + void setDelegate(QmlComponent *); + + QString part() const; + void setPart(const QString &); + + int count() const; + bool isValid() const { return delegate() != 0; } + QmlGraphicsItem *item(int index, bool complete=true); + QmlGraphicsItem *item(int index, const QByteArray &, bool complete=true); + ReleaseFlags release(QmlGraphicsItem *item); + void completeItem(); + QVariant evaluate(int index, const QString &expression, QObject *objectContext); + + int indexOf(QmlGraphicsItem *item, QObject *objectContext) const; + + QObject *parts(); + +Q_SIGNALS: + void createdPackage(int index, QmlPackage *package); + void destroyingPackage(QmlPackage *package); + +private Q_SLOTS: + void _q_itemsChanged(int, int, const QList &); + void _q_itemsInserted(int index, int count); + void _q_itemsRemoved(int index, int count); + void _q_itemsMoved(int from, int to, int count); + void _q_rowsInserted(const QModelIndex &,int,int); + void _q_rowsRemoved(const QModelIndex &,int,int); + void _q_dataChanged(const QModelIndex&,const QModelIndex&); + void _q_createdPackage(int index, QmlPackage *package); + void _q_destroyingPackage(QmlPackage *package); + +private: + Q_DISABLE_COPY(QmlGraphicsVisualDataModel) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsVisualModel) +QML_DECLARE_TYPE(QmlGraphicsVisualItemModel) +QML_DECLARE_TYPEINFO(QmlGraphicsVisualItemModel, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPE(QmlGraphicsVisualDataModel) + +QT_END_HEADER + +#endif // QMLGRAPHICSVISUALDATAMODEL_H diff --git a/src/declarative/fx/qmlgraphicswebview.cpp b/src/declarative/fx/qmlgraphicswebview.cpp index d9044cf..a307bc2 100644 --- a/src/declarative/fx/qmlgraphicswebview.cpp +++ b/src/declarative/fx/qmlgraphicswebview.cpp @@ -55,11 +55,11 @@ #include "qml.h" #include "qmlengine.h" -#include "qmlstate.h" -#include "qlistmodelinterface.h" +#include "qmlstate_p.h" +#include "qlistmodelinterface_p.h" -#include "qmlgraphicswebview.h" -#include +#include "qmlgraphicswebview_p.h" +#include QT_BEGIN_NAMESPACE QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,WebView,QmlGraphicsWebView) @@ -1385,4 +1385,4 @@ QWebPage *QmlGraphicsWebPage::createWindow(WebWindowType type) QT_END_NAMESPACE -#include "qfxwebview.moc" +#include "qmlgraphicswebview.moc" diff --git a/src/declarative/fx/qmlgraphicswebview.h b/src/declarative/fx/qmlgraphicswebview.h deleted file mode 100644 index 81f7bcd..0000000 --- a/src/declarative/fx/qmlgraphicswebview.h +++ /dev/null @@ -1,251 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSWEBVIEW_H -#define QMLGRAPHICSWEBVIEW_H - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -class QWebHistory; -class QWebSettings; - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) -class QmlGraphicsWebViewPrivate; -class QNetworkRequest; -class QmlGraphicsWebView; - -class Q_DECLARATIVE_EXPORT QmlGraphicsWebPage : public QWebPage -{ - Q_OBJECT -public: - explicit QmlGraphicsWebPage(QmlGraphicsWebView *parent); - ~QmlGraphicsWebPage(); -protected: - QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues); - QWebPage *createWindow(WebWindowType type); - -private: - QmlGraphicsWebView *viewItem(); -}; - - -class QmlGraphicsWebViewAttached; -class QmlGraphicsWebSettings; - -//### TODO: browser plugins - -class Q_DECLARATIVE_EXPORT QmlGraphicsWebView : public QmlGraphicsPaintedItem -{ - Q_OBJECT - - Q_ENUMS(Status) - - Q_PROPERTY(QString title READ title NOTIFY titleChanged) - Q_PROPERTY(QPixmap icon READ icon NOTIFY iconChanged) - Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false) - Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged) - Q_PROPERTY(QString statusText READ statusText NOTIFY statusTextChanged) - - Q_PROPERTY(QString html READ html WRITE setHtml) - - Q_PROPERTY(int preferredWidth READ preferredWidth WRITE setPreferredWidth NOTIFY preferredWidthChanged) - Q_PROPERTY(int webPageWidth READ webPageWidth WRITE setWebPageWidth) - Q_PROPERTY(int pixelCacheSize READ pixelCacheSize WRITE setPixelCacheSize) - Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) - Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) - Q_PROPERTY(Status status READ status NOTIFY statusChanged) - - Q_PROPERTY(QAction* reload READ reloadAction CONSTANT) - Q_PROPERTY(QAction* back READ backAction CONSTANT) - Q_PROPERTY(QAction* forward READ forwardAction CONSTANT) - Q_PROPERTY(QAction* stop READ stopAction CONSTANT) - - Q_PROPERTY(QmlGraphicsWebSettings* settings READ settingsObject CONSTANT) - - Q_PROPERTY(QmlList* javaScriptWindowObjects READ javaScriptWindowObjects CONSTANT) - - Q_PROPERTY(QmlComponent* newWindowComponent READ newWindowComponent WRITE setNewWindowComponent) - Q_PROPERTY(QmlGraphicsItem* newWindowParent READ newWindowParent WRITE setNewWindowParent) - - Q_PROPERTY(bool renderingEnabled READ renderingEnabled WRITE setRenderingEnabled) - -public: - QmlGraphicsWebView(QmlGraphicsItem *parent=0); - ~QmlGraphicsWebView(); - - QUrl url() const; - void setUrl(const QUrl &); - - QString title() const; - - QPixmap icon() const; - - qreal textSizeMultiplier() const; - void setTextSizeMultiplier(qreal); - - qreal zoomFactor() const; - void setZoomFactor(qreal); - - int preferredWidth() const; - void setPreferredWidth(int); - int webPageWidth() const; - void setWebPageWidth(int); - - enum Status { Null, Ready, Loading, Error }; - Status status() const; - qreal progress() const; - QString statusText() const; - - QAction *reloadAction() const; - QAction *backAction() const; - QAction *forwardAction() const; - QAction *stopAction() const; - - QWebPage *page() const; - void setPage(QWebPage *page); - - void load(const QNetworkRequest &request, - QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, - const QByteArray &body = QByteArray()); - - QString html() const; - - void setHtml(const QString &html, const QUrl &baseUrl = QUrl()); - void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl()); - - QWebHistory *history() const; - QWebSettings *settings() const; - QmlGraphicsWebSettings *settingsObject() const; - - int pixelCacheSize() const; - void setPixelCacheSize(int pixels); - - bool renderingEnabled() const; - void setRenderingEnabled(bool); - - QmlList *javaScriptWindowObjects(); - - static QmlGraphicsWebViewAttached *qmlAttachedProperties(QObject *); - - QmlComponent *newWindowComponent() const; - void setNewWindowComponent(QmlComponent *newWindow); - QmlGraphicsItem *newWindowParent() const; - void setNewWindowParent(QmlGraphicsItem *newWindow); - -Q_SIGNALS: - void preferredWidthChanged(); - void preferredHeightChanged(); - void urlChanged(); - void progressChanged(); - void statusChanged(Status); - void titleChanged(const QString&); - void iconChanged(); - void statusTextChanged(); - void zoomFactorChanged(); - - void loadStarted(); - void loadFinished(); - void loadFailed(); - - void doubleClick(int clickX, int clickY); - - void zooming(qreal zoom, int centerX, int centerY); - -public Q_SLOTS: - QVariant evaluateJavaScript(const QString&); - void heuristicZoom(int clickX, int clickY); - -private Q_SLOTS: - void expandToWebPage(); - void paintPage(const QRect&); - void doLoadStarted(); - void doLoadProgress(int p); - void doLoadFinished(bool ok); - void setStatusText(const QString&); - void windowObjectCleared(); - void pageUrlChanged(); - void contentsSizeChanged(const QSize&); - -protected: - QmlGraphicsWebView(QmlGraphicsWebViewPrivate &dd, QmlGraphicsItem *parent); - - void drawContents(QPainter *, const QRect &); - - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); - void hoverMoveEvent (QGraphicsSceneHoverEvent * event); - void keyPressEvent(QKeyEvent* event); - void keyReleaseEvent(QKeyEvent* event); - virtual void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry); - virtual void focusChanged(bool); - virtual bool sceneEvent(QEvent *event); - QmlGraphicsWebView *createWindow(QWebPage::WebWindowType type); - QRect elementAreaAt(int x, int y, int minwidth, int minheight) const; - -private: - void init(); - virtual void componentComplete(); - Q_DISABLE_COPY(QmlGraphicsWebView) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsWebView) - friend class QmlGraphicsWebPage; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsWebView) -QML_DECLARE_TYPEINFO(QmlGraphicsWebView, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(QAction) - -QT_END_HEADER - -#endif diff --git a/src/declarative/fx/qmlgraphicswebview_p.h b/src/declarative/fx/qmlgraphicswebview_p.h new file mode 100644 index 0000000..0398b0d --- /dev/null +++ b/src/declarative/fx/qmlgraphicswebview_p.h @@ -0,0 +1,251 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSWEBVIEW_H +#define QMLGRAPHICSWEBVIEW_H + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +class QWebHistory; +class QWebSettings; + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) +class QmlGraphicsWebViewPrivate; +class QNetworkRequest; +class QmlGraphicsWebView; + +class Q_DECLARATIVE_EXPORT QmlGraphicsWebPage : public QWebPage +{ + Q_OBJECT +public: + explicit QmlGraphicsWebPage(QmlGraphicsWebView *parent); + ~QmlGraphicsWebPage(); +protected: + QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues); + QWebPage *createWindow(WebWindowType type); + +private: + QmlGraphicsWebView *viewItem(); +}; + + +class QmlGraphicsWebViewAttached; +class QmlGraphicsWebSettings; + +//### TODO: browser plugins + +class Q_DECLARATIVE_EXPORT QmlGraphicsWebView : public QmlGraphicsPaintedItem +{ + Q_OBJECT + + Q_ENUMS(Status) + + Q_PROPERTY(QString title READ title NOTIFY titleChanged) + Q_PROPERTY(QPixmap icon READ icon NOTIFY iconChanged) + Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false) + Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged) + Q_PROPERTY(QString statusText READ statusText NOTIFY statusTextChanged) + + Q_PROPERTY(QString html READ html WRITE setHtml) + + Q_PROPERTY(int preferredWidth READ preferredWidth WRITE setPreferredWidth NOTIFY preferredWidthChanged) + Q_PROPERTY(int webPageWidth READ webPageWidth WRITE setWebPageWidth) + Q_PROPERTY(int pixelCacheSize READ pixelCacheSize WRITE setPixelCacheSize) + Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) + Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) + Q_PROPERTY(Status status READ status NOTIFY statusChanged) + + Q_PROPERTY(QAction* reload READ reloadAction CONSTANT) + Q_PROPERTY(QAction* back READ backAction CONSTANT) + Q_PROPERTY(QAction* forward READ forwardAction CONSTANT) + Q_PROPERTY(QAction* stop READ stopAction CONSTANT) + + Q_PROPERTY(QmlGraphicsWebSettings* settings READ settingsObject CONSTANT) + + Q_PROPERTY(QmlList* javaScriptWindowObjects READ javaScriptWindowObjects CONSTANT) + + Q_PROPERTY(QmlComponent* newWindowComponent READ newWindowComponent WRITE setNewWindowComponent) + Q_PROPERTY(QmlGraphicsItem* newWindowParent READ newWindowParent WRITE setNewWindowParent) + + Q_PROPERTY(bool renderingEnabled READ renderingEnabled WRITE setRenderingEnabled) + +public: + QmlGraphicsWebView(QmlGraphicsItem *parent=0); + ~QmlGraphicsWebView(); + + QUrl url() const; + void setUrl(const QUrl &); + + QString title() const; + + QPixmap icon() const; + + qreal textSizeMultiplier() const; + void setTextSizeMultiplier(qreal); + + qreal zoomFactor() const; + void setZoomFactor(qreal); + + int preferredWidth() const; + void setPreferredWidth(int); + int webPageWidth() const; + void setWebPageWidth(int); + + enum Status { Null, Ready, Loading, Error }; + Status status() const; + qreal progress() const; + QString statusText() const; + + QAction *reloadAction() const; + QAction *backAction() const; + QAction *forwardAction() const; + QAction *stopAction() const; + + QWebPage *page() const; + void setPage(QWebPage *page); + + void load(const QNetworkRequest &request, + QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, + const QByteArray &body = QByteArray()); + + QString html() const; + + void setHtml(const QString &html, const QUrl &baseUrl = QUrl()); + void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl()); + + QWebHistory *history() const; + QWebSettings *settings() const; + QmlGraphicsWebSettings *settingsObject() const; + + int pixelCacheSize() const; + void setPixelCacheSize(int pixels); + + bool renderingEnabled() const; + void setRenderingEnabled(bool); + + QmlList *javaScriptWindowObjects(); + + static QmlGraphicsWebViewAttached *qmlAttachedProperties(QObject *); + + QmlComponent *newWindowComponent() const; + void setNewWindowComponent(QmlComponent *newWindow); + QmlGraphicsItem *newWindowParent() const; + void setNewWindowParent(QmlGraphicsItem *newWindow); + +Q_SIGNALS: + void preferredWidthChanged(); + void preferredHeightChanged(); + void urlChanged(); + void progressChanged(); + void statusChanged(Status); + void titleChanged(const QString&); + void iconChanged(); + void statusTextChanged(); + void zoomFactorChanged(); + + void loadStarted(); + void loadFinished(); + void loadFailed(); + + void doubleClick(int clickX, int clickY); + + void zooming(qreal zoom, int centerX, int centerY); + +public Q_SLOTS: + QVariant evaluateJavaScript(const QString&); + void heuristicZoom(int clickX, int clickY); + +private Q_SLOTS: + void expandToWebPage(); + void paintPage(const QRect&); + void doLoadStarted(); + void doLoadProgress(int p); + void doLoadFinished(bool ok); + void setStatusText(const QString&); + void windowObjectCleared(); + void pageUrlChanged(); + void contentsSizeChanged(const QSize&); + +protected: + QmlGraphicsWebView(QmlGraphicsWebViewPrivate &dd, QmlGraphicsItem *parent); + + void drawContents(QPainter *, const QRect &); + + void mousePressEvent(QGraphicsSceneMouseEvent *event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); + void hoverMoveEvent (QGraphicsSceneHoverEvent * event); + void keyPressEvent(QKeyEvent* event); + void keyReleaseEvent(QKeyEvent* event); + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + virtual void focusChanged(bool); + virtual bool sceneEvent(QEvent *event); + QmlGraphicsWebView *createWindow(QWebPage::WebWindowType type); + QRect elementAreaAt(int x, int y, int minwidth, int minheight) const; + +private: + void init(); + virtual void componentComplete(); + Q_DISABLE_COPY(QmlGraphicsWebView) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsWebView) + friend class QmlGraphicsWebPage; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsWebView) +QML_DECLARE_TYPEINFO(QmlGraphicsWebView, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPE(QAction) + +QT_END_HEADER + +#endif diff --git a/src/declarative/qml/qmlbasicscript.cpp b/src/declarative/qml/qmlbasicscript.cpp index eba4307..0eb897b 100644 --- a/src/declarative/qml/qmlbasicscript.cpp +++ b/src/declarative/qml/qmlbasicscript.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/declarative/qml/qmlbinding.cpp b/src/declarative/qml/qmlbinding.cpp index fa971a3..045b45a 100644 --- a/src/declarative/qml/qmlbinding.cpp +++ b/src/declarative/qml/qmlbinding.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 5d2bd12..f7bd027 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -41,7 +41,7 @@ #include "private/qmlcompiler_p.h" #include "private/qmlcompositetypedata_p.h" -#include +#include #include "qmlparser_p.h" #include "private/qmlscriptparser_p.h" #include diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index c856680..f2268a7 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -48,7 +48,7 @@ #include "qmlvme_p.h" #include "qml.h" #include -#include +#include #include #include #include diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 463bd93..6f60b4f 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -62,7 +62,7 @@ #include #include #include "qml.h" -#include +#include #include #include "private/qmlbasicscript_p.h" #include "qmlengine.h" diff --git a/src/declarative/qml/qmlenginedebug_p.h b/src/declarative/qml/qmlenginedebug_p.h index a8572eb..c381033 100644 --- a/src/declarative/qml/qmlenginedebug_p.h +++ b/src/declarative/qml/qmlenginedebug_p.h @@ -53,7 +53,7 @@ // We mean it. // -#include +#include #include #include diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index edec988..a76c36b 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -43,7 +43,7 @@ #include "qmlmetaproperty_p.h" #include "qmlcompositetypedata_p.h" #include -#include +#include #include #include "qmlbinding.h" #include diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index f9e3c50..dfedae5 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include "private/qmlcomponent_p.h" #include diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 95dfe5b..2dfda37 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -55,7 +55,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index b986b60..e112f25 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -41,7 +41,7 @@ #include "qmlvme_p.h" #include "qmlcompiler_p.h" -#include +#include #include #include #include "private/qmetaobjectbuilder_p.h" diff --git a/src/declarative/qml/qmlwatcher.cpp b/src/declarative/qml/qmlwatcher.cpp index 8cd51e0..a9d3dad 100644 --- a/src/declarative/qml/qmlwatcher.cpp +++ b/src/declarative/qml/qmlwatcher.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/declarative/util/qfxperf.cpp b/src/declarative/util/qfxperf.cpp index 97f195b..a21f2ed 100644 --- a/src/declarative/util/qfxperf.cpp +++ b/src/declarative/util/qfxperf.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "private/qfxperf_p.h" +#include "private/qfxperf_p_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qfxperf_p.h b/src/declarative/util/qfxperf_p.h deleted file mode 100644 index 37bfc32..0000000 --- a/src/declarative/util/qfxperf_p.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QFXPERF_H -#define QFXPERF_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "private/qperformancelog_p.h" - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -Q_DECLARE_PERFORMANCE_LOG(QmlPerf) { - Q_DECLARE_PERFORMANCE_METRIC(QmlParsing) - - Q_DECLARE_PERFORMANCE_METRIC(Compilation) - Q_DECLARE_PERFORMANCE_METRIC(VMEExecution) - - Q_DECLARE_PERFORMANCE_METRIC(BindInit) - Q_DECLARE_PERFORMANCE_METRIC(BindValue) - Q_DECLARE_PERFORMANCE_METRIC(BindValueSSE) - Q_DECLARE_PERFORMANCE_METRIC(BindValueQt) - Q_DECLARE_PERFORMANCE_METRIC(BindableValueUpdate) - Q_DECLARE_PERFORMANCE_METRIC(PixmapLoad) - Q_DECLARE_PERFORMANCE_METRIC(FontDatabase) - Q_DECLARE_PERFORMANCE_METRIC(QmlGraphicsPathViewPathCache) - Q_DECLARE_PERFORMANCE_METRIC(CreateParticle) - Q_DECLARE_PERFORMANCE_METRIC(ItemComponentComplete) - Q_DECLARE_PERFORMANCE_METRIC(ImageComponentComplete) - Q_DECLARE_PERFORMANCE_METRIC(BaseLayoutComponentComplete) - Q_DECLARE_PERFORMANCE_METRIC(TextComponentComplete) - Q_DECLARE_PERFORMANCE_METRIC(QmlGraphicsText_setText) - Q_DECLARE_PERFORMANCE_METRIC(AddScript) -} - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QFXPERF_H diff --git a/src/declarative/util/qfxperf_p_p.h b/src/declarative/util/qfxperf_p_p.h new file mode 100644 index 0000000..e4424b0 --- /dev/null +++ b/src/declarative/util/qfxperf_p_p.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef QFXPERF_H +#define QFXPERF_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "private/qperformancelog_p_p.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +Q_DECLARE_PERFORMANCE_LOG(QmlPerf) { + Q_DECLARE_PERFORMANCE_METRIC(QmlParsing) + + Q_DECLARE_PERFORMANCE_METRIC(Compilation) + Q_DECLARE_PERFORMANCE_METRIC(VMEExecution) + + Q_DECLARE_PERFORMANCE_METRIC(BindInit) + Q_DECLARE_PERFORMANCE_METRIC(BindValue) + Q_DECLARE_PERFORMANCE_METRIC(BindValueSSE) + Q_DECLARE_PERFORMANCE_METRIC(BindValueQt) + Q_DECLARE_PERFORMANCE_METRIC(BindableValueUpdate) + Q_DECLARE_PERFORMANCE_METRIC(PixmapLoad) + Q_DECLARE_PERFORMANCE_METRIC(FontDatabase) + Q_DECLARE_PERFORMANCE_METRIC(QmlGraphicsPathViewPathCache) + Q_DECLARE_PERFORMANCE_METRIC(CreateParticle) + Q_DECLARE_PERFORMANCE_METRIC(ItemComponentComplete) + Q_DECLARE_PERFORMANCE_METRIC(ImageComponentComplete) + Q_DECLARE_PERFORMANCE_METRIC(BaseLayoutComponentComplete) + Q_DECLARE_PERFORMANCE_METRIC(TextComponentComplete) + Q_DECLARE_PERFORMANCE_METRIC(QmlGraphicsText_setText) + Q_DECLARE_PERFORMANCE_METRIC(AddScript) +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QFXPERF_H diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index e00a1c8..cc46a9c 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qmlanimation.h" +#include "qmlanimation_p.h" #include "qvariant.h" #include "qcolor.h" #include "qfile.h" #include "qmlpropertyvaluesource.h" #include "qml.h" #include "qmlinfo.h" -#include "qmlanimation_p.h" -#include "qmlbehavior.h" +#include "qmlanimation_p_p.h" +#include #include #include #include @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/declarative/util/qmlanimation.h b/src/declarative/util/qmlanimation.h deleted file mode 100644 index 4e94aa0..0000000 --- a/src/declarative/util/qmlanimation.h +++ /dev/null @@ -1,407 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLANIMATION_H -#define QMLANIMATION_H - -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlAbstractAnimationPrivate; -class QmlAnimationGroup; -class Q_AUTOTEST_EXPORT QmlAbstractAnimation : public QObject, public QmlPropertyValueSource, public QmlParserStatus -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlAbstractAnimation) - - Q_INTERFACES(QmlParserStatus) - Q_INTERFACES(QmlPropertyValueSource) - Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) - Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged) - Q_PROPERTY(bool alwaysRunToEnd READ alwaysRunToEnd WRITE setAlwaysRunToEnd NOTIFY alwaysRunToEndChanged()) - Q_PROPERTY(bool repeat READ repeat WRITE setRepeat NOTIFY repeatChanged) - Q_CLASSINFO("DefaultMethod", "start()") - Q_INTERFACES(QmlParserStatus) - -public: - QmlAbstractAnimation(QObject *parent=0); - virtual ~QmlAbstractAnimation(); - - bool isRunning() const; - void setRunning(bool); - bool isPaused() const; - void setPaused(bool); - bool alwaysRunToEnd() const; - void setAlwaysRunToEnd(bool); - bool repeat() const; - void setRepeat(bool); - - int currentTime(); - void setCurrentTime(int); - - QmlAnimationGroup *group() const; - void setGroup(QmlAnimationGroup *); - - //### these belong at a lower level in the hierarchy - QObject *target() const; - void setTarget(QObject *); - QString property() const; - void setProperty(const QString &); - - virtual void setTarget(const QmlMetaProperty &); - - void classBegin(); - void componentComplete(); - -Q_SIGNALS: - void started(); - void completed(); - void runningChanged(bool); - void pausedChanged(bool); - void repeatChanged(bool); - void targetChanged(QObject *, const QString &); - void alwaysRunToEndChanged(bool); - -public Q_SLOTS: - void restart(); - void start(); - void pause(); - void resume(); - void stop(); - void complete(); - -protected: - QmlAbstractAnimation(QmlAbstractAnimationPrivate &dd, QObject *parent); - -public: - enum TransitionDirection { Forward, Backward }; - virtual void transition(QmlStateActions &actions, - QmlMetaProperties &modified, - TransitionDirection direction); - virtual void prepare(QmlMetaProperty &); - virtual QAbstractAnimation *qtAnimation() = 0; - -private Q_SLOTS: - void timelineComplete(); -}; - -class QmlPauseAnimationPrivate; -class QmlPauseAnimation : public QmlAbstractAnimation -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlPauseAnimation) - - Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) - -public: - QmlPauseAnimation(QObject *parent=0); - virtual ~QmlPauseAnimation(); - - int duration() const; - void setDuration(int); - -Q_SIGNALS: - void durationChanged(int); - -protected: - virtual QAbstractAnimation *qtAnimation(); -}; - -class QmlScriptActionPrivate; -class QmlScriptAction : public QmlAbstractAnimation -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlScriptAction) - - Q_PROPERTY(QmlScriptString script READ script WRITE setScript) - Q_PROPERTY(QString stateChangeScriptName READ stateChangeScriptName WRITE setStateChangeScriptName) - -public: - QmlScriptAction(QObject *parent=0); - virtual ~QmlScriptAction(); - - QmlScriptString script() const; - void setScript(const QmlScriptString &); - - QString stateChangeScriptName() const; - void setStateChangeScriptName(const QString &); - -protected: - virtual void transition(QmlStateActions &actions, - QmlMetaProperties &modified, - TransitionDirection direction); - virtual QAbstractAnimation *qtAnimation(); -}; - -class QmlPropertyActionPrivate; -class QmlPropertyAction : public QmlAbstractAnimation -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlPropertyAction) - - Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) - Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged) - Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QList* targets READ targets) - Q_PROPERTY(QList* exclude READ exclude) - Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) - -public: - QmlPropertyAction(QObject *parent=0); - virtual ~QmlPropertyAction(); - - QString properties() const; - void setProperties(const QString &); - - QList *targets(); - QList *exclude(); - - QVariant value() const; - void setValue(const QVariant &); - -Q_SIGNALS: - void valueChanged(const QVariant &); - void propertiesChanged(const QString &); - -protected: - virtual void transition(QmlStateActions &actions, - QmlMetaProperties &modified, - TransitionDirection direction); - virtual QAbstractAnimation *qtAnimation(); - virtual void prepare(QmlMetaProperty &); -}; - -class QmlGraphicsItem; -class QmlParentActionPrivate; -class QmlParentAction : public QmlAbstractAnimation -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlParentAction) - - Q_PROPERTY(QmlGraphicsItem *target READ object WRITE setObject) - Q_PROPERTY(QmlGraphicsItem *parent READ parent WRITE setParent) - -public: - QmlParentAction(QObject *parent=0); - virtual ~QmlParentAction(); - - QmlGraphicsItem *object() const; - void setObject(QmlGraphicsItem *); - - QmlGraphicsItem *parent() const; - void setParent(QmlGraphicsItem *); - -protected: - virtual void transition(QmlStateActions &actions, - QmlMetaProperties &modified, - TransitionDirection direction); - virtual QAbstractAnimation *qtAnimation(); -}; - -class QmlPropertyAnimationPrivate; -class Q_AUTOTEST_EXPORT QmlPropertyAnimation : public QmlAbstractAnimation -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlPropertyAnimation) - - Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) - Q_PROPERTY(QVariant from READ from WRITE setFrom NOTIFY fromChanged) - Q_PROPERTY(QVariant to READ to WRITE setTo NOTIFY toChanged) - Q_PROPERTY(QString easing READ easing WRITE setEasing NOTIFY easingChanged) - Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) - Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged) - Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QList* targets READ targets) - Q_PROPERTY(QList* exclude READ exclude) - -public: - QmlPropertyAnimation(QObject *parent=0); - virtual ~QmlPropertyAnimation(); - - int duration() const; - void setDuration(int); - - QVariant from() const; - void setFrom(const QVariant &); - - QVariant to() const; - void setTo(const QVariant &); - - QString easing() const; - void setEasing(const QString &); - - QString properties() const; - void setProperties(const QString &); - - QList *targets(); - QList *exclude(); - -protected: - virtual void transition(QmlStateActions &actions, - QmlMetaProperties &modified, - TransitionDirection direction); - virtual QAbstractAnimation *qtAnimation(); - virtual void prepare(QmlMetaProperty &); - -Q_SIGNALS: - void durationChanged(int); - void fromChanged(QVariant); - void toChanged(QVariant); - void easingChanged(const QString &); - void propertiesChanged(const QString &); -}; - -class Q_AUTOTEST_EXPORT QmlColorAnimation : public QmlPropertyAnimation -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlPropertyAnimation) - Q_PROPERTY(QColor from READ from WRITE setFrom NOTIFY fromChanged) - Q_PROPERTY(QColor to READ to WRITE setTo NOTIFY toChanged) - -public: - QmlColorAnimation(QObject *parent=0); - virtual ~QmlColorAnimation(); - - QColor from() const; - void setFrom(const QColor &); - - QColor to() const; - void setTo(const QColor &); -}; - -class Q_AUTOTEST_EXPORT QmlNumberAnimation : public QmlPropertyAnimation -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlPropertyAnimation) - - Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged) - Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged) - -public: - QmlNumberAnimation(QObject *parent=0); - virtual ~QmlNumberAnimation(); - - qreal from() const; - void setFrom(qreal); - - qreal to() const; - void setTo(qreal); -}; - -class QmlAnimationGroupPrivate; -class QmlAnimationGroup : public QmlAbstractAnimation -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlAnimationGroup) - - Q_CLASSINFO("DefaultProperty", "animations") - Q_PROPERTY(QmlList *animations READ animations) - -public: - QmlAnimationGroup(QObject *parent); - virtual ~QmlAnimationGroup(); - - QmlList* animations(); - friend class QmlAbstractAnimation; -}; - -class QmlSequentialAnimation : public QmlAnimationGroup -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlAnimationGroup) - -public: - QmlSequentialAnimation(QObject *parent=0); - virtual ~QmlSequentialAnimation(); - -protected: - virtual void transition(QmlStateActions &actions, - QmlMetaProperties &modified, - TransitionDirection direction); - virtual QAbstractAnimation *qtAnimation(); - virtual void prepare(QmlMetaProperty &); -}; - -class QmlParallelAnimation : public QmlAnimationGroup -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlAnimationGroup) - -public: - QmlParallelAnimation(QObject *parent=0); - virtual ~QmlParallelAnimation(); - -protected: - virtual void transition(QmlStateActions &actions, - QmlMetaProperties &modified, - TransitionDirection direction); - virtual QAbstractAnimation *qtAnimation(); - virtual void prepare(QmlMetaProperty &); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlAbstractAnimation) -QML_DECLARE_TYPE(QmlPauseAnimation) -QML_DECLARE_TYPE(QmlScriptAction) -QML_DECLARE_TYPE(QmlPropertyAction) -QML_DECLARE_TYPE(QmlParentAction) -QML_DECLARE_TYPE(QmlPropertyAnimation) -QML_DECLARE_TYPE(QmlColorAnimation) -QML_DECLARE_TYPE(QmlNumberAnimation) -QML_DECLARE_TYPE(QmlSequentialAnimation) -QML_DECLARE_TYPE(QmlParallelAnimation) - -QT_END_HEADER - -#endif // QMLANIMATION_H diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h index 38b92ae..5f9f907 100644 --- a/src/declarative/util/qmlanimation_p.h +++ b/src/declarative/util/qmlanimation_p.h @@ -39,324 +39,369 @@ ** ****************************************************************************/ -#ifndef QMLANIMATION_P_H -#define QMLANIMATION_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef QMLANIMATION_H +#define QMLANIMATION_H + +#include +#include +#include +#include +#include +#include #include -#include -#include +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -//interface for classes that provide animation actions for QActionAnimation -class QAbstractAnimationAction -{ -public: - virtual ~QAbstractAnimationAction() {} - virtual void doAction() = 0; -}; +QT_MODULE(Declarative) -//templated animation action -//allows us to specify an action that calls a function of a class. -//(so that class doesn't have to inherit QmlAbstractAnimationAction) -template -class QAnimationActionProxy : public QAbstractAnimationAction +class QmlAbstractAnimationPrivate; +class QmlAnimationGroup; +class Q_AUTOTEST_EXPORT QmlAbstractAnimation : public QObject, public QmlPropertyValueSource, public QmlParserStatus { + Q_OBJECT + Q_DECLARE_PRIVATE(QmlAbstractAnimation) + + Q_INTERFACES(QmlParserStatus) + Q_INTERFACES(QmlPropertyValueSource) + Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) + Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged) + Q_PROPERTY(bool alwaysRunToEnd READ alwaysRunToEnd WRITE setAlwaysRunToEnd NOTIFY alwaysRunToEndChanged()) + Q_PROPERTY(bool repeat READ repeat WRITE setRepeat NOTIFY repeatChanged) + Q_CLASSINFO("DefaultMethod", "start()") + Q_INTERFACES(QmlParserStatus) + public: - QAnimationActionProxy(T *p) : m_p(p) {} - virtual void doAction() { (m_p->*method)(); } + QmlAbstractAnimation(QObject *parent=0); + virtual ~QmlAbstractAnimation(); + + bool isRunning() const; + void setRunning(bool); + bool isPaused() const; + void setPaused(bool); + bool alwaysRunToEnd() const; + void setAlwaysRunToEnd(bool); + bool repeat() const; + void setRepeat(bool); + + int currentTime(); + void setCurrentTime(int); + + QmlAnimationGroup *group() const; + void setGroup(QmlAnimationGroup *); + + //### these belong at a lower level in the hierarchy + QObject *target() const; + void setTarget(QObject *); + QString property() const; + void setProperty(const QString &); + + virtual void setTarget(const QmlMetaProperty &); + + void classBegin(); + void componentComplete(); + +Q_SIGNALS: + void started(); + void completed(); + void runningChanged(bool); + void pausedChanged(bool); + void repeatChanged(bool); + void targetChanged(QObject *, const QString &); + void alwaysRunToEndChanged(bool); + +public Q_SLOTS: + void restart(); + void start(); + void pause(); + void resume(); + void stop(); + void complete(); + +protected: + QmlAbstractAnimation(QmlAbstractAnimationPrivate &dd, QObject *parent); -private: - T *m_p; +public: + enum TransitionDirection { Forward, Backward }; + virtual void transition(QmlStateActions &actions, + QmlMetaProperties &modified, + TransitionDirection direction); + virtual void prepare(QmlMetaProperty &); + virtual QAbstractAnimation *qtAnimation() = 0; + +private Q_SLOTS: + void timelineComplete(); }; -//performs an action of type QAbstractAnimationAction -class QActionAnimation : public QAbstractAnimation +class QmlPauseAnimationPrivate; +class QmlPauseAnimation : public QmlAbstractAnimation { Q_OBJECT + Q_DECLARE_PRIVATE(QmlPauseAnimation) + + Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) + public: - QActionAnimation(QObject *parent = 0) : QAbstractAnimation(parent), animAction(0), policy(KeepWhenStopped) {} - QActionAnimation(QAbstractAnimationAction *action, QObject *parent = 0) - : QAbstractAnimation(parent), animAction(action), policy(KeepWhenStopped) {} - virtual int duration() const { return 0; } - void setAnimAction(QAbstractAnimationAction *action, DeletionPolicy p) - { - if (state() == Running) - stop(); - animAction = action; - policy = p; - } + QmlPauseAnimation(QObject *parent=0); + virtual ~QmlPauseAnimation(); + + int duration() const; + void setDuration(int); + +Q_SIGNALS: + void durationChanged(int); + protected: - virtual void updateCurrentTime(int) {} - - virtual void updateState(State /*oldState*/, State newState) - { - if (newState == Running) { - if (animAction) - animAction->doAction(); - } else if (newState == Stopped && policy == DeleteWhenStopped) { - delete animAction; - animAction = 0; - } - } - -private: - QAbstractAnimationAction *animAction; - DeletionPolicy policy; + virtual QAbstractAnimation *qtAnimation(); }; -//animates QmlTimeLineValue (assumes start and end values will be reals or compatible) -class QmlTimeLineValueAnimator : public QVariantAnimation +class QmlScriptActionPrivate; +class QmlScriptAction : public QmlAbstractAnimation { Q_OBJECT + Q_DECLARE_PRIVATE(QmlScriptAction) + + Q_PROPERTY(QmlScriptString script READ script WRITE setScript) + Q_PROPERTY(QString stateChangeScriptName READ stateChangeScriptName WRITE setStateChangeScriptName) + public: - QmlTimeLineValueAnimator(QObject *parent = 0) : QVariantAnimation(parent), animValue(0), fromSourced(0), policy(KeepWhenStopped) {} - void setAnimValue(QmlTimeLineValue *value, DeletionPolicy p) - { - if (state() == Running) - stop(); - animValue = value; - policy = p; - } - void setFromSourcedValue(bool *value) - { - fromSourced = value; - } + QmlScriptAction(QObject *parent=0); + virtual ~QmlScriptAction(); + + QmlScriptString script() const; + void setScript(const QmlScriptString &); + + QString stateChangeScriptName() const; + void setStateChangeScriptName(const QString &); + protected: - virtual void updateCurrentValue(const QVariant &value) - { - if (animValue) - animValue->setValue(value.toDouble()); - } - virtual void updateState(State oldState, State newState) - { - QVariantAnimation::updateState(oldState, newState); - if (newState == Running) { - //check for new from every loop - if (fromSourced) - *fromSourced = false; - } else if (newState == Stopped && policy == DeleteWhenStopped) { - delete animValue; - animValue = 0; - } - } - -private: - QmlTimeLineValue *animValue; - bool *fromSourced; - DeletionPolicy policy; + virtual void transition(QmlStateActions &actions, + QmlMetaProperties &modified, + TransitionDirection direction); + virtual QAbstractAnimation *qtAnimation(); }; -//an animation that just gives a tick -template -class QTickAnimationProxy : public QAbstractAnimation +class QmlPropertyActionPrivate; +class QmlPropertyAction : public QmlAbstractAnimation { - //Q_OBJECT //doesn't work with templating -public: - QTickAnimationProxy(T *p, QObject *parent = 0) : QAbstractAnimation(parent), m_p(p) {} - virtual int duration() const { return -1; } -protected: - virtual void updateCurrentTime(int msec) { (m_p->*method)(msec); } + Q_OBJECT + Q_DECLARE_PRIVATE(QmlPropertyAction) -private: - T *m_p; -}; + Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) + Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged) + Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) + Q_PROPERTY(QList* targets READ targets) + Q_PROPERTY(QList* exclude READ exclude) + Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) -class QmlAbstractAnimationPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QmlAbstractAnimation) public: - QmlAbstractAnimationPrivate() - : running(false), paused(false), alwaysRunToEnd(false), repeat(false), - connectedTimeLine(false), componentComplete(true), startOnCompletion(false), - target(0), group(0) {} - - bool running; - bool paused; - bool alwaysRunToEnd; - bool repeat; - bool connectedTimeLine; + QmlPropertyAction(QObject *parent=0); + virtual ~QmlPropertyAction(); - bool componentComplete; - bool startOnCompletion; + QString properties() const; + void setProperties(const QString &); - void commence(); + QList *targets(); + QList *exclude(); - QmlNullableValue userProperty; - QObject *target; - QString propertyName; + QVariant value() const; + void setValue(const QVariant &); - QmlMetaProperty property; - QmlAnimationGroup *group; +Q_SIGNALS: + void valueChanged(const QVariant &); + void propertiesChanged(const QString &); - QmlMetaProperty createProperty(QObject *obj, const QString &str); +protected: + virtual void transition(QmlStateActions &actions, + QmlMetaProperties &modified, + TransitionDirection direction); + virtual QAbstractAnimation *qtAnimation(); + virtual void prepare(QmlMetaProperty &); }; -class QmlPauseAnimationPrivate : public QmlAbstractAnimationPrivate +class QmlGraphicsItem; +class QmlParentActionPrivate; +class QmlParentAction : public QmlAbstractAnimation { - Q_DECLARE_PUBLIC(QmlPauseAnimation) -public: - QmlPauseAnimationPrivate() - : QmlAbstractAnimationPrivate(), pa(0) {} - - void init(); + Q_OBJECT + Q_DECLARE_PRIVATE(QmlParentAction) - QPauseAnimation *pa; -}; + Q_PROPERTY(QmlGraphicsItem *target READ object WRITE setObject) + Q_PROPERTY(QmlGraphicsItem *parent READ parent WRITE setParent) -class QmlScriptActionPrivate : public QmlAbstractAnimationPrivate -{ - Q_DECLARE_PUBLIC(QmlScriptAction) public: - QmlScriptActionPrivate() - : QmlAbstractAnimationPrivate(), hasRunScriptScript(false), proxy(this), rsa(0) {} + QmlParentAction(QObject *parent=0); + virtual ~QmlParentAction(); - void init(); + QmlGraphicsItem *object() const; + void setObject(QmlGraphicsItem *); - QmlScriptString script; - QString name; - QmlScriptString runScriptScript; - bool hasRunScriptScript; + QmlGraphicsItem *parent() const; + void setParent(QmlGraphicsItem *); - void execute(); - - QAnimationActionProxy proxy; - QActionAnimation *rsa; +protected: + virtual void transition(QmlStateActions &actions, + QmlMetaProperties &modified, + TransitionDirection direction); + virtual QAbstractAnimation *qtAnimation(); }; -class QmlPropertyActionPrivate : public QmlAbstractAnimationPrivate +class QmlPropertyAnimationPrivate; +class Q_AUTOTEST_EXPORT QmlPropertyAnimation : public QmlAbstractAnimation { - Q_DECLARE_PUBLIC(QmlPropertyAction) + Q_OBJECT + Q_DECLARE_PRIVATE(QmlPropertyAnimation) + + Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) + Q_PROPERTY(QVariant from READ from WRITE setFrom NOTIFY fromChanged) + Q_PROPERTY(QVariant to READ to WRITE setTo NOTIFY toChanged) + Q_PROPERTY(QString easing READ easing WRITE setEasing NOTIFY easingChanged) + Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) + Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged) + Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) + Q_PROPERTY(QList* targets READ targets) + Q_PROPERTY(QList* exclude READ exclude) + public: - QmlPropertyActionPrivate() - : QmlAbstractAnimationPrivate(), proxy(this), spa(0) {} + QmlPropertyAnimation(QObject *parent=0); + virtual ~QmlPropertyAnimation(); - void init(); + int duration() const; + void setDuration(int); - QString properties; - QList targets; - QList exclude; + QVariant from() const; + void setFrom(const QVariant &); - QmlNullableValue value; + QVariant to() const; + void setTo(const QVariant &); - void doAction(); + QString easing() const; + void setEasing(const QString &); - QAnimationActionProxy proxy; - QActionAnimation *spa; + QString properties() const; + void setProperties(const QString &); + + QList *targets(); + QList *exclude(); + +protected: + virtual void transition(QmlStateActions &actions, + QmlMetaProperties &modified, + TransitionDirection direction); + virtual QAbstractAnimation *qtAnimation(); + virtual void prepare(QmlMetaProperty &); + +Q_SIGNALS: + void durationChanged(int); + void fromChanged(QVariant); + void toChanged(QVariant); + void easingChanged(const QString &); + void propertiesChanged(const QString &); }; -class QmlParentActionPrivate : public QmlAbstractAnimationPrivate +class Q_AUTOTEST_EXPORT QmlColorAnimation : public QmlPropertyAnimation { - Q_DECLARE_PUBLIC(QmlParentAction) -public: - QmlParentActionPrivate() - : QmlAbstractAnimationPrivate(), pcTarget(0), pcParent(0) {} + Q_OBJECT + Q_DECLARE_PRIVATE(QmlPropertyAnimation) + Q_PROPERTY(QColor from READ from WRITE setFrom NOTIFY fromChanged) + Q_PROPERTY(QColor to READ to WRITE setTo NOTIFY toChanged) - void init(); +public: + QmlColorAnimation(QObject *parent=0); + virtual ~QmlColorAnimation(); - QmlGraphicsItem *pcTarget; - QmlGraphicsItem *pcParent; + QColor from() const; + void setFrom(const QColor &); - void doAction(); - QActionAnimation *cpa; + QColor to() const; + void setTo(const QColor &); }; -class QmlAnimationGroupPrivate : public QmlAbstractAnimationPrivate +class Q_AUTOTEST_EXPORT QmlNumberAnimation : public QmlPropertyAnimation { - Q_DECLARE_PUBLIC(QmlAnimationGroup) + Q_OBJECT + Q_DECLARE_PRIVATE(QmlPropertyAnimation) + + Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged) + Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged) + public: - QmlAnimationGroupPrivate() - : QmlAbstractAnimationPrivate(), animations(this), ag(0) {} - - struct AnimationList : public QmlConcreteList - { - AnimationList(QmlAnimationGroupPrivate *p) - : anim(p) {} - virtual void append(QmlAbstractAnimation *a) { - QmlConcreteList::append(a); - a->setGroup(anim->q_func()); - } - virtual void clear() - { - for (int i = 0; i < count(); ++i) - at(i)->setGroup(0); - QmlConcreteList::clear(); - } - virtual void removeAt(int i) - { - at(i)->setGroup(0); - QmlConcreteList::removeAt(i); - } - virtual void insert(int i, QmlAbstractAnimation *a) - { - QmlConcreteList::insert(i, a); - a->setGroup(anim->q_func()); - } - - QmlAnimationGroupPrivate *anim; - }; - - AnimationList animations; - QAnimationGroup *ag; + QmlNumberAnimation(QObject *parent=0); + virtual ~QmlNumberAnimation(); + + qreal from() const; + void setFrom(qreal); + + qreal to() const; + void setTo(qreal); }; -class QmlPropertyAnimationPrivate : public QmlAbstractAnimationPrivate +class QmlAnimationGroupPrivate; +class QmlAnimationGroup : public QmlAbstractAnimation { - Q_DECLARE_PUBLIC(QmlPropertyAnimation) -public: - QmlPropertyAnimationPrivate() - : QmlAbstractAnimationPrivate(), fromSourced(false), fromIsDefined(false), toIsDefined(false), - defaultToInterpolatorType(0), interpolatorType(0), interpolator(0), va(0), - value(this, &QmlPropertyAnimationPrivate::valueChanged) {} + Q_OBJECT + Q_DECLARE_PRIVATE(QmlAnimationGroup) - void init(); + Q_CLASSINFO("DefaultProperty", "animations") + Q_PROPERTY(QmlList *animations READ animations) - QVariant from; - QVariant to; +public: + QmlAnimationGroup(QObject *parent); + virtual ~QmlAnimationGroup(); - QString easing; + QmlList* animations(); + friend class QmlAbstractAnimation; +}; - QString properties; - QList targets; - QList exclude; +class QmlSequentialAnimation : public QmlAnimationGroup +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlAnimationGroup) - bool fromSourced; - bool fromIsDefined; - bool toIsDefined; - bool defaultToInterpolatorType; - int interpolatorType; - QVariantAnimation::Interpolator interpolator; +public: + QmlSequentialAnimation(QObject *parent=0); + virtual ~QmlSequentialAnimation(); - QmlTimeLineValueAnimator *va; - virtual void valueChanged(qreal); +protected: + virtual void transition(QmlStateActions &actions, + QmlMetaProperties &modified, + TransitionDirection direction); + virtual QAbstractAnimation *qtAnimation(); + virtual void prepare(QmlMetaProperty &); +}; - QmlTimeLineValueProxy value; +class QmlParallelAnimation : public QmlAnimationGroup +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlAnimationGroup) + +public: + QmlParallelAnimation(QObject *parent=0); + virtual ~QmlParallelAnimation(); - static QVariant interpolateVariant(const QVariant &from, const QVariant &to, qreal progress); - static void convertVariant(QVariant &variant, int type); +protected: + virtual void transition(QmlStateActions &actions, + QmlMetaProperties &modified, + TransitionDirection direction); + virtual QAbstractAnimation *qtAnimation(); + virtual void prepare(QmlMetaProperty &); }; QT_END_NAMESPACE -#endif // QMLANIMATION_P_H +QML_DECLARE_TYPE(QmlAbstractAnimation) +QML_DECLARE_TYPE(QmlPauseAnimation) +QML_DECLARE_TYPE(QmlScriptAction) +QML_DECLARE_TYPE(QmlPropertyAction) +QML_DECLARE_TYPE(QmlParentAction) +QML_DECLARE_TYPE(QmlPropertyAnimation) +QML_DECLARE_TYPE(QmlColorAnimation) +QML_DECLARE_TYPE(QmlNumberAnimation) +QML_DECLARE_TYPE(QmlSequentialAnimation) +QML_DECLARE_TYPE(QmlParallelAnimation) + +QT_END_HEADER + +#endif // QMLANIMATION_H diff --git a/src/declarative/util/qmlanimation_p_p.h b/src/declarative/util/qmlanimation_p_p.h new file mode 100644 index 0000000..1372343 --- /dev/null +++ b/src/declarative/util/qmlanimation_p_p.h @@ -0,0 +1,362 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLANIMATION_P_H +#define QMLANIMATION_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +//interface for classes that provide animation actions for QActionAnimation +class QAbstractAnimationAction +{ +public: + virtual ~QAbstractAnimationAction() {} + virtual void doAction() = 0; +}; + +//templated animation action +//allows us to specify an action that calls a function of a class. +//(so that class doesn't have to inherit QmlAbstractAnimationAction) +template +class QAnimationActionProxy : public QAbstractAnimationAction +{ +public: + QAnimationActionProxy(T *p) : m_p(p) {} + virtual void doAction() { (m_p->*method)(); } + +private: + T *m_p; +}; + +//performs an action of type QAbstractAnimationAction +class QActionAnimation : public QAbstractAnimation +{ + Q_OBJECT +public: + QActionAnimation(QObject *parent = 0) : QAbstractAnimation(parent), animAction(0), policy(KeepWhenStopped) {} + QActionAnimation(QAbstractAnimationAction *action, QObject *parent = 0) + : QAbstractAnimation(parent), animAction(action), policy(KeepWhenStopped) {} + virtual int duration() const { return 0; } + void setAnimAction(QAbstractAnimationAction *action, DeletionPolicy p) + { + if (state() == Running) + stop(); + animAction = action; + policy = p; + } +protected: + virtual void updateCurrentTime(int) {} + + virtual void updateState(State /*oldState*/, State newState) + { + if (newState == Running) { + if (animAction) + animAction->doAction(); + } else if (newState == Stopped && policy == DeleteWhenStopped) { + delete animAction; + animAction = 0; + } + } + +private: + QAbstractAnimationAction *animAction; + DeletionPolicy policy; +}; + +//animates QmlTimeLineValue (assumes start and end values will be reals or compatible) +class QmlTimeLineValueAnimator : public QVariantAnimation +{ + Q_OBJECT +public: + QmlTimeLineValueAnimator(QObject *parent = 0) : QVariantAnimation(parent), animValue(0), fromSourced(0), policy(KeepWhenStopped) {} + void setAnimValue(QmlTimeLineValue *value, DeletionPolicy p) + { + if (state() == Running) + stop(); + animValue = value; + policy = p; + } + void setFromSourcedValue(bool *value) + { + fromSourced = value; + } +protected: + virtual void updateCurrentValue(const QVariant &value) + { + if (animValue) + animValue->setValue(value.toDouble()); + } + virtual void updateState(State oldState, State newState) + { + QVariantAnimation::updateState(oldState, newState); + if (newState == Running) { + //check for new from every loop + if (fromSourced) + *fromSourced = false; + } else if (newState == Stopped && policy == DeleteWhenStopped) { + delete animValue; + animValue = 0; + } + } + +private: + QmlTimeLineValue *animValue; + bool *fromSourced; + DeletionPolicy policy; +}; + +//an animation that just gives a tick +template +class QTickAnimationProxy : public QAbstractAnimation +{ + //Q_OBJECT //doesn't work with templating +public: + QTickAnimationProxy(T *p, QObject *parent = 0) : QAbstractAnimation(parent), m_p(p) {} + virtual int duration() const { return -1; } +protected: + virtual void updateCurrentTime(int msec) { (m_p->*method)(msec); } + +private: + T *m_p; +}; + +class QmlAbstractAnimationPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QmlAbstractAnimation) +public: + QmlAbstractAnimationPrivate() + : running(false), paused(false), alwaysRunToEnd(false), repeat(false), + connectedTimeLine(false), componentComplete(true), startOnCompletion(false), + target(0), group(0) {} + + bool running; + bool paused; + bool alwaysRunToEnd; + bool repeat; + bool connectedTimeLine; + + bool componentComplete; + bool startOnCompletion; + + void commence(); + + QmlNullableValue userProperty; + QObject *target; + QString propertyName; + + QmlMetaProperty property; + QmlAnimationGroup *group; + + QmlMetaProperty createProperty(QObject *obj, const QString &str); +}; + +class QmlPauseAnimationPrivate : public QmlAbstractAnimationPrivate +{ + Q_DECLARE_PUBLIC(QmlPauseAnimation) +public: + QmlPauseAnimationPrivate() + : QmlAbstractAnimationPrivate(), pa(0) {} + + void init(); + + QPauseAnimation *pa; +}; + +class QmlScriptActionPrivate : public QmlAbstractAnimationPrivate +{ + Q_DECLARE_PUBLIC(QmlScriptAction) +public: + QmlScriptActionPrivate() + : QmlAbstractAnimationPrivate(), hasRunScriptScript(false), proxy(this), rsa(0) {} + + void init(); + + QmlScriptString script; + QString name; + QmlScriptString runScriptScript; + bool hasRunScriptScript; + + void execute(); + + QAnimationActionProxy proxy; + QActionAnimation *rsa; +}; + +class QmlPropertyActionPrivate : public QmlAbstractAnimationPrivate +{ + Q_DECLARE_PUBLIC(QmlPropertyAction) +public: + QmlPropertyActionPrivate() + : QmlAbstractAnimationPrivate(), proxy(this), spa(0) {} + + void init(); + + QString properties; + QList targets; + QList exclude; + + QmlNullableValue value; + + void doAction(); + + QAnimationActionProxy proxy; + QActionAnimation *spa; +}; + +class QmlParentActionPrivate : public QmlAbstractAnimationPrivate +{ + Q_DECLARE_PUBLIC(QmlParentAction) +public: + QmlParentActionPrivate() + : QmlAbstractAnimationPrivate(), pcTarget(0), pcParent(0) {} + + void init(); + + QmlGraphicsItem *pcTarget; + QmlGraphicsItem *pcParent; + + void doAction(); + QActionAnimation *cpa; +}; + +class QmlAnimationGroupPrivate : public QmlAbstractAnimationPrivate +{ + Q_DECLARE_PUBLIC(QmlAnimationGroup) +public: + QmlAnimationGroupPrivate() + : QmlAbstractAnimationPrivate(), animations(this), ag(0) {} + + struct AnimationList : public QmlConcreteList + { + AnimationList(QmlAnimationGroupPrivate *p) + : anim(p) {} + virtual void append(QmlAbstractAnimation *a) { + QmlConcreteList::append(a); + a->setGroup(anim->q_func()); + } + virtual void clear() + { + for (int i = 0; i < count(); ++i) + at(i)->setGroup(0); + QmlConcreteList::clear(); + } + virtual void removeAt(int i) + { + at(i)->setGroup(0); + QmlConcreteList::removeAt(i); + } + virtual void insert(int i, QmlAbstractAnimation *a) + { + QmlConcreteList::insert(i, a); + a->setGroup(anim->q_func()); + } + + QmlAnimationGroupPrivate *anim; + }; + + AnimationList animations; + QAnimationGroup *ag; +}; + +class QmlPropertyAnimationPrivate : public QmlAbstractAnimationPrivate +{ + Q_DECLARE_PUBLIC(QmlPropertyAnimation) +public: + QmlPropertyAnimationPrivate() + : QmlAbstractAnimationPrivate(), fromSourced(false), fromIsDefined(false), toIsDefined(false), + defaultToInterpolatorType(0), interpolatorType(0), interpolator(0), va(0), + value(this, &QmlPropertyAnimationPrivate::valueChanged) {} + + void init(); + + QVariant from; + QVariant to; + + QString easing; + + QString properties; + QList targets; + QList exclude; + + bool fromSourced; + bool fromIsDefined; + bool toIsDefined; + bool defaultToInterpolatorType; + int interpolatorType; + QVariantAnimation::Interpolator interpolator; + + QmlTimeLineValueAnimator *va; + virtual void valueChanged(qreal); + + QmlTimeLineValueProxy value; + + static QVariant interpolateVariant(const QVariant &from, const QVariant &to, qreal progress); + static void convertVariant(QVariant &variant, int type); +}; + +QT_END_NAMESPACE + +#endif // QMLANIMATION_P_H diff --git a/src/declarative/util/qmlbind.cpp b/src/declarative/util/qmlbind.cpp index d18ef47..98ec7cf 100644 --- a/src/declarative/util/qmlbind.cpp +++ b/src/declarative/util/qmlbind.cpp @@ -47,8 +47,8 @@ #include #include #include -#include -#include "qmlbind.h" +#include +#include "qmlbind_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmlbind.h b/src/declarative/util/qmlbind.h deleted file mode 100644 index 731cdf8..0000000 --- a/src/declarative/util/qmlbind.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLBIND_H -#define QMLBIND_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlBindPrivate; -class Q_DECLARATIVE_EXPORT QmlBind : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlBind) - - Q_PROPERTY(QObject *target READ object WRITE setObject) - Q_PROPERTY(QString property READ property WRITE setProperty) - Q_PROPERTY(QVariant value READ value WRITE setValue) - Q_PROPERTY(bool when READ when WRITE setWhen) - -public: - QmlBind(QObject *parent=0); - ~QmlBind(); - - bool when() const; - void setWhen(bool); - - QObject *object(); - void setObject(QObject *); - - QString property() const; - void setProperty(const QString &); - - QVariant value() const; - void setValue(const QVariant &); - -private: - void eval(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlBind) - -QT_END_HEADER - -#endif diff --git a/src/declarative/util/qmlbind_p.h b/src/declarative/util/qmlbind_p.h new file mode 100644 index 0000000..731cdf8 --- /dev/null +++ b/src/declarative/util/qmlbind_p.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLBIND_H +#define QMLBIND_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlBindPrivate; +class Q_DECLARATIVE_EXPORT QmlBind : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlBind) + + Q_PROPERTY(QObject *target READ object WRITE setObject) + Q_PROPERTY(QString property READ property WRITE setProperty) + Q_PROPERTY(QVariant value READ value WRITE setValue) + Q_PROPERTY(bool when READ when WRITE setWhen) + +public: + QmlBind(QObject *parent=0); + ~QmlBind(); + + bool when() const; + void setWhen(bool); + + QObject *object(); + void setObject(QObject *); + + QString property() const; + void setProperty(const QString &); + + QVariant value() const; + void setValue(const QVariant &); + +private: + void eval(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlBind) + +QT_END_HEADER + +#endif diff --git a/src/declarative/util/qmlconnection.cpp b/src/declarative/util/qmlconnection.cpp index 5475fb2..c52732f 100644 --- a/src/declarative/util/qmlconnection.cpp +++ b/src/declarative/util/qmlconnection.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlconnection.h" +#include "qmlconnection_p.h" #include #include "private/qmlboundsignal_p.h" #include "private/qobject_p.h" diff --git a/src/declarative/util/qmlconnection.h b/src/declarative/util/qmlconnection.h deleted file mode 100644 index 3d69c6f..0000000 --- a/src/declarative/util/qmlconnection.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLCONNECTION_H -#define QMLCONNECTION_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlBoundSignal; -class QmlContext; -class QmlConnectionPrivate; -class Q_DECLARATIVE_EXPORT QmlConnection : public QObject, public QmlParserStatus -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlConnection) - - Q_INTERFACES(QmlParserStatus) - Q_PROPERTY(QObject *sender READ signalSender WRITE setSignalSender) - Q_PROPERTY(QmlScriptString script READ script WRITE setScript) - Q_PROPERTY(QString signal READ signal WRITE setSignal) - -public: - QmlConnection(QObject *parent=0); - ~QmlConnection(); - - QObject *signalSender() const; - void setSignalSender(QObject *); - QmlScriptString script() const; - void setScript(const QmlScriptString&); - QString signal() const; - void setSignal(const QString&); - -private: - void disconnectIfValid(); - void connectIfValid(); - void componentComplete(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlConnection) - -QT_END_HEADER - -#endif diff --git a/src/declarative/util/qmlconnection_p.h b/src/declarative/util/qmlconnection_p.h new file mode 100644 index 0000000..3d69c6f --- /dev/null +++ b/src/declarative/util/qmlconnection_p.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLCONNECTION_H +#define QMLCONNECTION_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlBoundSignal; +class QmlContext; +class QmlConnectionPrivate; +class Q_DECLARATIVE_EXPORT QmlConnection : public QObject, public QmlParserStatus +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlConnection) + + Q_INTERFACES(QmlParserStatus) + Q_PROPERTY(QObject *sender READ signalSender WRITE setSignalSender) + Q_PROPERTY(QmlScriptString script READ script WRITE setScript) + Q_PROPERTY(QString signal READ signal WRITE setSignal) + +public: + QmlConnection(QObject *parent=0); + ~QmlConnection(); + + QObject *signalSender() const; + void setSignalSender(QObject *); + QmlScriptString script() const; + void setScript(const QmlScriptString&); + QString signal() const; + void setSignal(const QString&); + +private: + void disconnectIfValid(); + void connectIfValid(); + void componentComplete(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlConnection) + +QT_END_HEADER + +#endif diff --git a/src/declarative/util/qmleasefollow.cpp b/src/declarative/util/qmleasefollow.cpp index 9d17d25..96654c6 100644 --- a/src/declarative/util/qmleasefollow.cpp +++ b/src/declarative/util/qmleasefollow.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "qmleasefollow.h" +#include "qmleasefollow_p.h" #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmleasefollow.h b/src/declarative/util/qmleasefollow.h deleted file mode 100644 index a653ea6..0000000 --- a/src/declarative/util/qmleasefollow.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLEASEFOLLOW_H -#define QMLEASEFOLLOW_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlMetaProperty; -class QmlEaseFollowPrivate; -class Q_DECLARATIVE_EXPORT QmlEaseFollow : public QObject, - public QmlPropertyValueSource -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlEaseFollow) - Q_INTERFACES(QmlPropertyValueSource) - Q_ENUMS(ReversingMode) - - Q_PROPERTY(qreal source READ sourceValue WRITE setSourceValue NOTIFY sourceChanged) - Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity NOTIFY velocityChanged) - Q_PROPERTY(qreal duration READ duration WRITE setDuration NOTIFY durationChanged) - Q_PROPERTY(ReversingMode reversingMode READ reversingMode WRITE setReversingMode NOTIFY reversingModeChanged) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(qreal maximumEasingTime READ maximumEasingTime WRITE setMaximumEasingTime NOTIFY maximumEasingTimeChanged) - -public: - enum ReversingMode { Eased, Immediate, Sync }; - - QmlEaseFollow(QObject *parent = 0); - ~QmlEaseFollow(); - - ReversingMode reversingMode() const; - void setReversingMode(ReversingMode); - - qreal sourceValue() const; - void setSourceValue(qreal); - - qreal velocity() const; - void setVelocity(qreal); - - qreal duration() const; - void setDuration(qreal); - - bool enabled() const; - void setEnabled(bool enabled); - - qreal maximumEasingTime() const; - void setMaximumEasingTime(qreal); - - virtual void setTarget(const QmlMetaProperty &); - -signals: - void sourceChanged(); - void velocityChanged(); - void durationChanged(); - void reversingModeChanged(); - void enabledChanged(); - void maximumEasingTimeChanged(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlEaseFollow); - -QT_END_HEADER - -#endif // QMLEASEFOLLOW_H diff --git a/src/declarative/util/qmleasefollow_p.h b/src/declarative/util/qmleasefollow_p.h new file mode 100644 index 0000000..a653ea6 --- /dev/null +++ b/src/declarative/util/qmleasefollow_p.h @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLEASEFOLLOW_H +#define QMLEASEFOLLOW_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlMetaProperty; +class QmlEaseFollowPrivate; +class Q_DECLARATIVE_EXPORT QmlEaseFollow : public QObject, + public QmlPropertyValueSource +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlEaseFollow) + Q_INTERFACES(QmlPropertyValueSource) + Q_ENUMS(ReversingMode) + + Q_PROPERTY(qreal source READ sourceValue WRITE setSourceValue NOTIFY sourceChanged) + Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity NOTIFY velocityChanged) + Q_PROPERTY(qreal duration READ duration WRITE setDuration NOTIFY durationChanged) + Q_PROPERTY(ReversingMode reversingMode READ reversingMode WRITE setReversingMode NOTIFY reversingModeChanged) + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) + Q_PROPERTY(qreal maximumEasingTime READ maximumEasingTime WRITE setMaximumEasingTime NOTIFY maximumEasingTimeChanged) + +public: + enum ReversingMode { Eased, Immediate, Sync }; + + QmlEaseFollow(QObject *parent = 0); + ~QmlEaseFollow(); + + ReversingMode reversingMode() const; + void setReversingMode(ReversingMode); + + qreal sourceValue() const; + void setSourceValue(qreal); + + qreal velocity() const; + void setVelocity(qreal); + + qreal duration() const; + void setDuration(qreal); + + bool enabled() const; + void setEnabled(bool enabled); + + qreal maximumEasingTime() const; + void setMaximumEasingTime(qreal); + + virtual void setTarget(const QmlMetaProperty &); + +signals: + void sourceChanged(); + void velocityChanged(); + void durationChanged(); + void reversingModeChanged(); + void enabledChanged(); + void maximumEasingTimeChanged(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlEaseFollow); + +QT_END_HEADER + +#endif // QMLEASEFOLLOW_H diff --git a/src/declarative/util/qmllistaccessor.cpp b/src/declarative/util/qmllistaccessor.cpp index 3e4cb64..80709f1 100644 --- a/src/declarative/util/qmllistaccessor.cpp +++ b/src/declarative/util/qmllistaccessor.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmllistaccessor.h" +#include "qmllistaccessor_p.h" #include #include #include diff --git a/src/declarative/util/qmllistaccessor.h b/src/declarative/util/qmllistaccessor.h deleted file mode 100644 index c3ff632..0000000 --- a/src/declarative/util/qmllistaccessor.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLLISTACCESSOR_H -#define QMLLISTACCESSOR_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlEngine; -class Q_DECLARATIVE_EXPORT QmlListAccessor -{ -public: - QmlListAccessor(); - virtual ~QmlListAccessor(); - - QVariant list() const; - void setList(const QVariant &, QmlEngine * = 0); - - bool isValid() const; - - int count() const; - QVariant at(int) const; - - virtual void append(const QVariant &); - virtual void insert(int, const QVariant &); - virtual void removeAt(int); - virtual void clear(); - - enum Type { Invalid, StringList, VariantList, QmlList, QList, Instance, Integer }; - Type type() const { return m_type; } - -private: - Type m_type; - QVariant d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLLISTACCESSOR_H diff --git a/src/declarative/util/qmllistaccessor_p.h b/src/declarative/util/qmllistaccessor_p.h new file mode 100644 index 0000000..c3ff632 --- /dev/null +++ b/src/declarative/util/qmllistaccessor_p.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLLISTACCESSOR_H +#define QMLLISTACCESSOR_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlEngine; +class Q_DECLARATIVE_EXPORT QmlListAccessor +{ +public: + QmlListAccessor(); + virtual ~QmlListAccessor(); + + QVariant list() const; + void setList(const QVariant &, QmlEngine * = 0); + + bool isValid() const; + + int count() const; + QVariant at(int) const; + + virtual void append(const QVariant &); + virtual void insert(int, const QVariant &); + virtual void removeAt(int); + virtual void clear(); + + enum Type { Invalid, StringList, VariantList, QmlList, QList, Instance, Integer }; + Type type() const { return m_type; } + +private: + Type m_type; + QVariant d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLLISTACCESSOR_H diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index 9c9fa6a..d5202c5 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -44,9 +44,9 @@ #include #include #include -#include "qmlopenmetaobject.h" +#include "qmlopenmetaobject_p.h" #include -#include "qmllistmodel.h" +#include "qmllistmodel_p.h" #include Q_DECLARE_METATYPE(QListModelInterface *) diff --git a/src/declarative/util/qmllistmodel.h b/src/declarative/util/qmllistmodel.h deleted file mode 100644 index 7bb94cf..0000000 --- a/src/declarative/util/qmllistmodel.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLLISTMODEL_H -#define QMLLISTMODEL_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -struct ModelNode; -class QmlListModel : public QListModelInterface -{ - Q_OBJECT - Q_PROPERTY(int count READ count) - -public: - QmlListModel(QObject *parent=0); - ~QmlListModel(); - - virtual QList roles() const; - virtual QString toString(int role) const; - virtual int count() const; - virtual QHash data(int index, const QList &roles = (QList())) const; - - Q_INVOKABLE void clear(); - Q_INVOKABLE void remove(int index); - Q_INVOKABLE void append(const QScriptValue&); - Q_INVOKABLE void insert(int index, const QScriptValue&); - Q_INVOKABLE void set(int index, const QScriptValue&); - Q_INVOKABLE void set(int index, const QString& property, const QVariant& value); - Q_INVOKABLE void move(int from, int to, int count); - -private: - QVariant valueForNode(ModelNode *) const; - mutable QStringList roleStrings; - friend class QmlListModelParser; - friend struct ModelNode; - - void checkRoles() const; - void addRole(const QString &) const; - mutable bool _rolesOk; - ModelNode *_root; -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlListModel) - -QT_END_HEADER - -#endif // QMLLISTMODEL_H diff --git a/src/declarative/util/qmllistmodel_p.h b/src/declarative/util/qmllistmodel_p.h new file mode 100644 index 0000000..b376e59 --- /dev/null +++ b/src/declarative/util/qmllistmodel_p.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLLISTMODEL_H +#define QMLLISTMODEL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +struct ModelNode; +class QmlListModel : public QListModelInterface +{ + Q_OBJECT + Q_PROPERTY(int count READ count) + +public: + QmlListModel(QObject *parent=0); + ~QmlListModel(); + + virtual QList roles() const; + virtual QString toString(int role) const; + virtual int count() const; + virtual QHash data(int index, const QList &roles = (QList())) const; + + Q_INVOKABLE void clear(); + Q_INVOKABLE void remove(int index); + Q_INVOKABLE void append(const QScriptValue&); + Q_INVOKABLE void insert(int index, const QScriptValue&); + Q_INVOKABLE void set(int index, const QScriptValue&); + Q_INVOKABLE void set(int index, const QString& property, const QVariant& value); + Q_INVOKABLE void move(int from, int to, int count); + +private: + QVariant valueForNode(ModelNode *) const; + mutable QStringList roleStrings; + friend class QmlListModelParser; + friend struct ModelNode; + + void checkRoles() const; + void addRole(const QString &) const; + mutable bool _rolesOk; + ModelNode *_root; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlListModel) + +QT_END_HEADER + +#endif // QMLLISTMODEL_H diff --git a/src/declarative/util/qmlnullablevalue_p.h b/src/declarative/util/qmlnullablevalue_p.h deleted file mode 100644 index 6455642..0000000 --- a/src/declarative/util/qmlnullablevalue_p.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLNULLABLEVALUE_P_H -#define QMLNULLABLEVALUE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -QT_BEGIN_NAMESPACE - -template -struct QmlNullableValue -{ - QmlNullableValue() - : isNull(true), value(T()) {} - QmlNullableValue(const QmlNullableValue &o) - : isNull(o.isNull), value(o.value) {} - QmlNullableValue(const T &t) - : isNull(false), value(t) {} - QmlNullableValue &operator=(const T &t) - { isNull = false; value = t; return *this; } - QmlNullableValue &operator=(const QmlNullableValue &o) - { isNull = o.isNull; value = o.value; return *this; } - operator T() const { return value; } - - void invalidate() { isNull = true; } - bool isValid() const { return !isNull; } - bool isNull; - T value; -}; - -QT_END_NAMESPACE - -#endif // QMLNULLABLEVALUE_P_H diff --git a/src/declarative/util/qmlnullablevalue_p_p.h b/src/declarative/util/qmlnullablevalue_p_p.h new file mode 100644 index 0000000..6455642 --- /dev/null +++ b/src/declarative/util/qmlnullablevalue_p_p.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLNULLABLEVALUE_P_H +#define QMLNULLABLEVALUE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_NAMESPACE + +template +struct QmlNullableValue +{ + QmlNullableValue() + : isNull(true), value(T()) {} + QmlNullableValue(const QmlNullableValue &o) + : isNull(o.isNull), value(o.value) {} + QmlNullableValue(const T &t) + : isNull(false), value(t) {} + QmlNullableValue &operator=(const T &t) + { isNull = false; value = t; return *this; } + QmlNullableValue &operator=(const QmlNullableValue &o) + { isNull = o.isNull; value = o.value; return *this; } + operator T() const { return value; } + + void invalidate() { isNull = true; } + bool isValid() const { return !isNull; } + bool isNull; + T value; +}; + +QT_END_NAMESPACE + +#endif // QMLNULLABLEVALUE_P_H diff --git a/src/declarative/util/qmlopenmetaobject.cpp b/src/declarative/util/qmlopenmetaobject.cpp index 11648f6..c348ced 100644 --- a/src/declarative/util/qmlopenmetaobject.cpp +++ b/src/declarative/util/qmlopenmetaobject.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmlopenmetaobject.h" +#include "qmlopenmetaobject_p.h" #include "private/qmetaobjectbuilder_p.h" #include diff --git a/src/declarative/util/qmlopenmetaobject.h b/src/declarative/util/qmlopenmetaobject.h deleted file mode 100644 index be0490d..0000000 --- a/src/declarative/util/qmlopenmetaobject.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLOPENMETAOBJECT_H -#define QMLOPENMETAOBJECT_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlOpenMetaObjectPrivate; -class QMetaPropertyBuilder; -class Q_DECLARATIVE_EXPORT QmlOpenMetaObject : public QAbstractDynamicMetaObject -{ -public: - QmlOpenMetaObject(QObject *, bool = true); - ~QmlOpenMetaObject(); - - QVariant value(const QByteArray &) const; - void setValue(const QByteArray &, const QVariant &); - QVariant value(int) const; - void setValue(int, const QVariant &); - QVariant &operator[](const QByteArray &); - - int count() const; - QByteArray name(int) const; - - QObject *object() const; -protected: - virtual int metaCall(QMetaObject::Call _c, int _id, void **_a); - virtual int createProperty(const char *, const char *); - - virtual void propertyRead(int); - virtual void propertyWrite(int); - virtual QVariant propertyCreated(int, QMetaPropertyBuilder &); - -private: - int doCreateProperty(const char *); - - QmlOpenMetaObjectPrivate *d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLOPENMETAOBJECT_H diff --git a/src/declarative/util/qmlopenmetaobject_p.h b/src/declarative/util/qmlopenmetaobject_p.h new file mode 100644 index 0000000..be0490d --- /dev/null +++ b/src/declarative/util/qmlopenmetaobject_p.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLOPENMETAOBJECT_H +#define QMLOPENMETAOBJECT_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlOpenMetaObjectPrivate; +class QMetaPropertyBuilder; +class Q_DECLARATIVE_EXPORT QmlOpenMetaObject : public QAbstractDynamicMetaObject +{ +public: + QmlOpenMetaObject(QObject *, bool = true); + ~QmlOpenMetaObject(); + + QVariant value(const QByteArray &) const; + void setValue(const QByteArray &, const QVariant &); + QVariant value(int) const; + void setValue(int, const QVariant &); + QVariant &operator[](const QByteArray &); + + int count() const; + QByteArray name(int) const; + + QObject *object() const; +protected: + virtual int metaCall(QMetaObject::Call _c, int _id, void **_a); + virtual int createProperty(const char *, const char *); + + virtual void propertyRead(int); + virtual void propertyWrite(int); + virtual QVariant propertyCreated(int, QMetaPropertyBuilder &); + +private: + int doCreateProperty(const char *); + + QmlOpenMetaObjectPrivate *d; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLOPENMETAOBJECT_H diff --git a/src/declarative/util/qmlpackage.cpp b/src/declarative/util/qmlpackage.cpp index 7df8453..05b6cbc 100644 --- a/src/declarative/util/qmlpackage.cpp +++ b/src/declarative/util/qmlpackage.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "private/qobject_p.h" -#include "qmlpackage.h" +#include "qmlpackage_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmlpackage.h b/src/declarative/util/qmlpackage.h deleted file mode 100644 index 7cceaa7..0000000 --- a/src/declarative/util/qmlpackage.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLPACKAGE_H -#define QMLPACKAGE_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -/***************************************************************************** - ***************************************************************************** - XXX Experimental - ***************************************************************************** -*****************************************************************************/ - -class QmlPackagePrivate; -class QmlPackageAttached; -class QmlPackage : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlPackage) - - Q_CLASSINFO("DefaultProperty", "data") - Q_PROPERTY(QmlList *data READ data SCRIPTABLE false) - -public: - QmlPackage(QObject *parent=0); - virtual ~QmlPackage(); - - QmlList *data(); - - QObject *part(const QString & = QString()); - bool hasPart(const QString &); - - static QmlPackageAttached *qmlAttachedProperties(QObject *); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlPackage) -QML_DECLARE_TYPEINFO(QmlPackage, QML_HAS_ATTACHED_PROPERTIES) - -QT_END_HEADER - -#endif // QMLPACKAGE_H diff --git a/src/declarative/util/qmlpackage_p.h b/src/declarative/util/qmlpackage_p.h new file mode 100644 index 0000000..7cceaa7 --- /dev/null +++ b/src/declarative/util/qmlpackage_p.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLPACKAGE_H +#define QMLPACKAGE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +/***************************************************************************** + ***************************************************************************** + XXX Experimental + ***************************************************************************** +*****************************************************************************/ + +class QmlPackagePrivate; +class QmlPackageAttached; +class QmlPackage : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlPackage) + + Q_CLASSINFO("DefaultProperty", "data") + Q_PROPERTY(QmlList *data READ data SCRIPTABLE false) + +public: + QmlPackage(QObject *parent=0); + virtual ~QmlPackage(); + + QmlList *data(); + + QObject *part(const QString & = QString()); + bool hasPart(const QString &); + + static QmlPackageAttached *qmlAttachedProperties(QObject *); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlPackage) +QML_DECLARE_TYPEINFO(QmlPackage, QML_HAS_ATTACHED_PROPERTIES) + +QT_END_HEADER + +#endif // QMLPACKAGE_H diff --git a/src/declarative/util/qmlpropertychanges.cpp b/src/declarative/util/qmlpropertychanges.cpp index 0ac168b..57db897 100644 --- a/src/declarative/util/qmlpropertychanges.cpp +++ b/src/declarative/util/qmlpropertychanges.cpp @@ -40,8 +40,8 @@ ****************************************************************************/ #include "private/qobject_p.h" -#include "qmlopenmetaobject.h" -#include "qmlpropertychanges.h" +#include "qmlopenmetaobject_p.h" +#include "qmlpropertychanges_p.h" #include #include #include diff --git a/src/declarative/util/qmlpropertychanges.h b/src/declarative/util/qmlpropertychanges.h deleted file mode 100644 index 2931cdb..0000000 --- a/src/declarative/util/qmlpropertychanges.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLPROPERTYCHANGES_H -#define QMLPROPERTYCHANGES_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlPropertyChangesPrivate; -class Q_DECLARATIVE_EXPORT QmlPropertyChanges : public QmlStateOperation -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlPropertyChanges) - - Q_PROPERTY(QObject *target READ object WRITE setObject) - Q_PROPERTY(bool restoreEntryValues READ restoreEntryValues WRITE setRestoreEntryValues) - Q_PROPERTY(bool explicit READ isExplicit WRITE setIsExplicit) -public: - QmlPropertyChanges(); - ~QmlPropertyChanges(); - - QObject *object() const; - void setObject(QObject *); - - bool restoreEntryValues() const; - void setRestoreEntryValues(bool); - - bool isExplicit() const; - void setIsExplicit(bool); - - virtual ActionList actions(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlPropertyChanges) - -QT_END_HEADER - -#endif // QMLPROPERTYCHANGES_H diff --git a/src/declarative/util/qmlpropertychanges_p.h b/src/declarative/util/qmlpropertychanges_p.h new file mode 100644 index 0000000..cb93eb3 --- /dev/null +++ b/src/declarative/util/qmlpropertychanges_p.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLPROPERTYCHANGES_H +#define QMLPROPERTYCHANGES_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlPropertyChangesPrivate; +class Q_DECLARATIVE_EXPORT QmlPropertyChanges : public QmlStateOperation +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlPropertyChanges) + + Q_PROPERTY(QObject *target READ object WRITE setObject) + Q_PROPERTY(bool restoreEntryValues READ restoreEntryValues WRITE setRestoreEntryValues) + Q_PROPERTY(bool explicit READ isExplicit WRITE setIsExplicit) +public: + QmlPropertyChanges(); + ~QmlPropertyChanges(); + + QObject *object() const; + void setObject(QObject *); + + bool restoreEntryValues() const; + void setRestoreEntryValues(bool); + + bool isExplicit() const; + void setIsExplicit(bool); + + virtual ActionList actions(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlPropertyChanges) + +QT_END_HEADER + +#endif // QMLPROPERTYCHANGES_H diff --git a/src/declarative/util/qmlpropertymap.cpp b/src/declarative/util/qmlpropertymap.cpp index a587af3..c54135c 100644 --- a/src/declarative/util/qmlpropertymap.cpp +++ b/src/declarative/util/qmlpropertymap.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qmlpropertymap.h" -#include +#include "qmlpropertymap_p.h" +#include #include QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmlpropertymap.h b/src/declarative/util/qmlpropertymap.h deleted file mode 100644 index 24b4395..0000000 --- a/src/declarative/util/qmlpropertymap.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLPROPERTYMAP_H -#define QMLPROPERTYMAP_H - -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlPropertyMapPrivate; -class Q_DECLARATIVE_EXPORT QmlPropertyMap : public QObject -{ - Q_OBJECT -public: - QmlPropertyMap(QObject *parent = 0); - virtual ~QmlPropertyMap(); - - QVariant value(const QString &key) const; - void insert(const QString &key, const QVariant &value); - void clear(const QString &key); - - Q_INVOKABLE QStringList keys() const; - - int count() const; - int size() const; - bool isEmpty() const; - bool contains(const QString &key) const; - - QVariant &operator[](const QString &key); - const QVariant operator[](const QString &key) const; - -Q_SIGNALS: - void valueChanged(const QString &key); - -private: - Q_DECLARE_PRIVATE(QmlPropertyMap) - Q_DISABLE_COPY(QmlPropertyMap) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/declarative/util/qmlpropertymap_p.h b/src/declarative/util/qmlpropertymap_p.h new file mode 100644 index 0000000..24b4395 --- /dev/null +++ b/src/declarative/util/qmlpropertymap_p.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLPROPERTYMAP_H +#define QMLPROPERTYMAP_H + +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlPropertyMapPrivate; +class Q_DECLARATIVE_EXPORT QmlPropertyMap : public QObject +{ + Q_OBJECT +public: + QmlPropertyMap(QObject *parent = 0); + virtual ~QmlPropertyMap(); + + QVariant value(const QString &key) const; + void insert(const QString &key, const QVariant &value); + void clear(const QString &key); + + Q_INVOKABLE QStringList keys() const; + + int count() const; + int size() const; + bool isEmpty() const; + bool contains(const QString &key) const; + + QVariant &operator[](const QString &key); + const QVariant operator[](const QString &key) const; + +Q_SIGNALS: + void valueChanged(const QString &key); + +private: + Q_DECLARE_PRIVATE(QmlPropertyMap) + Q_DISABLE_COPY(QmlPropertyMap) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/declarative/util/qmlspringfollow.cpp b/src/declarative/util/qmlspringfollow.cpp index 3b2526b..354110e 100644 --- a/src/declarative/util/qmlspringfollow.cpp +++ b/src/declarative/util/qmlspringfollow.cpp @@ -43,8 +43,8 @@ #include #include #include "private/qobject_p.h" -#include "qmlspringfollow.h" -#include "private/qmlanimation_p.h" +#include "qmlspringfollow_p.h" +#include "private/qmlanimation_p_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmlspringfollow.h b/src/declarative/util/qmlspringfollow.h deleted file mode 100644 index 1b77861..0000000 --- a/src/declarative/util/qmlspringfollow.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLFOLLOW_H -#define QMLFOLLOW_H - -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlSpringFollowPrivate; -class Q_DECLARATIVE_EXPORT QmlSpringFollow : public QObject, - public QmlPropertyValueSource -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlSpringFollow) - Q_INTERFACES(QmlPropertyValueSource) - - Q_PROPERTY(qreal source READ sourceValue WRITE setSourceValue) - Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity) - Q_PROPERTY(qreal spring READ spring WRITE setSpring) - Q_PROPERTY(qreal damping READ damping WRITE setDamping) - Q_PROPERTY(qreal epsilon READ epsilon WRITE setEpsilon) - Q_PROPERTY(qreal modulus READ modulus WRITE setModulus) - Q_PROPERTY(bool enabled READ enabled WRITE setEnabled) - Q_PROPERTY(qreal value READ value NOTIFY valueChanged) - Q_PROPERTY(qreal modulus READ modulus WRITE setModulus NOTIFY modulusChanged) - Q_PROPERTY(qreal mass READ mass WRITE setMass NOTIFY massChanged) - Q_PROPERTY(bool inSync READ inSync NOTIFY syncChanged) - -public: - QmlSpringFollow(QObject *parent=0); - ~QmlSpringFollow(); - - virtual void setTarget(const QmlMetaProperty &); - - qreal sourceValue() const; - void setSourceValue(qreal value); - qreal velocity() const; - void setVelocity(qreal velocity); - qreal spring() const; - void setSpring(qreal spring); - qreal damping() const; - void setDamping(qreal damping); - qreal epsilon() const; - void setEpsilon(qreal epsilon); - qreal mass() const; - void setMass(qreal modulus); - qreal modulus() const; - void setModulus(qreal modulus); - bool enabled() const; - void setEnabled(bool enabled); - bool inSync() const; - - qreal value() const; - -Q_SIGNALS: - void valueChanged(qreal); - void modulusChanged(); - void massChanged(); - void syncChanged(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlSpringFollow) - -QT_END_HEADER - -#endif // QFXFOLLOW_H diff --git a/src/declarative/util/qmlspringfollow_p.h b/src/declarative/util/qmlspringfollow_p.h new file mode 100644 index 0000000..1b77861 --- /dev/null +++ b/src/declarative/util/qmlspringfollow_p.h @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLFOLLOW_H +#define QMLFOLLOW_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlSpringFollowPrivate; +class Q_DECLARATIVE_EXPORT QmlSpringFollow : public QObject, + public QmlPropertyValueSource +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlSpringFollow) + Q_INTERFACES(QmlPropertyValueSource) + + Q_PROPERTY(qreal source READ sourceValue WRITE setSourceValue) + Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity) + Q_PROPERTY(qreal spring READ spring WRITE setSpring) + Q_PROPERTY(qreal damping READ damping WRITE setDamping) + Q_PROPERTY(qreal epsilon READ epsilon WRITE setEpsilon) + Q_PROPERTY(qreal modulus READ modulus WRITE setModulus) + Q_PROPERTY(bool enabled READ enabled WRITE setEnabled) + Q_PROPERTY(qreal value READ value NOTIFY valueChanged) + Q_PROPERTY(qreal modulus READ modulus WRITE setModulus NOTIFY modulusChanged) + Q_PROPERTY(qreal mass READ mass WRITE setMass NOTIFY massChanged) + Q_PROPERTY(bool inSync READ inSync NOTIFY syncChanged) + +public: + QmlSpringFollow(QObject *parent=0); + ~QmlSpringFollow(); + + virtual void setTarget(const QmlMetaProperty &); + + qreal sourceValue() const; + void setSourceValue(qreal value); + qreal velocity() const; + void setVelocity(qreal velocity); + qreal spring() const; + void setSpring(qreal spring); + qreal damping() const; + void setDamping(qreal damping); + qreal epsilon() const; + void setEpsilon(qreal epsilon); + qreal mass() const; + void setMass(qreal modulus); + qreal modulus() const; + void setModulus(qreal modulus); + bool enabled() const; + void setEnabled(bool enabled); + bool inSync() const; + + qreal value() const; + +Q_SIGNALS: + void valueChanged(qreal); + void modulusChanged(); + void massChanged(); + void syncChanged(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlSpringFollow) + +QT_END_HEADER + +#endif // QFXFOLLOW_H diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index 425480c..6908175 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -39,14 +39,14 @@ ** ****************************************************************************/ -#include "qmltransition.h" -#include "qmlstategroup.h" -#include "qmlstate_p.h" +#include "qmltransition_p.h" +#include "qmlstategroup_p.h" +#include "qmlstate_p_p.h" #include "qmlbinding.h" -#include "qmlstateoperations.h" -#include "qmlanimation.h" +#include "qmlstateoperations_p.h" #include "qmlanimation_p.h" -#include "qmlstate.h" +#include "qmlanimation_p_p.h" +#include "qmlstate_p.h" #include QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmlstate.h b/src/declarative/util/qmlstate.h deleted file mode 100644 index 50128c0..0000000 --- a/src/declarative/util/qmlstate.h +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLSTATE_H -#define QMLSTATE_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class ActionEvent; -class QmlBinding; -class Action -{ -public: - Action(); - Action(QObject *, const QString &, const QVariant &); - - bool restore:1; - bool actionDone:1; - bool reverseEvent:1; - bool deletableToBinding:1; - - QmlMetaProperty property; - QVariant fromValue; - QVariant toValue; - - QmlAbstractBinding *fromBinding; - QmlAbstractBinding *toBinding; - ActionEvent *event; - - //strictly for matching - QObject *specifiedObject; - QString specifiedProperty; - - void deleteFromBinding(); -}; - -class ActionEvent -{ -public: - virtual ~ActionEvent(); - virtual QString typeName() const; - - virtual void execute(); - virtual bool isReversable(); - virtual void reverse(); - virtual void saveOriginals() {} - - //virtual bool hasExtraActions(); - virtual QList extraActions(); - - virtual bool changesBindings(); - virtual void clearForwardBindings(); - virtual void clearReverseBindings(); - virtual bool override(ActionEvent*other); -}; - -//### rename to QmlStateChange? -class QmlStateGroup; -class Q_DECLARATIVE_EXPORT QmlStateOperation : public QObject -{ - Q_OBJECT -public: - QmlStateOperation(QObject *parent = 0) - : QObject(parent) {} - typedef QList ActionList; - - virtual ActionList actions(); - -protected: - QmlStateOperation(QObjectPrivate &dd, QObject *parent = 0); -}; - -typedef QmlStateOperation::ActionList QmlStateActions; - -class QmlTransition; -class QmlStatePrivate; -class Q_DECLARATIVE_EXPORT QmlState : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(QmlBinding *when READ when WRITE setWhen) - Q_PROPERTY(QString extend READ extends WRITE setExtends) - Q_PROPERTY(QmlList* changes READ changes) - Q_CLASSINFO("DefaultProperty", "changes") - -public: - QmlState(QObject *parent=0); - virtual ~QmlState(); - - QString name() const; - void setName(const QString &); - - /*'when' is a QmlBinding to limit state changes oscillation - due to the unpredictable order of evaluation of bound expressions*/ - bool isWhenKnown() const; - QmlBinding *when() const; - void setWhen(QmlBinding *); - - QString extends() const; - void setExtends(const QString &); - - QmlList *changes(); - QmlState &operator<<(QmlStateOperation *); - - void apply(QmlStateGroup *, QmlTransition *, QmlState *revert); - void cancel(); - - QmlStateGroup *stateGroup() const; - void setStateGroup(QmlStateGroup *); - -Q_SIGNALS: - void completed(); - -private: - Q_DECLARE_PRIVATE(QmlState) - Q_DISABLE_COPY(QmlState) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlStateOperation) -QML_DECLARE_TYPE(QmlState) - -QT_END_HEADER - -#endif // QMLSTATE_H diff --git a/src/declarative/util/qmlstate_p.h b/src/declarative/util/qmlstate_p.h index 63fc6da..50128c0 100644 --- a/src/declarative/util/qmlstate_p.h +++ b/src/declarative/util/qmlstate_p.h @@ -39,83 +39,136 @@ ** ****************************************************************************/ -#ifndef QMLSTATE_P_H -#define QMLSTATE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include +#ifndef QMLSTATE_H +#define QMLSTATE_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class SimpleAction +QT_MODULE(Declarative) + +class ActionEvent; +class QmlBinding; +class Action { public: - enum State { StartState, EndState }; - SimpleAction(const Action &a, State state = StartState) - { - property = a.property; - specifiedObject = a.specifiedObject; - specifiedProperty = a.specifiedProperty; - event = a.event; - if (state == StartState) { - value = a.fromValue; - binding = property.binding(); - reverseEvent = true; - } else { - value = a.toValue; - binding = a.toBinding; - reverseEvent = false; - } - } + Action(); + Action(QObject *, const QString &, const QVariant &); + + bool restore:1; + bool actionDone:1; + bool reverseEvent:1; + bool deletableToBinding:1; QmlMetaProperty property; - QVariant value; - QmlAbstractBinding *binding; + QVariant fromValue; + QVariant toValue; + + QmlAbstractBinding *fromBinding; + QmlAbstractBinding *toBinding; + ActionEvent *event; + + //strictly for matching QObject *specifiedObject; QString specifiedProperty; - ActionEvent *event; - bool reverseEvent; + + void deleteFromBinding(); }; -class QmlStatePrivate : public QObjectPrivate +class ActionEvent { - Q_DECLARE_PUBLIC(QmlState) +public: + virtual ~ActionEvent(); + virtual QString typeName() const; + + virtual void execute(); + virtual bool isReversable(); + virtual void reverse(); + virtual void saveOriginals() {} + + //virtual bool hasExtraActions(); + virtual QList extraActions(); + virtual bool changesBindings(); + virtual void clearForwardBindings(); + virtual void clearReverseBindings(); + virtual bool override(ActionEvent*other); +}; + +//### rename to QmlStateChange? +class QmlStateGroup; +class Q_DECLARATIVE_EXPORT QmlStateOperation : public QObject +{ + Q_OBJECT public: - QmlStatePrivate() - : when(0), inState(false), group(0) {} + QmlStateOperation(QObject *parent = 0) + : QObject(parent) {} + typedef QList ActionList; - typedef QList SimpleActionList; + virtual ActionList actions(); - QString name; - QmlBinding *when; - QmlConcreteList operations; +protected: + QmlStateOperation(QObjectPrivate &dd, QObject *parent = 0); +}; + +typedef QmlStateOperation::ActionList QmlStateActions; + +class QmlTransition; +class QmlStatePrivate; +class Q_DECLARATIVE_EXPORT QmlState : public QObject +{ + Q_OBJECT + + Q_PROPERTY(QString name READ name WRITE setName) + Q_PROPERTY(QmlBinding *when READ when WRITE setWhen) + Q_PROPERTY(QString extend READ extends WRITE setExtends) + Q_PROPERTY(QmlList* changes READ changes) + Q_CLASSINFO("DefaultProperty", "changes") + +public: + QmlState(QObject *parent=0); + virtual ~QmlState(); - QmlTransitionManager transitionManager; + QString name() const; + void setName(const QString &); - SimpleActionList revertList; - QList reverting; - QString extends; - mutable bool inState; - QmlStateGroup *group; + /*'when' is a QmlBinding to limit state changes oscillation + due to the unpredictable order of evaluation of bound expressions*/ + bool isWhenKnown() const; + QmlBinding *when() const; + void setWhen(QmlBinding *); - QmlStateOperation::ActionList generateActionList(QmlStateGroup *) const; - void complete(); + QString extends() const; + void setExtends(const QString &); + + QmlList *changes(); + QmlState &operator<<(QmlStateOperation *); + + void apply(QmlStateGroup *, QmlTransition *, QmlState *revert); + void cancel(); + + QmlStateGroup *stateGroup() const; + void setStateGroup(QmlStateGroup *); + +Q_SIGNALS: + void completed(); + +private: + Q_DECLARE_PRIVATE(QmlState) + Q_DISABLE_COPY(QmlState) }; QT_END_NAMESPACE -#endif // QMLSTATE_P_H +QML_DECLARE_TYPE(QmlStateOperation) +QML_DECLARE_TYPE(QmlState) + +QT_END_HEADER + +#endif // QMLSTATE_H diff --git a/src/declarative/util/qmlstate_p_p.h b/src/declarative/util/qmlstate_p_p.h new file mode 100644 index 0000000..2b62213 --- /dev/null +++ b/src/declarative/util/qmlstate_p_p.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLSTATE_P_H +#define QMLSTATE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class SimpleAction +{ +public: + enum State { StartState, EndState }; + SimpleAction(const Action &a, State state = StartState) + { + property = a.property; + specifiedObject = a.specifiedObject; + specifiedProperty = a.specifiedProperty; + event = a.event; + if (state == StartState) { + value = a.fromValue; + binding = property.binding(); + reverseEvent = true; + } else { + value = a.toValue; + binding = a.toBinding; + reverseEvent = false; + } + } + + QmlMetaProperty property; + QVariant value; + QmlAbstractBinding *binding; + QObject *specifiedObject; + QString specifiedProperty; + ActionEvent *event; + bool reverseEvent; +}; + +class QmlStatePrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QmlState) + +public: + QmlStatePrivate() + : when(0), inState(false), group(0) {} + + typedef QList SimpleActionList; + + QString name; + QmlBinding *when; + QmlConcreteList operations; + + QmlTransitionManager transitionManager; + + SimpleActionList revertList; + QList reverting; + QString extends; + mutable bool inState; + QmlStateGroup *group; + + QmlStateOperation::ActionList generateActionList(QmlStateGroup *) const; + void complete(); +}; + +QT_END_NAMESPACE + +#endif // QMLSTATE_P_H diff --git a/src/declarative/util/qmlstategroup.cpp b/src/declarative/util/qmlstategroup.cpp index b07def1..6ef8dce 100644 --- a/src/declarative/util/qmlstategroup.cpp +++ b/src/declarative/util/qmlstategroup.cpp @@ -40,8 +40,8 @@ ****************************************************************************/ #include "private/qobject_p.h" -#include "qmlstategroup.h" -#include "qmltransition.h" +#include "qmlstategroup_p.h" +#include "qmltransition_p.h" #include #include diff --git a/src/declarative/util/qmlstategroup.h b/src/declarative/util/qmlstategroup.h deleted file mode 100644 index cf79eb4..0000000 --- a/src/declarative/util/qmlstategroup.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLSTATEGROUP_H -#define QMLSTATEGROUP_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlStateGroupPrivate; -class Q_DECLARATIVE_EXPORT QmlStateGroup : public QObject, public QmlParserStatus -{ - Q_OBJECT - Q_INTERFACES(QmlParserStatus) - Q_DECLARE_PRIVATE(QmlStateGroup) - - Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) - Q_PROPERTY(QmlList* states READ statesProperty DESIGNABLE false) - Q_PROPERTY(QmlList* transitions READ transitionsProperty DESIGNABLE false) - -public: - QmlStateGroup(QObject * = 0); - virtual ~QmlStateGroup(); - - QString state() const; - void setState(const QString &); - - QmlList* statesProperty(); - QList states() const; - - QmlList* transitionsProperty(); - - QmlState *findState(const QString &name) const; - - virtual void classBegin(); - virtual void componentComplete(); -Q_SIGNALS: - void stateChanged(const QString &); - -private: - friend class QmlState; - void updateAutoState(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlStateGroup) - -QT_END_HEADER - -#endif // QMLSTATEGROUP_H diff --git a/src/declarative/util/qmlstategroup_p.h b/src/declarative/util/qmlstategroup_p.h new file mode 100644 index 0000000..3136b1e --- /dev/null +++ b/src/declarative/util/qmlstategroup_p.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLSTATEGROUP_H +#define QMLSTATEGROUP_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlStateGroupPrivate; +class Q_DECLARATIVE_EXPORT QmlStateGroup : public QObject, public QmlParserStatus +{ + Q_OBJECT + Q_INTERFACES(QmlParserStatus) + Q_DECLARE_PRIVATE(QmlStateGroup) + + Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) + Q_PROPERTY(QmlList* states READ statesProperty DESIGNABLE false) + Q_PROPERTY(QmlList* transitions READ transitionsProperty DESIGNABLE false) + +public: + QmlStateGroup(QObject * = 0); + virtual ~QmlStateGroup(); + + QString state() const; + void setState(const QString &); + + QmlList* statesProperty(); + QList states() const; + + QmlList* transitionsProperty(); + + QmlState *findState(const QString &name) const; + + virtual void classBegin(); + virtual void componentComplete(); +Q_SIGNALS: + void stateChanged(const QString &); + +private: + friend class QmlState; + void updateAutoState(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlStateGroup) + +QT_END_HEADER + +#endif // QMLSTATEGROUP_H diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp index 5c328cf..af8ba63 100644 --- a/src/declarative/util/qmlstateoperations.cpp +++ b/src/declarative/util/qmlstateoperations.cpp @@ -43,10 +43,10 @@ #include #include #include -#include "qmlstateoperations.h" +#include "qmlstateoperations_p.h" #include #include -#include +#include #include #include #include @@ -730,8 +730,8 @@ bool QmlAnchorChanges::override(ActionEvent*other) return false; } -QT_END_NAMESPACE - #include "qmlstateoperations.moc" -#include "moc_qmlstateoperations.cpp" +#include "moc_qmlstateoperations_p.cpp" + +QT_END_NAMESPACE diff --git a/src/declarative/util/qmlstateoperations.h b/src/declarative/util/qmlstateoperations.h deleted file mode 100644 index f2bcd49..0000000 --- a/src/declarative/util/qmlstateoperations.h +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLSTATEOPERATIONS_H -#define QMLSTATEOPERATIONS_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlParentChangePrivate; -class Q_DECLARATIVE_EXPORT QmlParentChange : public QmlStateOperation, public ActionEvent -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlParentChange) - - Q_PROPERTY(QmlGraphicsItem *target READ object WRITE setObject) - Q_PROPERTY(QmlGraphicsItem *parent READ parent WRITE setParent) -public: - QmlParentChange(QObject *parent=0); - ~QmlParentChange(); - - QmlGraphicsItem *object() const; - void setObject(QmlGraphicsItem *); - - QmlGraphicsItem *parent() const; - void setParent(QmlGraphicsItem *); - - virtual ActionList actions(); - - virtual void saveOriginals(); - virtual void execute(); - virtual bool isReversable(); - virtual void reverse(); - virtual QString typeName() const; - virtual bool override(ActionEvent*other); -}; - -class QmlStateChangeScriptPrivate; -class Q_DECLARATIVE_EXPORT QmlStateChangeScript : public QmlStateOperation, public ActionEvent -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlStateChangeScript) - - Q_PROPERTY(QmlScriptString script READ script WRITE setScript) - Q_PROPERTY(QString name READ name WRITE setName) - -public: - QmlStateChangeScript(QObject *parent=0); - ~QmlStateChangeScript(); - - virtual ActionList actions(); - - QmlScriptString script() const; - void setScript(const QmlScriptString &); - - QString name() const; - void setName(const QString &); - - virtual void execute(); -}; - -class QmlAnchorChangesPrivate; -class Q_DECLARATIVE_EXPORT QmlAnchorChanges : public QmlStateOperation, public ActionEvent -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlAnchorChanges) - - Q_PROPERTY(QmlGraphicsItem *target READ object WRITE setObject) - Q_PROPERTY(QString reset READ reset WRITE setReset) - Q_PROPERTY(QmlGraphicsAnchorLine left READ left WRITE setLeft) - Q_PROPERTY(QmlGraphicsAnchorLine right READ right WRITE setRight) - Q_PROPERTY(QmlGraphicsAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter) - Q_PROPERTY(QmlGraphicsAnchorLine top READ top WRITE setTop) - Q_PROPERTY(QmlGraphicsAnchorLine bottom READ bottom WRITE setBottom) - Q_PROPERTY(QmlGraphicsAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter) - Q_PROPERTY(QmlGraphicsAnchorLine baseline READ baseline WRITE setBaseline) - -public: - QmlAnchorChanges(QObject *parent=0); - ~QmlAnchorChanges(); - - virtual ActionList actions(); - - QmlGraphicsItem *object() const; - void setObject(QmlGraphicsItem *); - - QString reset() const; - void setReset(const QString &); - - QmlGraphicsAnchorLine left() const; - void setLeft(const QmlGraphicsAnchorLine &edge); - - QmlGraphicsAnchorLine right() const; - void setRight(const QmlGraphicsAnchorLine &edge); - - QmlGraphicsAnchorLine horizontalCenter() const; - void setHorizontalCenter(const QmlGraphicsAnchorLine &edge); - - QmlGraphicsAnchorLine top() const; - void setTop(const QmlGraphicsAnchorLine &edge); - - QmlGraphicsAnchorLine bottom() const; - void setBottom(const QmlGraphicsAnchorLine &edge); - - QmlGraphicsAnchorLine verticalCenter() const; - void setVerticalCenter(const QmlGraphicsAnchorLine &edge); - - QmlGraphicsAnchorLine baseline() const; - void setBaseline(const QmlGraphicsAnchorLine &edge); - - virtual void execute(); - virtual bool isReversable(); - virtual void reverse(); - virtual QString typeName() const; - virtual bool override(ActionEvent*other); - virtual QList extraActions(); - virtual bool changesBindings(); - virtual void saveOriginals(); - virtual void clearForwardBindings(); - virtual void clearReverseBindings(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlParentChange) -QML_DECLARE_TYPE(QmlStateChangeScript) -QML_DECLARE_TYPE(QmlAnchorChanges) - -QT_END_HEADER - -#endif // QMLSTATEOPERATIONS_H diff --git a/src/declarative/util/qmlstateoperations_p.h b/src/declarative/util/qmlstateoperations_p.h new file mode 100644 index 0000000..04ea781 --- /dev/null +++ b/src/declarative/util/qmlstateoperations_p.h @@ -0,0 +1,177 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLSTATEOPERATIONS_H +#define QMLSTATEOPERATIONS_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlParentChangePrivate; +class Q_DECLARATIVE_EXPORT QmlParentChange : public QmlStateOperation, public ActionEvent +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlParentChange) + + Q_PROPERTY(QmlGraphicsItem *target READ object WRITE setObject) + Q_PROPERTY(QmlGraphicsItem *parent READ parent WRITE setParent) +public: + QmlParentChange(QObject *parent=0); + ~QmlParentChange(); + + QmlGraphicsItem *object() const; + void setObject(QmlGraphicsItem *); + + QmlGraphicsItem *parent() const; + void setParent(QmlGraphicsItem *); + + virtual ActionList actions(); + + virtual void saveOriginals(); + virtual void execute(); + virtual bool isReversable(); + virtual void reverse(); + virtual QString typeName() const; + virtual bool override(ActionEvent*other); +}; + +class QmlStateChangeScriptPrivate; +class Q_DECLARATIVE_EXPORT QmlStateChangeScript : public QmlStateOperation, public ActionEvent +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlStateChangeScript) + + Q_PROPERTY(QmlScriptString script READ script WRITE setScript) + Q_PROPERTY(QString name READ name WRITE setName) + +public: + QmlStateChangeScript(QObject *parent=0); + ~QmlStateChangeScript(); + + virtual ActionList actions(); + + QmlScriptString script() const; + void setScript(const QmlScriptString &); + + QString name() const; + void setName(const QString &); + + virtual void execute(); +}; + +class QmlAnchorChangesPrivate; +class Q_DECLARATIVE_EXPORT QmlAnchorChanges : public QmlStateOperation, public ActionEvent +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlAnchorChanges) + + Q_PROPERTY(QmlGraphicsItem *target READ object WRITE setObject) + Q_PROPERTY(QString reset READ reset WRITE setReset) + Q_PROPERTY(QmlGraphicsAnchorLine left READ left WRITE setLeft) + Q_PROPERTY(QmlGraphicsAnchorLine right READ right WRITE setRight) + Q_PROPERTY(QmlGraphicsAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter) + Q_PROPERTY(QmlGraphicsAnchorLine top READ top WRITE setTop) + Q_PROPERTY(QmlGraphicsAnchorLine bottom READ bottom WRITE setBottom) + Q_PROPERTY(QmlGraphicsAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter) + Q_PROPERTY(QmlGraphicsAnchorLine baseline READ baseline WRITE setBaseline) + +public: + QmlAnchorChanges(QObject *parent=0); + ~QmlAnchorChanges(); + + virtual ActionList actions(); + + QmlGraphicsItem *object() const; + void setObject(QmlGraphicsItem *); + + QString reset() const; + void setReset(const QString &); + + QmlGraphicsAnchorLine left() const; + void setLeft(const QmlGraphicsAnchorLine &edge); + + QmlGraphicsAnchorLine right() const; + void setRight(const QmlGraphicsAnchorLine &edge); + + QmlGraphicsAnchorLine horizontalCenter() const; + void setHorizontalCenter(const QmlGraphicsAnchorLine &edge); + + QmlGraphicsAnchorLine top() const; + void setTop(const QmlGraphicsAnchorLine &edge); + + QmlGraphicsAnchorLine bottom() const; + void setBottom(const QmlGraphicsAnchorLine &edge); + + QmlGraphicsAnchorLine verticalCenter() const; + void setVerticalCenter(const QmlGraphicsAnchorLine &edge); + + QmlGraphicsAnchorLine baseline() const; + void setBaseline(const QmlGraphicsAnchorLine &edge); + + virtual void execute(); + virtual bool isReversable(); + virtual void reverse(); + virtual QString typeName() const; + virtual bool override(ActionEvent*other); + virtual QList extraActions(); + virtual bool changesBindings(); + virtual void saveOriginals(); + virtual void clearForwardBindings(); + virtual void clearReverseBindings(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlParentChange) +QML_DECLARE_TYPE(QmlStateChangeScript) +QML_DECLARE_TYPE(QmlAnchorChanges) + +QT_END_HEADER + +#endif // QMLSTATEOPERATIONS_H diff --git a/src/declarative/util/qmlsystempalette.cpp b/src/declarative/util/qmlsystempalette.cpp index 014eca8..c5a0986 100644 --- a/src/declarative/util/qmlsystempalette.cpp +++ b/src/declarative/util/qmlsystempalette.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "private/qobject_p.h" -#include "qmlsystempalette.h" +#include "qmlsystempalette_p.h" #include QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmlsystempalette.h b/src/declarative/util/qmlsystempalette.h deleted file mode 100644 index 6558c7e..0000000 --- a/src/declarative/util/qmlsystempalette.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLSYSTEMPALETTE_H -#define QMLSYSTEMPALETTE_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlSystemPalettePrivate; -class Q_DECLARATIVE_EXPORT QmlSystemPalette : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlSystemPalette) - - Q_PROPERTY(QPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged) - Q_PROPERTY(QColor window READ window NOTIFY paletteChanged) - Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged) - Q_PROPERTY(QColor base READ base NOTIFY paletteChanged) - Q_PROPERTY(QColor text READ text NOTIFY paletteChanged) - Q_PROPERTY(QColor alternateBase READ alternateBase NOTIFY paletteChanged) - Q_PROPERTY(QColor button READ button NOTIFY paletteChanged) - Q_PROPERTY(QColor buttonText READ buttonText NOTIFY paletteChanged) - Q_PROPERTY(QColor light READ light NOTIFY paletteChanged) - Q_PROPERTY(QColor midlight READ midlight NOTIFY paletteChanged) - Q_PROPERTY(QColor dark READ dark NOTIFY paletteChanged) - Q_PROPERTY(QColor mid READ mid NOTIFY paletteChanged) - Q_PROPERTY(QColor shadow READ shadow NOTIFY paletteChanged) - Q_PROPERTY(QColor highlight READ highlight NOTIFY paletteChanged) - Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged) - -public: - QmlSystemPalette(QObject *parent=0); - ~QmlSystemPalette(); - - QColor window() const; - QColor windowText() const; - - QColor base() const; - QColor text() const; - QColor alternateBase() const; - - QColor button() const; - QColor buttonText() const; - - QColor light() const; - QColor midlight() const; - QColor dark() const; - QColor mid() const; - QColor shadow() const; - - QColor highlight() const; - QColor highlightedText() const; - - QPalette::ColorGroup colorGroup() const; - void setColorGroup(QPalette::ColorGroup); - - // FIXME: Move to utility class? - Q_INVOKABLE QColor lighter(const QColor&) const; - Q_INVOKABLE QColor darker(const QColor&) const; - -Q_SIGNALS: - void paletteChanged(); - -private: - bool eventFilter(QObject *watched, QEvent *event); - bool event(QEvent *event); - -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlSystemPalette) - -QT_END_HEADER - -#endif // QMLSYSTEMPALETTE_H diff --git a/src/declarative/util/qmlsystempalette_p.h b/src/declarative/util/qmlsystempalette_p.h new file mode 100644 index 0000000..6558c7e --- /dev/null +++ b/src/declarative/util/qmlsystempalette_p.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLSYSTEMPALETTE_H +#define QMLSYSTEMPALETTE_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlSystemPalettePrivate; +class Q_DECLARATIVE_EXPORT QmlSystemPalette : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlSystemPalette) + + Q_PROPERTY(QPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged) + Q_PROPERTY(QColor window READ window NOTIFY paletteChanged) + Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged) + Q_PROPERTY(QColor base READ base NOTIFY paletteChanged) + Q_PROPERTY(QColor text READ text NOTIFY paletteChanged) + Q_PROPERTY(QColor alternateBase READ alternateBase NOTIFY paletteChanged) + Q_PROPERTY(QColor button READ button NOTIFY paletteChanged) + Q_PROPERTY(QColor buttonText READ buttonText NOTIFY paletteChanged) + Q_PROPERTY(QColor light READ light NOTIFY paletteChanged) + Q_PROPERTY(QColor midlight READ midlight NOTIFY paletteChanged) + Q_PROPERTY(QColor dark READ dark NOTIFY paletteChanged) + Q_PROPERTY(QColor mid READ mid NOTIFY paletteChanged) + Q_PROPERTY(QColor shadow READ shadow NOTIFY paletteChanged) + Q_PROPERTY(QColor highlight READ highlight NOTIFY paletteChanged) + Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged) + +public: + QmlSystemPalette(QObject *parent=0); + ~QmlSystemPalette(); + + QColor window() const; + QColor windowText() const; + + QColor base() const; + QColor text() const; + QColor alternateBase() const; + + QColor button() const; + QColor buttonText() const; + + QColor light() const; + QColor midlight() const; + QColor dark() const; + QColor mid() const; + QColor shadow() const; + + QColor highlight() const; + QColor highlightedText() const; + + QPalette::ColorGroup colorGroup() const; + void setColorGroup(QPalette::ColorGroup); + + // FIXME: Move to utility class? + Q_INVOKABLE QColor lighter(const QColor&) const; + Q_INVOKABLE QColor darker(const QColor&) const; + +Q_SIGNALS: + void paletteChanged(); + +private: + bool eventFilter(QObject *watched, QEvent *event); + bool event(QEvent *event); + +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlSystemPalette) + +QT_END_HEADER + +#endif // QMLSYSTEMPALETTE_H diff --git a/src/declarative/util/qmltimeline.cpp b/src/declarative/util/qmltimeline.cpp index 5ba310d..55d9490 100644 --- a/src/declarative/util/qmltimeline.cpp +++ b/src/declarative/util/qmltimeline.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmltimeline_p.h" +#include "qmltimeline_p_p.h" #include #include #include diff --git a/src/declarative/util/qmltimeline_p.h b/src/declarative/util/qmltimeline_p.h deleted file mode 100644 index abed80a..0000000 --- a/src/declarative/util/qmltimeline_p.h +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLTIMELINE_H -#define QMLTIMELINE_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QEasingCurve; -class QmlTimeLineValue; -class QmlTimeLineEvent; -struct QmlTimeLinePrivate; -class QmlTimeLineObject; -class Q_DECLARATIVE_EXPORT QmlTimeLine : public QAbstractAnimation -{ -Q_OBJECT -public: - QmlTimeLine(QObject *parent = 0); - ~QmlTimeLine(); - - enum SyncMode { LocalSync, GlobalSync }; - SyncMode syncMode() const; - void setSyncMode(SyncMode); - - void pause(QmlTimeLineObject &, int); - void execute(const QmlTimeLineEvent &); - void set(QmlTimeLineValue &, qreal); - - int accel(QmlTimeLineValue &, qreal velocity, qreal accel); - int accel(QmlTimeLineValue &, qreal velocity, qreal accel, qreal maxDistance); - int accelDistance(QmlTimeLineValue &, qreal velocity, qreal distance); - - void move(QmlTimeLineValue &, qreal destination, int time = 500); - void move(QmlTimeLineValue &, qreal destination, const QEasingCurve &, int time = 500); - void moveBy(QmlTimeLineValue &, qreal change, int time = 500); - void moveBy(QmlTimeLineValue &, qreal change, const QEasingCurve &, int time = 500); - - void sync(); - void setSyncPoint(int); - int syncPoint() const; - - void sync(QmlTimeLineValue &); - void sync(QmlTimeLineValue &, QmlTimeLineValue &); - - void reset(QmlTimeLineValue &); - - void complete(); - void clear(); - bool isActive() const; - - int time() const; - - virtual int duration() const; -Q_SIGNALS: - void updated(); - void completed(); - -protected: - virtual void updateCurrentTime(int); - -private: - void remove(QmlTimeLineObject *); - friend class QmlTimeLineObject; - friend struct QmlTimeLinePrivate; - QmlTimeLinePrivate *d; -}; - -class Q_DECLARATIVE_EXPORT QmlTimeLineObject -{ -public: - QmlTimeLineObject(); - virtual ~QmlTimeLineObject(); - -protected: - friend class QmlTimeLine; - friend struct QmlTimeLinePrivate; - QmlTimeLine *_t; -}; - -class Q_DECLARATIVE_EXPORT QmlTimeLineValue : public QmlTimeLineObject -{ -public: - QmlTimeLineValue(qreal v = 0.) : _v(v) {} - - virtual qreal value() const { return _v; } - virtual void setValue(qreal v) { _v = v; } - - QmlTimeLine *timeLine() const { return _t; } - - operator qreal() const { return _v; } - QmlTimeLineValue &operator=(qreal v) { setValue(v); return *this; } -private: - friend class QmlTimeLine; - friend struct QmlTimeLinePrivate; - qreal _v; -}; - -class Q_DECLARATIVE_EXPORT QmlTimeLineEvent -{ -public: - QmlTimeLineEvent(); - QmlTimeLineEvent(const QmlTimeLineEvent &o); - - template - QmlTimeLineEvent(QmlTimeLineObject *b, T *c) - { - d0 = &callFunc; - d1 = (void *)c; - d2 = b; - } - - template - static QmlTimeLineEvent timeLineEvent(QmlTimeLineObject *b, T *c) - { - QmlTimeLineEvent rv; - rv.d0 = &callFunc; - rv.d1 = (void *)c; - rv.d2 = b; - return rv; - } - - QmlTimeLineEvent &operator=(const QmlTimeLineEvent &o); - void execute() const; - QmlTimeLineObject *eventObject() const; - -private: - typedef void (*CallFunc)(void *c); - - template - static void callFunc(void *c) - { - T *cls = (T *)c; - (cls->*method)(); - } - CallFunc d0; - void *d1; - QmlTimeLineObject *d2; -}; - -template -class QmlTimeLineValueProxy : public QmlTimeLineValue -{ -public: - QmlTimeLineValueProxy(T *cls, void (T::*func)(qreal), qreal v = 0.) - : QmlTimeLineValue(v), _class(cls), _setFunctionReal(func), _setFunctionInt(0) - { - Q_ASSERT(_class); - } - - QmlTimeLineValueProxy(T *cls, void (T::*func)(int), qreal v = 0.) - : QmlTimeLineValue(v), _class(cls), _setFunctionReal(0), _setFunctionInt(func) - { - Q_ASSERT(_class); - } - - virtual void setValue(qreal v) - { - QmlTimeLineValue::setValue(v); - if (_setFunctionReal) (_class->*_setFunctionReal)(v); - else if (_setFunctionInt) (_class->*_setFunctionInt)((int)v); - } - -private: - T *_class; - void (T::*_setFunctionReal)(qreal); - void (T::*_setFunctionInt)(int); -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/declarative/util/qmltimeline_p_p.h b/src/declarative/util/qmltimeline_p_p.h new file mode 100644 index 0000000..abed80a --- /dev/null +++ b/src/declarative/util/qmltimeline_p_p.h @@ -0,0 +1,224 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLTIMELINE_H +#define QMLTIMELINE_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QEasingCurve; +class QmlTimeLineValue; +class QmlTimeLineEvent; +struct QmlTimeLinePrivate; +class QmlTimeLineObject; +class Q_DECLARATIVE_EXPORT QmlTimeLine : public QAbstractAnimation +{ +Q_OBJECT +public: + QmlTimeLine(QObject *parent = 0); + ~QmlTimeLine(); + + enum SyncMode { LocalSync, GlobalSync }; + SyncMode syncMode() const; + void setSyncMode(SyncMode); + + void pause(QmlTimeLineObject &, int); + void execute(const QmlTimeLineEvent &); + void set(QmlTimeLineValue &, qreal); + + int accel(QmlTimeLineValue &, qreal velocity, qreal accel); + int accel(QmlTimeLineValue &, qreal velocity, qreal accel, qreal maxDistance); + int accelDistance(QmlTimeLineValue &, qreal velocity, qreal distance); + + void move(QmlTimeLineValue &, qreal destination, int time = 500); + void move(QmlTimeLineValue &, qreal destination, const QEasingCurve &, int time = 500); + void moveBy(QmlTimeLineValue &, qreal change, int time = 500); + void moveBy(QmlTimeLineValue &, qreal change, const QEasingCurve &, int time = 500); + + void sync(); + void setSyncPoint(int); + int syncPoint() const; + + void sync(QmlTimeLineValue &); + void sync(QmlTimeLineValue &, QmlTimeLineValue &); + + void reset(QmlTimeLineValue &); + + void complete(); + void clear(); + bool isActive() const; + + int time() const; + + virtual int duration() const; +Q_SIGNALS: + void updated(); + void completed(); + +protected: + virtual void updateCurrentTime(int); + +private: + void remove(QmlTimeLineObject *); + friend class QmlTimeLineObject; + friend struct QmlTimeLinePrivate; + QmlTimeLinePrivate *d; +}; + +class Q_DECLARATIVE_EXPORT QmlTimeLineObject +{ +public: + QmlTimeLineObject(); + virtual ~QmlTimeLineObject(); + +protected: + friend class QmlTimeLine; + friend struct QmlTimeLinePrivate; + QmlTimeLine *_t; +}; + +class Q_DECLARATIVE_EXPORT QmlTimeLineValue : public QmlTimeLineObject +{ +public: + QmlTimeLineValue(qreal v = 0.) : _v(v) {} + + virtual qreal value() const { return _v; } + virtual void setValue(qreal v) { _v = v; } + + QmlTimeLine *timeLine() const { return _t; } + + operator qreal() const { return _v; } + QmlTimeLineValue &operator=(qreal v) { setValue(v); return *this; } +private: + friend class QmlTimeLine; + friend struct QmlTimeLinePrivate; + qreal _v; +}; + +class Q_DECLARATIVE_EXPORT QmlTimeLineEvent +{ +public: + QmlTimeLineEvent(); + QmlTimeLineEvent(const QmlTimeLineEvent &o); + + template + QmlTimeLineEvent(QmlTimeLineObject *b, T *c) + { + d0 = &callFunc; + d1 = (void *)c; + d2 = b; + } + + template + static QmlTimeLineEvent timeLineEvent(QmlTimeLineObject *b, T *c) + { + QmlTimeLineEvent rv; + rv.d0 = &callFunc; + rv.d1 = (void *)c; + rv.d2 = b; + return rv; + } + + QmlTimeLineEvent &operator=(const QmlTimeLineEvent &o); + void execute() const; + QmlTimeLineObject *eventObject() const; + +private: + typedef void (*CallFunc)(void *c); + + template + static void callFunc(void *c) + { + T *cls = (T *)c; + (cls->*method)(); + } + CallFunc d0; + void *d1; + QmlTimeLineObject *d2; +}; + +template +class QmlTimeLineValueProxy : public QmlTimeLineValue +{ +public: + QmlTimeLineValueProxy(T *cls, void (T::*func)(qreal), qreal v = 0.) + : QmlTimeLineValue(v), _class(cls), _setFunctionReal(func), _setFunctionInt(0) + { + Q_ASSERT(_class); + } + + QmlTimeLineValueProxy(T *cls, void (T::*func)(int), qreal v = 0.) + : QmlTimeLineValue(v), _class(cls), _setFunctionReal(0), _setFunctionInt(func) + { + Q_ASSERT(_class); + } + + virtual void setValue(qreal v) + { + QmlTimeLineValue::setValue(v); + if (_setFunctionReal) (_class->*_setFunctionReal)(v); + else if (_setFunctionInt) (_class->*_setFunctionInt)((int)v); + } + +private: + T *_class; + void (T::*_setFunctionReal)(qreal); + void (T::*_setFunctionInt)(int); +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/declarative/util/qmltimer.cpp b/src/declarative/util/qmltimer.cpp index 1d90051..ff4c912 100644 --- a/src/declarative/util/qmltimer.cpp +++ b/src/declarative/util/qmltimer.cpp @@ -42,7 +42,7 @@ #include "QtCore/qcoreapplication.h" #include "QtCore/qpauseanimation.h" #include "private/qobject_p.h" -#include "qmltimer.h" +#include "qmltimer_p.h" #include "qdebug.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmltimer.h b/src/declarative/util/qmltimer.h deleted file mode 100644 index 22478cb..0000000 --- a/src/declarative/util/qmltimer.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLTIMER_H -#define QMLTIMER_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlTimerPrivate; -class Q_DECLARATIVE_EXPORT QmlTimer : public QObject, public QmlParserStatus -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlTimer) - Q_INTERFACES(QmlParserStatus) - Q_PROPERTY(int interval READ interval WRITE setInterval) - Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) - Q_PROPERTY(bool repeat READ isRepeating WRITE setRepeating) - Q_PROPERTY(bool triggeredOnStart READ triggeredOnStart WRITE setTriggeredOnStart) - -public: - QmlTimer(QObject *parent=0); - - void setInterval(int interval); - int interval() const; - - bool isRunning() const; - void setRunning(bool running); - - bool isRepeating() const; - void setRepeating(bool repeating); - - bool triggeredOnStart() const; - void setTriggeredOnStart(bool triggeredOnStart); - -protected: - void classBegin(); - void componentComplete(); - -public Q_SLOTS: - void start(); - void stop(); - -Q_SIGNALS: - void triggered(); - void runningChanged(); - -private: - void update(); - -private Q_SLOTS: - void ticked(); - void stateChanged(QAbstractAnimation::State,QAbstractAnimation::State); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlTimer) - -QT_END_HEADER - -#endif diff --git a/src/declarative/util/qmltimer_p.h b/src/declarative/util/qmltimer_p.h new file mode 100644 index 0000000..22478cb --- /dev/null +++ b/src/declarative/util/qmltimer_p.h @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLTIMER_H +#define QMLTIMER_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlTimerPrivate; +class Q_DECLARATIVE_EXPORT QmlTimer : public QObject, public QmlParserStatus +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlTimer) + Q_INTERFACES(QmlParserStatus) + Q_PROPERTY(int interval READ interval WRITE setInterval) + Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) + Q_PROPERTY(bool repeat READ isRepeating WRITE setRepeating) + Q_PROPERTY(bool triggeredOnStart READ triggeredOnStart WRITE setTriggeredOnStart) + +public: + QmlTimer(QObject *parent=0); + + void setInterval(int interval); + int interval() const; + + bool isRunning() const; + void setRunning(bool running); + + bool isRepeating() const; + void setRepeating(bool repeating); + + bool triggeredOnStart() const; + void setTriggeredOnStart(bool triggeredOnStart); + +protected: + void classBegin(); + void componentComplete(); + +public Q_SLOTS: + void start(); + void stop(); + +Q_SIGNALS: + void triggered(); + void runningChanged(); + +private: + void update(); + +private Q_SLOTS: + void ticked(); + void stateChanged(QAbstractAnimation::State,QAbstractAnimation::State); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlTimer) + +QT_END_HEADER + +#endif diff --git a/src/declarative/util/qmltransition.cpp b/src/declarative/util/qmltransition.cpp index 97a3b74..d752d1b 100644 --- a/src/declarative/util/qmltransition.cpp +++ b/src/declarative/util/qmltransition.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include "qmlstate.h" -#include "qmlstategroup.h" #include "qmlstate_p.h" -#include "qmlstateoperations.h" -#include "qmlanimation.h" +#include "qmlstategroup_p.h" +#include "qmlstate_p_p.h" +#include "qmlstateoperations_p.h" #include "qmlanimation_p.h" -#include "qmltransitionmanager_p.h" +#include "qmlanimation_p_p.h" +#include "qmltransitionmanager_p_p.h" #include QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmltransition.h b/src/declarative/util/qmltransition.h deleted file mode 100644 index b09341d..0000000 --- a/src/declarative/util/qmltransition.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLTRANSITION_H -#define QMLTRANSITION_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlAbstractAnimation; -class QmlTransitionPrivate; -class QmlTransitionManager; -class Q_DECLARATIVE_EXPORT QmlTransition : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlTransition) - - Q_PROPERTY(QString from READ fromState WRITE setFromState) - Q_PROPERTY(QString to READ toState WRITE setToState) - Q_PROPERTY(bool reversible READ reversible WRITE setReversible) - Q_PROPERTY(QmlList* animations READ animations) - Q_CLASSINFO("DefaultProperty", "animations") - -public: - QmlTransition(QObject *parent=0); - ~QmlTransition(); - - QString fromState() const; - void setFromState(const QString &); - - QString toState() const; - void setToState(const QString &); - - bool reversible() const; - void setReversible(bool); - - QmlList* animations(); - - void prepare(QmlStateOperation::ActionList &actions, - QList &after, - QmlTransitionManager *end); - - void setReversed(bool r); - void stop(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlTransition) - -QT_END_HEADER - -#endif // QMLTRANSITION_H diff --git a/src/declarative/util/qmltransition_p.h b/src/declarative/util/qmltransition_p.h new file mode 100644 index 0000000..092cde9 --- /dev/null +++ b/src/declarative/util/qmltransition_p.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLTRANSITION_H +#define QMLTRANSITION_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlAbstractAnimation; +class QmlTransitionPrivate; +class QmlTransitionManager; +class Q_DECLARATIVE_EXPORT QmlTransition : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlTransition) + + Q_PROPERTY(QString from READ fromState WRITE setFromState) + Q_PROPERTY(QString to READ toState WRITE setToState) + Q_PROPERTY(bool reversible READ reversible WRITE setReversible) + Q_PROPERTY(QmlList* animations READ animations) + Q_CLASSINFO("DefaultProperty", "animations") + +public: + QmlTransition(QObject *parent=0); + ~QmlTransition(); + + QString fromState() const; + void setFromState(const QString &); + + QString toState() const; + void setToState(const QString &); + + bool reversible() const; + void setReversible(bool); + + QmlList* animations(); + + void prepare(QmlStateOperation::ActionList &actions, + QList &after, + QmlTransitionManager *end); + + void setReversed(bool r); + void stop(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlTransition) + +QT_END_HEADER + +#endif // QMLTRANSITION_H diff --git a/src/declarative/util/qmltransitionmanager.cpp b/src/declarative/util/qmltransitionmanager.cpp index 7eaccac..b33cae3 100644 --- a/src/declarative/util/qmltransitionmanager.cpp +++ b/src/declarative/util/qmltransitionmanager.cpp @@ -40,8 +40,8 @@ ****************************************************************************/ #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmltransitionmanager_p.h b/src/declarative/util/qmltransitionmanager_p.h deleted file mode 100644 index 74a3950..0000000 --- a/src/declarative/util/qmltransitionmanager_p.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLTRANSITIONMANAGER_P_H -#define QMLTRANSITIONMANAGER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QmlStatePrivate; -class QmlTransitionManagerPrivate; -class QmlTransitionManager -{ -public: - QmlTransitionManager(); - ~QmlTransitionManager(); - - void transition(const QList &, QmlTransition *transition); - - void cancel(); - -private: - Q_DISABLE_COPY(QmlTransitionManager); - QmlTransitionManagerPrivate *d; - - void complete(); - void setState(QmlState *); - - friend class QmlState; - friend class QmlTransitionPrivate; -}; - -QT_END_NAMESPACE - -#endif // QMLTRANSITIONMANAGER_P_H diff --git a/src/declarative/util/qmltransitionmanager_p_p.h b/src/declarative/util/qmltransitionmanager_p_p.h new file mode 100644 index 0000000..ab435aa --- /dev/null +++ b/src/declarative/util/qmltransitionmanager_p_p.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLTRANSITIONMANAGER_P_H +#define QMLTRANSITIONMANAGER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +class QmlStatePrivate; +class QmlTransitionManagerPrivate; +class QmlTransitionManager +{ +public: + QmlTransitionManager(); + ~QmlTransitionManager(); + + void transition(const QList &, QmlTransition *transition); + + void cancel(); + +private: + Q_DISABLE_COPY(QmlTransitionManager); + QmlTransitionManagerPrivate *d; + + void complete(); + void setState(QmlState *); + + friend class QmlState; + friend class QmlTransitionPrivate; +}; + +QT_END_NAMESPACE + +#endif // QMLTRANSITIONMANAGER_P_H diff --git a/src/declarative/util/qmlview.cpp b/src/declarative/util/qmlview.cpp index 91d443a..f19ac98 100644 --- a/src/declarative/util/qmlview.cpp +++ b/src/declarative/util/qmlview.cpp @@ -53,14 +53,14 @@ #include "qml.h" #include "qmlgraphicsitem.h" -#include "private/qperformancelog_p.h" -#include "private/qfxperf_p.h" +#include "private/qperformancelog_p_p.h" +#include "private/qfxperf_p_p.h" #include "qmlview.h" #include #include -#include -#include +#include +#include #include QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qperformancelog.cpp b/src/declarative/util/qperformancelog.cpp index 8e11997..1a9be90 100644 --- a/src/declarative/util/qperformancelog.cpp +++ b/src/declarative/util/qperformancelog.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qperformancelog_p.h" +#include "qperformancelog_p_p.h" #include #include diff --git a/src/declarative/util/qperformancelog_p.h b/src/declarative/util/qperformancelog_p.h deleted file mode 100644 index 6655a8d..0000000 --- a/src/declarative/util/qperformancelog_p.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QPERFORMANCELOG_H -#define QPERFORMANCELOG_H - -#include - -QT_BEGIN_NAMESPACE - -namespace QPerformanceLog -{ - Q_DECLARATIVE_EXPORT void displayData(); - Q_DECLARATIVE_EXPORT void clear(); - -#ifdef Q_ENABLE_PERFORMANCE_LOG - struct LogData { - LogData(const char *); - QTime timer; - int sumTime; - unsigned int *data; - }; - - struct LogMetric { - LogMetric(LogData *, int, const char *); - }; - - // Internal - void displayData(LogData *); - void clear(LogData *); -#endif -} - -#ifdef Q_ENABLE_PERFORMANCE_LOG - -#define Q_DECLARE_PERFORMANCE_METRIC(name) \ - enum { name = ValueChoice<0, ValueTracker<0, __LINE__>::value, __LINE__>::value }; \ - template \ - struct ValueTracker \ - { \ - enum { value = name }; \ - }; \ - extern QPerformanceLog::LogMetric metric ## name; - -#define Q_DECLARE_PERFORMANCE_LOG(name) \ - namespace name { \ - extern QPerformanceLog::LogData log; \ - inline void displayData() { QPerformanceLog::displayData(&log); } \ - inline void clear() { QPerformanceLog::clear(&log); } \ - } \ - template \ - class name ## Timer { \ - public: \ - name ## Timer() { \ - lastSum = name::log.sumTime + name::log.timer.restart(); \ - name::log.sumTime = 0; \ - } \ - ~ name ## Timer() { \ - name::log.data[2 * N] += name::log.sumTime + name::log.timer.restart(); \ - ++name::log.data[2 * N + 1]; \ - name::log.sumTime = lastSum; \ - } \ - private: \ - int lastSum; \ - }; \ - namespace name { \ - template \ - struct ValueTracker \ - { \ - enum { value = -1 }; \ - }; \ - template \ - struct ValueChoice \ - { \ - enum { value = ValueChoice::value, L>::value }; \ - }; \ - template \ - struct ValueChoice \ - { \ - enum { value = DefNextValue }; \ - }; \ - } \ - namespace name - -#define Q_DEFINE_PERFORMANCE_LOG(name, desc) \ - QPerformanceLog::LogData name::log(desc); \ - namespace name - -#define Q_DEFINE_PERFORMANCE_METRIC(name, desc) \ - QPerformanceLog::LogMetric metrix ## name(&log, name, desc); - -#else // Q_ENABLE_PERFORMANCE_LOG - -#define Q_DECLARE_PERFORMANCE_METRIC(name) -#define Q_DECLARE_PERFORMANCE_LOG(name) namespace name -#define Q_DEFINE_PERFORMANCE_LOG(name, desc) namespace name -#define Q_DEFINE_PERFORMANCE_METRIC(name, desc) - -#endif // Q_ENABLE_PERFORMANCE_LOG - -QT_END_NAMESPACE - -#endif // QPERFORMANCELOG_H diff --git a/src/declarative/util/qperformancelog_p_p.h b/src/declarative/util/qperformancelog_p_p.h new file mode 100644 index 0000000..6655a8d --- /dev/null +++ b/src/declarative/util/qperformancelog_p_p.h @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPERFORMANCELOG_H +#define QPERFORMANCELOG_H + +#include + +QT_BEGIN_NAMESPACE + +namespace QPerformanceLog +{ + Q_DECLARATIVE_EXPORT void displayData(); + Q_DECLARATIVE_EXPORT void clear(); + +#ifdef Q_ENABLE_PERFORMANCE_LOG + struct LogData { + LogData(const char *); + QTime timer; + int sumTime; + unsigned int *data; + }; + + struct LogMetric { + LogMetric(LogData *, int, const char *); + }; + + // Internal + void displayData(LogData *); + void clear(LogData *); +#endif +} + +#ifdef Q_ENABLE_PERFORMANCE_LOG + +#define Q_DECLARE_PERFORMANCE_METRIC(name) \ + enum { name = ValueChoice<0, ValueTracker<0, __LINE__>::value, __LINE__>::value }; \ + template \ + struct ValueTracker \ + { \ + enum { value = name }; \ + }; \ + extern QPerformanceLog::LogMetric metric ## name; + +#define Q_DECLARE_PERFORMANCE_LOG(name) \ + namespace name { \ + extern QPerformanceLog::LogData log; \ + inline void displayData() { QPerformanceLog::displayData(&log); } \ + inline void clear() { QPerformanceLog::clear(&log); } \ + } \ + template \ + class name ## Timer { \ + public: \ + name ## Timer() { \ + lastSum = name::log.sumTime + name::log.timer.restart(); \ + name::log.sumTime = 0; \ + } \ + ~ name ## Timer() { \ + name::log.data[2 * N] += name::log.sumTime + name::log.timer.restart(); \ + ++name::log.data[2 * N + 1]; \ + name::log.sumTime = lastSum; \ + } \ + private: \ + int lastSum; \ + }; \ + namespace name { \ + template \ + struct ValueTracker \ + { \ + enum { value = -1 }; \ + }; \ + template \ + struct ValueChoice \ + { \ + enum { value = ValueChoice::value, L>::value }; \ + }; \ + template \ + struct ValueChoice \ + { \ + enum { value = DefNextValue }; \ + }; \ + } \ + namespace name + +#define Q_DEFINE_PERFORMANCE_LOG(name, desc) \ + QPerformanceLog::LogData name::log(desc); \ + namespace name + +#define Q_DEFINE_PERFORMANCE_METRIC(name, desc) \ + QPerformanceLog::LogMetric metrix ## name(&log, name, desc); + +#else // Q_ENABLE_PERFORMANCE_LOG + +#define Q_DECLARE_PERFORMANCE_METRIC(name) +#define Q_DECLARE_PERFORMANCE_LOG(name) namespace name +#define Q_DEFINE_PERFORMANCE_LOG(name, desc) namespace name +#define Q_DEFINE_PERFORMANCE_METRIC(name, desc) + +#endif // Q_ENABLE_PERFORMANCE_LOG + +QT_END_NAMESPACE + +#endif // QPERFORMANCELOG_H diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri index 01ad898..a60613e 100644 --- a/src/declarative/util/util.pri +++ b/src/declarative/util/util.pri @@ -24,28 +24,28 @@ SOURCES += \ HEADERS += \ util/qmlview.h \ - util/qfxperf_p.h \ + util/qfxperf_p_p.h \ util/qfxglobal.h \ - util/qperformancelog_p.h \ - util/qmlconnection.h \ - util/qmlpackage.h \ - util/qmlanimation.h \ + util/qperformancelog_p_p.h \ + util/qmlconnection_p.h \ + util/qmlpackage_p.h \ util/qmlanimation_p.h \ - util/qmlsystempalette.h \ - util/qmlspringfollow.h \ - util/qmleasefollow.h \ - util/qmlstate.h\ - util/qmlstateoperations.h \ - util/qmlpropertychanges.h \ + util/qmlanimation_p_p.h \ + util/qmlsystempalette_p.h \ + util/qmlspringfollow_p.h \ + util/qmleasefollow_p.h \ util/qmlstate_p.h\ - util/qmltransitionmanager_p.h \ - util/qmlstategroup.h \ - util/qmltransition.h \ - util/qmllistmodel.h\ - util/qmllistaccessor.h \ - util/qmlopenmetaobject.h \ - util/qmlnullablevalue_p.h \ - util/qmltimeline_p.h \ - util/qmltimer.h \ - util/qmlbind.h \ - util/qmlpropertymap.h + util/qmlstateoperations_p.h \ + util/qmlpropertychanges_p.h \ + util/qmlstate_p_p.h\ + util/qmltransitionmanager_p_p.h \ + util/qmlstategroup_p.h \ + util/qmltransition_p.h \ + util/qmllistmodel_p.h\ + util/qmllistaccessor_p.h \ + util/qmlopenmetaobject_p.h \ + util/qmlnullablevalue_p_p.h \ + util/qmltimeline_p_p.h \ + util/qmltimer_p.h \ + util/qmlbind_p.h \ + util/qmlpropertymap_p.h diff --git a/src/declarative/widgets/graphicslayouts.cpp b/src/declarative/widgets/graphicslayouts.cpp index 8707b94..e2f5370 100644 --- a/src/declarative/widgets/graphicslayouts.cpp +++ b/src/declarative/widgets/graphicslayouts.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "graphicslayouts.h" +#include "graphicslayouts_p.h" #include #include diff --git a/src/declarative/widgets/graphicslayouts.h b/src/declarative/widgets/graphicslayouts.h deleted file mode 100644 index 45f1439..0000000 --- a/src/declarative/widgets/graphicslayouts.h +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef GRAPHICSLAYOUTS_H -#define GRAPHICSLAYOUTS_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QGraphicsLinearLayoutStretchItemObject : public QObject, public QGraphicsLayoutItem -{ - Q_OBJECT - Q_INTERFACES(QGraphicsLayoutItem) -public: - QGraphicsLinearLayoutStretchItemObject(QObject *parent = 0); - - virtual QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const; -}; - -//TODO: -// -content margins -// -per-item spacing (does this need to be exposed?) -// -per-item alignment -class LinearLayoutAttached; -class QGraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout -{ - Q_OBJECT - Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) - - Q_PROPERTY(QmlList *children READ children) - Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) - Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) - Q_CLASSINFO("DefaultProperty", "children") -public: - QGraphicsLinearLayoutObject(QObject * = 0); - ~QGraphicsLinearLayoutObject(); - - QmlList *children() { return &_children; } - - static LinearLayoutAttached *qmlAttachedProperties(QObject *); - -private Q_SLOTS: - void updateStretch(QGraphicsLayoutItem*,int); - void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); - -private: - friend class LinearLayoutAttached; - void clearChildren(); - void insertLayoutItem(int, QGraphicsLayoutItem *); - static QHash attachedProperties; - - class ChildList : public QmlList - { - public: - ChildList(QGraphicsLinearLayoutObject *o) - : obj(o) {} - - virtual void append(QGraphicsLayoutItem *item) - { - insert(-1, item); - } - virtual void clear() { obj->clearChildren(); } - virtual int count() const { return obj->count(); } - virtual void removeAt(int i) { obj->removeAt(i); } - virtual QGraphicsLayoutItem *at(int i) const { return obj->itemAt(i); } - virtual void insert(int i, QGraphicsLayoutItem *item) { obj->insertLayoutItem(i, item); } - - private: - QGraphicsLinearLayoutObject *obj; - }; - - ChildList _children; -}; - -//TODO: -// -content margins -// -column and row specific settings: -// -alignment -// -fixed/min/max/preferred width -// -spacing -// -stretch -class GridLayoutAttached; -class QGraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout -{ - Q_OBJECT - Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) - - Q_PROPERTY(QmlList *children READ children) - Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) - Q_PROPERTY(qreal verticalSpacing READ verticalSpacing WRITE setVerticalSpacing) - Q_PROPERTY(qreal horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing) - Q_CLASSINFO("DefaultProperty", "children") -public: - QGraphicsGridLayoutObject(QObject * = 0); - ~QGraphicsGridLayoutObject(); - - QmlList *children() { return &_children; } - - qreal spacing() const; - - static GridLayoutAttached *qmlAttachedProperties(QObject *); - -private: - friend class GraphicsLayoutAttached; - void addWidget(QGraphicsWidget *); - void clearChildren(); - void addLayoutItem(QGraphicsLayoutItem *); - static QHash attachedProperties; - - class ChildList : public QmlList - { - public: - ChildList(QGraphicsGridLayoutObject *o) - : obj(o) {} - - virtual void append(QGraphicsLayoutItem *o) - { - obj->addLayoutItem(o); - } - virtual void clear() { obj->clearChildren(); } - virtual int count() const { return obj->count(); } - virtual void removeAt(int i) { obj->removeAt(i); } - virtual QGraphicsLayoutItem *at(int i) const { return obj->itemAt(i); } - //XXX GridLayout doesn't have an insert, so for now we treat it as an append. - // this is obviously potenitally dangerous -- perhaps should be a concrete - // list with no relation to layout index, etc at all. - virtual void insert(int, QGraphicsLayoutItem *item) { append(item); } - - private: - QGraphicsGridLayoutObject *obj; - }; - - ChildList _children; -}; - -QT_END_NAMESPACE - -QML_DECLARE_INTERFACE(QGraphicsLayoutItem) -QML_DECLARE_INTERFACE(QGraphicsLayout) -QML_DECLARE_TYPE(QGraphicsLinearLayoutStretchItemObject) -QML_DECLARE_TYPE(QGraphicsLinearLayoutObject) -QML_DECLARE_TYPEINFO(QGraphicsLinearLayoutObject, QML_HAS_ATTACHED_PROPERTIES) -QML_DECLARE_TYPE(QGraphicsGridLayoutObject) -QML_DECLARE_TYPEINFO(QGraphicsGridLayoutObject, QML_HAS_ATTACHED_PROPERTIES) - -QT_END_HEADER - -#endif // GRAPHICSLAYOUTS_H diff --git a/src/declarative/widgets/graphicslayouts_p.h b/src/declarative/widgets/graphicslayouts_p.h new file mode 100644 index 0000000..9eeac24 --- /dev/null +++ b/src/declarative/widgets/graphicslayouts_p.h @@ -0,0 +1,193 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GRAPHICSLAYOUTS_H +#define GRAPHICSLAYOUTS_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QGraphicsLinearLayoutStretchItemObject : public QObject, public QGraphicsLayoutItem +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayoutItem) +public: + QGraphicsLinearLayoutStretchItemObject(QObject *parent = 0); + + virtual QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const; +}; + +//TODO: +// -content margins +// -per-item spacing (does this need to be exposed?) +// -per-item alignment +class LinearLayoutAttached; +class QGraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) + + Q_PROPERTY(QmlList *children READ children) + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) + Q_CLASSINFO("DefaultProperty", "children") +public: + QGraphicsLinearLayoutObject(QObject * = 0); + ~QGraphicsLinearLayoutObject(); + + QmlList *children() { return &_children; } + + static LinearLayoutAttached *qmlAttachedProperties(QObject *); + +private Q_SLOTS: + void updateStretch(QGraphicsLayoutItem*,int); + void updateAlignment(QGraphicsLayoutItem*,Qt::Alignment); + +private: + friend class LinearLayoutAttached; + void clearChildren(); + void insertLayoutItem(int, QGraphicsLayoutItem *); + static QHash attachedProperties; + + class ChildList : public QmlList + { + public: + ChildList(QGraphicsLinearLayoutObject *o) + : obj(o) {} + + virtual void append(QGraphicsLayoutItem *item) + { + insert(-1, item); + } + virtual void clear() { obj->clearChildren(); } + virtual int count() const { return obj->count(); } + virtual void removeAt(int i) { obj->removeAt(i); } + virtual QGraphicsLayoutItem *at(int i) const { return obj->itemAt(i); } + virtual void insert(int i, QGraphicsLayoutItem *item) { obj->insertLayoutItem(i, item); } + + private: + QGraphicsLinearLayoutObject *obj; + }; + + ChildList _children; +}; + +//TODO: +// -content margins +// -column and row specific settings: +// -alignment +// -fixed/min/max/preferred width +// -spacing +// -stretch +class GridLayoutAttached; +class QGraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout +{ + Q_OBJECT + Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) + + Q_PROPERTY(QmlList *children READ children) + Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing) + Q_PROPERTY(qreal verticalSpacing READ verticalSpacing WRITE setVerticalSpacing) + Q_PROPERTY(qreal horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing) + Q_CLASSINFO("DefaultProperty", "children") +public: + QGraphicsGridLayoutObject(QObject * = 0); + ~QGraphicsGridLayoutObject(); + + QmlList *children() { return &_children; } + + qreal spacing() const; + + static GridLayoutAttached *qmlAttachedProperties(QObject *); + +private: + friend class GraphicsLayoutAttached; + void addWidget(QGraphicsWidget *); + void clearChildren(); + void addLayoutItem(QGraphicsLayoutItem *); + static QHash attachedProperties; + + class ChildList : public QmlList + { + public: + ChildList(QGraphicsGridLayoutObject *o) + : obj(o) {} + + virtual void append(QGraphicsLayoutItem *o) + { + obj->addLayoutItem(o); + } + virtual void clear() { obj->clearChildren(); } + virtual int count() const { return obj->count(); } + virtual void removeAt(int i) { obj->removeAt(i); } + virtual QGraphicsLayoutItem *at(int i) const { return obj->itemAt(i); } + //XXX GridLayout doesn't have an insert, so for now we treat it as an append. + // this is obviously potenitally dangerous -- perhaps should be a concrete + // list with no relation to layout index, etc at all. + virtual void insert(int, QGraphicsLayoutItem *item) { append(item); } + + private: + QGraphicsGridLayoutObject *obj; + }; + + ChildList _children; +}; + +QT_END_NAMESPACE + +QML_DECLARE_INTERFACE(QGraphicsLayoutItem) +QML_DECLARE_INTERFACE(QGraphicsLayout) +QML_DECLARE_TYPE(QGraphicsLinearLayoutStretchItemObject) +QML_DECLARE_TYPE(QGraphicsLinearLayoutObject) +QML_DECLARE_TYPEINFO(QGraphicsLinearLayoutObject, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPE(QGraphicsGridLayoutObject) +QML_DECLARE_TYPEINFO(QGraphicsGridLayoutObject, QML_HAS_ATTACHED_PROPERTIES) + +QT_END_HEADER + +#endif // GRAPHICSLAYOUTS_H diff --git a/src/declarative/widgets/graphicswidgets.cpp b/src/declarative/widgets/graphicswidgets.cpp index cfcc87b..b631884 100644 --- a/src/declarative/widgets/graphicswidgets.cpp +++ b/src/declarative/widgets/graphicswidgets.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "graphicswidgets.h" +#include "graphicswidgets_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/widgets/graphicswidgets.h b/src/declarative/widgets/graphicswidgets.h deleted file mode 100644 index 8147400..0000000 --- a/src/declarative/widgets/graphicswidgets.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, 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 are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef GRAPHICSWIDGETS_H -#define GRAPHICSWIDGETS_H - -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_MODULE(Declarative) - -QML_DECLARE_TYPE(QGraphicsView) -QML_DECLARE_TYPE_HASMETATYPE(QGraphicsScene) -QML_DECLARE_TYPE(QGraphicsWidget) -QML_DECLARE_INTERFACE_HASMETATYPE(QGraphicsItem) - -QT_END_HEADER - -#endif // GRAPHICSWIDGETS_H diff --git a/src/declarative/widgets/graphicswidgets_p.h b/src/declarative/widgets/graphicswidgets_p.h new file mode 100644 index 0000000..8147400 --- /dev/null +++ b/src/declarative/widgets/graphicswidgets_p.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GRAPHICSWIDGETS_H +#define GRAPHICSWIDGETS_H + +#include +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_MODULE(Declarative) + +QML_DECLARE_TYPE(QGraphicsView) +QML_DECLARE_TYPE_HASMETATYPE(QGraphicsScene) +QML_DECLARE_TYPE(QGraphicsWidget) +QML_DECLARE_INTERFACE_HASMETATYPE(QGraphicsItem) + +QT_END_HEADER + +#endif // GRAPHICSWIDGETS_H diff --git a/src/declarative/widgets/widgets.pri b/src/declarative/widgets/widgets.pri index 41c50d8..4a8bc93 100644 --- a/src/declarative/widgets/widgets.pri +++ b/src/declarative/widgets/widgets.pri @@ -3,8 +3,8 @@ SOURCES += \ widgets/graphicslayouts.cpp \ HEADERS += \ - widgets/graphicswidgets.h \ - widgets/graphicslayouts.h \ + widgets/graphicswidgets_p.h \ + widgets/graphicslayouts_p.h \ diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index ec6a951..ed4c61e 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -2,8 +2,8 @@ #include #include #include -#include -#include +#include +#include class tst_anchors : public QObject diff --git a/tests/auto/declarative/animatedimage/tst_animatedimage.cpp b/tests/auto/declarative/animatedimage/tst_animatedimage.cpp index 099daec..bedf97c 100644 --- a/tests/auto/declarative/animatedimage/tst_animatedimage.cpp +++ b/tests/auto/declarative/animatedimage/tst_animatedimage.cpp @@ -2,9 +2,9 @@ #include #include #include -#include -#include -#include "qmlgraphicsanimatedimageitem.h" +#include +#include +#include "qmlgraphicsanimatedimageitem_p.h" class tst_animatedimage : public QObject { diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index eaf4d14..cb535d4 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include class tst_animations : public QObject diff --git a/tests/auto/declarative/behaviors/tst_behaviors.cpp b/tests/auto/declarative/behaviors/tst_behaviors.cpp index b225a7d..ef2ce76 100644 --- a/tests/auto/declarative/behaviors/tst_behaviors.cpp +++ b/tests/auto/declarative/behaviors/tst_behaviors.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include class tst_behaviors : public QObject diff --git a/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp b/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp index 556912e..8cc14d1 100644 --- a/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp +++ b/tests/auto/declarative/datetimeformatter/tst_datetimeformatter.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include class tst_datetimeformatter : public QObject diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp index 0b9e402..0a97768 100644 --- a/tests/auto/declarative/layouts/tst_layouts.cpp +++ b/tests/auto/declarative/layouts/tst_layouts.cpp @@ -1,7 +1,7 @@ #include -#include +#include #include -#include +#include #include class tst_QmlGraphicsLayouts : public QObject diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp index 4e0f6cb..f38e721 100644 --- a/tests/auto/declarative/listview/tst_listview.cpp +++ b/tests/auto/declarative/listview/tst_listview.cpp @@ -1,8 +1,8 @@ #include -#include +#include #include -#include -#include +#include +#include #include #include diff --git a/tests/auto/declarative/numberformatter/tst_numberformatter.cpp b/tests/auto/declarative/numberformatter/tst_numberformatter.cpp index 412557f..ce6ec0a 100644 --- a/tests/auto/declarative/numberformatter/tst_numberformatter.cpp +++ b/tests/auto/declarative/numberformatter/tst_numberformatter.cpp @@ -2,8 +2,8 @@ #include #include #include -#include -#include +#include +#include class tst_numberformat : public QObject { diff --git a/tests/auto/declarative/pathview/tst_pathview.cpp b/tests/auto/declarative/pathview/tst_pathview.cpp index 013edf5..aa42832 100644 --- a/tests/auto/declarative/pathview/tst_pathview.cpp +++ b/tests/auto/declarative/pathview/tst_pathview.cpp @@ -1,9 +1,9 @@ #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/auto/declarative/qfxloader/tst_qfxloader.cpp b/tests/auto/declarative/qfxloader/tst_qfxloader.cpp index c54c151..4f8b5a0 100644 --- a/tests/auto/declarative/qfxloader/tst_qfxloader.cpp +++ b/tests/auto/declarative/qfxloader/tst_qfxloader.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include class tst_qfxloader : public QObject diff --git a/tests/auto/declarative/qfxpixmapcache/tst_qfxpixmapcache.cpp b/tests/auto/declarative/qfxpixmapcache/tst_qfxpixmapcache.cpp index 14f3f19..e9f9a6f 100644 --- a/tests/auto/declarative/qfxpixmapcache/tst_qfxpixmapcache.cpp +++ b/tests/auto/declarative/qfxpixmapcache/tst_qfxpixmapcache.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include diff --git a/tests/auto/declarative/qfxtext/tst_qfxtext.cpp b/tests/auto/declarative/qfxtext/tst_qfxtext.cpp index 4011851..0014d8d 100644 --- a/tests/auto/declarative/qfxtext/tst_qfxtext.cpp +++ b/tests/auto/declarative/qfxtext/tst_qfxtext.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include class tst_qfxtext : public QObject diff --git a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp index cab8666..94d1f85 100644 --- a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp +++ b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp b/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp index eeaef89..a03bd15 100644 --- a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp +++ b/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp @@ -2,7 +2,7 @@ #include "../../../shared/util.h" #include #include -#include +#include #include #include #include diff --git a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp b/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp index f5b57ea..7bcd96d 100644 --- a/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp +++ b/tests/auto/declarative/qmllistaccessor/tst_qmllistaccessor.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include class tst_QmlListAccessor : public QObject { diff --git a/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp b/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp index f3e62ab..0976e84 100644 --- a/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp +++ b/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp @@ -1,9 +1,9 @@ #include #include #include -#include +#include #include -#include +#include #include class tst_QmlPropertyMap : public QObject diff --git a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp index 15b558f..3602fc7 100644 --- a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp +++ b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include class tst_qmltimer : public QObject { diff --git a/tests/auto/declarative/repeater/tst_repeater.cpp b/tests/auto/declarative/repeater/tst_repeater.cpp index 8354005..ca056fa 100644 --- a/tests/auto/declarative/repeater/tst_repeater.cpp +++ b/tests/auto/declarative/repeater/tst_repeater.cpp @@ -1,8 +1,8 @@ #include -#include +#include #include -#include -#include +#include +#include #include class tst_QmlGraphicsRepeater : public QObject diff --git a/tests/auto/declarative/sql/tst_sql.cpp b/tests/auto/declarative/sql/tst_sql.cpp index ce73c0c..d398dc1 100644 --- a/tests/auto/declarative/sql/tst_sql.cpp +++ b/tests/auto/declarative/sql/tst_sql.cpp @@ -2,7 +2,7 @@ #include "../../../shared/util.h" #include #include -#include +#include #include #include #include diff --git a/tests/auto/declarative/states/tst_states.cpp b/tests/auto/declarative/states/tst_states.cpp index 218baf8..7855889 100644 --- a/tests/auto/declarative/states/tst_states.cpp +++ b/tests/auto/declarative/states/tst_states.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include class tst_states : public QObject { diff --git a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp index 5881cd1..0d404ab 100644 --- a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp +++ b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp @@ -33,8 +33,8 @@ #include #include -#include -#include +#include +#include #include "../standalone/objectpropertiesview.h" #include "../standalone/objecttree.h" diff --git a/tools/qmldebugger/creatorplugin/qmlinspectorplugin.cpp b/tools/qmldebugger/creatorplugin/qmlinspectorplugin.cpp index 5108c35..0520125 100644 --- a/tools/qmldebugger/creatorplugin/qmlinspectorplugin.cpp +++ b/tools/qmldebugger/creatorplugin/qmlinspectorplugin.cpp @@ -14,8 +14,8 @@ #include -#include -#include +#include +#include #include "runcontrol.h" #include "qmlinspector.h" diff --git a/tools/qmldebugger/standalone/canvasframerate.cpp b/tools/qmldebugger/standalone/canvasframerate.cpp index 10c3dbf..f16dedd 100644 --- a/tools/qmldebugger/standalone/canvasframerate.cpp +++ b/tools/qmldebugger/standalone/canvasframerate.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/qmldebugger/standalone/canvasframerate.h b/tools/qmldebugger/standalone/canvasframerate.h index 6c1ff9f..4711055 100644 --- a/tools/qmldebugger/standalone/canvasframerate.h +++ b/tools/qmldebugger/standalone/canvasframerate.h @@ -4,7 +4,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/tools/qmldebugger/standalone/engine.cpp b/tools/qmldebugger/standalone/engine.cpp index 92c54eb..61a53eb 100644 --- a/tools/qmldebugger/standalone/engine.cpp +++ b/tools/qmldebugger/standalone/engine.cpp @@ -5,10 +5,10 @@ #include #include -#include +#include #include #include -#include +#include #include "engine.h" #include "objectpropertiesview.h" diff --git a/tools/qmldebugger/standalone/engine.h b/tools/qmldebugger/standalone/engine.h index a3ebe46..d2ea7d8 100644 --- a/tools/qmldebugger/standalone/engine.h +++ b/tools/qmldebugger/standalone/engine.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/tools/qmldebugger/standalone/expressionquerywidget.h b/tools/qmldebugger/standalone/expressionquerywidget.h index 3fe0295..15096e2 100644 --- a/tools/qmldebugger/standalone/expressionquerywidget.h +++ b/tools/qmldebugger/standalone/expressionquerywidget.h @@ -3,7 +3,7 @@ #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/tools/qmldebugger/standalone/objectpropertiesview.cpp b/tools/qmldebugger/standalone/objectpropertiesview.cpp index d6fefa0..1fa6f85 100644 --- a/tools/qmldebugger/standalone/objectpropertiesview.cpp +++ b/tools/qmldebugger/standalone/objectpropertiesview.cpp @@ -4,9 +4,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "objectpropertiesview.h" diff --git a/tools/qmldebugger/standalone/objectpropertiesview.h b/tools/qmldebugger/standalone/objectpropertiesview.h index 306e5b9..fb64837 100644 --- a/tools/qmldebugger/standalone/objectpropertiesview.h +++ b/tools/qmldebugger/standalone/objectpropertiesview.h @@ -1,7 +1,7 @@ #ifndef PROPERTIESTABLEMODEL_H #define PROPERTIESTABLEMODEL_H -#include +#include #include diff --git a/tools/qmldebugger/standalone/objecttree.cpp b/tools/qmldebugger/standalone/objecttree.cpp index 6c132b6..65860c8 100644 --- a/tools/qmldebugger/standalone/objecttree.cpp +++ b/tools/qmldebugger/standalone/objecttree.cpp @@ -4,9 +4,9 @@ #include -#include -#include -#include +#include +#include +#include #include "objecttree.h" diff --git a/tools/qmldebugger/standalone/qmldebugger.h b/tools/qmldebugger/standalone/qmldebugger.h index 9203e33..1c20087 100644 --- a/tools/qmldebugger/standalone/qmldebugger.h +++ b/tools/qmldebugger/standalone/qmldebugger.h @@ -1,7 +1,7 @@ #ifndef QMLDEBUGGER_H #define QMLDEBUGGER_H -#include +#include #include #include diff --git a/tools/qmldebugger/standalone/watchtable.cpp b/tools/qmldebugger/standalone/watchtable.cpp index 19f034e..00d5a69 100644 --- a/tools/qmldebugger/standalone/watchtable.cpp +++ b/tools/qmldebugger/standalone/watchtable.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 93470eb..e32c899 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -18,7 +18,7 @@ #include #include #include "qml.h" -#include +#include #include #include #include "deviceskin.h" -- cgit v0.12