summaryrefslogtreecommitdiffstats
path: root/kpresenter
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
commit8362bf63dea22bbf6736609b0f49c152f975eb63 (patch)
tree0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kpresenter
downloadkoffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz
koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpresenter')
-rw-r--r--kpresenter/AUTHORS9
-rw-r--r--kpresenter/CHANGES282
-rw-r--r--kpresenter/KPrAboutData.h49
-rw-r--r--kpresenter/KPrAutoFormObjectIface.cpp54
-rw-r--r--kpresenter/KPrAutoFormObjectIface.h48
-rw-r--r--kpresenter/KPrAutoformObject.cpp378
-rw-r--r--kpresenter/KPrAutoformObject.h82
-rw-r--r--kpresenter/KPrBackDia.cpp420
-rw-r--r--kpresenter/KPrBackDia.h134
-rw-r--r--kpresenter/KPrBackground.cpp653
-rw-r--r--kpresenter/KPrBackground.h188
-rw-r--r--kpresenter/KPrBezierCurveObject.cpp302
-rw-r--r--kpresenter/KPrBezierCurveObject.h90
-rw-r--r--kpresenter/KPrBgSpellCheck.cpp60
-rw-r--r--kpresenter/KPrBgSpellCheck.h42
-rw-r--r--kpresenter/KPrBrush.cpp247
-rw-r--r--kpresenter/KPrBrush.h50
-rw-r--r--kpresenter/KPrBrushProperty.cpp498
-rw-r--r--kpresenter/KPrBrushProperty.h88
-rw-r--r--kpresenter/KPrCanvas.cpp5704
-rw-r--r--kpresenter/KPrCanvas.h938
-rw-r--r--kpresenter/KPrClosedLineObject.cpp339
-rw-r--r--kpresenter/KPrClosedLineObject.h84
-rw-r--r--kpresenter/KPrCommand.cpp2827
-rw-r--r--kpresenter/KPrCommand.h1094
-rw-r--r--kpresenter/KPrConfig.cpp1128
-rw-r--r--kpresenter/KPrConfig.h228
-rw-r--r--kpresenter/KPrCubicBezierCurveObjectIface.cpp65
-rw-r--r--kpresenter/KPrCubicBezierCurveObjectIface.h50
-rw-r--r--kpresenter/KPrCustomSlideShowDia.cpp461
-rw-r--r--kpresenter/KPrCustomSlideShowDia.h117
-rw-r--r--kpresenter/KPrDocument.cpp4857
-rw-r--r--kpresenter/KPrDocument.h714
-rw-r--r--kpresenter/KPrDocumentIface.cpp571
-rw-r--r--kpresenter/KPrDocumentIface.h188
-rw-r--r--kpresenter/KPrDuplicateObjDia.cpp125
-rw-r--r--kpresenter/KPrDuplicateObjDia.h54
-rw-r--r--kpresenter/KPrEffectDia.cpp528
-rw-r--r--kpresenter/KPrEffectDia.h94
-rw-r--r--kpresenter/KPrEffectHandler.cpp1055
-rw-r--r--kpresenter/KPrEffectHandler.h345
-rw-r--r--kpresenter/KPrEllipseObject.cpp128
-rw-r--r--kpresenter/KPrEllipseObject.h64
-rw-r--r--kpresenter/KPrFactory.cpp84
-rw-r--r--kpresenter/KPrFactory.h48
-rw-r--r--kpresenter/KPrFactoryInit.cpp24
-rw-r--r--kpresenter/KPrFindReplace.cpp64
-rw-r--r--kpresenter/KPrFindReplace.h63
-rw-r--r--kpresenter/KPrFreehandObject.cpp106
-rw-r--r--kpresenter/KPrFreehandObject.h54
-rw-r--r--kpresenter/KPrFreehandObjectIface.cpp67
-rw-r--r--kpresenter/KPrFreehandObjectIface.h50
-rw-r--r--kpresenter/KPrGeneralProperty.cpp254
-rw-r--r--kpresenter/KPrGeneralProperty.h82
-rw-r--r--kpresenter/KPrGotoPage.cpp91
-rw-r--r--kpresenter/KPrGotoPage.h53
-rw-r--r--kpresenter/KPrGradient.cpp136
-rw-r--r--kpresenter/KPrGradient.h97
-rw-r--r--kpresenter/KPrGradientCollection.cpp73
-rw-r--r--kpresenter/KPrGradientCollection.h63
-rw-r--r--kpresenter/KPrGroupObject.cpp642
-rw-r--r--kpresenter/KPrGroupObject.h116
-rw-r--r--kpresenter/KPrImageEffectDia.cpp412
-rw-r--r--kpresenter/KPrImageEffectDia.h83
-rw-r--r--kpresenter/KPrImportStyleDia.cpp157
-rw-r--r--kpresenter/KPrImportStyleDia.h47
-rw-r--r--kpresenter/KPrLineObject.cpp499
-rw-r--r--kpresenter/KPrLineObject.h84
-rw-r--r--kpresenter/KPrLineObjectIface.cpp66
-rw-r--r--kpresenter/KPrLineObjectIface.h49
-rw-r--r--kpresenter/KPrLoadingInfo.h87
-rw-r--r--kpresenter/KPrMSPresentationSetup.cpp619
-rw-r--r--kpresenter/KPrMSPresentationSetup.h159
-rw-r--r--kpresenter/KPrMarginWidget.cpp129
-rw-r--r--kpresenter/KPrMarginWidget.h57
-rw-r--r--kpresenter/KPrMoveHelpLineDia.cpp154
-rw-r--r--kpresenter/KPrMoveHelpLineDia.h95
-rw-r--r--kpresenter/KPrNoteBar.cpp197
-rw-r--r--kpresenter/KPrNoteBar.h65
-rw-r--r--kpresenter/KPrObject.cpp2172
-rw-r--r--kpresenter/KPrObject.h557
-rw-r--r--kpresenter/KPrObject2DIface.cpp124
-rw-r--r--kpresenter/KPrObject2DIface.h59
-rw-r--r--kpresenter/KPrObjectIface.cpp288
-rw-r--r--kpresenter/KPrObjectIface.h101
-rw-r--r--kpresenter/KPrObjectProperties.cpp310
-rw-r--r--kpresenter/KPrObjectProperties.h98
-rw-r--r--kpresenter/KPrPBPreview.cpp125
-rw-r--r--kpresenter/KPrPBPreview.h82
-rw-r--r--kpresenter/KPrPage.cpp2614
-rw-r--r--kpresenter/KPrPage.h607
-rw-r--r--kpresenter/KPrPageEffects.cpp1590
-rw-r--r--kpresenter/KPrPageEffects.h121
-rw-r--r--kpresenter/KPrPageIface.cpp699
-rw-r--r--kpresenter/KPrPageIface.h137
-rw-r--r--kpresenter/KPrPartObject.cpp203
-rw-r--r--kpresenter/KPrPartObject.h69
-rw-r--r--kpresenter/KPrPenStyleWidget.cpp279
-rw-r--r--kpresenter/KPrPenStyleWidget.h67
-rw-r--r--kpresenter/KPrPgConfDia.cpp324
-rw-r--r--kpresenter/KPrPgConfDia.h90
-rw-r--r--kpresenter/KPrPicturePreview.cpp307
-rw-r--r--kpresenter/KPrPicturePreview.h74
-rw-r--r--kpresenter/KPrPictureProperty.cpp132
-rw-r--r--kpresenter/KPrPictureProperty.h53
-rw-r--r--kpresenter/KPrPieObject.cpp607
-rw-r--r--kpresenter/KPrPieObject.h109
-rw-r--r--kpresenter/KPrPieObjectIface.cpp83
-rw-r--r--kpresenter/KPrPieObjectIface.h52
-rw-r--r--kpresenter/KPrPiePreview.cpp66
-rw-r--r--kpresenter/KPrPiePreview.h58
-rw-r--r--kpresenter/KPrPieProperty.cpp141
-rw-r--r--kpresenter/KPrPieProperty.h55
-rw-r--r--kpresenter/KPrPixmapObject.cpp958
-rw-r--r--kpresenter/KPrPixmapObject.h153
-rw-r--r--kpresenter/KPrPixmapObjectIface.cpp101
-rw-r--r--kpresenter/KPrPixmapObjectIface.h56
-rw-r--r--kpresenter/KPrPointObject.cpp276
-rw-r--r--kpresenter/KPrPointObject.h74
-rw-r--r--kpresenter/KPrPolyLineObjectIface.cpp45
-rw-r--r--kpresenter/KPrPolyLineObjectIface.h43
-rw-r--r--kpresenter/KPrPolygonObject.cpp377
-rw-r--r--kpresenter/KPrPolygonObject.h88
-rw-r--r--kpresenter/KPrPolygonObjectIface.cpp62
-rw-r--r--kpresenter/KPrPolygonObjectIface.h49
-rw-r--r--kpresenter/KPrPolygonPreview.cpp120
-rw-r--r--kpresenter/KPrPolygonPreview.h61
-rw-r--r--kpresenter/KPrPolygonProperty.cpp134
-rw-r--r--kpresenter/KPrPolygonProperty.h55
-rw-r--r--kpresenter/KPrPolylineObject.cpp91
-rw-r--r--kpresenter/KPrPolylineObject.h56
-rw-r--r--kpresenter/KPrPresDurationDia.cpp81
-rw-r--r--kpresenter/KPrPresDurationDia.h59
-rw-r--r--kpresenter/KPrPrinterDlg.cpp114
-rw-r--r--kpresenter/KPrPrinterDlg.h56
-rw-r--r--kpresenter/KPrPropertyEditor.cpp499
-rw-r--r--kpresenter/KPrPropertyEditor.h84
-rw-r--r--kpresenter/KPrQuadricBezierCurveObjectIface.cpp66
-rw-r--r--kpresenter/KPrQuadricBezierCurveObjectIface.h50
-rw-r--r--kpresenter/KPrRectObject.cpp219
-rw-r--r--kpresenter/KPrRectObject.h75
-rw-r--r--kpresenter/KPrRectObjectIface.cpp52
-rw-r--r--kpresenter/KPrRectObjectIface.h44
-rw-r--r--kpresenter/KPrRectPreview.cpp50
-rw-r--r--kpresenter/KPrRectPreview.h51
-rw-r--r--kpresenter/KPrRectProperty.cpp147
-rw-r--r--kpresenter/KPrRectProperty.h60
-rw-r--r--kpresenter/KPrRotationDialogImpl.cpp174
-rw-r--r--kpresenter/KPrRotationDialogImpl.h136
-rw-r--r--kpresenter/KPrSVGPathParser.cpp179
-rw-r--r--kpresenter/KPrSVGPathParser.h92
-rw-r--r--kpresenter/KPrShadowDialogImpl.cpp91
-rw-r--r--kpresenter/KPrShadowDialogImpl.h41
-rw-r--r--kpresenter/KPrSideBar.cpp1111
-rw-r--r--kpresenter/KPrSideBar.h182
-rw-r--r--kpresenter/KPrSlideTransitionDia.cpp413
-rw-r--r--kpresenter/KPrSlideTransitionDia.h79
-rw-r--r--kpresenter/KPrSoundPlayer.cpp111
-rw-r--r--kpresenter/KPrSoundPlayer.h63
-rw-r--r--kpresenter/KPrStyleManager.cpp61
-rw-r--r--kpresenter/KPrStyleManager.h49
-rw-r--r--kpresenter/KPrTextDocument.cpp103
-rw-r--r--kpresenter/KPrTextDocument.h55
-rw-r--r--kpresenter/KPrTextObject.cpp2586
-rw-r--r--kpresenter/KPrTextObject.h312
-rw-r--r--kpresenter/KPrTextObjectIface.cpp366
-rw-r--r--kpresenter/KPrTextObjectIface.h110
-rw-r--r--kpresenter/KPrTextPreview.cpp101
-rw-r--r--kpresenter/KPrTextPreview.h30
-rw-r--r--kpresenter/KPrTextProperty.cpp139
-rw-r--r--kpresenter/KPrTextProperty.h67
-rw-r--r--kpresenter/KPrTextViewIface.cpp122
-rw-r--r--kpresenter/KPrTextViewIface.h56
-rw-r--r--kpresenter/KPrTransEffectDia.cpp466
-rw-r--r--kpresenter/KPrTransEffectDia.h138
-rw-r--r--kpresenter/KPrUtils.cpp448
-rw-r--r--kpresenter/KPrUtils.h62
-rw-r--r--kpresenter/KPrVariableCollection.cpp200
-rw-r--r--kpresenter/KPrVariableCollection.h71
-rw-r--r--kpresenter/KPrView.cpp6480
-rw-r--r--kpresenter/KPrView.h1228
-rw-r--r--kpresenter/KPrViewIface.cpp719
-rw-r--r--kpresenter/KPrViewIface.h238
-rw-r--r--kpresenter/KPrWebPresentation.cpp1305
-rw-r--r--kpresenter/KPrWebPresentation.h227
-rw-r--r--kpresenter/KoPointArray.cpp320
-rw-r--r--kpresenter/KoPointArray.h65
-rw-r--r--kpresenter/Makefile.am104
-rw-r--r--kpresenter/TODO117
-rw-r--r--kpresenter/autoformEdit/AFChoose.cpp202
-rw-r--r--kpresenter/autoformEdit/AFChoose.h89
-rw-r--r--kpresenter/autoformEdit/ATFInterpreter.cpp453
-rw-r--r--kpresenter/autoformEdit/ATFInterpreter.h175
-rw-r--r--kpresenter/autoformEdit/Makefile.am12
-rw-r--r--kpresenter/autoforms/.autoforms2
-rw-r--r--kpresenter/autoforms/Arrows/.directory41
-rw-r--r--kpresenter/autoforms/Arrows/ArrowDown.atf255
-rw-r--r--kpresenter/autoforms/Arrows/ArrowDown.desktop49
-rw-r--r--kpresenter/autoforms/Arrows/ArrowDown.pngbin0 -> 309 bytes
-rw-r--r--kpresenter/autoforms/Arrows/ArrowLeft.atf255
-rw-r--r--kpresenter/autoforms/Arrows/ArrowLeft.desktop49
-rw-r--r--kpresenter/autoforms/Arrows/ArrowLeft.pngbin0 -> 311 bytes
-rw-r--r--kpresenter/autoforms/Arrows/ArrowLeftDown.atf255
-rw-r--r--kpresenter/autoforms/Arrows/ArrowLeftDown.desktop49
-rw-r--r--kpresenter/autoforms/Arrows/ArrowLeftDown.pngbin0 -> 337 bytes
-rw-r--r--kpresenter/autoforms/Arrows/ArrowLeftUp.atf255
-rw-r--r--kpresenter/autoforms/Arrows/ArrowLeftUp.desktop49
-rw-r--r--kpresenter/autoforms/Arrows/ArrowLeftUp.pngbin0 -> 340 bytes
-rw-r--r--kpresenter/autoforms/Arrows/ArrowRight.atf255
-rw-r--r--kpresenter/autoforms/Arrows/ArrowRight.desktop49
-rw-r--r--kpresenter/autoforms/Arrows/ArrowRight.pngbin0 -> 320 bytes
-rw-r--r--kpresenter/autoforms/Arrows/ArrowRightDown.atf255
-rw-r--r--kpresenter/autoforms/Arrows/ArrowRightDown.desktop49
-rw-r--r--kpresenter/autoforms/Arrows/ArrowRightDown.pngbin0 -> 338 bytes
-rw-r--r--kpresenter/autoforms/Arrows/ArrowRightUp.atf255
-rw-r--r--kpresenter/autoforms/Arrows/ArrowRightUp.desktop49
-rw-r--r--kpresenter/autoforms/Arrows/ArrowRightUp.pngbin0 -> 333 bytes
-rw-r--r--kpresenter/autoforms/Arrows/ArrowUp.atf255
-rw-r--r--kpresenter/autoforms/Arrows/ArrowUp.desktop49
-rw-r--r--kpresenter/autoforms/Arrows/ArrowUp.pngbin0 -> 309 bytes
-rw-r--r--kpresenter/autoforms/Arrows/Makefile.am18
-rw-r--r--kpresenter/autoforms/Connections/.directory42
-rw-r--r--kpresenter/autoforms/Connections/Connection1.atf131
-rw-r--r--kpresenter/autoforms/Connections/Connection1.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection1.pngbin0 -> 259 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection10.atf131
-rw-r--r--kpresenter/autoforms/Connections/Connection10.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection10.pngbin0 -> 246 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection11.atf131
-rw-r--r--kpresenter/autoforms/Connections/Connection11.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection11.pngbin0 -> 246 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection12.atf131
-rw-r--r--kpresenter/autoforms/Connections/Connection12.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection12.pngbin0 -> 245 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection2.atf131
-rw-r--r--kpresenter/autoforms/Connections/Connection2.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection2.pngbin0 -> 262 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection3.atf131
-rw-r--r--kpresenter/autoforms/Connections/Connection3.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection3.pngbin0 -> 262 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection4.atf131
-rw-r--r--kpresenter/autoforms/Connections/Connection4.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection4.pngbin0 -> 264 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection5.atf224
-rw-r--r--kpresenter/autoforms/Connections/Connection5.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection5.pngbin0 -> 254 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection6.atf224
-rw-r--r--kpresenter/autoforms/Connections/Connection6.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection6.pngbin0 -> 251 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection7.atf224
-rw-r--r--kpresenter/autoforms/Connections/Connection7.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection7.pngbin0 -> 250 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection8.atf224
-rw-r--r--kpresenter/autoforms/Connections/Connection8.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection8.pngbin0 -> 250 bytes
-rw-r--r--kpresenter/autoforms/Connections/Connection9.atf131
-rw-r--r--kpresenter/autoforms/Connections/Connection9.desktop71
-rw-r--r--kpresenter/autoforms/Connections/Connection9.pngbin0 -> 244 bytes
-rw-r--r--kpresenter/autoforms/Connections/Makefile.am24
-rw-r--r--kpresenter/autoforms/Makefile.am6
-rw-r--r--kpresenter/brushpropertyui.ui86
-rw-r--r--kpresenter/configure.in.in1
-rw-r--r--kpresenter/dtd/Makefile.am4
-rw-r--r--kpresenter/dtd/kpresenter.dtd777
-rw-r--r--kpresenter/generalpropertyui.ui193
-rw-r--r--kpresenter/global.h299
-rw-r--r--kpresenter/gradientpropertyui.ui178
-rw-r--r--kpresenter/imageEffectBase.ui1480
-rw-r--r--kpresenter/insertpagedia.ui185
-rw-r--r--kpresenter/kprconverter.pl174
-rw-r--r--kpresenter/kpresenter.desktop85
-rw-r--r--kpresenter/kpresenter.rc682
-rw-r--r--kpresenter/kpresenter_readonly.rc82
-rw-r--r--kpresenter/kpresenterpart.desktop83
-rw-r--r--kpresenter/main.cpp46
-rw-r--r--kpresenter/marginui.ui167
-rw-r--r--kpresenter/penstyle.ui199
-rw-r--r--kpresenter/pics/Makefile.am6
-rw-r--r--kpresenter/pics/hi16-app-kpresenter.pngbin0 -> 989 bytes
-rw-r--r--kpresenter/pics/hi22-app-kpresenter.pngbin0 -> 1258 bytes
-rw-r--r--kpresenter/pics/hi32-app-kpresenter.pngbin0 -> 1809 bytes
-rw-r--r--kpresenter/pics/hi48-app-kpresenter.pngbin0 -> 2657 bytes
-rw-r--r--kpresenter/pics/rotate/Makefile.am4
-rw-r--r--kpresenter/pics/rotate/bl.pngbin0 -> 576 bytes
-rw-r--r--kpresenter/pics/rotate/bldn.pngbin0 -> 557 bytes
-rw-r--r--kpresenter/pics/rotate/bm.pngbin0 -> 538 bytes
-rw-r--r--kpresenter/pics/rotate/bmdn.pngbin0 -> 509 bytes
-rw-r--r--kpresenter/pics/rotate/br.pngbin0 -> 602 bytes
-rw-r--r--kpresenter/pics/rotate/brdn.pngbin0 -> 562 bytes
-rw-r--r--kpresenter/pics/rotate/ml.pngbin0 -> 520 bytes
-rw-r--r--kpresenter/pics/rotate/mldn.pngbin0 -> 505 bytes
-rw-r--r--kpresenter/pics/rotate/mr.pngbin0 -> 525 bytes
-rw-r--r--kpresenter/pics/rotate/mrdn.pngbin0 -> 502 bytes
-rw-r--r--kpresenter/pics/rotate/tl.pngbin0 -> 553 bytes
-rw-r--r--kpresenter/pics/rotate/tldn.pngbin0 -> 534 bytes
-rw-r--r--kpresenter/pics/rotate/tm.pngbin0 -> 525 bytes
-rw-r--r--kpresenter/pics/rotate/tmdn.pngbin0 -> 497 bytes
-rw-r--r--kpresenter/pics/rotate/tr.pngbin0 -> 575 bytes
-rw-r--r--kpresenter/pics/rotate/trdn.pngbin0 -> 554 bytes
-rw-r--r--kpresenter/pics/webslideshow-sidebar.pngbin0 -> 11299 bytes
-rw-r--r--kpresenter/picturepropertyui.ui180
-rw-r--r--kpresenter/piepropertyui.ui146
-rw-r--r--kpresenter/polygonpropertyui.ui151
-rw-r--r--kpresenter/presstep.h52
-rw-r--r--kpresenter/rectpropertyui.ui181
-rw-r--r--kpresenter/rotationpropertyui.ui166
-rwxr-xr-xkpresenter/scripts/automate_presentation.sh25
-rwxr-xr-xkpresenter/scripts/mkstandalone.sh91
-rw-r--r--kpresenter/shadowdialog.ui499
-rw-r--r--kpresenter/slideshow/Makefile.am5
-rw-r--r--kpresenter/slideshow/first.bmpbin0 -> 3126 bytes
-rw-r--r--kpresenter/slideshow/first.jpegbin0 -> 1110 bytes
-rw-r--r--kpresenter/slideshow/first.pngbin0 -> 2452 bytes
-rw-r--r--kpresenter/slideshow/home.bmpbin0 -> 4194 bytes
-rw-r--r--kpresenter/slideshow/home.jpegbin0 -> 1402 bytes
-rw-r--r--kpresenter/slideshow/home.pngbin0 -> 951 bytes
-rw-r--r--kpresenter/slideshow/last.bmpbin0 -> 3126 bytes
-rw-r--r--kpresenter/slideshow/last.jpegbin0 -> 1130 bytes
-rw-r--r--kpresenter/slideshow/last.pngbin0 -> 2483 bytes
-rw-r--r--kpresenter/slideshow/next.bmpbin0 -> 3126 bytes
-rw-r--r--kpresenter/slideshow/next.jpegbin0 -> 1120 bytes
-rw-r--r--kpresenter/slideshow/next.pngbin0 -> 2478 bytes
-rw-r--r--kpresenter/slideshow/prev.bmpbin0 -> 3126 bytes
-rw-r--r--kpresenter/slideshow/prev.jpegbin0 -> 1116 bytes
-rw-r--r--kpresenter/slideshow/prev.pngbin0 -> 2519 bytes
-rw-r--r--kpresenter/slidetransitionwidget.ui308
-rw-r--r--kpresenter/templates/A4/.directory7
-rw-r--r--kpresenter/templates/A4/Makefile.am20
-rw-r--r--kpresenter/templates/A4/OneColumnLandscape.kptbin0 -> 1140 bytes
-rw-r--r--kpresenter/templates/A4/OneColumnPortrait.kptbin0 -> 1141 bytes
-rw-r--r--kpresenter/templates/A4/TitleLandscape.kptbin0 -> 1111 bytes
-rw-r--r--kpresenter/templates/A4/TitlePortrait.kptbin0 -> 1113 bytes
-rw-r--r--kpresenter/templates/A4/TwoColumnLandscape.kptbin0 -> 1153 bytes
-rw-r--r--kpresenter/templates/A4/TwoColumnPortrait.kptbin0 -> 1151 bytes
-rw-r--r--kpresenter/templates/A4/emptyLandscape.kptbin0 -> 999 bytes
-rw-r--r--kpresenter/templates/A4/emptyPortrait.kptbin0 -> 996 bytes
-rw-r--r--kpresenter/templates/Makefile.am1
-rw-r--r--kpresenter/templates/README9
-rw-r--r--kpresenter/templates/Screen/.directory59
-rw-r--r--kpresenter/templates/Screen/Makefile.am16
-rw-r--r--kpresenter/templates/Screen/OneColumnLandscape.kpt101
-rw-r--r--kpresenter/templates/Screen/TitleLandscape.kpt83
-rw-r--r--kpresenter/templates/Screen/TwoColumnLandscape.kpt119
-rw-r--r--kpresenter/templates/Screen/emptyLandscape.kpt64
-rw-r--r--kpresenter/templates/Screenpresentations/.directory49
-rw-r--r--kpresenter/templates/Screenpresentations/BlueBreezeDouble.desktop90
-rw-r--r--kpresenter/templates/Screenpresentations/BlueBreezeDouble.kptbin0 -> 3490 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/BlueBreezePicture.desktop92
-rw-r--r--kpresenter/templates/Screenpresentations/BlueBreezePicture.kptbin0 -> 93363 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/BlueBreezeSingle.desktop90
-rw-r--r--kpresenter/templates/Screenpresentations/BlueBreezeSingle.kptbin0 -> 3425 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/CopperPlain.desktop85
-rw-r--r--kpresenter/templates/Screenpresentations/CopperPlain.kptbin0 -> 3922 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/GradientBlueRed.desktop101
-rw-r--r--kpresenter/templates/Screenpresentations/GradientBlueRed.kptbin0 -> 1227 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/Makefile.am18
-rw-r--r--kpresenter/templates/Screenpresentations/SnowyMountains.desktop100
-rw-r--r--kpresenter/templates/Screenpresentations/SnowyMountains.kptbin0 -> 61271 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/TotallyNewProduct.desktop100
-rw-r--r--kpresenter/templates/Screenpresentations/TotallyNewProduct.kptbin0 -> 75755 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/classroom.desktop78
-rw-r--r--kpresenter/templates/Screenpresentations/classroom.kptbin0 -> 104924 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezedouble.pngbin0 -> 995 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezepicture.pngbin0 -> 2718 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezesingle.pngbin0 -> 748 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_classroom.pngbin0 -> 1779 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_copperplain.pngbin0 -> 294 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_gradientbluered.pngbin0 -> 252 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_kde.pngbin0 -> 310 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_kde2.pngbin0 -> 353 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_kde3.pngbin0 -> 601 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_savannah.pngbin0 -> 1390 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_screenplain.pngbin0 -> 182 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_snowymountains.pngbin0 -> 2785 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/hi48-action-template_totallynewproduct.pngbin0 -> 2458 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/kde.desktop45
-rw-r--r--kpresenter/templates/Screenpresentations/kde.kptbin0 -> 4382 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/kde2.desktop47
-rw-r--r--kpresenter/templates/Screenpresentations/kde2.kptbin0 -> 4314 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/kde3.desktop45
-rw-r--r--kpresenter/templates/Screenpresentations/kde3.kptbin0 -> 46091 bytes
-rw-r--r--kpresenter/templates/Screenpresentations/savannah.desktop64
-rw-r--r--kpresenter/templates/Screenpresentations/savannah.kptbin0 -> 71306 bytes
-rw-r--r--kpresenter/templates/common_desktop/OneColumnLandscape.desktop107
-rw-r--r--kpresenter/templates/common_desktop/OneColumnPortrait.desktop102
-rw-r--r--kpresenter/templates/common_desktop/TitleLandscape.desktop109
-rw-r--r--kpresenter/templates/common_desktop/TitlePortrait.desktop102
-rw-r--r--kpresenter/templates/common_desktop/TwoColumnLandscape.desktop106
-rw-r--r--kpresenter/templates/common_desktop/TwoColumnPortrait.desktop102
-rw-r--r--kpresenter/templates/common_desktop/emptyLandscape.desktop100
-rw-r--r--kpresenter/templates/common_desktop/emptyPortrait.desktop91
-rw-r--r--kpresenter/templates/common_icon/Makefile.am3
-rw-r--r--kpresenter/templates/common_icon/cr48-action-template_emptylandscape.pngbin0 -> 443 bytes
-rw-r--r--kpresenter/templates/common_icon/cr48-action-template_emptyportrait.pngbin0 -> 469 bytes
-rw-r--r--kpresenter/templates/common_icon/cr48-action-template_onecolumnlandscape.pngbin0 -> 812 bytes
-rw-r--r--kpresenter/templates/common_icon/cr48-action-template_onecolumnportrait.pngbin0 -> 892 bytes
-rw-r--r--kpresenter/templates/common_icon/cr48-action-template_titlelandscape.pngbin0 -> 529 bytes
-rw-r--r--kpresenter/templates/common_icon/cr48-action-template_titleportrait.pngbin0 -> 584 bytes
-rw-r--r--kpresenter/templates/common_icon/cr48-action-template_twocolumnlandscape.pngbin0 -> 918 bytes
-rw-r--r--kpresenter/templates/common_icon/cr48-action-template_twocolumnportrait.pngbin0 -> 1155 bytes
-rw-r--r--kpresenter/templates/common_icon/crsc-action-template_emptylandscape.svgzbin0 -> 1415 bytes
-rw-r--r--kpresenter/templates/common_icon/crsc-action-template_emptyportrait.svgzbin0 -> 1432 bytes
-rw-r--r--kpresenter/templates/common_icon/crsc-action-template_onecolumnlandscape.svgzbin0 -> 1816 bytes
-rw-r--r--kpresenter/templates/common_icon/crsc-action-template_onecolumnportrait.svgzbin0 -> 1830 bytes
-rw-r--r--kpresenter/templates/common_icon/crsc-action-template_titlelandscape.svgzbin0 -> 1581 bytes
-rw-r--r--kpresenter/templates/common_icon/crsc-action-template_titleportrait.svgzbin0 -> 1595 bytes
-rw-r--r--kpresenter/templates/common_icon/crsc-action-template_twocolumnlandscape.svgzbin0 -> 1889 bytes
-rw-r--r--kpresenter/templates/common_icon/crsc-action-template_twocolumnportrait.svgzbin0 -> 1910 bytes
-rw-r--r--kpresenter/templates/legal/.directory24
-rw-r--r--kpresenter/templates/legal/Makefile.am20
-rw-r--r--kpresenter/templates/legal/OneColumnLandscape.kptbin0 -> 1148 bytes
-rw-r--r--kpresenter/templates/legal/OneColumnPortrait.kptbin0 -> 1175 bytes
-rw-r--r--kpresenter/templates/legal/TitleLandscape.kptbin0 -> 1119 bytes
-rw-r--r--kpresenter/templates/legal/TitlePortrait.kptbin0 -> 1113 bytes
-rw-r--r--kpresenter/templates/legal/TwoColumnLandscape.kptbin0 -> 1167 bytes
-rw-r--r--kpresenter/templates/legal/TwoColumnPortrait.kptbin0 -> 1158 bytes
-rw-r--r--kpresenter/templates/legal/emptyLandscape.kptbin0 -> 1008 bytes
-rw-r--r--kpresenter/templates/legal/emptyPortrait.kptbin0 -> 1008 bytes
-rw-r--r--kpresenter/templates/letter/.directory43
-rw-r--r--kpresenter/templates/letter/Makefile.am20
-rw-r--r--kpresenter/templates/letter/OneColumnLandscape.kptbin0 -> 1141 bytes
-rw-r--r--kpresenter/templates/letter/OneColumnPortrait.kptbin0 -> 1142 bytes
-rw-r--r--kpresenter/templates/letter/TitleLandscape.kptbin0 -> 1113 bytes
-rw-r--r--kpresenter/templates/letter/TitlePortrait.kptbin0 -> 1113 bytes
-rw-r--r--kpresenter/templates/letter/TwoColumnLandscape.kptbin0 -> 1152 bytes
-rw-r--r--kpresenter/templates/letter/TwoColumnPortrait.kptbin0 -> 1151 bytes
-rw-r--r--kpresenter/templates/letter/emptyLandscape.kptbin0 -> 999 bytes
-rw-r--r--kpresenter/templates/letter/emptyPortrait.kptbin0 -> 999 bytes
-rwxr-xr-xkpresenter/tests/oasis-kpresenter.sh87
-rw-r--r--kpresenter/textpropertyui.ui61
-rw-r--r--kpresenter/toolbar/Makefile.am2
-rw-r--r--kpresenter/toolbar/action-alignobjs.svg886
-rw-r--r--kpresenter/toolbar/action-autoform.svg151
-rw-r--r--kpresenter/toolbar/action-circle.svg152
-rw-r--r--kpresenter/toolbar/action-closed_cubicbeziercurve.svg444
-rw-r--r--kpresenter/toolbar/action-closed_freehand.svg482
-rw-r--r--kpresenter/toolbar/action-closed_polyline.svg482
-rw-r--r--kpresenter/toolbar/action-closed_quadricbeziercurve.svg402
-rw-r--r--kpresenter/toolbar/action-cubicbeziercurve.svg432
-rw-r--r--kpresenter/toolbar/action-effect.png.svg973
-rw-r--r--kpresenter/toolbar/action-effect.svg879
-rw-r--r--kpresenter/toolbar/action-freehand.svg481
-rw-r--r--kpresenter/toolbar/action-line.svg539
-rw-r--r--kpresenter/toolbar/action-penbrush.svg3337
-rw-r--r--kpresenter/toolbar/action-pie.svg603
-rw-r--r--kpresenter/toolbar/action-polygon.svg147
-rw-r--r--kpresenter/toolbar/action-polyline.svg327
-rw-r--r--kpresenter/toolbar/action-quadricbeziercurve.svg393
-rw-r--r--kpresenter/toolbar/action-rectangle.svg150
-rw-r--r--kpresenter/toolbar/action-slide_effect.svg680
-rw-r--r--kpresenter/toolbar/cr16-action-alignobjs.pngbin0 -> 444 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-alignobjs.svg1066
-rw-r--r--kpresenter/toolbar/cr16-action-autoform.pngbin0 -> 536 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-circle.pngbin0 -> 626 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-closed_cubicbeziercurve.pngbin0 -> 429 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-closed_freehand.pngbin0 -> 589 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-closed_polyline.pngbin0 -> 487 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-closed_quadricbeziercurve.pngbin0 -> 495 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-cubicbeziercurve.pngbin0 -> 288 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-effect.pngbin0 -> 997 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-freehand.pngbin0 -> 416 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-line.pngbin0 -> 240 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-penbrush.pngbin0 -> 946 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-pie.pngbin0 -> 625 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-polygon.pngbin0 -> 598 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-polyline.pngbin0 -> 273 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-quadricbeziercurve.pngbin0 -> 303 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-rectangle.pngbin0 -> 410 bytes
-rw-r--r--kpresenter/toolbar/cr16-action-slide_effect.pngbin0 -> 824 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-alignobjs.pngbin0 -> 485 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-alignobjs.svg1061
-rw-r--r--kpresenter/toolbar/cr22-action-arrange.pngbin0 -> 429 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-autoform.pngbin0 -> 663 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-cakes.pngbin0 -> 330 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-cakes3d.pngbin0 -> 332 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-circle.pngbin0 -> 861 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-closed_cubicbeziercurve.pngbin0 -> 624 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-closed_freehand.pngbin0 -> 880 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-closed_polyline.pngbin0 -> 691 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-closed_quadricbeziercurve.pngbin0 -> 758 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-cubicbeziercurve.pngbin0 -> 373 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-edit_picture.pngbin0 -> 930 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-edit_pie.pngbin0 -> 435 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-edit_polygon.pngbin0 -> 268 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-effect.pngbin0 -> 1592 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-freehand.pngbin0 -> 579 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line.pngbin0 -> 306 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_arrow_begin.pngbin0 -> 135 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_arrow_end.pngbin0 -> 137 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_begin.pngbin0 -> 419 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_circle_begin.pngbin0 -> 137 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_circle_end.pngbin0 -> 136 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_dimension_line_begin.pngbin0 -> 144 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_dimension_line_end.pngbin0 -> 134 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_double_arrow_begin.pngbin0 -> 190 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_double_arrow_end.pngbin0 -> 193 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_double_line_arrow_begin.pngbin0 -> 184 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_double_line_arrow_end.pngbin0 -> 185 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_end.pngbin0 -> 368 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_line_arrow_begin.pngbin0 -> 168 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_line_arrow_end.pngbin0 -> 193 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_normal_begin.pngbin0 -> 90 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_normal_end.pngbin0 -> 90 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_rect_begin.pngbin0 -> 103 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-line_rect_end.pngbin0 -> 109 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-mini_autoform.pngbin0 -> 274 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-mini_circle.pngbin0 -> 282 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-mini_clipart.pngbin0 -> 336 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-mini_line.pngbin0 -> 240 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-mini_pie.pngbin0 -> 319 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-mini_polygon.pngbin0 -> 138 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-mini_rect.pngbin0 -> 259 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_style.pngbin0 -> 237 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_style_dash.pngbin0 -> 107 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_style_dashdot.pngbin0 -> 115 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_style_dashdotdot.pngbin0 -> 110 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_style_dot.pngbin0 -> 101 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_style_nopen.pngbin0 -> 88 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_style_solid.pngbin0 -> 106 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width.pngbin0 -> 218 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width1.pngbin0 -> 106 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width10.pngbin0 -> 108 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width2.pngbin0 -> 108 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width3.pngbin0 -> 107 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width4.pngbin0 -> 110 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width5.pngbin0 -> 109 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width6.pngbin0 -> 108 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width7.pngbin0 -> 108 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width8.pngbin0 -> 109 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pen_width9.pngbin0 -> 108 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-penbrush.pngbin0 -> 1487 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pgnum.pngbin0 -> 299 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-pie.pngbin0 -> 851 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-polygon.pngbin0 -> 791 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-polyline.pngbin0 -> 341 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-quadricbeziercurve.pngbin0 -> 389 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-rectangle.pngbin0 -> 562 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-slide_effect.pngbin0 -> 1253 bytes
-rw-r--r--kpresenter/toolbar/cr22-action-webpres.pngbin0 -> 420 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-alignobjs.pngbin0 -> 946 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-autoform.pngbin0 -> 1006 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-circle.pngbin0 -> 1214 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-closed_cubicbeziercurve.pngbin0 -> 972 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-closed_freehand.pngbin0 -> 1288 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-closed_polyline.pngbin0 -> 1090 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-closed_quadricbeziercurve.pngbin0 -> 1166 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-cubicbeziercurve.pngbin0 -> 480 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-effect.pngbin0 -> 2753 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-freehand.pngbin0 -> 814 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-line.pngbin0 -> 406 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-penbrush.pngbin0 -> 2552 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-pie.pngbin0 -> 1256 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-polygon.pngbin0 -> 1195 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-polyline.pngbin0 -> 507 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-quadricbeziercurve.pngbin0 -> 552 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-rectangle.pngbin0 -> 750 bytes
-rw-r--r--kpresenter/toolbar/cr32-action-slide_effect.pngbin0 -> 1911 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-alignobjs.pngbin0 -> 1616 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-autoform.pngbin0 -> 1490 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-circle.pngbin0 -> 1882 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-closed_cubicbeziercurve.pngbin0 -> 1480 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-closed_freehand.pngbin0 -> 2062 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-closed_polyline.pngbin0 -> 1620 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-closed_quadricbeziercurve.pngbin0 -> 1730 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-cubicbeziercurve.pngbin0 -> 706 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-effect.pngbin0 -> 4817 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-freehand.pngbin0 -> 1310 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-line.pngbin0 -> 670 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-penbrush.pngbin0 -> 4571 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-pie.pngbin0 -> 1981 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-polygon.pngbin0 -> 1866 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-polyline.pngbin0 -> 816 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-quadricbeziercurve.pngbin0 -> 837 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-rectangle.pngbin0 -> 1189 bytes
-rw-r--r--kpresenter/toolbar/cr48-action-slide_effect.pngbin0 -> 3328 bytes
575 files changed, 95990 insertions, 0 deletions
diff --git a/kpresenter/AUTHORS b/kpresenter/AUTHORS
new file mode 100644
index 000000000..f7e6b75d7
--- /dev/null
+++ b/kpresenter/AUTHORS
@@ -0,0 +1,9 @@
+Laurent Montel (official maintainer)
+Werner Trobin
+David Faure
+Toshitaka Fujioka
+Lukáš Tinkl
+Thorsten Zachmann
+Ariya Hidayat
+Percy Leonhardt
+Thomas Zander
diff --git a/kpresenter/CHANGES b/kpresenter/CHANGES
new file mode 100644
index 000000000..651081cf6
--- /dev/null
+++ b/kpresenter/CHANGES
@@ -0,0 +1,282 @@
+Changes after KPresenter 1.4
+============================
+Fixes:
+- Fixed Bug 47825 object appeared on the wrong page after save/open in kpr format
+- Fixed Bug 118825: Property altering actions are not enabled correctly
+
+Changes:
+- Added auto guidelines
+- Now we can or not display object from master page
+- Draw objects of the master slide behind the objects of the current slide.
+
+Changes after KPresenter 1.3
+============================
+Fixes:
+- Fixed undo of delete and group command
+- Fixed possible crash in presentation mode if not all slides are shown
+- Fixed take tmp objects for redrawing in effect from the correct page
+- Fixed show the duration for the correct page if not all slides are shown
+- Fixed crash in infinite loop presentation mode when first slide is not shown
+- Fixed redrawing of lines in drawing mode in case of a repaint event
+- Fixed aligning of rotated lines and line with pen.width() > 1
+- Fixed that the width/height of an rotated object could be negative
+- Fixed copy and paste when one pic is in the copied objects
+- Fixed crash in history of group/ungroup commands
+- Ignore sticky objects when duplicating a page
+- Fixed Object Effects are not correctly done (#64384)
+- Fixed drawing of rect with round corners when zoomed and gradient filling
+- Fixed no alpha channel set on mirrored pictures
+- Fixed objects placed on wrong page after saving and loading in kpr file format
+- Fixed picture not updated when only depth is changed
+- Fixed saving of document type for webpresentations
+
+Changes:
+- Flip now works as in Gimp. Horizontal flip flips on y-axis
+ vertical filp on x-axis
+- Group objects: The grouped object is now in the z-order of the upperst
+ object grouped and no longer on the top.
+- Ungroup object: The objects are now in the z-order where the group object
+ was and no longer on top.
+- If a page is shown more than once during a presentation add the time for
+ the duration instead of showing only the last duration.
+- Use kspell2
+- Now PresSpeed is into each page
+- Now PageUp/PageDown during presentation go to beginning of the next/previous slide
+- Each object effect can have it's own speed now
+- Copy between kword/kpresenter
+- Now we can configure header/footer by page
+- Configure Custom Slide Show
+- Add statistic variable
+
+Changes after KPresenter 1.3 RC1
+================================
+- during a presentation variables on the sticky page were not updated (#67515)
+
+
+Changes after KPresenter 1.3 beta 4
+===================================
+Fixes:
+- Fixed When resizing a frame it does not snap to the grid (#63032)
+- Fixed after resize/undo size of object is not the same
+- Fixed after move/undo position of object is not the same
+- Fixed resizing of poly line objects
+- Fixed after reload of some objects moved up a little bit
+- Fixed moving with key left used y grid
+- Fixed header/footer moved in undo
+
+Changes after KPresenter 1.3 beta 3
+===================================
+Fixes:
+- Fixed cursor not blinking in some cases
+- Fixed "blinking cursor erases formatting characters" bug
+- "Adjust object to contents" works as intended now
+- Purpose of the 'Notebar' is unknown (#63037)
+- kpresenter crashed when I tried to insert the variable
+ "section title" (#61735)
+- large footer from kpresenter 1.2.1 will crash kpresenter
+ (#61449)
+- embedded spreadsheet (table button) appears at wrong size
+ (#58498)
+- embedded kspread object displayed with wrong size (#33233)
+- KPresenter hangs when inserted text wraps to newline
+ (#56946)
+- layer lowering is incorrect (#53277)
+- resize handles deceptive when zoomed out (#61602)
+- fixed painting garbage at a side of the screen in the presentation mode (on
+ weird DPIs)
+
+Changes after KPresenter 1.3 beta 2
+===================================
+Fixes:
+- KPR 'forgets' solid line attribute of text frames (#61343)
+- fix pasting text objects screwing UTF-8 text
+- snap to Grid function aligns relatively, not absolutely (#56181)
+- when cutting&pasting a vertically centred text frame,
+ the vertical position changes (#61330)
+
+Changes:
+- grid, snap to grid are on now by default, with a finer step of 5mm
+ (#60011 and #60013)
+
+Changes after KPresenter 1.3 beta 1
+===================================
+Fixes:
+- fixed loading of old documents with invalid paragraph indents
+- paste image gives tiny initial object (#59058)
+- setting the font size in the toolbar doesn't work (#39786)
+- objects disappears on the rightside of a dinA0 presentation (#37370)
+- large unwanted offset in print preview and printing (#56123)
+
+New features:
+- flip groups horizontally/vertically (#45561)
+
+
+Changes after KPresenter 1.2
+============================
+- Add "add to bookmark" feature
+- Add font properties : change relative font size when we sub/super script font
+- Add support to add offset from baseline
+- Now koinsertlink use 'recent document'
+- Add support to insert cursor directly
+- Add autocorrection : "Capitalize name of days"
+- Added support for global language
+- Use new kospell API
+- Added support for naming objects
+- Added flipping support for most objects (not yet for text autoform and kpart)
+
+Visual stuff:
+- objects use "forbidden" cursor when they're protected (new)
+- display an "End of presentation"-slide at end of presentation; configurable
+ (new)
+- transition effect dialog with preview (new)
+
+Text boxes:
+- can spellcheck in selection only (new)
+- shadow is a text property now (bugfix)
+- link manipulation (add/copy/remove) (new)
+- access to spellcheck result via context menu
+- text formats now include language information (new)
+- new line spacing types: at least / exactly / multiple of (new)
+- new font attributes: small caps, uppercase, lowercase (new)
+- new underline and strikethru type: word by word
+
+Images:
+- properly draw images with alpha channels (bugfix)
+- better loading of background pictures; especially for remote files (new)
+
+Variables:
+- created/modified/printed document date (bug #24242)
+- added time/date variable offset (new)
+- added new variables: Next page number, Previous page number (new)
+
+Configurability:
+- whether and where to create backup files (new)
+- path to pictures (new)
+- personal dictionary (new)
+- list of ignored words when spellchecking (new)
+- go with a per-slide default when inserting a new one (wish #22629)
+- printing of slide notes (wish #56120)
+
+Misc:
+- web presentation: better HTML generation, usability improvement of the wizard (new)
+- copy/paste image/embedded objects between different instances (bugfix)
+- comment text can be copied now (bugfix)
+- undo/redo shows history of commands (new)
+
+
+Changes between KPresenter-1.2-RC1 and KPresenter-1.2
+=====================================================
+Bugfixes:
+- Fix undo/redo move object.
+- Fix #45966 kpresenter refuses to update image with same name
+- Fix #45991: problems w.r.t. font color and bullets
+- Fix mouse move event + vertical alignment
+- Fix resize to height : Don't create command when it's not necessary.
+- Fix availableHeight + vertical alignment
+- Fix save variable.
+- Fix recalc page number + sticky object
+- Fix draw gradient + rectangle object
+- Fix presentation mode : Don't draw grid and helpline in this mode
+- Fix update ruler tabs when we switch between two text object
+- Fix move up/down style
+- Fix restore style shortcut when we remove/rename/add style
+
+
+Changes between KPresenter-1.2-beta2 and KPresenter-1.2-RC1
+===========================================================
+New:
+- Like all of KOffice: a readonly GUI for embedding into Konqueror
+- More DCOP calls
+
+Bugfixes:
+- Fix resize text object
+- Fix webpresentation => display real variable value
+- Fix autocorrection (crash/change language etc...)
+- Fix update sidebar
+- Fix key event when text object is protect content.
+- Fix group object : allow to change text object attribute, fix load close object etc...
+- Width and height spin boxes in the style dialog are now coupled when
+ keep aspect ratio is in effect.
+- Fix unselect object : use right button + shift
+- Fixed rounded rectangle + gradient
+- Fixed saving shadowed objects (when only their color differed from
+ the defaults)
+- Restored a lot of backwards compatibility (formatting, bullets, numbers,
+ whitespace handling etc.)
+- Speedup in displaying of the pixmap objects
+- Fixed the drawing of the background (no gradient when background is
+ an image or a clipart)
+
+Crashes:
+- Fixed crash when we close kword and "special char dialogbox" is not closed
+- Fixed several memory leaks
+- Fixed crash when we cancel insert time/date variable.
+- Fixed crash when we duplicate page and there was an embedded document.
+- Fixed crash when we split view and we try to open menu when factory() is null
+- Fixed crash when we didn't select a slide and try to launch presentation
+
+
+KPresenter 1.2beta1 -> 1.2 beta 2
+---------------------------------
+- Add support for flip polyline object
+- Add support for "protect size and postion"
+- When we create a line object and we press shift we draw horizontal/vertical
+- Added support for dnd between text objects
+- Added support for keeping ratio of objects
+- Added dialog for duplicatiing objects
+- Add "Apply AutoFormat"
+- Add new type of begin/end line (line arrow, Dimension line... )
+- Add support for find/replace with format
+- Now we can create directly a style from a selection
+- Add support for protect content of text object
+- Now we can close polyline object
+- Fix save/load variable
+- Use tripleState in styledia
+- Removed settings-toolbar and corresponding menu-entries
+- Added tab to properties-dialog according to selected object
+- Moved default-settings for rectangles, pies and polygons to
+ 'Settings' -> 'Configure KPresenter'
+- Now we can change grid color
+- Add option to "Snap to grid"
+- Add support for text object margins
+- Improve font style
+- New transition effects: Strips
+- Add support for vertical alignment
+- Now we can change tab stop value
+- Now we can save picture from file to disk
+- Add Closed Line Object (freehand, polyline, quadric bezier curve, cubic bezier curve)
+- Add New Cursor for rotate tool and freehand tool
+- Merged actions for lines, shapes and arrangement of objects into
+ an appropriate drop-down menu
+- Add support for autocorrect with format
+- Add option "Allow cursor in text object protected content"
+- Add import text style support
+- Add save page background image on disk
+- Add display field code (for variable)
+- We can change autoformat language
+
+
+Changes after KPresenter 1.1
+============================
+- Port to kotext
+- New effect : kpresenter can play sounds
+- Thumbnail mode for the sidebar
+- Add notebar
+- Add a real statusbar
+- Add New Tool : freehand, polyline, quadric bezier curve, cubic bezier curve, convex/concave polygon
+- Add zoom support
+- Improve undo/redo (now we can undo/redo "insert new page"/"delete page"/"paste page"/"Duplicate page")
+- Now kpresenter has real page
+- Limit position/size object to page
+- spell checking/search/find works on all page
+- Add "Show Presentation Duration"
+- Add dcop interface : now we can insert text, change text format, etc...
+- Add support for style
+- Add support for background spell checking
+- Add support for manual completion (use CTRL + E )
+- Add Help line
+- New transition effect: Blinds, Box In/Out, Checkboard, Cover, Uncover, Dissolve, Random,...
+- Add grid support
+- Add Help Point
+- Add support to change zoom with mouse (zoom selected area)
+- Add Configure Picture Dialog
diff --git a/kpresenter/KPrAboutData.h b/kpresenter/KPrAboutData.h
new file mode 100644
index 000000000..c576b9d57
--- /dev/null
+++ b/kpresenter/KPrAboutData.h
@@ -0,0 +1,49 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRESENTER_ABOUTDATA
+#define KPRESENTER_ABOUTDATA
+
+#include <kaboutdata.h>
+#include <klocale.h>
+#include <kofficeversion.h>
+
+static const char* description=I18N_NOOP("KOffice Presentation Tool");
+static const char* version=KOFFICE_VERSION_STRING;
+
+KAboutData * newKPresenterAboutData()
+{
+ KAboutData * aboutData=new KAboutData( "kpresenter", I18N_NOOP("KPresenter"),
+ version, description, KAboutData::License_LGPL,
+ I18N_NOOP("(c) 1998-2006, The KPresenter Team"), 0,
+ "http://www.koffice.org/kpresenter/");
+ aboutData->addAuthor("Laurent Montel", I18N_NOOP("current maintainer"), "montel@kde.org");
+ aboutData->addAuthor("Werner Trobin", 0, "trobin@kde.org");
+ aboutData->addAuthor("David Faure", 0, "faure@kde.org");
+ aboutData->addAuthor("Toshitaka Fujioka", 0, "fujioka@kde.org");
+ aboutData->addAuthor("Lukáš Tinkl", 0, "lukas@kde.org");
+ aboutData->addAuthor("Thorsten Zachmann", 0, "t.zachmann@zagge.de");
+ aboutData->addAuthor("Ariya Hidayat", 0, "ariya@kde.org");
+ aboutData->addAuthor("Percy Leonhardt", 0, "percy@eris23.de");
+ aboutData->addAuthor("Thomas Zander", 0, "");
+ aboutData->addAuthor("Reginald Stadlbauer",I18N_NOOP("original author"), "reggie@kde.org");
+ return aboutData;
+}
+
+#endif
diff --git a/kpresenter/KPrAutoFormObjectIface.cpp b/kpresenter/KPrAutoFormObjectIface.cpp
new file mode 100644
index 000000000..ee9500b04
--- /dev/null
+++ b/kpresenter/KPrAutoFormObjectIface.cpp
@@ -0,0 +1,54 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrAutoFormObjectIface.h"
+#include "KPrAutoformObject.h"
+#include "KPrUtils.h"
+#include "KPrObject.h"
+#include <kdebug.h>
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrAutoFormObjectIface::KPrAutoFormObjectIface( KPrAutoformObject *_obj )
+ : KPrObject2DIface(_obj)
+{
+ obj = _obj;
+}
+
+QString KPrAutoFormObjectIface::fileName() const
+{
+ return obj->getFileName();
+}
+
+void KPrAutoFormObjectIface::setFileName( const QString &_filename )
+{
+ obj->setFileName(_filename);
+}
+
+void KPrAutoFormObjectIface::setLineBegin( const QString & type)
+{
+ obj->setLineBegin(lineEndBeginFromString( type ));
+}
+
+void KPrAutoFormObjectIface::setLineEnd( const QString & type)
+{
+ obj->setLineEnd(lineEndBeginFromString( type ));
+}
diff --git a/kpresenter/KPrAutoFormObjectIface.h b/kpresenter/KPrAutoFormObjectIface.h
new file mode 100644
index 000000000..685b0c5fa
--- /dev/null
+++ b/kpresenter/KPrAutoFormObjectIface.h
@@ -0,0 +1,48 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPAUTOFORM_OBJECT_IFACE_H
+#define KPAUTOFORM_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObject2DIface.h"
+#include <qstring.h>
+
+class KPrAutoformObject;
+
+class KPrAutoFormObjectIface : public KPrObject2DIface
+{
+ K_DCOP
+public:
+ KPrAutoFormObjectIface( KPrAutoformObject *obj_ );
+
+k_dcop:
+ QString fileName() const;
+ void setFileName( const QString &_filename );
+
+ virtual void setLineBegin( const QString & );
+ virtual void setLineEnd( const QString & );
+
+private:
+ KPrAutoformObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrAutoformObject.cpp b/kpresenter/KPrAutoformObject.cpp
new file mode 100644
index 000000000..c5d7028d6
--- /dev/null
+++ b/kpresenter/KPrAutoformObject.cpp
@@ -0,0 +1,378 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrAutoformObject.h"
+#include "KPrAutoFormObjectIface.h"
+#include "KPrUtils.h"
+#include "KPrGradient.h"
+
+#include <qbitmap.h>
+#include <qpointarray.h>
+#include <qptrlist.h>
+#include <qregion.h>
+#include <qdom.h>
+#include <qpainter.h>
+#include <qwmatrix.h>
+#include <kstandarddirs.h>
+#include <kdebug.h>
+#include <KoTextZoomHandler.h>
+#include <math.h>
+using namespace std;
+
+KPrAutoformObject::KPrAutoformObject()
+: KPr2DObject()
+, KPrStartEndLine( L_NORMAL, L_NORMAL )
+, atfInterp()
+{
+}
+
+KPrAutoformObject::KPrAutoformObject( const KoPen & _pen, const QBrush &_brush, const QString & _filename,
+ LineEnd _lineBegin, LineEnd _lineEnd,
+ FillType _fillType, const QColor &_gColor1,
+ const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor)
+: KPr2DObject( _pen, _brush, _fillType, _gColor1, _gColor2, _gType, _unbalanced, _xfactor, _yfactor )
+, KPrStartEndLine( _lineBegin, _lineEnd )
+, filename( _filename ), atfInterp()
+{
+ atfInterp.load( filename );
+}
+
+KPrAutoformObject &KPrAutoformObject::operator=( const KPrAutoformObject & )
+{
+ return *this;
+}
+
+DCOPObject* KPrAutoformObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrAutoFormObjectIface( this );
+ return dcop;
+}
+
+void KPrAutoformObject::setFileName( const QString & _filename )
+{
+ filename = _filename;
+ atfInterp.load( filename );
+}
+
+
+bool KPrAutoformObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ kdDebug(33001) << "bool KPrAutoformObject::saveOasisObjectAttributes()" << endl;
+ QSize size( int( ext.width() * 100 ), int( ext.height() * 100 ) );
+
+ sc.xmlWriter.addAttribute( "svg:viewBox", QString( "0 0 %1 %2" ).arg( size.width() )
+ .arg( size.height() ) );
+
+ QPointArray points = const_cast<ATFInterpreter &>( atfInterp ).getPointArray( size.width(), size.height() );
+
+ unsigned int pointCount = points.size();
+ unsigned int pos = 0;
+ bool closed = points.at( 0 ) == points.at( pointCount - 1 );
+
+ if ( closed )
+ --pointCount;
+
+ QString d;
+ d += QString( "M%1 %2" ).arg( points.at(pos).x() )
+ .arg( points.at(pos).y() );
+ ++pos;
+
+ while ( pos < pointCount )
+ {
+ d += QString( "L%1 %2" ).arg( points.at( pos ).x() )
+ .arg( points.at( pos ).y() );
+ ++pos;
+ }
+
+ if ( closed )
+ d += "Z";
+
+ sc.xmlWriter.addAttribute( "svg:d", d );
+
+ return true;
+}
+
+void KPrAutoformObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const
+{
+ kdDebug(33001) << "KPr2DObject::fillStyle" << endl;
+ KPrShadowObject::fillStyle( styleObjectAuto, mainStyles );
+
+ QPointArray points = const_cast<ATFInterpreter &>( atfInterp ).getPointArray( int( ext.width() * 100 ),
+ int( ext.height() * 100 ) );
+
+ // if it is a closed object save the background
+ if ( points.at( 0 ) == points.at( points.size() - 1 ) )
+ {
+ m_brush.saveOasisFillStyle( styleObjectAuto, mainStyles );
+ }
+ else
+ {
+ saveOasisMarkerElement( mainStyles, styleObjectAuto );
+ }
+}
+
+const char * KPrAutoformObject::getOasisElementName() const
+{
+ return "draw:path";
+}
+
+QDomDocumentFragment KPrAutoformObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment=KPr2DObject::save(doc, offset);
+ KPrStartEndLine::save( fragment, doc );
+
+ // The filename contains the absolute path to the autoform. This is
+ // bad, so we simply remove everything but the last dir and the name.
+ // e.g. /my/local/path/to/kpresenter/Arrow/.source/Arrow1.atf -> Arrow/.source/Arrow1.atf
+ QStringList afDirs = KPrFactory::global()->dirs()->resourceDirs("autoforms");
+ QValueList<QString>::ConstIterator it=afDirs.begin();
+ QString str;
+ for( ; it!=afDirs.end(); ++it) {
+ if(filename.startsWith(*it)) {
+ str=filename.mid((*it).length());
+ break;
+ }
+ }
+ QDomElement elem=doc.createElement("FILENAME");
+ elem.setAttribute("value", str);
+ fragment.appendChild(elem);
+ return fragment;
+}
+
+double KPrAutoformObject::load(const QDomElement &element)
+{
+ double offset=KPr2DObject::load(element);
+ KPrStartEndLine::load( element );
+ QDomElement e=element.namedItem("FILENAME").toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute("value"))
+ filename=e.attribute("value");
+ // don't crash on invalid files, better insert something
+ if(filename.isEmpty())
+ filename="Connections/.source/Connection1.atf";
+ // workaround for a bug in the (very) old file format
+ if(filename[0]=='/') {
+ kdDebug(33001) << "rubbish ahead! cleaning up..." << endl;
+ // remove the leading absolute path (i.e. to create Arrow/Arrow1.atf)
+ filename=filename.mid(filename.findRev('/', filename.findRev('/')-1)+1);
+ }
+ // okay... we changed the file format again and now the autoforms
+ // are stored in .../kpresenter/autoforms/.source/foo.atf (note: we didn't have .source
+ // before. Therefore we have to add this dir if it's not already there to make it
+ // work with old files
+ if(filename.find(".source")==-1) {
+ // okay, old file -- add the .source dir
+ filename=filename.insert(filename.find('/'), "/.source");
+ }
+ filename = locate("autoforms", filename, KPrFactory::global());
+ atfInterp.load( filename );
+ }
+ return offset;
+}
+
+void KPrAutoformObject::paint( QPainter* _painter, KoTextZoomHandler *_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour )
+{
+ unsigned int pw = 0, pwOrig = 0, px, py;
+ QPen pen2;
+ QSize size( _zoomHandler->zoomSize( ext ) );
+
+ if ( drawContour )
+ pen2 = QPen( Qt::black, 1, Qt::DotLine );
+ else {
+ pen2 = pen.zoomedPen( _zoomHandler );
+ }
+
+ _painter->setPen( pen2 );
+ pwOrig = ( pen2.style() == Qt::NoPen ) ? 1 : pen2.width();
+ if ( !drawContour )
+ _painter->setBrush( getBrush() );
+
+ QPointArray pntArray = atfInterp.getPointArray( _zoomHandler->zoomItX( ext.width()),
+ _zoomHandler->zoomItY( ext.height() ) );
+ QPtrList<ATFInterpreter::AttribList> atrLs = atfInterp.getAttribList();
+ QPointArray pntArray2( pntArray.size() );
+ int ex = _zoomHandler->zoomItX(ext.width());
+ int ey = _zoomHandler->zoomItY(ext.height());
+ for ( unsigned int i = 0; i < pntArray.size(); i++ )
+ {
+ px = pntArray.at( i ).x();
+ py = pntArray.at( i ).y();
+ if ( atrLs.at( i )->pwDiv > 0 )
+ {
+ pw = pwOrig / atrLs.at( i )->pwDiv;
+ px = (int)((double)(ex - pw) / (double)ex * px + pw / 2);
+ py = (int)((double)(ey - pw) / (double)ey * py + pw / 2);
+ }
+ pntArray2.setPoint( i, px, py );
+ }
+
+ if ( pntArray2.size() > 0 )
+ {
+ if ( pntArray2.at( 0 ) == pntArray2.at( pntArray2.size() - 1 ) )
+ {
+ if ( drawContour || (drawingShadow || getFillType() == FT_BRUSH || !gradient) )
+ _painter->drawPolygon( pntArray2 );
+ else
+ {
+ if ( angle == 0 || angle==360 )
+ {
+ //int ox = _painter->viewport().x() + static_cast<int>( _painter->worldMatrix().dx() );
+ //int oy = _painter->viewport().y() + static_cast<int>( _painter->worldMatrix().dy() );
+
+ QPointArray pntArray3 = pntArray2.copy();
+ _painter->save();
+
+ QRegion clipregion( pntArray3 );
+
+ // Intersect with current clipregion (whereas setupClipRegion unites)
+ if ( _painter->hasClipping() )
+ clipregion = _painter->clipRegion(QPainter::CoordPainter).intersect( clipregion );
+
+ _painter->setClipRegion( clipregion, QPainter::CoordPainter );
+
+ gradient->setSize( size );
+ _painter->drawPixmap( 0, 0, gradient->pixmap() );
+
+ _painter->restore();
+ }
+ else
+ {
+ if ( m_redrawGradientPix || gradient->size() != size )
+ {
+ kdDebug(33001) << "KPrAutoformObject::draw redrawPix" << endl;
+ gradient->setSize( size );
+ m_redrawGradientPix = false;
+ QRegion clipregion( pntArray2 );
+ m_gradientPix.resize ( _zoomHandler->zoomItX(ext.width()),_zoomHandler->zoomItY(ext.height()) );
+ m_gradientPix.fill( Qt::white );
+
+
+ QPainter p;
+ p.begin( &m_gradientPix );
+ p.setClipRegion( clipregion , QPainter::CoordPainter);
+ p.drawPixmap( 0, 0, gradient->pixmap() );
+ p.end();
+
+ m_gradientPix.setMask( m_gradientPix.createHeuristicMask() );
+ }
+
+ _painter->drawPixmap( 0, 0, m_gradientPix );
+ }
+
+ _painter->setPen( pen2 );
+ _painter->setBrush( Qt::NoBrush );
+ _painter->drawPolygon( pntArray2 );
+ }
+ }
+ else
+ {
+ KoSize diff1( 0, 0 ), diff2( 0, 0 );
+ int _w = int( pen.pointWidth() );
+
+ if ( lineBegin != L_NORMAL )
+ diff1 = getBoundingSize( lineBegin, _w, _zoomHandler );
+
+ if ( lineEnd != L_NORMAL )
+ diff2 = getBoundingSize( lineEnd, _w, _zoomHandler );
+
+ if ( pntArray.size() > 1 )
+ {
+ if ( lineBegin != L_NORMAL && !drawContour )
+ {
+ QPoint pnt1( pntArray2.at( 0 ) ), pnt2( pntArray2.at( 1 ) );
+ QPoint pnt3, pnt4( pntArray.at( 0 ) );
+ float _angle = KoPoint::getAngle( KoPoint( pnt1 ), KoPoint( pnt2 ) );
+
+ switch ( static_cast<int>( _angle ) )
+ {
+ case 0:
+ {
+ pnt3.setX( pnt4.x() - (int)diff1.width() / 2 );
+ pnt3.setY( pnt1.y() );
+ } break;
+ case 180:
+ {
+ pnt3.setX( pnt4.x() + (int)diff1.width() / 2 );
+ pnt3.setY( pnt1.y() );
+ } break;
+ case 90:
+ {
+ pnt3.setX( pnt1.x() );
+ pnt3.setY( pnt4.y() - (int)diff1.width() / 2 );
+ } break;
+ case 270:
+ {
+ pnt3.setX( pnt1.x() );
+ pnt3.setY( pnt4.y() + (int)diff1.width() / 2 );
+ } break;
+ default:
+ pnt3 = pnt1;
+ break;
+ }
+
+ drawFigure( lineBegin, _painter, _zoomHandler->unzoomPoint( pnt3 ), pen2.color(), _w, _angle, _zoomHandler );
+ }
+
+ if ( lineEnd != L_NORMAL && !drawContour )
+ {
+ QPoint pnt1( pntArray2.at( pntArray2.size() - 1 ) ), pnt2( pntArray2.at( pntArray2.size() - 2 ) );
+ QPoint pnt3, pnt4( pntArray.at( pntArray.size() - 1 ) );
+ float _angle = KoPoint::getAngle( KoPoint( pnt1 ), KoPoint( pnt2 ) );
+
+ switch ( ( int )_angle )
+ {
+ case 0:
+ {
+ pnt3.setX( pnt4.x() - (int)diff2.width() / 2 );
+ pnt3.setY( pnt1.y() );
+ } break;
+ case 180:
+ {
+ pnt3.setX( pnt4.x() + (int)diff2.width() / 2 );
+ pnt3.setY( pnt1.y() );
+ } break;
+ case 90:
+ {
+ pnt3.setX( pnt1.x() );
+ pnt3.setY( pnt4.y() - (int)diff2.width() / 2 );
+ } break;
+ case 270:
+ {
+ pnt3.setX( pnt1.x() );
+ pnt3.setY( pnt4.y() + (int)diff2.width() / 2 );
+ } break;
+ default:
+ pnt3 = pnt1;
+ break;
+ }
+
+ drawFigure( lineEnd, _painter, _zoomHandler->unzoomPoint( pnt3 ), pen2.color(), _w, _angle,_zoomHandler );
+ }
+ }
+
+ _painter->setPen( pen2 );
+ _painter->drawPolyline( pntArray2 );
+ }
+ }
+}
diff --git a/kpresenter/KPrAutoformObject.h b/kpresenter/KPrAutoformObject.h
new file mode 100644
index 000000000..9963769d9
--- /dev/null
+++ b/kpresenter/KPrAutoformObject.h
@@ -0,0 +1,82 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpautoformobject_h
+#define kpautoformobject_h
+
+#include <qpixmap.h>
+#include <KoBrush.h>
+
+#include "KPrObject.h"
+#include "global.h"
+#include "autoformEdit/ATFInterpreter.h"
+
+class KPrGradient;
+class DCOPObject;
+
+class KPrAutoformObject : public KPr2DObject, public KPrStartEndLine
+{
+public:
+ KPrAutoformObject();
+ KPrAutoformObject( const KoPen & _pen, const QBrush &_brush, const QString &_filename, LineEnd _lineBegin, LineEnd _lineEnd,
+ FillType _fillType, const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor);
+ virtual ~KPrAutoformObject() {}
+
+ KPrAutoformObject &operator=( const KPrAutoformObject & );
+
+ virtual DCOPObject* dcopObject();
+
+ virtual void setFileName( const QString &_filename );
+ virtual void setLineBegin( LineEnd _lineBegin )
+ { lineBegin = _lineBegin; }
+ virtual void setLineEnd( LineEnd _lineEnd )
+ { lineEnd = _lineEnd; }
+
+ virtual ObjType getType() const
+ { return OT_AUTOFORM; }
+ virtual QString getTypeString() const
+ { return i18n("Autoform"); }
+
+ QString getFileName() const
+ { return filename; }
+ virtual LineEnd getLineBegin() const
+ { return lineBegin; }
+ virtual LineEnd getLineEnd() const
+ { return lineEnd; }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc,double offset );
+
+ virtual double load(const QDomElement &element);
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+ virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
+
+ virtual void paint( QPainter *_painter, KoTextZoomHandler *_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour = FALSE );
+
+ QString filename;
+
+ ATFInterpreter atfInterp;
+};
+
+#endif
diff --git a/kpresenter/KPrBackDia.cpp b/kpresenter/KPrBackDia.cpp
new file mode 100644
index 000000000..ebee42636
--- /dev/null
+++ b/kpresenter/KPrBackDia.cpp
@@ -0,0 +1,420 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <KoPictureFilePreview.h>
+#include "KPrBackDia.h"
+#include "KPrBackground.h"
+#include "KPrDocument.h"
+#include "KPrPage.h"
+
+#include <qlabel.h>
+#include <qpainter.h>
+#include <qcombobox.h>
+#include <qslider.h>
+#include <qlayout.h>
+#include <qtabwidget.h>
+#include <qvbox.h>
+#include <qcheckbox.h>
+#include <qdatetime.h>
+
+#include <kcolorbutton.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kimageio.h>
+#include <kbuttonbox.h>
+#include <kurlrequester.h>
+
+#include <KoPicture.h>
+
+KPrBackPreview::KPrBackPreview( QWidget *parent, KPrPage *page )
+ : QFrame( parent )
+{
+ setFrameStyle( WinPanel | Sunken );
+ back = new KPrBackGround( page );
+ setMinimumSize( 300, 200 );
+}
+
+KPrBackPreview::~KPrBackPreview()
+{
+ delete back;
+}
+
+void KPrBackPreview::drawContents( QPainter *p )
+{
+ QFrame::drawContents( p );
+ p->save();
+ p->translate( contentsRect().x(), contentsRect().y() );
+ back->drawBackground( p, contentsRect().size(), contentsRect(), false );
+ p->restore();
+}
+
+KPrBackDialog::KPrBackDialog( QWidget* parent, const char* name,
+ BackType backType, const QColor &backColor1,
+ const QColor &backColor2, BCType _bcType,
+ const KoPicture &backPic,
+ BackView backPicView, bool _unbalanced,
+ int _xfactor, int _yfactor, KPrPage *_page )
+ : KDialogBase( parent, name, true, "",KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel|
+ KDialogBase::User1|KDialogBase::User2 ),
+ m_useMasterBackground( 0 ), m_picture(backPic),m_oldpicture(backPic), m_page( _page )
+{
+ lockUpdate = true;
+
+ oldUseMasterBackground=m_page->useMasterBackground();
+ oldBackType=backType;
+ oldBackColor1=backColor1;
+ oldBackColor2 = backColor2;
+ oldBcType= _bcType;
+ oldBackPicView=backPicView;
+ oldUnbalanced=_unbalanced;
+ oldXFactor=_xfactor;
+ oldYFactor=_yfactor;
+
+ QWidget *page = new QWidget( this );
+ setMainWidget(page);
+ QVBoxLayout *layout = new QVBoxLayout( page, 0, spacingHint() );
+
+
+ QHBoxLayout *hbox = new QHBoxLayout( layout );
+ hbox->setSpacing( KDialog::spacingHint() );
+ QVBoxLayout *vbox = new QVBoxLayout( hbox );
+ vbox->setSpacing( KDialog::spacingHint() );
+
+ if ( !m_page->isMasterPage() )
+ {
+ m_useMasterBackground = new QCheckBox( i18n( "Use slide master background" ), page );
+ connect( m_useMasterBackground, SIGNAL( clicked() ),
+ this, SLOT( updateConfiguration() ) );
+ m_useMasterBackground->setChecked( m_page->useMasterBackground() );
+ vbox->addWidget( m_useMasterBackground );
+ }
+ vbox->addWidget( new QLabel( i18n( "Background type:" ), page ) );
+
+ backCombo = new QComboBox( false, page );
+ backCombo->insertItem( i18n( "Color/Gradient" ) );
+ backCombo->insertItem( i18n( "Picture" ) );
+ backCombo->setCurrentItem( (int)backType );
+ connect( backCombo, SIGNAL( activated( int ) ),
+ this, SLOT( changeComboText(int) ) );
+
+ vbox->addWidget( backCombo );
+
+ tabWidget = new QTabWidget( page );
+ vbox->addWidget( tabWidget );
+
+ // color/gradient tab ---------------
+
+ QVBox *colorTab = new QVBox( tabWidget );
+ colorTab->setSpacing( KDialog::spacingHint() );
+ colorTab->setMargin( 5 );
+
+ cType = new QComboBox( false, colorTab );
+ cType->insertItem( i18n( "Plain" ) );
+ cType->insertItem( i18n( "Vertical Gradient" ) );
+ cType->insertItem( i18n( "Horizontal Gradient" ) );
+ cType->insertItem( i18n( "Diagonal Gradient 1" ) );
+ cType->insertItem( i18n( "Diagonal Gradient 2" ) );
+ cType->insertItem( i18n( "Circle Gradient" ) );
+ cType->insertItem( i18n( "Rectangle Gradient" ) );
+ cType->insertItem( i18n( "PipeCross Gradient" ) );
+ cType->insertItem( i18n( "Pyramid Gradient" ) );
+ cType->setCurrentItem( _bcType );
+ connect( cType, SIGNAL( activated( int ) ),
+ this, SLOT( updateConfiguration() ) );
+
+ color1Choose = new KColorButton( backColor1, colorTab );
+ connect( color1Choose, SIGNAL( changed( const QColor& ) ),
+ this, SLOT( updateConfiguration() ) );
+
+ color2Choose = new KColorButton( backColor2, colorTab );
+ connect( color2Choose, SIGNAL( changed( const QColor& ) ),
+ this, SLOT( updateConfiguration() ) );
+
+ unbalanced = new QCheckBox( i18n( "Unbalanced" ), colorTab );
+ connect( unbalanced, SIGNAL( clicked() ),
+ this, SLOT( updateConfiguration() ) );
+ unbalanced->setChecked( _unbalanced );
+
+ labXFactor =new QLabel( i18n( "X-factor:" ), colorTab );
+
+ xfactor = new QSlider( -200, 200, 1, 100, QSlider::Horizontal, colorTab );
+ connect( xfactor, SIGNAL( valueChanged( int ) ),
+ this, SLOT( updateConfiguration() ) );
+ xfactor->setValue( _xfactor );
+
+ labYFactor=new QLabel( i18n( "Y-factor:" ), colorTab );
+
+ yfactor = new QSlider( -200, 200, 1, 100, QSlider::Horizontal, colorTab );
+ connect( yfactor, SIGNAL( valueChanged( int ) ),
+ this, SLOT( updateConfiguration() ) );
+ yfactor->setValue( _yfactor );
+
+ tabWidget->addTab( colorTab, i18n( "Color/Gradient" ) );
+
+ // picture tab ---------------------
+
+ QVBox *picTab = new QVBox( tabWidget );
+ picTab->setSpacing( KDialog::spacingHint() );
+ picTab->setMargin( 5 );
+
+ QLabel *l = new QLabel( i18n( "View mode:" ), picTab );
+ l->setFixedHeight( l->sizeHint().height() );
+
+ picView = new QComboBox( false, picTab );
+ picView->insertItem( i18n( "Scaled" ) );
+ picView->insertItem( i18n( "Centered" ) );
+ picView->insertItem( i18n( "Tiled" ) );
+ picView->setCurrentItem( (int)backPicView );
+ connect( picView, SIGNAL( activated( int ) ),
+ this, SLOT( updateConfiguration() ) );
+
+ picChooseLabel = new QLabel( i18n("&Location:"), picTab );
+ picChooseLabel->setFixedHeight( picChooseLabel->sizeHint().height() );
+
+ picChoose = new KURLRequester( picTab, "picChoose" );
+ picChoose->setFixedHeight( picChoose->sizeHint().height() );
+ picChoose->setMode( KFile::ExistingOnly );
+ connect( picChoose, SIGNAL( openFileDialog( KURLRequester * ) ),
+ SLOT( aboutToSelectPic() ) );
+ connect( picChoose, SIGNAL( urlSelected( const QString & ) ),
+ SLOT( afterSelectPic( const QString & ) ) );
+
+ picChooseLabel->setBuddy( picChoose );
+
+ (void)new QWidget( picTab );
+
+ tabWidget->addTab( picTab, i18n( "Picture" ) );
+
+ // ------------------------ preview
+
+ preview = new KPrBackPreview( page, m_page );
+ hbox->addWidget( preview );
+
+ // ------------------------ buttons
+
+ connect( this, SIGNAL( okClicked() ),
+ this, SLOT( Ok() ) );
+ connect( this, SIGNAL( applyClicked() ),
+ this, SLOT( Apply() ) );
+ connect( this, SIGNAL( user1Clicked() ),
+ this, SLOT( ApplyGlobal() ) );
+
+ connect( this, SIGNAL( user2Clicked() ),
+ this, SLOT( slotReset() ) );
+
+ connect( this, SIGNAL( okClicked() ),
+ this, SLOT( accept() ) );
+ setButtonText(KDialogBase::User1,i18n( "Apply &Global" ));
+ setButtonText(KDialogBase::User2,i18n( "&Reset" ));
+ picChanged = true;
+ lockUpdate = false;
+ updateConfiguration();
+}
+
+void KPrBackDialog::slotReset()
+{
+ if ( m_useMasterBackground )
+ m_useMasterBackground->setChecked( oldUseMasterBackground );
+ backCombo->setCurrentItem( (int)oldBackType );
+ color1Choose->setColor( oldBackColor1 );
+ color2Choose->setColor( oldBackColor2 );
+ cType->setCurrentItem( oldBcType );
+
+ m_picture=m_oldpicture;
+
+ if ( !m_picture.isNull() )
+ picChoose->setURL( m_picture.getKey().filename() );
+ else
+ picChoose->setURL( QString::null );
+
+ picView->setCurrentItem( (int)oldBackPicView );
+ unbalanced->setChecked( oldUnbalanced );
+ xfactor->setValue( oldXFactor );
+ yfactor->setValue( oldYFactor );
+ updateConfiguration();
+}
+
+void KPrBackDialog::changeComboText(int _p)
+{
+ if(_p!=tabWidget->currentPageIndex ())
+ tabWidget->setCurrentPage(_p);
+ updateConfiguration();
+}
+
+void KPrBackDialog::showEvent( QShowEvent *e )
+{
+ QDialog::showEvent( e );
+ lockUpdate = false;
+ updateConfiguration();
+}
+
+void KPrBackDialog::updateConfiguration()
+{
+ if ( lockUpdate )
+ return;
+
+ if ( m_useMasterBackground )
+ {
+ tabWidget->setEnabled( !m_useMasterBackground->isChecked() );
+ backCombo->setEnabled( !m_useMasterBackground->isChecked() );
+ }
+ else
+ {
+ tabWidget->setEnabled( true );
+ backCombo->setEnabled( true );
+ }
+ if ( getBackColorType() == BCT_PLAIN )
+ {
+ unbalanced->setEnabled( false );
+ xfactor->setEnabled( false );
+ yfactor->setEnabled( false );
+ labXFactor->setEnabled(false);
+ labYFactor->setEnabled(false);
+ color2Choose->setEnabled( false );
+ }
+ else
+ {
+ unbalanced->setEnabled( true );
+ if ( unbalanced->isChecked() )
+ {
+ xfactor->setEnabled( true );
+ yfactor->setEnabled( true );
+ labXFactor->setEnabled(true);
+ labYFactor->setEnabled(true);
+ }
+ else
+ {
+ xfactor->setEnabled( false );
+ yfactor->setEnabled( false );
+ labXFactor->setEnabled(false);
+ labYFactor->setEnabled(false);
+ }
+ color2Choose->setEnabled( true );
+ }
+
+ if ( m_useMasterBackground && m_useMasterBackground->isChecked() )
+ {
+ kdDebug(33001) << "set backgound to master" << endl;
+ preview->backGround()->setBackGround( m_page->masterPage()->background()->getBackGround() );
+ preview->repaint( true );
+ }
+ else
+ {
+ picChanged = (getBackType() == BT_PICTURE);
+ preview->backGround()->setBackType( getBackType() );
+ preview->backGround()->setBackView( getBackView() );
+ preview->backGround()->setBackColor1( getBackColor1() );
+ preview->backGround()->setBackColor2( getBackColor2() );
+ preview->backGround()->setBackColorType( getBackColorType() );
+ preview->backGround()->setBackUnbalanced( getBackUnbalanced() );
+ preview->backGround()->setBackXFactor( getBackXFactor() );
+ preview->backGround()->setBackYFactor( getBackYFactor() );
+ if ( !m_picture.isNull() && picChanged )
+ preview->backGround()->setBackPicture( m_picture );
+ preview->backGround()->setBackType( getBackType() );
+ if ( preview->isVisible() && isVisible() ) {
+ preview->backGround()->reload(); // ### TODO: instead of reloading, load or remove the picture correctly.
+ preview->repaint( true );
+ }
+
+ picChanged = false;
+ }
+}
+
+BackType KPrBackDialog::getBackType() const
+{
+ return (BackType)backCombo->currentItem();
+}
+
+BackView KPrBackDialog::getBackView() const
+{
+ return (BackView)picView->currentItem();
+}
+
+QColor KPrBackDialog::getBackColor1() const
+{
+ return color1Choose->color();
+}
+
+QColor KPrBackDialog::getBackColor2() const
+{
+ return color2Choose->color();
+}
+
+BCType KPrBackDialog::getBackColorType() const
+{
+ return (BCType)cType->currentItem();
+}
+
+bool KPrBackDialog::getBackUnbalanced() const
+{
+ return unbalanced->isChecked();
+}
+
+int KPrBackDialog::getBackXFactor() const
+{
+ return xfactor->value();
+}
+
+int KPrBackDialog::getBackYFactor() const
+{
+ return yfactor->value();
+}
+
+KPrBackGround::Settings KPrBackDialog::getBackGround() const
+{
+ return KPrBackGround::Settings( getBackType(), getBackColor1(),
+ getBackColor2(), getBackColorType(),
+ getBackUnbalanced(), getBackXFactor(),
+ getBackYFactor(), getBackPicture().getKey(),
+ getBackView() );
+}
+
+bool KPrBackDialog::useMasterBackground() const
+{
+ return m_useMasterBackground ? m_useMasterBackground->isChecked():false;
+}
+
+void KPrBackDialog::aboutToSelectPic()
+{
+ QStringList mimetypes;
+ mimetypes += KImageIO::mimeTypes( KImageIO::Reading );
+ mimetypes += KoPictureFilePreview::clipartMimeTypes();
+
+ picChoose->fileDialog()->setMimeFilter( mimetypes );
+ picChoose->fileDialog()->setPreviewWidget( new KoPictureFilePreview( picChoose->fileDialog() ) );
+}
+
+void KPrBackDialog::afterSelectPic( const QString &url )
+{
+ KoPicture picture;
+ picture.setKeyAndDownloadPicture(url, tabWidget);
+
+ if ( picture.isNull() )
+ return;
+
+ backCombo->setCurrentItem( 1 );
+ m_picture=picture;
+ picChanged = true;
+ updateConfiguration();
+}
+
+#include "KPrGradient.h"
+#include "KPrBackDia.moc"
diff --git a/kpresenter/KPrBackDia.h b/kpresenter/KPrBackDia.h
new file mode 100644
index 000000000..433edb5ee
--- /dev/null
+++ b/kpresenter/KPrBackDia.h
@@ -0,0 +1,134 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef BACKDIA_H
+#define BACKDIA_H
+
+#include <kdialogbase.h>
+#include <qframe.h>
+#include <qdatetime.h>
+
+#include "global.h"
+#include "KPrBackground.h"
+
+#include <KoBrush.h>
+#include <KoPicture.h>
+
+class QLabel;
+class QComboBox;
+class KColorButton;
+class QSlider;
+class KPrBackGround;
+class QCheckBox;
+class QTabWidget;
+class KPrPage;
+class KURLRequester;
+
+
+class KPrBackPreview : public QFrame
+{
+ Q_OBJECT
+
+public:
+ KPrBackPreview( QWidget *parent, KPrPage *page );
+ virtual ~KPrBackPreview();
+
+ KPrBackGround *backGround() const {
+ return back;
+ }
+
+protected:
+ virtual void drawContents( QPainter *p );
+
+private:
+ KPrBackGround *back;
+
+};
+
+class KPrBackDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KPrBackDialog( QWidget* parent, const char* name,
+ BackType backType, const QColor &backColor1,
+ const QColor &backColor2, BCType _bcType,
+ const KoPicture &backPic,
+ BackView backPicView, bool _unbalanced,
+ int _xfactor, int _yfactor, KPrPage *_page );
+
+ KPrBackGround::Settings getBackGround() const;
+ bool useMasterBackground() const;
+
+protected:
+ void showEvent( QShowEvent *e );
+ QColor getBackColor1() const;
+ QColor getBackColor2() const;
+ BCType getBackColorType() const;
+ BackType getBackType() const;
+ KoPicture getBackPicture() const { return m_picture; }
+ BackView getBackView() const;
+ bool getBackUnbalanced() const;
+ int getBackXFactor() const;
+ int getBackYFactor() const;
+private:
+ QLabel *picPreview;
+ QCheckBox *unbalanced;
+ QComboBox *cType, *backCombo, *picView;
+ QLabel *picChooseLabel;
+ KURLRequester *picChoose;
+ KColorButton *color1Choose, *color2Choose;
+ QSlider *xfactor, *yfactor;
+ KPrBackPreview *preview;
+ bool picChanged, lockUpdate;
+ QLabel *labXFactor, *labYFactor;
+ QTabWidget *tabWidget;
+ QCheckBox *m_useMasterBackground;
+
+ bool oldUseMasterBackground;
+ BackType oldBackType;
+ QColor oldBackColor1;
+ QColor oldBackColor2;
+ BCType oldBcType;
+ BackView oldBackPicView;
+ bool oldUnbalanced;
+ int oldXFactor;
+ int oldYFactor;
+
+ KoPicture m_picture, m_oldpicture;
+ KPrPage *m_page;
+
+private slots:
+ void aboutToSelectPic();
+ void afterSelectPic( const QString & );
+ void updateConfiguration();
+
+ void Ok() { emit backOk( this, false ); }
+ void Apply() { emit backOk( this, false ); }
+ void ApplyGlobal() { emit backOk( this, true ); }
+
+ void changeComboText(int _p);
+ void slotReset();
+
+signals:
+ void backOk( KPrBackDialog*, bool );
+
+};
+#endif //BACKDIA_H
diff --git a/kpresenter/KPrBackground.cpp b/kpresenter/KPrBackground.cpp
new file mode 100644
index 000000000..e8e7586d8
--- /dev/null
+++ b/kpresenter/KPrBackground.cpp
@@ -0,0 +1,653 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2004-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrBackground.h"
+#include "KPrDocument.h"
+#include <kapplication.h>
+#include "KPrGradientCollection.h"
+#include "KPrTextObject.h"
+#include "KPrPage.h"
+#include "KPrUtils.h"
+#include "KPrBrush.h"
+
+#include <qpainter.h>
+#include <qpicture.h>
+#include <qfileinfo.h>
+
+#include <KoRichText.h>
+#include <KoTextObject.h>
+// for getenv ()
+#include <stdlib.h>
+using namespace std;
+#include <kdebug.h>
+#include <kglobalsettings.h>
+#include <KoStore.h>
+#include <KoStoreDevice.h>
+#include <KoGenStyles.h>
+#include <KoXmlNS.h>
+
+KPrBackGround::KPrBackGround( KPrPage *_page )
+ // : footerHeight( 0 )
+{
+ backType = BT_COLOR;
+ backView = BV_CENTER;
+ backColor1 = Qt::white;
+ backColor2 = Qt::white;
+ bcType = BCT_PLAIN;
+ unbalanced = false;
+ xfactor = 100;
+ yfactor = 100;
+
+ gradientPixmap = 0L;
+ m_page=_page;
+}
+
+void KPrBackGround::setBackPicture( const KoPicture& picture )
+{
+ if ( backType != BT_PICTURE )
+ return;
+ backPicture = pictureCollection()->insertPicture(picture);
+}
+
+void KPrBackGround::setBackPicture ( const KoPictureKey& key )
+{
+ if ( backType != BT_PICTURE )
+ return;
+ backPicture = pictureCollection()->findOrLoad(key.filename(), key.lastModified() );
+}
+
+void KPrBackGround::drawBackground( QPainter *_painter, const KoTextZoomHandler* zoomHandler,
+ const QRect& _crect, bool _drawBorders )
+{
+ QRect pageRect = zoomHandler->zoomRect( m_page->getPageRect() );
+ QRect crect = pageRect.intersect( _crect );
+ if ( crect.isEmpty() )
+ return;
+ QSize ext = pageRect.size();
+ drawBackground( _painter, ext, crect, _drawBorders );
+}
+
+void KPrBackGround::drawBackground( QPainter *_painter, const QSize& ext, const QRect& crect, bool _drawBorders )
+{
+ if ( m_page->displayBackground() )
+ {
+ _painter->save();
+ switch ( backType )
+ {
+ case BT_COLOR:
+ drawBackColor( _painter, ext, crect );
+ break;
+ case BT_CLIPART:
+ case BT_PICTURE:
+ {
+ if ( backView == BV_CENTER )
+ drawBackColor( _painter, ext, crect );
+ drawBackPix( _painter, ext, crect );
+ break;
+ }
+ default:
+ break;
+ }
+
+ if ( _drawBorders )
+ drawBorders( _painter, ext, crect );
+
+ _painter->restore();
+ }
+}
+
+void KPrBackGround::reload()
+{
+ if ( backType == BT_PICTURE || backType == BT_CLIPART )
+ backPicture = pictureCollection()->insertPicture(backPicture);
+ else
+ backPicture.clear();
+}
+
+
+QDomElement KPrBackGround::save( QDomDocument &doc )
+{
+ QString tag = m_page->masterPage() == 0 ? "MASTERPAGE" : "PAGE";
+ QDomElement page=doc.createElement( tag );
+ QDomElement element;
+
+ element=doc.createElement("BACKMASTER");
+ element.setAttribute( "useMasterBackground", static_cast<int>(m_page->useMasterBackground() ) );
+ element.setAttribute( "displayMasterPageObject", static_cast<int>( m_page->displayObjectFromMasterPage() ));
+ element.setAttribute( "displayBackground", static_cast<int>( m_page->displayBackground() ));
+ page.appendChild(element);
+ if ( !m_page->useMasterBackground() )
+ {
+
+ if (backType!=BT_COLOR) {
+ element=doc.createElement("BACKTYPE");
+ element.setAttribute("value", static_cast<int>( backType ));
+ page.appendChild(element);
+ }
+
+ if (backView!=BV_CENTER) {
+ element=doc.createElement("BACKVIEW");
+ element.setAttribute("value", static_cast<int>( backView ));
+ page.appendChild(element);
+ }
+
+ if (backColor1!=Qt::white) {
+ element=doc.createElement("BACKCOLOR1");
+ element.setAttribute("color", backColor1.name());
+ page.appendChild(element);
+ }
+
+ if (backColor2!=Qt::white) {
+ element=doc.createElement("BACKCOLOR2");
+ element.setAttribute("color", backColor2.name());
+ page.appendChild(element);
+ }
+
+ if (bcType!=BCT_PLAIN) {
+ element=doc.createElement("BCTYPE");
+ element.setAttribute("value", static_cast<int>( bcType ));
+ page.appendChild(element);
+ }
+
+ if (xfactor!=100 || yfactor!=100 || unbalanced) {
+ element=doc.createElement("BGRADIENT");
+ element.setAttribute("unbalanced", static_cast<int>( unbalanced ));
+ element.setAttribute("xfactor", xfactor);
+ element.setAttribute("yfactor", yfactor);
+ page.appendChild(element);
+ }
+
+ if ( !backPicture.isNull() && ( ( backType == BT_PICTURE ) || ( backType == BT_CLIPART ) ) )
+ {
+ element = doc.createElement( "BACKPICTUREKEY" );
+
+ backPicture.getKey().saveAttributes( element );
+ page.appendChild( element );
+ }
+ }
+
+ return page;
+}
+
+
+void KPrBackGround::saveOasisBackgroundPageStyle( KoGenStyle& stylepageauto, KoGenStyles& mainStyles )
+{
+ switch ( backType )
+ {
+ case BT_COLOR:
+ {
+ QBrush qbrush( backColor1 );
+ KPrBrush brush( qbrush, backColor1, backColor2, bcType,
+ bcType == BCT_PLAIN ? FT_BRUSH : FT_GRADIENT,
+ unbalanced, xfactor, yfactor );
+ brush.saveOasisFillStyle( stylepageauto, mainStyles );
+ } break;
+ case BT_BRUSH:
+ case BT_CLIPART:
+ case BT_PICTURE:
+ {
+ stylepageauto.addProperty("draw:fill", "bitmap" );
+ stylepageauto.addProperty("draw:fill-image-name", saveOasisPictureStyle( mainStyles ) );
+ QString repeat = "repeat";
+ switch ( backView )
+ {
+ case BV_ZOOM:
+ repeat = "stretch";
+ break;
+ case BV_CENTER:
+ repeat = "no-repeat";
+ break;
+ case BV_TILED:
+ repeat = "repeat";
+ break;
+ }
+ stylepageauto.addProperty( "style:repeat", repeat );
+ } break;
+ }
+}
+
+
+QString KPrBackGround::saveOasisPictureStyle( KoGenStyles& mainStyles )
+{
+ //<draw:fill-image draw:name="Pattern" xlink:href="Pictures/100000000000005E0000005E43C87AF2.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
+ KoGenStyle pictureStyle( KPrDocument::STYLE_PICTURE /*no family name*/ );
+ pictureStyle.addAttribute( "xlink:show", "embed" );
+ pictureStyle.addAttribute( "xlink:actuate", "onLoad" );
+ pictureStyle.addAttribute( "xlink:type", "simple" );
+ pictureStyle.addAttribute( "xlink:href", pictureCollection()->getOasisFileName(backPicture ) );
+ return mainStyles.lookup( pictureStyle, "picture" );
+}
+
+
+void KPrBackGround::loadOasis(KoOasisContext & context )
+{
+ KoStyleStack& styleStack = context.styleStack();
+ kdDebug()<<"KPrBackGround::loadOasis()\n";
+ styleStack.setTypeProperties( "drawing-page" );
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "fill" ) )
+ {
+ const QString fill = styleStack.attributeNS( KoXmlNS::draw, "fill" );
+ kdDebug(33001) <<"fill page type :" << fill << endl;
+ if ( fill == "solid" || fill == "gradient" )
+ {
+ KPrBrush brush;
+ brush.loadOasisFillStyle( context, "drawing-page" );
+ if ( brush.getFillType() == FT_BRUSH )
+ {
+ setBackColor1( brush.getBrush().color() );
+ setBackColorType( BCT_PLAIN );
+ }
+ else
+ {
+ setBackColor1( brush.getGColor1() );
+ setBackColor2( brush.getGColor2() );
+ setBackColorType( brush.getGType() );
+ setBackUnbalanced( brush.getGUnbalanced() );
+ setBackXFactor( brush.getGXFactor() );
+ setBackYFactor( brush.getGYFactor() );
+ }
+ setBackType( BT_COLOR );
+ }
+ else if ( fill == "bitmap" )
+ {
+ QString style = styleStack.attributeNS( KoXmlNS::draw, "fill-image-name" );
+ QDomElement* draw =context.oasisStyles().drawStyles()[style];
+
+ const QString href( draw->attributeNS( KoXmlNS::xlink, "href", QString::null) );
+ kdDebug()<<" href: "<<href<<endl;
+ if ( !href.isEmpty() )
+ {
+ QString strExtension;
+ const int result=href.findRev(".");
+ if (result>=0)
+ {
+ strExtension=href.mid(result+1); // As we are using KoPicture, the extension should be without the dot.
+ }
+ QString filename(href);
+ const KoPictureKey key(filename, QDateTime::currentDateTime(Qt::UTC));
+ backPicture.setKey(key);
+
+ KoStore* store = context.store();
+ if ( store->open( filename ) )
+ {
+ KoStoreDevice dev(store);
+ if ( !backPicture.load( &dev, strExtension ) )
+ kdWarning() << "Cannot load picture: " << filename << " " << href << endl;
+ store->close();
+ }
+ pictureCollection()->insertPicture( key, backPicture );
+ }
+
+ if ( styleStack.hasAttributeNS( KoXmlNS::style, "repeat" ) )
+ {
+ QString repeat = styleStack.attributeNS( KoXmlNS::style, "repeat" );
+ if ( repeat == "stretch" )
+ setBackView( BV_ZOOM );
+ else if ( repeat == "no-repeat" )
+ setBackView( BV_CENTER );
+ else
+ setBackView( BV_TILED );
+ }
+ else
+ setBackView( BV_TILED );; // use tiled as default
+
+ setBackType(BT_PICTURE);
+ }
+ }
+}
+
+void KPrBackGround::load( const QDomElement &element )
+{
+ //compatible with old file format kpresenter-1.4
+ QDomElement e=element.namedItem("BACKMASTER").toElement();
+ if ( !e.isNull() )
+ {
+ if ( e.hasAttribute( "useMasterBackground" ) )
+ {
+ m_page->setUseMasterBackground( (bool)e.attribute("useMasterBackground").toInt());
+ }
+ else //for kpresenter-1.4
+ m_page->setUseMasterBackground( true );
+
+ if(e.hasAttribute("displayMasterPageObject"))
+ {
+ m_page->setDisplayObjectFromMasterPage( (bool)e.attribute("displayMasterPageObject").toInt());
+ }
+ if(e.hasAttribute("displayBackground"))
+ {
+ m_page->setDisplayBackground( (bool)e.attribute("displayBackground").toInt());
+ }
+ }
+ else
+ m_page->setUseMasterBackground( false );
+
+ e=element.namedItem("BACKTYPE").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ setBackType(static_cast<BackType>(tmp));
+ }
+ e=element.namedItem("BACKVIEW").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ setBackView(static_cast<BackView>(tmp));
+ }
+ e=element.namedItem("BACKCOLOR1").toElement();
+ if(!e.isNull()) {
+ int red=0, green=0, blue=0;
+ if(e.hasAttribute("red"))
+ red=e.attribute("red").toInt();
+ if(e.hasAttribute("green"))
+ green=e.attribute("green").toInt();
+ if(e.hasAttribute("blue"))
+ blue=e.attribute("blue").toInt();
+ if(e.hasAttribute("color"))
+ setBackColor1(QColor(e.attribute("color")));
+ else
+ setBackColor1(QColor(red, green, blue));
+ }
+ e=element.namedItem("BACKCOLOR2").toElement();
+ if(!e.isNull()) {
+ int red=0, green=0, blue=0;
+ if(e.hasAttribute("red"))
+ red=e.attribute("red").toInt();
+ if(e.hasAttribute("green"))
+ green=e.attribute("green").toInt();
+ if(e.hasAttribute("blue"))
+ blue=e.attribute("blue").toInt();
+ if(e.hasAttribute("color"))
+ setBackColor2(QColor(e.attribute("color")));
+ else
+ setBackColor2(QColor(red, green, blue));
+ }
+ e=element.namedItem("BGRADIENT").toElement();
+ if(!e.isNull()) {
+ int xf=0, yf=0, unbalanced=0;
+ if(e.hasAttribute("xfactor"))
+ xf=e.attribute("xfactor").toInt();
+ setBackXFactor(xf);
+ if(e.hasAttribute("yfactor"))
+ yf=e.attribute("yfactor").toInt();
+ setBackYFactor(yf);
+ if(e.hasAttribute("unbalanced"))
+ unbalanced=e.attribute("unbalanced").toInt();
+ setBackUnbalanced(static_cast<bool>(unbalanced));
+ }
+ e=element.namedItem("BCTYPE").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ setBackColorType(static_cast<BCType>(tmp));
+ }
+ e=element.namedItem("BACKPICTUREKEY").toElement();
+ if(!e.isNull()) {
+ KoPictureKey key;
+ key.loadAttributes( e );
+ backPicture.clear();
+ backPicture.setKey( key );
+ // Image will be set by reload(), called by completeLoading()
+ }
+ e=element.namedItem("BACKPIXKEY").toElement();
+ if(!e.isNull()) {
+ KoPictureKey key;
+ key.loadAttributes( e );
+ backPicture.clear();
+ backPicture.setKey( key );
+ // Image will be set by reload(), called by completeLoading()
+ }
+ else {
+ // try to find a BACKPIX tag if the BACKPIXKEY is not available...
+ KoPictureKey key;
+ e=element.namedItem("BACKPIX").toElement();
+ if(!e.isNull()) {
+ bool openPic = true;
+ QString _data;
+ QString _fileName;
+ if(e.hasAttribute("data"))
+ _data=e.attribute("data");
+ if ( _data.isEmpty() )
+ openPic = true;
+ else
+ openPic = false;
+ if(e.hasAttribute("filename"))
+ _fileName=e.attribute("filename");
+ if ( !_fileName.isEmpty() )
+ {
+ if ( int _envVarB = _fileName.find( '$' ) >= 0 )
+ {
+ int _envVarE = _fileName.find( '/', _envVarB );
+ QString path = getenv( QFile::encodeName(_fileName.mid( _envVarB, _envVarE-_envVarB )) );
+ _fileName.replace( _envVarB-1, _envVarE-_envVarB+1, path );
+ }
+ }
+ if ( openPic )
+ // !! this loads it from the disk (unless it's in the image collection already)
+ backPicture = pictureCollection()->loadPicture( _fileName );
+ else
+ {
+ KoPictureKey key( _fileName );
+ backPicture.clear();
+ backPicture.setKey(key);
+ QByteArray rawData=_data.utf8(); // XPM is normally ASCII, therefore UTF-8
+ rawData[rawData.size()-1]=char(10); // Replace the NULL character by a LINE FEED
+ QBuffer buffer(rawData);
+ backPicture.loadXpm(&buffer);
+ }
+
+#if 0
+ if ( ext == orig_size.toQSize() )
+ ext = backPicture.size();
+
+ backPicture = backPicture.scale( ext );
+#endif
+ }
+ }
+ e=element.namedItem("BACKCLIPKEY").toElement();
+ if(!e.isNull()) {
+ KoPictureKey clipKey;
+ clipKey.loadAttributes( e );
+ backPicture.clear();
+ backPicture.setKey(clipKey);
+ // Picture will be set by reload(), called by completeLoading()
+ }
+ else {
+ // try to find a BACKCLIP tag if the BACKCLIPKEY is not available...
+ e=element.namedItem("BACKCLIP").toElement();
+ if(!e.isNull()) {
+ QString _fileName;
+ if(e.hasAttribute("filename"))
+ _fileName=e.attribute("filename");
+ if ( !_fileName.isEmpty() )
+ {
+ if ( int _envVarB = _fileName.find( '$' ) >= 0 )
+ {
+ int _envVarE = _fileName.find( '/', _envVarB );
+ QString path = getenv( QFile::encodeName(_fileName.mid( _envVarB, _envVarE-_envVarB )) );
+ _fileName.replace( _envVarB-1, _envVarE-_envVarB+1, path );
+ }
+ }
+ //KPClipartKey clipKey( _fileName, QDateTime( pictureCollection()->tmpDate(),
+ // pictureCollection()->tmpTime() ) );
+ backPicture = pictureCollection()->loadPicture( _fileName ); // load from disk !
+ }
+ }
+}
+
+void KPrBackGround::drawBackColor( QPainter *_painter, const QSize& ext, const QRect& crect )
+{
+ if ( (backType == BT_COLOR && bcType == BCT_PLAIN) || backColor1 == backColor2 ) //plain color
+ {
+ //kdDebug(33001) << "KPrBackGround::drawBackColor (filling " << DEBUGRECT(crect) << ")" << endl;
+ _painter->fillRect( crect, QBrush( getBackColor1() ) );
+ }
+ else if (backType == BT_COLOR && bcType != BCT_PLAIN) { //gradient
+ if ( !gradientPixmap || gradientPixmap->size() != ext )
+ generateGradient( ext );
+ _painter->drawPixmap( crect.topLeft(), *gradientPixmap, crect );
+ }
+ else /*if ( backType == BT_CLIPART || backType == BT_PICTURE )*/ //no gradient or bg color
+ _painter->fillRect( crect, QBrush( Qt::white ) );
+ return;
+}
+
+void KPrBackGround::drawBackPix( QPainter *_painter, const QSize& ext, const QRect& /*crect*/ )
+{
+ /*kdDebug(33001) << "KPrBackGround::drawBackPix ext=" << ext.width() << "," << ext.height() << endl;
+ kdDebug(33001) << "mode=" << (backView==BV_ZOOM?"ZOOM":backView==BV_TILED?"TILED":backView==BV_CENTER?"CENTER":"OTHER")
+ << " crect=" << DEBUGRECT(crect) << endl;*/
+ if ( !backPicture.isNull() )
+ {
+ // depend on page size and desktop size
+ const QSize _origSize = backPicture.getOriginalSize();
+ // NOTE: make all multiplications before any division
+ double w = _origSize.width();
+ w *= ext.width();
+#if KDE_IS_VERSION(3,1,90)
+ QRect desk = KGlobalSettings::desktopGeometry(kapp->activeWindow());
+#else
+ QRect desk = QApplication::desktop()->screenGeometry();
+#endif
+ w /= desk.width();
+ double h = _origSize.height();
+ h *= ext.height();
+ h /= desk.height();
+ const QSize _pixSize = QSize( (int)w, (int)h );
+ QPixmap backPix;
+
+ switch ( backView )
+ {
+ case BV_ZOOM:
+ backPix=backPicture.generatePixmap( ext, true );
+ _painter->drawPixmap( QRect( 0, 0, ext.width(), ext.height() ), backPix );
+ break;
+ case BV_TILED:
+ backPix=backPicture.generatePixmap( _pixSize, true );
+ _painter->drawTiledPixmap( 0, 0, ext.width(), ext.height(), backPix );
+ break;
+ case BV_CENTER:
+ {
+ backPix=backPicture.generatePixmap( _pixSize, true );
+
+ QPixmap *pix = new QPixmap( ext.width(), ext.height() );
+ bool delPix = true;
+ int _x = 0, _y = 0;
+
+ if ( backPix.width() > pix->width() && backPix.height() > pix->height() )
+ bitBlt( pix, 0, 0, &backPix, backPix.width() - pix->width(), backPix.height() - pix->height(),
+ pix->width(), pix->height() );
+ else if ( backPix.width() > pix->width() )
+ {
+ bitBlt( pix, 0, 0, &backPix, backPix.width() - pix->width(), 0,
+ pix->width(), backPix.height() );
+ _y = ( pix->height() - backPix.height() ) / 2;
+ }
+ else if ( backPix.height() > pix->height() )
+ {
+ bitBlt( pix, 0, 0, &backPix, 0, backPix.height() - pix->height(),
+ backPix.width(), pix->height() );
+ _x = ( pix->width() - backPix.width() ) / 2;
+ }
+ else
+ {
+ _x = ( pix->width() - backPix.width() ) / 2;
+ _y = ( pix->height() - backPix.height() ) / 2;
+ delPix = false;
+ delete pix;
+ pix = &backPix;
+ }
+
+ if ( pix && !pix->isNull() )
+ _painter->drawPixmap( _x, _y, *pix );
+ if ( delPix ) delete pix;
+ }
+ break;
+ }
+ }
+}
+
+void KPrBackGround::drawBorders( QPainter *_painter, const QSize& /*ext*/, const QRect& /*crect*/ )
+{
+ _painter->setPen( QApplication::palette().active().color( QColorGroup::Dark ) );
+ _painter->setBrush( Qt::NoBrush );
+
+ QRect rect = m_page->getZoomPageRect();
+
+ _painter->drawRect( rect.x()-1,rect.y()-1,rect.width()+1,rect.height()+1 );
+}
+
+void KPrBackGround::generateGradient( const QSize& size )
+{
+ if ( backType == BT_COLOR || backType == BT_CLIPART ||
+ backType == BT_PICTURE && backView == BV_CENTER ) {
+ removeGradient();
+ gradientPixmap = &gradientCollection()->getGradient( backColor1, backColor2, bcType, size,
+ unbalanced, xfactor, yfactor );
+ }
+
+ // Avoid keeping an unused gradient around
+ if ( (backType == BT_PICTURE || backType==BT_CLIPART) && gradientPixmap )
+ removeGradient();
+}
+
+void KPrBackGround::removeGradient()
+{
+ if ( gradientPixmap ) {
+ gradientCollection()->removeRef( backColor1, backColor2, bcType, gradientPixmap->size(),
+ unbalanced, xfactor, yfactor);
+ gradientPixmap = 0;
+ }
+}
+
+KoPictureCollection * KPrBackGround::pictureCollection() const
+{
+ return m_page->kPresenterDoc()->pictureCollection();
+}
+
+KPrGradientCollection * KPrBackGround::gradientCollection() const
+{
+ return m_page->kPresenterDoc()->gradientCollection();
+}
+
+void KPrBackGround::setBackGround( const struct Settings &settings )
+{
+ backType = settings.m_backType;
+ backColor1 = settings.m_backColor1;
+ backColor2 = settings.m_backColor2;
+ bcType = settings.m_bcType;
+ unbalanced = settings.m_unbalanced;
+ xfactor = settings.m_xfactor;
+ yfactor = settings.m_yfactor;
+ removeGradient();
+ setBackPicture( settings.m_backPictureKey );
+ backView = settings.m_backView;
+
+}
+
+struct KPrBackGround::Settings KPrBackGround::getBackGround() const
+{
+ return Settings( backType, backColor1, backColor2,
+ bcType, unbalanced, xfactor, yfactor,
+ backPicture.getKey(), backView);
+}
diff --git a/kpresenter/KPrBackground.h b/kpresenter/KPrBackground.h
new file mode 100644
index 000000000..b03266341
--- /dev/null
+++ b/kpresenter/KPrBackground.h
@@ -0,0 +1,188 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2004,2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpbackground_h
+#define kpbackground_h
+
+#include <qsize.h>
+#include <qdatetime.h>
+#include <KoBrush.h>
+#include <KoStyleStack.h>
+#include <KoOasisStyles.h>
+#include <KoOasisContext.h>
+
+#include <KoPictureCollection.h>
+
+#include "global.h"
+
+class KPrDocument;
+class QPainter;
+class QPixmap;
+class KPrGradientCollection;
+class QDomDocument;
+class QDomElement;
+class KoTextZoomHandler;
+class KPrPage;
+class KoXmlWriter;
+class KoGenStyles;
+class KoGenStyle;
+
+
+class KPrBackGround
+{
+public:
+ struct Settings
+ {
+ Settings( const BackType backType, const QColor backColor1, const QColor backColor2,
+ const BCType bcType, const bool unbalanced, const int xfactor, const int yfactor,
+ const KoPictureKey &key, const BackView backView )
+ : m_backType( backType )
+ , m_backColor1( backColor1 )
+ , m_backColor2( backColor2 )
+ , m_bcType( bcType )
+ , m_unbalanced( unbalanced )
+ , m_xfactor( xfactor )
+ , m_yfactor( yfactor )
+ , m_backPictureKey( key )
+ , m_backView( backView )
+ {}
+
+ BackType m_backType;
+ QColor m_backColor1;
+ QColor m_backColor2;
+ // Gradient setting
+ BCType m_bcType;
+ bool m_unbalanced;
+ // Gradient factors
+ int m_xfactor, m_yfactor;
+
+ KoPictureKey m_backPictureKey;
+ BackView m_backView;
+ };
+
+ KPrBackGround( KPrPage *_page );
+ ~KPrBackGround() {}
+
+ void setBackType( BackType _backType )
+ {
+ backType = _backType;
+ if (backType==BT_PICTURE || backType==BT_CLIPART)
+ removeGradient();
+ }
+ void setBackView( BackView _backView )
+ { backView = _backView; }
+ void setBackColor1( const QColor &_color )
+ { removeGradient(); backColor1 = _color; }
+ void setBackColor2( const QColor &_color )
+ { removeGradient(); backColor2 = _color; }
+ void setBackColorType( BCType _bcType )
+ { removeGradient(); bcType = _bcType; }
+ void setBackUnbalanced( bool _unbalanced )
+ { removeGradient(); unbalanced = _unbalanced; }
+ void setBackXFactor( int _xfactor )
+ { removeGradient(); xfactor = _xfactor; }
+ void setBackYFactor( int _yfactor )
+ { removeGradient(); yfactor = _yfactor; }
+ /// set the back picture to a new KoPicture
+ void setBackPicture( const KoPicture& picture );
+ void setBackPicture ( const KoPictureKey& key );
+ void setBackGround( const struct Settings &settings );
+ struct Settings getBackGround() const;
+
+ KoPicture picture() const { return backPicture;}
+
+ BackType getBackType() const
+ { return backType; }
+ BackView getBackView() const
+ { return backView; }
+ QColor getBackColor1() const
+ { return backColor1; }
+ QColor getBackColor2() const
+ { return backColor2; }
+ BCType getBackColorType() const
+ { return bcType; }
+ KoPictureKey getBackPictureKey() const
+ { return backPicture.getKey(); }
+ KoPicture getBackPicture() const
+ { return backPicture;}
+
+ bool getBackUnbalanced() const
+ { return unbalanced; }
+ int getBackXFactor() const
+ { return xfactor; }
+ int getBackYFactor() const
+ { return yfactor; }
+
+ // Draw the background.
+ // Uses the @p zoomHandler to determine the size of the background
+ void drawBackground( QPainter *_painter, const KoTextZoomHandler* zoomHandler,
+ const QRect& crect, bool _drawBorders );
+ // Draw the background. The size of the background is passed explicitly
+ void drawBackground( QPainter *_painter, const QSize& ext,
+ const QRect& crect, bool _drawBorders );
+
+ void reload();
+
+ QDomElement save( QDomDocument &doc );
+ void load( const QDomElement &element );
+ void loadOasis( KoOasisContext & context );
+ void saveOasisBackgroundPageStyle( KoGenStyle &stylepageauto, KoGenStyles &mainStyles );
+
+protected:
+ void drawBackColor( QPainter *_painter, const QSize& ext, const QRect& crect );
+ void drawBackPix( QPainter *_painter, const QSize& ext, const QRect& crect );
+ void drawBorders( QPainter *_painter, const QSize& ext, const QRect& crect );
+ // The current gradient isn't valid anymore (e.g. size or settings changed) -> discard it
+ void removeGradient();
+ // Generate a new gradient pixmap, for the given size
+ void generateGradient( const QSize& size );
+
+ KoPictureCollection *pictureCollection() const;
+ KPrGradientCollection *gradientCollection() const;
+
+ QString saveOasisPictureStyle( KoGenStyles& mainStyles );
+
+private:
+ BackType backType;
+ BackView backView;
+ QColor backColor1;
+ QColor backColor2;
+ BCType bcType;
+
+ // Background picture
+ KoPicture backPicture;
+
+ // Pixmap used to cache the drawing of the gradient, at the current size
+ const QPixmap *gradientPixmap;
+
+ // The page for which this background exists
+ KPrPage *m_page;
+
+ //int footerHeight;
+
+ // Gradient factors
+ int xfactor, yfactor;
+
+ // Gradient setting
+ bool unbalanced;
+};
+
+#endif
diff --git a/kpresenter/KPrBezierCurveObject.cpp b/kpresenter/KPrBezierCurveObject.cpp
new file mode 100644
index 000000000..152d466de
--- /dev/null
+++ b/kpresenter/KPrBezierCurveObject.cpp
@@ -0,0 +1,302 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrBezierCurveObject.h"
+#include "KPrCubicBezierCurveObjectIface.h"
+#include "KPrQuadricBezierCurveObjectIface.h"
+#include "KPrUtils.h"
+#include <KoTextZoomHandler.h>
+#include <qpainter.h>
+#include <qwmatrix.h>
+#include <qdom.h>
+#include "KoPointArray.h"
+#include <kdebug.h>
+
+#include <math.h>
+using namespace std;
+
+KPrBezierCurveObject::KPrBezierCurveObject()
+: KPrPointObject()
+{
+}
+
+KPrBezierCurveObject::KPrBezierCurveObject( const KoPointArray &_controlPoints,
+ const KoPointArray &_allPoints,
+ const KoSize &_size, const KoPen &_pen,
+ LineEnd _lineBegin, LineEnd _lineEnd )
+: KPrPointObject( _pen, _lineBegin, _lineEnd )
+{
+ points = KoPointArray( _controlPoints );
+ allPoints = KoPointArray( _allPoints );
+
+ ext = _size;
+}
+
+
+KPrBezierCurveObject &KPrBezierCurveObject::operator=( const KPrBezierCurveObject & )
+{
+ return *this;
+}
+
+
+bool KPrBezierCurveObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ KoRect rect( getRect() );
+ sc.xmlWriter.addAttribute("svg:viewBox", QString( "0 0 %1 %2" ).arg( int( rect.width() * 100 ) )
+ .arg( int( rect.height() * 100 ) ) );
+
+ unsigned int pointCount = points.count();
+ unsigned int pos = 0;
+
+ QString d;
+ d += QString( "M%1 %2" ).arg( int( points.at(pos).x() * 100 ) )
+ .arg( int( points.at(pos).y() * 100 ) );
+
+ while ( pos + 4 <= pointCount )
+ {
+ d += QString( "C%1 %2 %3 %4 %5 %6" ).arg( int( points.at( pos + 2 ).x() * 100 ) )
+ .arg( int( points.at( pos + 2 ).y() * 100 ) )
+ .arg( int( points.at( pos + 3 ).x() * 100 ) )
+ .arg( int( points.at( pos + 3 ).y() * 100 ) )
+ .arg( int( points.at( pos + 1 ).x() * 100 ) )
+ .arg( int( points.at( pos + 1 ).y() * 100 ) );
+ pos += 4;
+ }
+
+ if ( pos < pointCount )
+ {
+ d += QString( "L%1 %2" ).arg( int( points.at( pos + 1 ).x() * 100 ) )
+ .arg( int( points.at( pos + 1 ).y() * 100 ) );
+ }
+
+ sc.xmlWriter.addAttribute( "svg:d", d );
+
+ return true;
+}
+
+
+const char * KPrBezierCurveObject::getOasisElementName() const
+{
+ return "draw:path";
+}
+
+
+void KPrBezierCurveObject::loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo* info )
+{
+ kdDebug(33001) << "KPrBezierCurveObject::loadOasis" << endl;
+ KPrPointObject::loadOasis( element, context, info );
+
+ allPoints = bezier2polyline( points );
+
+ //load marker
+ loadOasisMarker( context );
+}
+
+QDomDocumentFragment KPrBezierCurveObject::save( QDomDocument& doc, double offset )
+{
+ return KPrPointObject::save( doc,offset );
+}
+
+double KPrBezierCurveObject::load(const QDomElement &element)
+{
+ double offset = KPrPointObject::load( element );
+
+ allPoints = bezier2polyline( points );
+
+ return offset;
+}
+
+void KPrBezierCurveObject::updatePoints( double _fx, double _fy )
+{
+ KPrPointObject::updatePoints( _fx, _fy );
+
+ int index = 0;
+ KoPointArray tmpPoints;
+ KoPointArray::ConstIterator it;
+ for ( it = allPoints.begin(); it != allPoints.end(); ++it ) {
+ KoPoint point = (*it);
+ double tmpX = point.x() * _fx;
+ double tmpY = point.y() * _fy;
+
+ tmpPoints.putPoints( index, 1, tmpX,tmpY );
+ ++index;
+ }
+ allPoints = tmpPoints;
+}
+
+KoPointArray KPrBezierCurveObject::bezier2polyline( const KoPointArray &bezierPoints )
+{
+ if ( bezierPoints.isNull() )
+ return bezierPoints;
+
+ KoPointArray _points( bezierPoints );
+ KoPointArray _allPoints;
+ unsigned int pointCount = _points.count();
+
+ if ( pointCount == 2 ) // line
+ {
+ _allPoints = _points;
+ }
+ else // cubic bezier curve
+ {
+ KoPointArray tmpPointArray;
+ unsigned int _tmpIndex = 0;
+ unsigned int count = 0;
+ while ( count < pointCount )
+ {
+ if ( pointCount >= ( count + 4 ) ) // for cubic bezier curve
+ {
+ double _firstX = _points.at( count ).x();
+ double _firstY = _points.at( count ).y();
+
+ double _fourthX = _points.at( count + 1 ).x();
+ double _fourthY = _points.at( count + 1 ).y();
+
+ double _secondX = _points.at( count + 2 ).x();
+ double _secondY = _points.at( count + 2 ).y();
+
+ double _thirdX = _points.at( count + 3 ).x();
+ double _thirdY = _points.at( count + 3 ).y();
+
+ KoPointArray bezierPoint;
+ bezierPoint.putPoints( 0, 4, _firstX,_firstY, _secondX,_secondY,
+ _thirdX,_thirdY, _fourthX,_fourthY );
+ bezierPoint = bezierPoint.cubicBezier();
+
+ KoPointArray::ConstIterator it;
+ for ( it = bezierPoint.begin(); it != bezierPoint.end(); ++it )
+ {
+ KoPoint _point = (*it);
+ tmpPointArray.putPoints( _tmpIndex, 1, _point.x(), _point.y() );
+ ++_tmpIndex;
+ }
+
+ count += 4;
+ }
+ else // for line
+ {
+ double _x1 = _points.at( count ).x();
+ double _y1 = _points.at( count ).y();
+
+ double _x2 = _points.at( count + 1 ).x();
+ double _y2 = _points.at( count + 1 ).y();
+
+ tmpPointArray.putPoints( _tmpIndex, 2, _x1,_y1, _x2,_y2 );
+ _tmpIndex += 2;
+ count += 2;
+ }
+ }
+
+ _allPoints = tmpPointArray;
+ }
+
+ return _allPoints;
+}
+
+void KPrBezierCurveObject::flip(bool horizontal )
+{
+ KPrPointObject::flip( horizontal );
+
+ KoPointArray tmpPoints;
+ int index = 0;
+ if ( ! horizontal )
+ {
+ KoPointArray::ConstIterator it;
+ double horiz = getSize().height()/2;
+ for ( it = allPoints.begin(); it != allPoints.end(); ++it )
+ {
+ KoPoint point = (*it);
+ if ( point.y()> horiz )
+ tmpPoints.putPoints( index, 1, point.x(),point.y()- 2*(point.y()-horiz) );
+ else
+ tmpPoints.putPoints( index, 1, point.x(),point.y()+ 2*(horiz - point.y()) );
+ ++index;
+ }
+ }
+ else
+ {
+ KoPointArray::ConstIterator it;
+ double vert = getSize().width()/2;
+ for ( it = allPoints.begin(); it != allPoints.end(); ++it )
+ {
+ KoPoint point = (*it);
+ if ( point.y()> vert )
+ tmpPoints.putPoints( index, 1, point.x()- 2*(point.x()-vert), point.y() );
+ else
+ tmpPoints.putPoints( index, 1, point.x()+ 2*(vert - point.x()),point.y() );
+ ++index;
+ }
+ }
+
+ allPoints = tmpPoints;
+}
+
+
+KoPointArray KPrBezierCurveObject::getDrawingPoints() const
+{
+ return allPoints;
+}
+
+
+KPrCubicBezierCurveObject::KPrCubicBezierCurveObject()
+: KPrBezierCurveObject()
+{
+}
+
+
+KPrCubicBezierCurveObject::KPrCubicBezierCurveObject( const KoPointArray &_controlPoints,
+ const KoPointArray &_allPoints,
+ const KoSize & _size, const KoPen &_pen,
+ LineEnd _lineBegin, LineEnd _lineEnd )
+: KPrBezierCurveObject( _controlPoints, _allPoints, _size, _pen, _lineBegin, _lineEnd )
+{
+}
+
+
+DCOPObject* KPrCubicBezierCurveObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrCubicBezierCurveObjectIface( this );
+ return dcop;
+}
+
+
+KPrQuadricBezierCurveObject::KPrQuadricBezierCurveObject()
+: KPrBezierCurveObject()
+{
+}
+
+
+KPrQuadricBezierCurveObject::KPrQuadricBezierCurveObject( const KoPointArray &_controlPoints,
+ const KoPointArray &_allPoints,
+ const KoSize & _size, const KoPen &_pen,
+ LineEnd _lineBegin, LineEnd _lineEnd )
+: KPrBezierCurveObject( _controlPoints, _allPoints, _size, _pen, _lineBegin, _lineEnd )
+{
+}
+
+
+DCOPObject* KPrQuadricBezierCurveObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrQuadricBezierCurveObjectIface( this );
+ return dcop;
+}
diff --git a/kpresenter/KPrBezierCurveObject.h b/kpresenter/KPrBezierCurveObject.h
new file mode 100644
index 000000000..db12f8d89
--- /dev/null
+++ b/kpresenter/KPrBezierCurveObject.h
@@ -0,0 +1,90 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpcubicbeziercurveobject_h
+#define kpcubicbeziercurveobject_h
+
+#include "KPrPointObject.h"
+
+class QPainter;
+class DCOPObject;
+
+class KPrBezierCurveObject : public KPrPointObject
+{
+public:
+ KPrBezierCurveObject();
+ KPrBezierCurveObject( const KoPointArray &_controlPoints, const KoPointArray &_allPoints, const KoSize & _size,
+ const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd );
+ virtual ~KPrBezierCurveObject() {}
+
+ virtual QDomDocumentFragment save( QDomDocument& doc,double offset );
+
+ virtual double load( const QDomElement &element );
+ virtual void loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo* info );
+
+ virtual void flip(bool horizontal );
+
+ static KoPointArray bezier2polyline( const KoPointArray &bezierPoints );
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+
+ virtual void updatePoints( double _fx, double _fy );
+ virtual KoPointArray getDrawingPoints() const;
+
+ KoPointArray allPoints;
+
+private:
+ // Don't assign it
+ KPrBezierCurveObject &operator=( const KPrBezierCurveObject & );
+};
+
+
+class KPrCubicBezierCurveObject : public KPrBezierCurveObject
+{
+public:
+ KPrCubicBezierCurveObject();
+ KPrCubicBezierCurveObject( const KoPointArray &_controlPoints, const KoPointArray &_allPoints, const KoSize & _size,
+ const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd );
+ virtual ~KPrCubicBezierCurveObject() {}
+
+ virtual DCOPObject* dcopObject();
+
+ virtual ObjType getType() const { return OT_CUBICBEZIERCURVE; }
+ virtual QString getTypeString() const { return i18n( "Cubic Bezier Curve" ); }
+};
+
+class KPrQuadricBezierCurveObject : public KPrBezierCurveObject
+{
+public:
+ KPrQuadricBezierCurveObject();
+ KPrQuadricBezierCurveObject( const KoPointArray &_controlPoints, const KoPointArray &_allPoints, const KoSize & _size,
+ const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd );
+ virtual ~KPrQuadricBezierCurveObject() {}
+
+ virtual DCOPObject* dcopObject();
+
+ virtual ObjType getType() const { return OT_CUBICBEZIERCURVE; }
+ virtual QString getTypeString() const { return i18n( "Quadric Bezier Curve" ); }
+};
+
+#endif
diff --git a/kpresenter/KPrBgSpellCheck.cpp b/kpresenter/KPrBgSpellCheck.cpp
new file mode 100644
index 000000000..efd84234e
--- /dev/null
+++ b/kpresenter/KPrBgSpellCheck.cpp
@@ -0,0 +1,60 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 David Faure <faure@kde.org>
+ 2002 Laurent Montel <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+
+#include "KPrBgSpellCheck.h"
+#include "KPrDocument.h"
+#include "KPrTextObject.h"
+
+#include "KoTextIterator.h"
+#include "KoTextObject.h"
+
+#include <kspell2/broker.h>
+using namespace KSpell2;
+
+#include <kdebug.h>
+#include <kconfig.h>
+#include <klocale.h>
+
+KPrBgSpellCheck::KPrBgSpellCheck(KPrDocument *_doc)
+ : KoBgSpellCheck(Broker::openBroker( KSharedConfig::openConfig( "kpresenterrc" ) ), _doc )
+{
+ m_doc=_doc;
+ m_currentObj=0L;
+}
+
+KPrBgSpellCheck::~KPrBgSpellCheck()
+{
+}
+
+
+KoTextIterator *KPrBgSpellCheck::createWholeDocIterator() const
+{
+ QValueList<KoTextObject *> objects = m_doc->visibleTextObjects( );
+
+ kdDebug()<<"Number of visible text objects = "<< objects.count() << endl;
+
+ if ( objects.isEmpty() )
+ return 0;
+
+ return new KoTextIterator( objects, 0, 0 );
+}
+
diff --git a/kpresenter/KPrBgSpellCheck.h b/kpresenter/KPrBgSpellCheck.h
new file mode 100644
index 000000000..d2d8edeab
--- /dev/null
+++ b/kpresenter/KPrBgSpellCheck.h
@@ -0,0 +1,42 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 David Faure <faure@kde.org>
+ 2002 Laurent Montel <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kprbgspellcheck_h
+#define kprbgspellcheck_h
+
+class KPrDocument;
+class KPrTextObject;
+#include "KoBgSpellCheck.h"
+
+
+class KPrBgSpellCheck : public KoBgSpellCheck
+{
+public:
+ KPrBgSpellCheck(KPrDocument *_doc);
+ virtual ~KPrBgSpellCheck();
+ virtual KoTextIterator *createWholeDocIterator() const;
+
+
+private:
+ KPrDocument *m_doc;
+ KPrTextObject *m_currentObj;
+};
+#endif
diff --git a/kpresenter/KPrBrush.cpp b/kpresenter/KPrBrush.cpp
new file mode 100644
index 000000000..6d4d16994
--- /dev/null
+++ b/kpresenter/KPrBrush.cpp
@@ -0,0 +1,247 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrBrush.h"
+
+#include <KoGenStyles.h>
+#include <KoOasisStyles.h>
+#include <KoOasisContext.h>
+#include <KoXmlNS.h>
+#include "KPrDocument.h"
+
+KPrBrush::KPrBrush()
+ : KoBrush()
+{
+}
+
+KPrBrush::KPrBrush( const QBrush &brush, const QColor &gColor1, const QColor &gColor2,
+ BCType gType, FillType fillType, bool unbalanced,
+ int xfactor, int yfactor )
+ : KoBrush( brush, gColor1,gColor2, gType, fillType, unbalanced, xfactor, yfactor )
+{
+}
+
+void KPrBrush::saveOasisFillStyle( KoGenStyle &styleObjectAuto, KoGenStyles& mainStyles ) const
+{
+ switch ( getFillType() )
+ {
+ case FT_BRUSH:
+ {
+ if( getBrush().style() != Qt::NoBrush )
+ {
+ KoOasisStyles::saveOasisFillStyle( styleObjectAuto, mainStyles, getBrush() );
+ }
+ else
+ {
+ styleObjectAuto.addProperty( "draw:fill","none" );
+ }
+ break;
+ }
+ case FT_GRADIENT:
+ styleObjectAuto.addProperty( "draw:fill","gradient" );
+ styleObjectAuto.addProperty( "draw:fill-gradient-name", saveOasisGradientStyle( mainStyles ) );
+ break;
+ }
+}
+
+
+QString KPrBrush::saveOasisGradientStyle( KoGenStyles& mainStyles ) const
+{
+ KoGenStyle gradientStyle( KPrDocument::STYLE_GRADIENT /*no family name*/);
+ gradientStyle.addAttribute( "draw:start-color", getGColor1().name() );
+ gradientStyle.addAttribute( "draw:end-color", getGColor2().name() );
+
+ QString unbalancedx( "50%" );
+ QString unbalancedy( "50%" );
+
+ if ( getGUnbalanced() )
+ {
+ unbalancedx = QString( "%1%" ).arg( getGXFactor() / 4 + 50 );
+ unbalancedy = QString( "%1%" ).arg( getGYFactor() / 4 + 50 );
+ }
+ gradientStyle.addAttribute( "draw:cx", unbalancedx );
+ gradientStyle.addAttribute( "draw:cy", unbalancedy );
+
+ switch( getGType() )
+ {
+ case BCT_PLAIN:
+ gradientStyle.addAttribute( "draw:angle", 0 );
+ gradientStyle.addAttribute( "draw:style", "linear" );
+ break;
+ case BCT_GHORZ:
+ gradientStyle.addAttribute( "draw:angle", 0 );
+ gradientStyle.addAttribute( "draw:style", "linear" );
+ break;
+ case BCT_GVERT:
+ gradientStyle.addAttribute( "draw:angle", 900 );
+ gradientStyle.addAttribute( "draw:style", "linear" );
+ break;
+ case BCT_GDIAGONAL1:
+ gradientStyle.addAttribute( "draw:angle", 450 );
+ gradientStyle.addAttribute( "draw:style", "linear" );
+ break;
+ case BCT_GDIAGONAL2:
+ gradientStyle.addAttribute( "draw:angle", 135 );
+ gradientStyle.addAttribute( "draw:style", "linear" );
+ break;
+ case BCT_GCIRCLE:
+ gradientStyle.addAttribute( "draw:angle", 0 );
+ gradientStyle.addAttribute( "draw:style", "radial" );
+ break;
+ case BCT_GRECT:
+ gradientStyle.addAttribute( "draw:angle", 0 );
+ gradientStyle.addAttribute( "draw:style", "square" );
+ break;
+ case BCT_GPIPECROSS:
+ gradientStyle.addAttribute( "draw:angle", 0 );
+ gradientStyle.addAttribute( "draw:style", "axial" );
+ break;
+ case BCT_GPYRAMID: //todo fixme ! it doesn't work !
+ gradientStyle.addAttribute( "draw:angle", 0 );
+ gradientStyle.addAttribute( "draw:style", 0 );
+ break;
+ }
+
+ return mainStyles.lookup( gradientStyle, "gradient" );
+}
+
+
+void KPrBrush::loadOasisFillStyle( KoOasisContext &context, const char * propertyType )
+{
+ KoStyleStack &styleStack = context.styleStack();
+ styleStack.setTypeProperties( propertyType );
+
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "fill" ) )
+ {
+ const QString fill = styleStack.attributeNS( KoXmlNS::draw, "fill" );
+ kdDebug(33001) << " load object gradient fill type :" << fill << endl;
+
+ if ( fill == "solid" || fill == "hatch" )
+ {
+ setBrush( KoOasisStyles::loadOasisFillStyle( styleStack, fill, context.oasisStyles() ) );
+ }
+ else if ( fill == "gradient" )
+ {
+ QString style = styleStack.attributeNS( KoXmlNS::draw, "fill-gradient-name" );
+ QDomElement* draw = context.oasisStyles().drawStyles()[style];
+
+ if ( draw )
+ {
+ setGColor1( draw->attributeNS( KoXmlNS::draw, "start-color", QString::null ) );
+ setGColor2( draw->attributeNS( KoXmlNS::draw, "end-color", QString::null ) );
+
+ QString type = draw->attributeNS( KoXmlNS::draw, "style", QString::null );
+ kdDebug()<<" type :"<<type<<endl;
+ if ( type == "linear" )
+ {
+ int angle = draw->attributeNS( KoXmlNS::draw, "angle", QString::null ).toInt() / 10;
+
+ // make sure the angle is between 0 and 359
+ angle = abs( angle );
+ angle -= ( (int) ( angle / 360 ) ) * 360;
+
+ // What we are trying to do here is to find out if the given
+ // angle belongs to a horizontal, vertical or diagonal gradient.
+ int lower, upper, nearAngle = 0;
+ for ( lower = 0, upper = 45; upper < 360; lower += 45, upper += 45 )
+ {
+ if ( upper >= angle )
+ {
+ int distanceToUpper = abs( angle - upper );
+ int distanceToLower = abs( angle - lower );
+ nearAngle = distanceToUpper > distanceToLower ? lower : upper;
+ break;
+ }
+ }
+ // nearAngle should now be one of: 0, 45, 90, 135, 180...
+ if ( nearAngle == 0 || nearAngle == 180 )
+ setGType( BCT_GHORZ ); // horizontal
+ else if ( nearAngle == 90 || nearAngle == 270 )
+ setGType( BCT_GVERT ); // vertical
+ else if ( nearAngle == 45 || nearAngle == 225 )
+ setGType( BCT_GDIAGONAL1 ); // diagonal 1
+ else if ( nearAngle == 135 || nearAngle == 315 )
+ setGType( BCT_GDIAGONAL2 ); // diagonal 2
+
+ if ( nearAngle == 180 || nearAngle == 270 || nearAngle == 225 || nearAngle == 315 )
+ {
+ setGColor1( draw->attributeNS( KoXmlNS::draw, "end-color", QString::null ) );
+ setGColor2( draw->attributeNS( KoXmlNS::draw, "start-color", QString::null ) );
+ }
+ }
+ else if ( type == "radial" || type == "ellipsoid" )
+ setGType( BCT_GCIRCLE ); // circle
+ else if ( type == "square" || type == "rectangular" )
+ setGType( BCT_GRECT ); // rectangle
+ else if ( type == "axial" )
+ setGType( BCT_GPIPECROSS ); // pipecross
+ else //safe
+ setGType( BCT_PLAIN ); // plain
+
+ // Hard to map between x- and y-center settings of ooimpress
+ // and (un-)balanced settings of kpresenter. Let's try it.
+ int x, y;
+ if ( draw->hasAttributeNS( KoXmlNS::draw, "cx" ) )
+ x = draw->attributeNS( KoXmlNS::draw, "cx", QString::null ).remove( '%' ).toInt();
+ else
+ x = 50;
+
+ if ( draw->hasAttributeNS( KoXmlNS::draw, "cy" ) )
+ y = draw->attributeNS( KoXmlNS::draw, "cy", QString::null ).remove( '%' ).toInt();
+ else
+ y = 50;
+
+ if ( x == 50 && y == 50 )
+ {
+ setGUnbalanced( false );
+ setGXFactor( 100 );
+ setGYFactor( 100 );
+ }
+ else
+ {
+ setGUnbalanced( true );
+ // map 0 - 100% to -200 - 200
+ setGXFactor( 4 * x - 200 );
+ setGYFactor( 4 * y - 200 );
+ }
+ }
+
+ // We have to set a brush with brushstyle != no background fill
+ // otherwise the properties dialog for the object won't
+ // display the preview for the gradient.
+ QBrush tmpBrush;
+ tmpBrush.setStyle( static_cast<Qt::BrushStyle>( 1 ) );
+ setBrush( tmpBrush );
+ setFillType( FT_GRADIENT );
+ }
+ else if ( fill == "none" )
+ {
+ //nothing
+ }
+ else if ( fill == "bitmap" )
+ {
+ //todo
+ //not implementer in kpresenter...
+ //the drawing object is filled with the bitmap specified by the draw:fill-image-name attribute.
+ //QBrush implement setPixmap
+ //easy just add pixmap and store it.
+ }
+ }
+}
diff --git a/kpresenter/KPrBrush.h b/kpresenter/KPrBrush.h
new file mode 100644
index 000000000..f96f66279
--- /dev/null
+++ b/kpresenter/KPrBrush.h
@@ -0,0 +1,50 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRBRUSH_H
+#define KPRBRUSH_H
+
+#include <qbrush.h>
+#include <KoBrush.h>
+
+#include "global.h"
+
+class KoGenStyle;
+class KoGenStyles;
+class KoOasisContext;
+class QDomElement;
+
+class KPrBrush : public KoBrush
+{
+public:
+ KPrBrush();
+ KPrBrush( const QBrush &brush, const QColor &gColor1, const QColor &gColor2,
+ BCType gType, FillType fillType, bool unbalanced,
+ int xfactor, int yfactor );
+
+ void saveOasisFillStyle( KoGenStyle &styleObjectAuto, KoGenStyles& mainStyles ) const;
+ void loadOasisFillStyle( KoOasisContext &context, const char * propertyType );
+
+private:
+ QString saveOasisGradientStyle( KoGenStyles& mainStyles ) const;
+};
+
+#endif /* KPRBRUSH_H */
+
diff --git a/kpresenter/KPrBrushProperty.cpp b/kpresenter/KPrBrushProperty.cpp
new file mode 100644
index 000000000..6e27e1180
--- /dev/null
+++ b/kpresenter/KPrBrushProperty.cpp
@@ -0,0 +1,498 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#include "KPrBrushProperty.h"
+
+#include "brushpropertyui.h"
+#include "gradientpropertyui.h"
+#include "KPrPBPreview.h"
+
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qslider.h>
+#include <qwhatsthis.h>
+#include <qwidgetstack.h>
+
+#include <klocale.h>
+#include <kcolorbutton.h>
+#include <kcombobox.h>
+
+KPrBrushProperty::KPrBrushProperty( QWidget *parent, const char *name, const KPrBrushCmd::Brush &brush )
+ : QWidget( parent, name )
+ , m_brush( brush )
+{
+ QGridLayout *layout = new QGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint() );
+
+ m_typeCombo = new KComboBox( this );
+ layout->addWidget( m_typeCombo, 0, 1 );
+ m_typeCombo->insertItem( i18n( "Single Color" ) );
+ m_typeCombo->insertItem( i18n( "Gradient" ) );
+ m_typeCombo->insertItem( i18n( "Transparent" ) );
+ QWhatsThis::add(m_typeCombo, i18n( "You can choose between Single Color, Gradient or Transparent as the type." ) );
+
+ QLabel *typeLabel = new QLabel( i18n( "&Type:" ), this );
+ layout->addWidget( typeLabel, 0, 0 );
+ typeLabel->setBuddy( m_typeCombo );
+
+ m_stack = new QWidgetStack( this );
+ layout->addMultiCellWidget( m_stack, 1, 1, 0, 1 );
+ connect( m_typeCombo, SIGNAL( activated( int ) ),
+ this, SLOT( slotTypeChanged( int ) ) );
+
+ m_brushUI = new BrushPropertyUI( m_stack );
+
+ m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 100 ) );
+ m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 94 ) );
+ m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 88 ) );
+ m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 63 ) );
+ m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 50 ) );
+ m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 37 ) );
+ m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 12 ) );
+ m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 6 ) );
+ m_brushUI->styleCombo->insertItem( i18n( "Horizontal Lines" ) );
+ m_brushUI->styleCombo->insertItem( i18n( "Vertical Lines" ) );
+ m_brushUI->styleCombo->insertItem( i18n( "Crossing Lines" ) );
+ m_brushUI->styleCombo->insertItem( i18n( "Diagonal Lines ( / )" ) );
+ m_brushUI->styleCombo->insertItem( i18n( "Diagonal Lines ( \\ )" ) );
+ m_brushUI->styleCombo->insertItem( i18n( "Diagonal Crossing Lines" ) );
+
+ m_preview_color = new KPrPBPreview( m_brushUI->previewPanel, 0, KPrPBPreview::Brush );
+ QHBoxLayout *hbox = new QHBoxLayout( m_brushUI->previewPanel );
+ QWhatsThis::add(m_preview_color, i18n( "This displays a preview of your choices." ) );
+ hbox->addWidget(m_preview_color);
+
+ connect( m_brushUI->styleCombo, SIGNAL( activated( int ) ),
+ this, SLOT( slotBrushChanged() ) );
+ connect( m_brushUI->colorChooser, SIGNAL( changed( const QColor& ) ),
+ this, SLOT( slotBrushChanged() ) );
+
+ m_stack->addWidget( m_brushUI, 0 );
+
+ m_gradientUI = new GradientPropertyUI( m_stack );
+ m_gradientUI->styleCombo->insertItem( i18n( "Horizontal" ) );
+ m_gradientUI->styleCombo->insertItem( i18n( "Vertical" ) );
+ m_gradientUI->styleCombo->insertItem( i18n( "Diagonal 1" ) );
+ m_gradientUI->styleCombo->insertItem( i18n( "Diagonal 2" ) );
+ m_gradientUI->styleCombo->insertItem( i18n( "Circle" ) );
+ m_gradientUI->styleCombo->insertItem( i18n( "Rectangle" ) );
+ m_gradientUI->styleCombo->insertItem( i18n( "PipeCross" ) );
+ m_gradientUI->styleCombo->insertItem( i18n( "Pyramid" ) );
+
+ m_preview_gradient = new KPrPBPreview( m_gradientUI->previewPanel, 0, KPrPBPreview::Gradient );
+ hbox = new QHBoxLayout( m_gradientUI->previewPanel );
+ hbox->addWidget(m_preview_gradient);
+
+ connect( m_gradientUI->styleCombo, SIGNAL( activated( int ) ),
+ this, SLOT( slotBackColorTypeChanged() ) );
+ connect( m_gradientUI->color1Chooser, SIGNAL( changed( const QColor& ) ),
+ this, SLOT( slotColor1Changed() ) );
+ connect( m_gradientUI->color2Chooser, SIGNAL( changed( const QColor& ) ),
+ this, SLOT( slotColor2Changed() ) );
+ connect( m_gradientUI->unbalancedCheckBox, SIGNAL( clicked() ),
+ this, SLOT( slotUnbalancedChanged() ) );
+ connect( m_gradientUI->xSlider, SIGNAL( valueChanged( int ) ),
+ this, SLOT( slotXFactorChanged() ) );
+ connect( m_gradientUI->ySlider, SIGNAL( valueChanged( int ) ),
+ this, SLOT( slotYFactorChanged() ) );
+
+ m_stack->addWidget( m_gradientUI, 1 );
+ m_stack->addWidget( new QFrame(), 2 ); // the transparent case
+
+ slotReset();
+}
+
+
+KPrBrushProperty::~KPrBrushProperty()
+{
+}
+
+
+FillType KPrBrushProperty::getFillType() const
+{
+ int selected = m_typeCombo->currentItem();
+ if(selected == 2)
+ selected = 0;
+ return (FillType) selected;
+}
+
+
+QBrush KPrBrushProperty::getQBrush() const
+{
+ QBrush brush;
+
+ switch ( m_brushUI->styleCombo->currentItem() )
+ {
+ case 0:
+ brush.setStyle( SolidPattern );
+ break;
+ case 1:
+ brush.setStyle( Dense1Pattern );
+ break;
+ case 2:
+ brush.setStyle( Dense2Pattern );
+ break;
+ case 3:
+ brush.setStyle( Dense3Pattern );
+ break;
+ case 4:
+ brush.setStyle( Dense4Pattern );
+ break;
+ case 5:
+ brush.setStyle( Dense5Pattern );
+ break;
+ case 6:
+ brush.setStyle( Dense6Pattern );
+ break;
+ case 7:
+ brush.setStyle( Dense7Pattern );
+ break;
+ case 8:
+ brush.setStyle( HorPattern );
+ break;
+ case 9:
+ brush.setStyle( VerPattern );
+ break;
+ case 10:
+ brush.setStyle( CrossPattern );
+ break;
+ case 11:
+ brush.setStyle( BDiagPattern );
+ break;
+ case 12:
+ brush.setStyle( FDiagPattern );
+ break;
+ case 13:
+ brush.setStyle( DiagCrossPattern );
+ break;
+ }
+ if( m_typeCombo->currentItem() == 2)
+ brush.setStyle( QBrush::NoBrush );
+
+ brush.setColor( m_brushUI->colorChooser->color() );
+
+ return brush;
+}
+
+
+QColor KPrBrushProperty::getGColor1()const
+{
+ return m_gradientUI->color1Chooser->color();
+}
+
+
+QColor KPrBrushProperty::getGColor2()const
+{
+ return m_gradientUI->color2Chooser->color();
+}
+
+
+BCType KPrBrushProperty::getGType()const
+{
+ return (BCType)( m_gradientUI->styleCombo->currentItem() +1 );
+}
+
+
+bool KPrBrushProperty::getGUnbalanced()const
+{
+ return m_gradientUI->unbalancedCheckBox->isChecked();
+}
+
+
+int KPrBrushProperty::getGXFactor() const
+{
+ return m_gradientUI->xSlider->value();
+}
+
+
+int KPrBrushProperty::getGYFactor() const
+{
+ return m_gradientUI->ySlider->value();
+}
+
+
+int KPrBrushProperty::getBrushPropertyChange() const
+{
+ int flags = 0;
+ bool fillTypeChanged = getFillType() != m_brush.fillType;
+
+ if ( getFillType() == FT_BRUSH )
+ {
+ QBrush brush = getQBrush();
+ if ( fillTypeChanged || brush.color() != m_brush.brush.color() )
+ {
+ flags |= KPrBrushCmd::BrushColor;
+ }
+ if ( fillTypeChanged || brush.style() != m_brush.brush.style() )
+ {
+ flags |= KPrBrushCmd::BrushStyle;
+ }
+ if ( fillTypeChanged )
+ {
+ flags |= KPrBrushCmd::BrushGradientSelect;
+ }
+ }
+ else
+ {
+ if ( fillTypeChanged || getGColor1() != m_brush.gColor1 )
+ {
+ flags |= KPrBrushCmd::GradientColor1;
+ }
+ if ( fillTypeChanged || getGColor2() != m_brush.gColor2 )
+ {
+ flags |= KPrBrushCmd::GradientColor2;
+ }
+ if ( fillTypeChanged || getGType() != m_brush.gType )
+ {
+ flags |= KPrBrushCmd::GradientType;
+ }
+ if ( fillTypeChanged || getGUnbalanced() != m_brush.unbalanced )
+ {
+ flags |= KPrBrushCmd::GradientBalanced;
+ }
+ if ( fillTypeChanged || getGXFactor() != m_brush.xfactor )
+ {
+ flags |= KPrBrushCmd::GradientXFactor;
+ }
+ if ( fillTypeChanged || getGYFactor() != m_brush.yfactor )
+ {
+ flags |= KPrBrushCmd::GradientYFactor;
+ }
+ if ( fillTypeChanged )
+ {
+ flags |= KPrBrushCmd::BrushGradientSelect;
+ }
+ }
+ return flags;
+}
+
+
+KPrBrushCmd::Brush KPrBrushProperty::getBrush() const
+{
+ KPrBrushCmd::Brush brush( getQBrush(),
+ getGColor1(),
+ getGColor2(),
+ getGType(),
+ getFillType(),
+ getGUnbalanced(),
+ getGXFactor(),
+ getGYFactor() );
+ return brush;
+}
+
+
+void KPrBrushProperty::setBrush( KPrBrushCmd::Brush &brush )
+{
+ m_brush = brush;
+ slotReset();
+}
+
+
+void KPrBrushProperty::apply()
+{
+ int flags = getBrushPropertyChange();
+
+ if ( flags & KPrBrushCmd::BrushGradientSelect )
+ m_brush.fillType = getFillType();
+
+ if ( flags & KPrBrushCmd::BrushColor )
+ m_brush.brush.setColor( getQBrush().color() );
+
+ if ( flags & KPrBrushCmd::BrushStyle )
+ m_brush.brush.setStyle( getQBrush().style() );
+
+ if ( flags & KPrBrushCmd::GradientColor1 )
+ m_brush.gColor1 = getGColor1();
+
+ if ( flags & KPrBrushCmd::GradientColor2 )
+ m_brush.gColor2 = getGColor2();
+
+ if ( flags & KPrBrushCmd::GradientType )
+ m_brush.gType = getGType() ;
+
+ if ( flags & KPrBrushCmd::GradientBalanced )
+ m_brush.unbalanced = getGUnbalanced() ;
+
+ if ( flags & KPrBrushCmd::GradientXFactor )
+ m_brush.xfactor = getGXFactor() ;
+
+ if ( flags & KPrBrushCmd::GradientYFactor )
+ m_brush.yfactor = getGYFactor() ;
+}
+
+
+void KPrBrushProperty::setQBrush( const QBrush &brush )
+{
+ switch ( brush.style() )
+ {
+ case NoBrush:
+ // TODO
+ break;
+ case SolidPattern:
+ m_brushUI->styleCombo->setCurrentItem( 0 );
+ break;
+ case Dense1Pattern:
+ m_brushUI->styleCombo->setCurrentItem( 1 );
+ break;
+ case Dense2Pattern:
+ m_brushUI->styleCombo->setCurrentItem( 2 );
+ break;
+ case Dense3Pattern:
+ m_brushUI->styleCombo->setCurrentItem( 3 );
+ break;
+ case Dense4Pattern:
+ m_brushUI->styleCombo->setCurrentItem( 4 );
+ break;
+ case Dense5Pattern:
+ m_brushUI->styleCombo->setCurrentItem( 5 );
+ break;
+ case Dense6Pattern:
+ m_brushUI->styleCombo->setCurrentItem( 6 );
+ break;
+ case Dense7Pattern:
+ m_brushUI->styleCombo->setCurrentItem( 7 );
+ break;
+ case HorPattern:
+ m_brushUI->styleCombo->setCurrentItem( 8 );
+ break;
+ case VerPattern:
+ m_brushUI->styleCombo->setCurrentItem( 9 );
+ break;
+ case CrossPattern:
+ m_brushUI->styleCombo->setCurrentItem( 10 );
+ break;
+ case BDiagPattern:
+ m_brushUI->styleCombo->setCurrentItem( 11 );
+ break;
+ case FDiagPattern:
+ m_brushUI->styleCombo->setCurrentItem( 12 );
+ break;
+ case DiagCrossPattern:
+ m_brushUI->styleCombo->setCurrentItem( 13 );
+ break;
+ case CustomPattern:
+ break;
+ }
+
+ m_brushUI->colorChooser->setColor( brush.color() );
+ m_preview_color->setBrush( brush );
+}
+
+
+void KPrBrushProperty::setGradient( const QColor &_c1, const QColor &_c2, BCType _t,
+ bool _unbalanced, int _xfactor, int _yfactor )
+{
+ m_gradientUI->styleCombo->setCurrentItem( (int) _t - 1 );
+ m_gradientUI->color1Chooser->setColor( _c1 );
+ m_gradientUI->color2Chooser->setColor( _c2 );
+ m_gradientUI->unbalancedCheckBox->setChecked( _unbalanced );
+ setUnbalancedEnabled( _unbalanced );
+ m_gradientUI->xSlider->setValue( _xfactor );
+ m_gradientUI->ySlider->setValue( _yfactor );
+ m_preview_gradient->setGradient( _c1, _c2, _t, _unbalanced, _xfactor, _yfactor );
+}
+
+
+void KPrBrushProperty::setUnbalancedEnabled( bool state )
+{
+ m_gradientUI->xFactorLabel->setEnabled( state );
+ m_gradientUI->xSlider->setEnabled( state );
+ m_gradientUI->yFactorLabel->setEnabled( state );
+ m_gradientUI->ySlider->setEnabled( state );
+}
+
+
+void KPrBrushProperty::slotReset()
+{
+ if ( m_brush.gType == BCT_PLAIN )
+ m_brush.gType = BCT_GHORZ;
+ setQBrush( m_brush.brush );
+ setGradient( m_brush.gColor1,
+ m_brush.gColor2,
+ m_brush.gType,
+ m_brush.unbalanced,
+ m_brush.xfactor,
+ m_brush.yfactor );
+
+ int panelIndex;
+ if( m_brush.fillType == FT_BRUSH && m_brush.brush.style() == QBrush::NoBrush )
+ panelIndex = 2;
+ else
+ panelIndex = (int)m_brush.fillType;
+
+ m_typeCombo->setCurrentItem( panelIndex );
+ slotTypeChanged( panelIndex );
+}
+
+
+void KPrBrushProperty::slotTypeChanged( int pos )
+{
+ m_stack->raiseWidget( pos );
+ slotBrushChanged();
+}
+
+
+void KPrBrushProperty::slotBrushChanged()
+{
+ m_preview_color->setBrush( getQBrush() );
+}
+
+
+void KPrBrushProperty::slotColor1Changed()
+{
+ m_preview_gradient->setColor1( getGColor1() );
+}
+
+
+void KPrBrushProperty::slotColor2Changed()
+{
+ m_preview_gradient->setColor2( getGColor2() );
+}
+
+
+void KPrBrushProperty::slotBackColorTypeChanged()
+{
+ BCType type = getGType();
+ m_preview_gradient->setBackColorType( type );
+ m_gradientUI->xSlider->setEnabled( type != 1 );
+ m_gradientUI->ySlider->setEnabled( type != 2 );
+}
+
+
+void KPrBrushProperty::slotUnbalancedChanged()
+{
+ bool state = getGUnbalanced();
+ setUnbalancedEnabled( state );
+ m_preview_gradient->setUnbalanced( state );
+
+ slotBackColorTypeChanged(); // make sure the sliders enabled-ness is up-to-date
+}
+
+
+void KPrBrushProperty::slotXFactorChanged()
+{
+ m_preview_gradient->setXFactor( getGXFactor() );
+}
+
+
+void KPrBrushProperty::slotYFactorChanged()
+{
+ m_preview_gradient->setYFactor( getGYFactor() );
+}
+
+#include "KPrBrushProperty.moc"
diff --git a/kpresenter/KPrBrushProperty.h b/kpresenter/KPrBrushProperty.h
new file mode 100644
index 000000000..1a49c685a
--- /dev/null
+++ b/kpresenter/KPrBrushProperty.h
@@ -0,0 +1,88 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#ifndef BRUSHSTYLEWIDGET_H
+#define BRUSHSTYLEWIDGET_H
+
+#include <qbrush.h>
+#include <qwidget.h>
+
+#include "KPrCommand.h"
+
+class BrushPropertyUI;
+class GradientPropertyUI;
+class KPrPBPreview;
+
+class QWidgetStack;
+
+class KComboBox;
+
+
+class KPrBrushProperty : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrBrushProperty( QWidget *parent, const char *name, const KPrBrushCmd::Brush &brush );
+ ~KPrBrushProperty();
+
+ int getBrushPropertyChange() const;
+ KPrBrushCmd::Brush getBrush() const;
+
+ void setBrush( KPrBrushCmd::Brush &brush );
+
+ void apply();
+
+protected:
+ FillType getFillType() const;
+ QBrush getQBrush() const;
+
+ QColor getGColor1() const;
+ QColor getGColor2() const;
+ BCType getGType() const;
+ bool getGUnbalanced() const;
+ int getGXFactor() const;
+ int getGYFactor() const;
+
+ void setQBrush( const QBrush &brush );
+ void setGradient( const QColor &_c1, const QColor &_c2, BCType _t,
+ bool _unbalanced, int _xfactor, int _yfactor );
+ void setUnbalancedEnabled( bool state );
+
+ KComboBox *m_typeCombo;
+ QWidgetStack *m_stack;
+ BrushPropertyUI *m_brushUI;
+ GradientPropertyUI *m_gradientUI;
+ KPrPBPreview *m_preview_color;
+ KPrPBPreview *m_preview_gradient;
+
+ KPrBrushCmd::Brush m_brush;
+
+protected slots:
+ void slotReset();
+ void slotTypeChanged( int pos );
+ void slotBrushChanged();
+
+ void slotColor1Changed();
+ void slotColor2Changed();
+ void slotBackColorTypeChanged();
+ void slotUnbalancedChanged();
+ void slotXFactorChanged();
+ void slotYFactorChanged();
+};
+
+#endif /* BRUSHSTYLEWIDGET_H */
diff --git a/kpresenter/KPrCanvas.cpp b/kpresenter/KPrCanvas.cpp
new file mode 100644
index 000000000..965a3fd4c
--- /dev/null
+++ b/kpresenter/KPrCanvas.cpp
@@ -0,0 +1,5704 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2002-2005 Thorsten Zachmann <zachmann@kde.org>
+ Copyright (C) 2005 Casper Boemann Rasmussen <cbr@boemann.dk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <stdlib.h>
+#include <math.h>
+
+#include <qprogressdialog.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+#include <qwmatrix.h>
+#include <qapplication.h>
+#include <kpopupmenu.h>
+#include <qimage.h>
+#include <qdatetime.h>
+#include <qdropsite.h>
+#include <qrect.h>
+#include <qsize.h>
+#include <qpoint.h>
+#include <qclipboard.h>
+
+#include <kapplication.h>
+#include <kmimemagic.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kprinter.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <ktempfile.h>
+#include <kdebug.h>
+#include <kcursor.h>
+#include <kmessagebox.h>
+#include <kmultipledrag.h>
+#include <kconfig.h>
+#include <kurl.h>
+#include <kurldrag.h>
+#include <kio/netaccess.h>
+
+#include <KoParagCounter.h>
+#include <KoPoint.h>
+#include <KoTextZoomHandler.h>
+#include <KoStore.h>
+#include <KoStoreDrag.h>
+#include "KoPointArray.h"
+#include <KoSpeaker.h>
+
+#include "KPrView.h"
+#include "KPrBackground.h"
+#include "KPrPixmapObject.h"
+#include "KPrFreehandObject.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrGotoPage.h"
+#include "KPrTextObject.h"
+#include "KPrSoundPlayer.h"
+#include "KPrNoteBar.h"
+#include "KPrPartObject.h"
+#include "KPrUtils.h"
+#include "KPrCommand.h"
+#include "KPrPolylineObject.h"
+#include "KPrClosedLineObject.h"
+#include "KPrPage.h"
+#include "KPrVariableCollection.h"
+#include "KPrGroupObject.h"
+#include "KPrDocument.h"
+
+#include "KPrCanvas.h"
+#include "KPrCanvas.moc"
+
+#include "KPrEffectHandler.h"
+#include "KPrPageEffects.h"
+#include <unistd.h>
+
+const int KPrCanvas::MOUSE_SNAP_DISTANCE = 4;
+const int KPrCanvas::KEY_SNAP_DISTANCE = 2;
+
+KPrCanvas::KPrCanvas( QWidget *parent, const char *name, KPrView *_view )
+: QWidget( parent, name, WStaticContents|WResizeNoErase|WRepaintNoErase )
+, buffer( size() )
+, m_gl( _view, _view->zoomHandler() )
+, m_paintGuides( false )
+, m_objectDisplayAbove( 0 )
+{
+ m_presMenu = 0;
+ m_currentTextObjectView=0L;
+ m_activePage=0L;
+ m_xOffset = 0;
+ m_yOffset = 0;
+ m_prevSpokenTO = 0;
+
+ m_keyPressEvent = false;
+ m_drawSymetricObject = false;
+ if ( parent ) {
+ showingLastSlide = false;
+ mousePressed = false;
+ drawContour = false;
+ modType = MT_NONE;
+ m_resizeObject = 0;
+ m_editObject = 0;
+ m_rotateObject = 0;
+ setBackgroundMode( Qt::NoBackground );
+ m_view = _view;
+ setupMenus();
+ setMouseTracking( true );
+ show();
+ editMode = true;
+ m_step.m_pageNumber = 0;
+ m_step.m_step = 0;
+ m_step.m_subStep = 0;
+ goingBack = false;
+ m_drawMode = false;
+ fillBlack = true;
+ drawRubber = false;
+ m_zoomRubberDraw = false;
+ toolEditMode = TEM_MOUSE;
+ setAcceptDrops( true );
+ m_ratio = 0.0;
+ m_isMoving = false;
+ m_isResizing = false;
+ mouseSelectedObject = false;
+ m_setPageTimer = true;
+ m_drawLineInDrawMode = false;
+ soundPlayer = 0;
+ m_disableSnapping = false;
+ m_drawPolyline = false;
+ m_drawCubicBezierCurve = false;
+ m_drawLineWithCubicBezierCurve = true;
+ m_oldCubicBezierPointArray.putPoints( 0, 4, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0 );
+ m_effectHandler = 0;
+ m_pageEffect = 0;
+ } else {
+ m_view = 0;
+ hide();
+ }
+
+ setFocusPolicy( QWidget::StrongFocus );
+ setFocus();
+ setKeyCompression( true );
+ setInputMethodEnabled( true ); // ensure using the InputMethod
+ installEventFilter( this );
+ KCursor::setAutoHideCursor( this, true, true );
+ m_zoomBeforePresentation=100;
+
+ if( m_view)
+ {
+ m_activePage=m_view->kPresenterDoc()->pageList().getFirst();
+ connect( m_view->kPresenterDoc(), SIGNAL( sig_terminateEditing( KPrTextObject * ) ),
+ this, SLOT( terminateEditing( KPrTextObject * ) ) );
+ connect( m_view, SIGNAL( autoScroll( const QPoint & )), this, SLOT( slotAutoScroll( const QPoint &)));
+ }
+
+ if ( kospeaker )
+ connect( kospeaker, SIGNAL( customSpeakWidget(QWidget*, const QPoint&, uint) ),
+ this, SLOT( speakTextUnderMouse(QWidget*, const QPoint&, uint) ) );
+}
+
+KPrCanvas::~KPrCanvas()
+{
+ // block all signals (save for destroyed()) to avoid crashes on exit
+ // (exitEditMode) emits signals
+ blockSignals(true);
+
+ exitEditMode( false );
+
+ delete m_presMenu;
+
+ stopSound();
+ delete soundPlayer;
+ blockSignals(false);
+}
+
+void KPrCanvas::scrollX( int x )
+{
+ // Relative movement
+ int dx = m_xOffset - x;
+ // new position
+ m_xOffset = x;
+ bitBlt( &buffer, dx, 0, &buffer );
+ scroll( dx, 0 );
+}
+
+void KPrCanvas::scrollY( int y )
+{
+ // Relative movement
+ int dy = m_yOffset - y;
+ // new position
+ m_yOffset = y;
+ bitBlt( &buffer, 0, dy, &buffer );
+ scroll( 0, dy );
+}
+
+bool KPrCanvas::eventFilter( QObject *o, QEvent *e )
+{
+ if ( !o || !e )
+ return TRUE;
+ if ( m_currentTextObjectView )
+ KCursor::autoHideEventFilter( o, e );
+ switch ( e->type() )
+ {
+ case QEvent::FocusIn:
+ if ( m_currentTextObjectView )
+ m_currentTextObjectView->focusInEvent();
+ return TRUE;
+ case QEvent::FocusOut:
+ if ( m_currentTextObjectView )
+ m_currentTextObjectView->focusOutEvent();
+ return TRUE;
+ case QEvent::KeyPress:
+ {
+ QKeyEvent * keyev = static_cast<QKeyEvent *>(e);
+ if ( keyev->key() == KGlobalSettings::contextMenuKey() ) {
+ popupContextMenu();
+ return true;
+ }
+ if ( m_currentTextObjectView &&
+ (keyev->key()==Qt::Key_Home ||keyev->key()==Key_End
+ || keyev->key()==Qt::Key_Tab || keyev->key()==Key_Prior
+ || keyev->key()==Qt::Key_Next || keyev->key() == Key_Backtab) )
+ {
+ m_currentTextObjectView->keyPressEvent( keyev );
+ return true;
+ }
+ else if ( !m_currentTextObjectView && keyev->key()==Qt::Key_Tab )
+ {
+ keyPressEvent(keyev);
+ return true;
+ }
+ break;
+ }
+ case QEvent::AccelOverride:
+ {
+#ifndef NDEBUG
+ QKeyEvent * keyev = static_cast<QKeyEvent *>(e);
+ // Debug keys
+ if ( ( keyev->state() & ControlButton ) && ( keyev->state() & ShiftButton ) )
+ {
+ switch ( keyev->key() ) {
+ case Qt::Key_P: // 'P' -> paragraph debug
+ printRTDebug( 0 );
+ keyev->accept();
+ break;
+ case Qt::Key_V: // 'V' -> verbose parag debug
+ printRTDebug( 1 );
+ keyev->accept();
+ break;
+ default:
+ break;
+ }
+ }
+#endif
+ break;
+ }
+ default:
+ break;
+ }
+ return QWidget::eventFilter(o,e);
+}
+
+bool KPrCanvas::focusNextPrevChild( bool )
+{
+ return TRUE; // Don't allow to go out of the canvas widget by pressing "Tab"
+}
+
+void KPrCanvas::paintEvent( QPaintEvent* paintEvent )
+{
+ if ( isUpdatesEnabled() )
+ {
+ //kdDebug(33001) << "KPrCanvas::paintEvent m_paintGuides = " << m_paintGuides << endl; //<< " " << kdBacktrace( 10 ) << endl;
+ KPrDocument *doc =m_view->kPresenterDoc();
+
+ if ( ! m_paintGuides )
+ {
+ //kdDebug(33001) << "KPrCanvas::paintEvent" << endl;
+ QPainter bufPainter;
+ bufPainter.begin( &buffer, this ); // double-buffering - (the buffer is as big as the widget)
+ bufPainter.translate( -diffx(), -diffy() );
+ bufPainter.setBrushOrigin( -diffx(), -diffy() );
+
+ QRect crect( paintEvent->rect() ); // the rectangle that needs to be repainted, in widget coordinates
+ bufPainter.setClipRect( crect );
+
+ //kdDebug(33001) << "KPrCanvas::paintEvent " << DEBUGRECT( crect ) << ", " << size() << endl;
+
+ crect.moveBy( diffx(), diffy() ); // now in contents coordinates
+ //kdDebug(33001) << "KPrCanvas::paintEvent after applying diffx/diffy: " << DEBUGRECT( crect ) << endl;
+
+ if ( editMode || !fillBlack )
+ bufPainter.fillRect( crect, white );
+ else
+ bufPainter.fillRect( crect, black );
+
+ KPrPage * page = editMode ? m_activePage : doc->pageList().at( m_step.m_pageNumber );
+ drawBackground( &bufPainter, crect, page, editMode );
+
+ if ( editMode )
+ {
+ SelectionMode selectionMode;
+
+ if ( toolEditMode == TEM_MOUSE || toolEditMode == TEM_ZOOM )
+ selectionMode = SM_MOVERESIZE;
+ else if ( toolEditMode == TEM_ROTATE )
+ selectionMode = SM_ROTATE;
+ else
+ selectionMode = SM_NONE;
+
+ if ( doc->showGrid() )
+ drawGrid( &bufPainter, crect );
+
+ drawEditPage( &bufPainter, crect, page, selectionMode );
+ }
+ else
+ {
+ // Center the slide in the screen, if it's smaller...
+#if 0 // this works but isn't enough - e.g. object effects need the same offsets
+ // so we should store them, but they don't work like diffx/diffy...
+ // (e.g. the painter mustn't be translated when painting the background)
+ QRect desk = KGlobalSettings::desktopGeometry(this);
+ QRect pgRect = m_view->kPresenterDoc()->pageList().at(0)->getZoomPageRect();
+ int offx = 0, offy = 0;
+ if ( desk.width() > pgRect.width() )
+ offx = ( desk.width() - pgRect.width() ) / 2;
+ if ( desk.height() > pgRect.height() )
+ offy = ( desk.height() - pgRect.height() ) / 2;
+ bufPainter.translate( offx, offy );
+#endif
+
+ PresStep step( m_step.m_pageNumber, m_step.m_step, m_step.m_subStep, m_effectTimer.isActive(), !goingBack );
+ drawPresPage( &bufPainter, crect, step );
+ if ( m_drawMode && m_drawModeLines.count() )
+ {
+ bufPainter.save();
+ bufPainter.setPen( m_view->kPresenterDoc()->presPen() );
+ for ( unsigned int i = 0; i < m_drawModeLines.count(); ++i )
+ {
+ bufPainter.drawPolyline( m_drawModeLines[i] );
+ }
+ bufPainter.restore();
+ }
+ }
+
+ bufPainter.end();
+ }
+
+
+ QPixmap topBuffer( buffer );
+ QPainter topPainter( &topBuffer, &buffer );
+ topPainter.translate( -diffx(), -diffy() );
+ topPainter.setBrushOrigin( -diffx(), -diffy() );
+
+ if ( editMode && doc->showGuideLines() )
+ {
+ m_gl.paintGuides( topPainter );
+ }
+
+ topPainter.setPen( QPen( Qt::black, 1, Qt::SolidLine ) );
+ topPainter.setRasterOp( NotROP );
+ switch ( toolEditMode )
+ {
+ case MT_NONE:
+ if ( drawRubber )
+ {
+ topPainter.setPen( QPen( black, 0, DotLine ) );
+ topPainter.drawRect( m_view->zoomHandler()->zoomRect( m_rubber ) );
+ }
+ break;
+ case INS_RECT:
+ if ( !m_insertRect.isNull() )
+ {
+ topPainter.drawRoundRect( m_view->zoomHandler()->zoomRect( m_insertRect.normalize() ),
+ m_view->getRndX(), m_view->getRndY() );
+ }
+ break;
+ case INS_ELLIPSE:
+ if ( !m_insertRect.isNull() )
+ {
+ topPainter.drawEllipse( m_view->zoomHandler()->zoomRect( m_insertRect.normalize() ) );
+ }
+ break;
+ case INS_AUTOFORM:
+ case INS_DIAGRAMM:
+ case INS_FORMULA:
+ case INS_CLIPART:
+ case INS_PICTURE:
+ case INS_OBJECT:
+ case INS_TABLE:
+ case INS_TEXT:
+ if ( !m_insertRect.isNull() )
+ {
+ topPainter.drawRect( m_view->zoomHandler()->zoomRect( m_insertRect.normalize() ) );
+ }
+ break;
+ case INS_PIE:
+ if ( !m_insertRect.isNull() )
+ {
+ drawPieObject( &topPainter, m_insertRect );
+ }
+ break;
+ case INS_LINE:
+ topPainter.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+ break;
+ case INS_FREEHAND:
+ case INS_CLOSED_FREEHAND:
+ case INS_POLYLINE:
+ case INS_CLOSED_POLYLINE:
+ {
+ QPointArray pointArray = m_pointArray.zoomPointArray( m_view->zoomHandler() );
+ topPainter.drawPolyline( pointArray );
+ topPainter.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+ } break;
+ case INS_QUADRICBEZIERCURVE:
+ case INS_CUBICBEZIERCURVE:
+ case INS_CLOSED_QUADRICBEZIERCURVE:
+ case INS_CLOSED_CUBICBEZIERCURVE:
+ if ( m_drawCubicBezierCurve )
+ {
+ if ( m_indexPointArray > 0 )
+ {
+ redrawCubicBezierCurve( topPainter );
+ drawCubicBezierCurve( topPainter, m_oldCubicBezierPointArray );
+ }
+ }
+ break;
+ case INS_POLYGON:
+ drawPolygon( topPainter, m_insertRect );
+ break;
+ default:
+ break;
+ }
+ topPainter.end();
+ bitBlt( this, paintEvent->rect().topLeft(), &topBuffer, paintEvent->rect() );
+ }
+ //else kdDebug(33001) << "KPrCanvas::paintEvent with updates disabled" << endl;
+}
+
+
+void KPrCanvas::drawBackground( QPainter *painter, const QRect& rect, KPrPage * page, bool edit ) const
+{
+ if ( edit )
+ {
+ QRect pageRect = page->getZoomPageRect();
+
+ if ( rect.intersects( pageRect ) )
+ {
+ if ( page->displayBackground() )
+ {
+ if ( page->masterPage() && page->useMasterBackground() )
+ page->masterPage()->background()->drawBackground( painter, m_view->zoomHandler(), rect, true );
+ else
+ page->background()->drawBackground( painter, m_view->zoomHandler(), rect, true );
+ }
+ }
+ // Include the border
+ pageRect.rLeft() -= 1;
+ pageRect.rTop() -= 1;
+ pageRect.rRight() += 1;
+ pageRect.rBottom() += 1;
+
+ QRegion grayRegion( rect );
+ grayRegion -= pageRect;
+
+ // In edit mode we also want to draw the gray area out of the pages
+ if ( !grayRegion.isEmpty() )
+ eraseEmptySpace( painter, grayRegion, QApplication::palette().active().brush( QColorGroup::Mid ) );
+ }
+ else
+ {
+ // Old code, left a black area if zoomX != zoomY
+ //page->background()->draw( painter, m_view->zoomHandler(), rect, false );
+
+ QRect desk = KGlobalSettings::desktopGeometry(getView());
+ QRect crect = desk.intersect( rect );
+ if ( crect.isEmpty() || !page->displayBackground())
+ return;
+
+ if ( page->masterPage() && page->useMasterBackground() )
+ page->masterPage()->background()->drawBackground( painter, desk.size(), crect, false );
+ else
+ page->background()->drawBackground( painter, desk.size(), crect, false );
+ }
+}
+
+
+// 100% stolen from KWord
+void KPrCanvas::eraseEmptySpace( QPainter * painter, const QRegion & emptySpaceRegion, const QBrush & brush ) const
+{
+ painter->save();
+ painter->setClipRegion( emptySpaceRegion, QPainter::CoordPainter );
+ painter->setPen( Qt::NoPen );
+
+ //kdDebug(33001) << "KWDocument::eraseEmptySpace emptySpaceRegion: " << DEBUGRECT( emptySpaceRegion.boundingRect() ) << endl;
+ painter->fillRect( emptySpaceRegion.boundingRect(), brush );
+ painter->restore();
+}
+
+
+void KPrCanvas::drawObjects( QPainter *painter, const QPtrList<KPrObject> &objects, SelectionMode selectionMode,
+ bool contour, KPrTextView * textView, int pageNum ) const
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current(); ++it )
+ {
+ SelectionMode selMode = selectionMode;
+ if ( selectionMode != SM_NONE
+ && it.current()->isSelected()
+ && ( m_view->kPresenterDoc()->isHeaderFooter(it.current())
+ || it.current()->isProtect() ) )
+ selMode = SM_PROTECT;
+
+ it.current()->draw( painter, m_view->zoomHandler(), pageNum, selMode, (it.current()->isSelected()) && contour );
+
+ it.current()->setSubPresStep( 0 );
+ it.current()->doSpecificEffects( false );
+ }
+
+ if ( textView )
+ {
+ textView->kpTextObject()->paintEdited( painter, m_view->zoomHandler(), false /*onlyChanged. Pass as param ?*/,
+ textView->cursor(), true /* idem */ );
+ }
+}
+
+
+void KPrCanvas::drawObjectsPres( QPainter *painter, const QPtrList<KPrObject> &_objects, PresStep step ) const
+{
+ QPtrList<KPrObject> objects;
+
+ QPtrListIterator<KPrObject> it( _objects );
+ for ( ; it.current(); ++it )
+ {
+ if ( objectIsAHeaderFooterHidden(it.current()) )
+ continue;
+ if ( it.current()->getAppearStep() <= step.m_step
+ && ( ! it.current()->getDisappear()
+ || it.current()->getDisappear()
+ && it.current()->getDisappearStep() > step.m_step ) )
+ {
+ if ( step.m_animate && it.current()->getAppearStep() == step.m_step && it.current()->getEffect() != EF_NONE )
+ continue;
+
+ if ( step.m_animateSub && it.current()->getAppearStep() == step.m_step )
+ {
+ it.current()->setSubPresStep( step.m_subStep );
+ it.current()->doSpecificEffects( true, false );
+ }
+
+ objects.append( it.current() );
+ }
+ }
+ drawObjects( painter, objects, SM_NONE, false, NULL, step.m_pageNumber );
+}
+
+
+void KPrCanvas::drawObjectsEdit( QPainter *painter, const KoRect &rect, const QPtrList<KPrObject> &_objects,
+ SelectionMode selectionMode, int pageNum ) const
+{
+ QPtrList<KPrObject> objects;
+
+ KPrTextView * textView = NULL;
+ QPtrListIterator<KPrObject> it( _objects );
+ for ( ; it.current(); ++it )
+ {
+ if ( objectIsAHeaderFooterHidden(it.current()) )
+ continue;
+
+ if ( rect.intersects( it.current()->getRepaintRect() ) )
+ {
+ if ( m_currentTextObjectView && m_currentTextObjectView->kpTextObject() == it.current() )
+ {
+ textView = m_currentTextObjectView;
+ }
+
+ objects.append( it.current() );
+ }
+ }
+ drawObjects( painter, objects, selectionMode, drawContour, textView, pageNum );
+}
+
+
+void KPrCanvas::drawEditPage( QPainter *painter, const QRect &_rect,
+ KPrPage *page, SelectionMode selectionMode ) const
+{
+ KoRect rect = m_view->zoomHandler()->unzoomRect(_rect);
+
+ int pageNum = m_view->kPresenterDoc()->pageList().findRef( page );
+ //objects on master page
+ if ( page->masterPage() && page->displayObjectFromMasterPage() )
+ drawObjectsEdit( painter, rect, page->masterPage()->objectList(), selectionMode, pageNum );
+ //objects on current page
+ drawObjectsEdit( painter, rect, displayObjectList(), selectionMode, pageNum );
+}
+
+
+void KPrCanvas::drawPresPage( QPainter *painter, const QRect &_rect, PresStep step ) const
+{
+ KoRect rect = m_view->zoomHandler()->unzoomRect(_rect);
+
+ KPrPage * page = m_view->kPresenterDoc()->pageList().at(step.m_pageNumber);
+ //objects on master page
+ if ( page->masterPage() && page->displayObjectFromMasterPage() )
+ drawObjectsPres( painter, page->masterPage()->objectList(), step );
+ //objects on current page
+ drawObjectsPres( painter, page->objectList(), step );
+}
+
+
+void KPrCanvas::drawGrid(QPainter *painter, const QRect &rect2) const
+{
+ KPrDocument *doc=m_view->kPresenterDoc();
+
+ if(!doc->isReadWrite())
+ return;
+ QPen _pen = QPen( doc->gridColor(), 6, Qt::DotLine );
+ painter->save();
+ painter->setPen( _pen );
+ QRect pageRect = m_activePage->getZoomPageRect();
+
+ int zoomedX, zoomedY;
+ double offsetX = doc->getGridX();
+ double offsetY = doc->getGridY();
+
+ for ( double i = offsetX; ( zoomedX = m_view->zoomHandler()->zoomItX( i )+pageRect.left() ) < pageRect.right(); i += offsetX )
+ for ( double j = offsetY; ( zoomedY = m_view->zoomHandler()->zoomItY( j )+pageRect.top() ) < pageRect.bottom(); j += offsetY )
+ if( rect2.contains( zoomedX, zoomedY ) )
+ painter->drawPoint( zoomedX, zoomedY );
+
+ painter->restore();
+}
+
+
+// This one is used to generate the pixmaps for the HTML presentation,
+// for the pres-structure-dialog, for the sidebar previews, for template icons.
+void KPrCanvas::drawAllObjectsInPage( QPainter *painter, const QPtrList<KPrObject> & obj, int pageNum ) const
+{
+ QPtrListIterator<KPrObject> it( obj );
+ for ( ; it.current(); ++it ) {
+ if ( objectIsAHeaderFooterHidden( it.current() ) )
+ continue;
+ it.current()->draw( painter, m_view->zoomHandler(), pageNum, SM_NONE, false );
+ }
+}
+
+void KPrCanvas::recalcAutoGuides( )
+{
+ QValueList<double> horizontalPos;
+ QValueList<double> verticalPos;
+ QPtrListIterator<KPrObject> it( m_activePage->objectList() );
+ for ( ; it.current(); ++it )
+ {
+ if( ! it.current()->isSelected() )
+ it.current()->addSelfToGuides( horizontalPos, verticalPos);
+ }
+
+ m_gl.setAutoGuideLines( horizontalPos, verticalPos );
+}
+
+void KPrCanvas::mousePressEvent( QMouseEvent *e )
+{
+ QPoint contentsPoint( e->pos().x()+diffx(), e->pos().y()+diffy() );
+ KoPoint docPoint = m_view->zoomHandler()->unzoomPoint( contentsPoint );
+ m_insertRect = KoRect();
+
+ if(!m_view->koDocument()->isReadWrite())
+ return;
+
+ if ( editMode && m_view->kPresenterDoc()->showGuideLines() && toolEditMode == TEM_MOUSE && m_gl.mousePressEvent( e ) )
+ return;
+
+ m_moveStartPosMouse = objectRect( false ).topLeft();
+ if(m_currentTextObjectView)
+ {
+ KPrTextObject *txtObj=m_currentTextObjectView->kpTextObject();
+ Q_ASSERT(txtObj);
+ if(txtObj->contains( docPoint ))
+ {
+ KoPoint pos = docPoint - txtObj->innerRect().topLeft(); // in pt, but now translated into the object's coordinate system
+ // This is common to all mouse buttons, so that RMB and MMB place the cursor too
+ m_currentTextObjectView->mousePressEvent(e, m_view->zoomHandler()->ptToLayoutUnitPix( pos ) ); // in LU pixels
+ mousePressed = true;
+ m_view->enableAutoScroll();
+ if(e->button() == RightButton)
+ {
+ m_currentTextObjectView->showPopup( m_view, QCursor::pos(), m_view->actionList() );
+ m_view->disableAutoScroll();
+ mousePressed=false;
+ }
+ else if( e->button() == MidButton )
+ {
+ QApplication::clipboard()->setSelectionMode( true );
+ m_currentTextObjectView->paste();
+ QApplication::clipboard()->setSelectionMode( false );
+ }
+ return;
+ }
+ }
+
+
+ KPrObject *kpobject = 0;
+
+ m_disableSnapping = e->state() & ShiftButton;
+
+ exitEditMode();
+
+ if ( editMode ) {
+ if ( e->button() == LeftButton ) {
+ mousePressed = true;
+ m_view->enableAutoScroll();
+
+ if ( m_drawPolyline && ( toolEditMode == INS_POLYLINE || toolEditMode == INS_CLOSED_POLYLINE ) )
+ {
+ m_startPoint = snapPoint( docPoint );
+ m_pointArray.putPoints( m_indexPointArray, 1, m_startPoint.x(), m_startPoint.y() );
+
+ ++m_indexPointArray;
+ return;
+ }
+
+ if ( m_drawCubicBezierCurve && ( toolEditMode == INS_CUBICBEZIERCURVE
+ || toolEditMode == INS_QUADRICBEZIERCURVE
+ || toolEditMode == INS_CLOSED_CUBICBEZIERCURVE
+ || toolEditMode == INS_CLOSED_QUADRICBEZIERCURVE ) ) {
+ if ( m_drawLineWithCubicBezierCurve ) {
+ QPainter p( this );
+ p.setPen( QPen( Qt::black, 1, Qt::SolidLine ) );
+ p.setBrush( Qt::NoBrush );
+ p.setRasterOp( Qt::NotROP );
+
+ p.translate( -diffx(), -diffy() );
+ KoPoint newStartPoint = snapPoint( docPoint );
+
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( newStartPoint ) );
+
+ m_startPoint = newStartPoint;
+ p.end();
+
+ m_pointArray.putPoints( m_indexPointArray, 1, m_startPoint.x(), m_startPoint.y() );
+
+ ++m_indexPointArray;
+ m_drawLineWithCubicBezierCurve = false;
+ }
+ else {
+ QPainter p( this );
+ QPen _pen = QPen( Qt::black, 1, Qt::DashLine );
+ p.setPen( _pen );
+ p.setBrush( Qt::NoBrush );
+ p.setRasterOp( Qt::NotROP );
+
+ p.translate( -diffx(), -diffy() );
+ p.save();
+
+ KoPoint endPoint = snapPoint( docPoint );
+
+ double angle = KoPoint::getAngle( endPoint, m_startPoint );
+
+ drawFigure( L_SQUARE, &p, endPoint, _pen.color(), _pen.width(), angle, m_view->zoomHandler() ); // erase old figure
+
+ p.restore();
+
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( endPoint ) );// erase old line
+
+ m_symmetricEndPoint = m_startPoint * 2 - endPoint;
+
+ p.save();
+ angle = KoPoint::getAngle( m_symmetricEndPoint, m_startPoint );
+
+ drawFigure( L_SQUARE, &p, m_symmetricEndPoint, _pen.color(), _pen.width(), angle, m_view->zoomHandler() ); // erase old figure
+
+ p.restore();
+
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_symmetricEndPoint ) );// erase old line
+
+ m_pointArray.putPoints( m_indexPointArray, 3, m_CubicBezierSecondPoint.x(), m_CubicBezierSecondPoint.y(),
+ m_CubicBezierThirdPoint.x(), m_CubicBezierThirdPoint.y(),
+ m_startPoint.x(), m_startPoint.y() );
+ m_indexPointArray += 3;
+ m_drawLineWithCubicBezierCurve = true;
+ m_oldCubicBezierPointArray = KoPointArray();
+ m_oldCubicBezierPointArray.putPoints( 0, 4, (double)0,(double)0, (double)0,(double)0,
+ (double)0,(double)0, (double)0,(double)0 );
+ m_endPoint = m_startPoint;
+ }
+
+ return;
+ }
+
+ switch ( toolEditMode ) {
+ case TEM_MOUSE: {
+ KPrObject *kpobject = getObjectAt( docPoint, true );
+
+ if ( kpobject ) {
+ // use ctrl + Button to select / deselect object
+ if ( e->state() & ControlButton && kpobject->isSelected() )
+ deSelectObj( kpobject );
+ else if ( e->state() & ControlButton )
+ {
+ selectObj( kpobject );
+ raiseObject( kpobject );
+ m_moveStartPosMouse = objectRect( false ).topLeft();
+ }
+ else
+ {
+ if ( modType != MT_MOVE || !kpobject->isSelected() )
+ deSelectAllObj();
+
+ selectObj( kpobject );
+ raiseObject( kpobject );
+ m_moveStartPosMouse = objectRect( false ).topLeft();
+ }
+
+ // start resizing
+ if ( modType != MT_MOVE && modType != MT_NONE )
+ {
+ deSelectAllObj();
+ selectObj( kpobject );
+ raiseObject( kpobject );
+
+ m_resizeObject = kpobject;
+
+ m_ratio = static_cast<double>( kpobject->getSize().width() ) /
+ static_cast<double>( kpobject->getSize().height() );
+ m_rectBeforeResize = kpobject->getRect();
+ }
+ recalcAutoGuides();
+ if ( m_view->kPresenterDoc()->showGuideLines() && !m_disableSnapping )
+ {
+ m_gl.repaintSnapping( objectRect( false ) );
+ }
+ }
+ else
+ {
+ KPrPage *masterPage = m_activePage->masterPage();
+ if ( masterPage && m_activePage->displayObjectFromMasterPage() )
+ {
+ kpobject = masterPage->getObjectAt( docPoint, true );
+
+ if ( kpobject && objectIsAHeaderFooterHidden( kpobject ) )
+ {
+ kpobject = 0;
+ }
+ }
+
+ if ( kpobject )
+ {
+ mousePressed = false;
+ QString msg( i18n( "The object you are trying to select belongs to the master slide. "
+ "Editing the object can only be done on the master slide.\n"
+ "Go there now?" ) );
+ m_view->disableAutoScroll(); // needed because the messagebox 'eats' the mouseRelease
+ if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes )
+ {
+ getView()->setEditMaster( true );
+ selectObj( kpobject );
+ raiseObject( kpobject );
+ m_moveStartPosMouse = objectRect( false ).topLeft();
+ }
+ else
+ {
+ deSelectAllObj();
+ modType = MT_NONE;
+ }
+ }
+ else {
+ modType = MT_NONE;
+ if ( !( e->state() & ShiftButton ) && !( e->state() & ControlButton ) )
+ deSelectAllObj();
+
+ drawRubber = true;
+ m_rubber = KoRect( docPoint.x(), docPoint.y(), 0, 0 );
+ }
+ }
+ m_origMousePos = docPoint;
+ } break;
+ case TEM_ZOOM: {
+ modType = MT_NONE;
+ drawRubber = true;
+ m_zoomRubberDraw = false;
+ m_rubber = KoRect( docPoint.x(), docPoint.y(), 0, 0 );
+ }break;
+ case TEM_ROTATE:
+ {
+ KPrObject *kpobject = getObjectAt( docPoint );
+
+ // clear old selections even if shift or control are pressed
+ // we don't support rotating multiple objects yet
+ deSelectAllObj();
+
+ if ( kpobject && !kpobject->isProtect())
+ {
+ m_rotateObject = kpobject;
+ m_rotateStart = docPoint;
+ m_angleBeforeRotate = kpobject->getAngle();
+ selectObj( kpobject );
+ raiseObject( kpobject );
+
+ // set center of selected object bounding rect
+ m_rotateCenter = kpobject->getRealRect().center();
+ }
+ } break;
+ case INS_LINE:
+ deSelectAllObj();
+ recalcAutoGuides();
+ mousePressed = true;
+
+ m_startPoint = snapPoint( docPoint );
+ m_endPoint = m_startPoint;
+ break;
+ case INS_FREEHAND: case INS_CLOSED_FREEHAND: {
+ deSelectAllObj();
+ recalcAutoGuides();
+ mousePressed = true;
+
+ m_indexPointArray = 0;
+ m_startPoint = snapPoint( docPoint );
+ m_endPoint = m_startPoint;
+ m_pointArray.putPoints( m_indexPointArray, 1, m_startPoint.x(), m_startPoint.y() );
+ ++m_indexPointArray;
+ } break;
+ case INS_POLYLINE: case INS_CLOSED_POLYLINE: {
+ deSelectAllObj();
+ recalcAutoGuides();
+ mousePressed = true;
+
+ m_drawPolyline = true;
+ m_indexPointArray = 0;
+ m_startPoint = snapPoint( docPoint );
+ m_endPoint = m_startPoint;
+ m_pointArray.putPoints( m_indexPointArray, 1, m_startPoint.x(), m_startPoint.y() );
+ ++m_indexPointArray;
+ } break;
+ case INS_CUBICBEZIERCURVE: case INS_QUADRICBEZIERCURVE:
+ case INS_CLOSED_CUBICBEZIERCURVE: case INS_CLOSED_QUADRICBEZIERCURVE: {
+ deSelectAllObj();
+ recalcAutoGuides();
+ mousePressed = true;
+
+ m_drawCubicBezierCurve = true;
+ m_drawLineWithCubicBezierCurve = true;
+ m_indexPointArray = 0;
+
+ m_oldCubicBezierPointArray.putPoints( 0, 4, (double)0,(double)0, (double)0,(double)0,
+ (double)0,(double)0, (double)0,(double)0 );
+ m_startPoint = snapPoint( docPoint );
+ m_endPoint = m_startPoint;
+ m_pointArray.putPoints( m_indexPointArray, 1, m_startPoint.x(), m_startPoint.y() );
+
+ ++m_indexPointArray;
+ } break;
+ default: {
+ deSelectAllObj();
+ recalcAutoGuides();
+ mousePressed = true;
+ KoPoint sp( snapPoint( docPoint ) );
+ m_insertRect = KoRect( sp.x(), sp.y(),0 ,0 );
+ } break;
+ }
+ }
+
+ if ( e->button() == RightButton && ( toolEditMode == INS_POLYLINE || toolEditMode == INS_CLOSED_POLYLINE )
+ && !m_pointArray.isNull() && m_drawPolyline ) {
+ if( m_indexPointArray > 1)
+ {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.translate( -diffx(), -diffy() );
+ p.save();
+ p.setRasterOp( NotROP );
+
+ // remove old line
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_pointArray.at( m_indexPointArray - 2 ) ) );
+ p.restore();
+
+ m_indexPointArray = QMAX( 1, m_indexPointArray - 1 );
+ m_pointArray.resize( m_indexPointArray );
+ m_startPoint = m_pointArray.at( m_indexPointArray - 1 );
+
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+
+ p.end();
+ }
+ else if( m_indexPointArray == 1)
+ {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+ p.end();
+ m_pointArray = KoPointArray();
+ m_indexPointArray = 0;
+
+ m_drawPolyline = false;
+ m_view->disableAutoScroll();
+ mousePressed = false;
+ }
+ return;
+ }
+
+ if ( e->button() == RightButton && ( toolEditMode == INS_CUBICBEZIERCURVE || toolEditMode == INS_QUADRICBEZIERCURVE
+ || toolEditMode == INS_CLOSED_CUBICBEZIERCURVE || toolEditMode == INS_CLOSED_QUADRICBEZIERCURVE )
+ && !m_pointArray.isNull() && m_drawCubicBezierCurve ) {
+ if ( m_drawLineWithCubicBezierCurve ) {
+ KoPoint point = snapPoint( docPoint );
+ m_pointArray.putPoints( m_indexPointArray, 1, point.x(), point.y() );
+ ++m_indexPointArray;
+ }
+ else {
+ m_pointArray.putPoints( m_indexPointArray, 2, m_CubicBezierSecondPoint.x(), m_CubicBezierSecondPoint.y(),
+ m_CubicBezierThirdPoint.x(), m_CubicBezierThirdPoint.y() );
+ m_indexPointArray += 2;
+ }
+
+ endDrawCubicBezierCurve();
+
+ m_gl.repaintAfterSnapping();
+
+ return;
+ }
+
+ if ( e->button() == RightButton && toolEditMode == TEM_MOUSE ) {
+ KPrObject * obj = getObjectAt( docPoint );
+ if ( obj )
+ {
+ kpobject = obj;
+ QPoint pnt = QCursor::pos();
+ mousePressed = false;
+ m_view->disableAutoScroll();
+ bool state=!( e->state() & ShiftButton ) && !( e->state() & ControlButton ) && !kpobject->isSelected();
+
+ if ( state )
+ deSelectAllObj();
+ selectObj( kpobject );
+ objectPopup( kpobject, pnt );
+ } else {
+ QPoint pnt = QCursor::pos();
+ m_view->openPopupMenuMenuPage( pnt );
+ m_view->disableAutoScroll();
+ mousePressed = false;
+ }
+ modType = MT_NONE;
+
+ }
+ else if( e->button() == RightButton && toolEditMode == TEM_ZOOM ) {
+ QPoint pnt = QCursor::pos();
+ mousePressed = false;
+ m_view->disableAutoScroll();
+ m_view->openPopupMenuZoom( pnt );
+ }
+ else if( e->button() == RightButton && toolEditMode != TEM_MOUSE ) {
+ //deactivate tools when you click on right button
+ setToolEditMode( TEM_MOUSE );
+ }
+ } else {
+ if ( e->button() == LeftButton ) {
+ if ( m_drawMode ) {
+ setCursor( KPrUtils::penCursor() );
+ m_drawLineInDrawMode = true;
+ m_drawModeLineIndex = 0;
+ m_drawModeLines.append( QPointArray() );
+ m_drawModeLines[m_drawModeLines.count() - 1].putPoints( m_drawModeLineIndex++, 1, e->x(), e->y() );
+ }
+ else
+ m_view->screenNext();
+ } else if ( e->button() == MidButton )
+ m_view->screenPrev();
+ else if ( e->button() == RightButton ) {
+ if ( !m_drawMode && !spManualSwitch() )
+ {
+ finishObjectEffects();
+ finishPageEffect();
+ m_view->stopAutoPresTimer();
+ }
+
+ setCursor( arrowCursor );
+ QPoint pnt = QCursor::pos();
+ int ret = m_presMenu->exec( pnt );
+ // we have to continue the timer if the menu was canceled and we draw mode is not active
+ if ( ret == -1 && !m_presMenu->isItemChecked( PM_DM ) && !spManualSwitch() )
+ m_view->continueAutoPresTimer();
+ }
+ }
+
+
+#if 0 // Where do you need this ? (toshitaka)
+ // ME: I have no idea why this is needed at all
+ if ( toolEditMode == TEM_MOUSE )
+ mouseMoveEvent( e );
+#endif
+}
+
+KoRect KPrCanvas::getAlignBoundingRect() const
+{
+ KoRect boundingRect;
+
+ QPtrListIterator<KPrObject> it( m_activePage->objectList() );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current() == m_view->kPresenterDoc()->header() ||
+ it.current() == m_view->kPresenterDoc()->footer() )
+ continue;
+
+ if( it.current()->isSelected() && !it.current()->isProtect() ) {
+ boundingRect |= it.current()->getRealRect();
+ }
+ }
+ return boundingRect;
+}
+
+void KPrCanvas::mouseReleaseEvent( QMouseEvent *e )
+{
+ if ( editMode && m_view->kPresenterDoc()->showGuideLines() && toolEditMode == TEM_MOUSE && m_gl.mouseReleaseEvent( e ) )
+ return;
+
+ QPoint contentsPoint( e->pos().x()+diffx(), e->pos().y()+diffy() );
+ if(m_currentTextObjectView)
+ {
+ m_currentTextObjectView->mouseReleaseEvent( e, contentsPoint );
+ emit objectSelectedChanged();
+ m_view->disableAutoScroll();
+ mousePressed=false;
+ return;
+ }
+
+ if ( e->button() != LeftButton )
+ return;
+
+ if ( m_drawMode ) {
+ m_drawLineInDrawMode = false;
+ m_drawModeLines[m_drawModeLines.count() - 1].putPoints( m_drawModeLineIndex++, 1, contentsPoint.x(), contentsPoint.y() );
+ return;
+ }
+
+ QPtrList<KPrObject> _objects;
+ _objects.setAutoDelete( false );
+
+ if ( ( m_drawPolyline && ( toolEditMode == INS_POLYLINE || toolEditMode == INS_CLOSED_POLYLINE ) )
+ || ( m_drawCubicBezierCurve && ( toolEditMode == INS_CUBICBEZIERCURVE || toolEditMode == INS_QUADRICBEZIERCURVE
+ || toolEditMode == INS_CLOSED_CUBICBEZIERCURVE || toolEditMode == INS_CLOSED_QUADRICBEZIERCURVE ) ) ) {
+ return;
+ }
+
+ m_insertRect = m_insertRect.normalize();
+
+ switch ( toolEditMode ) {
+ case TEM_MOUSE: {
+ drawContour = FALSE;
+ switch ( modType ) {
+ case MT_NONE: {
+ if ( drawRubber ) {
+ // used for selecting multiple object in with the mouse
+ QPainter p;
+ p.begin( this );
+ p.setRasterOp( NotROP );
+ p.setPen( QPen( black, 0, DotLine ) );
+ p.translate( -diffx(), -diffy() );
+ p.drawRect( m_view->zoomHandler()->zoomRect( m_rubber ) );
+ p.end();
+ drawRubber = false;
+
+ m_rubber = m_rubber.normalize();
+
+ QPtrListIterator<KPrObject> it( getObjectList() );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->intersects( m_rubber ) )
+ {
+ if( objectIsAHeaderFooterHidden(it.current()))
+ continue;
+ it.current()->setSelected( true );
+ mouseSelectedObject = true;
+ }
+ }
+
+ if ( mouseSelectedObject )
+ _repaint( false );
+ emit objectSelectedChanged();
+ }
+ } break;
+ case MT_MOVE: {
+ KoPoint move( objectRect( false ).topLeft() - m_moveStartPosMouse );
+ if ( move != KoPoint( 0, 0 ) )
+ {
+ KCommand *cmd=m_activePage->moveObject(m_view, move.x(), move.y());
+ if(cmd)
+ m_view->kPresenterDoc()->addCommand( cmd );
+ } else
+ {
+ m_activePage->repaintObj();
+ }
+ m_isMoving = false;
+ }
+ break;
+ case MT_RESIZE_UP:
+ finishResizeObject( i18n( "Resize Object Up" ) );
+ break;
+ case MT_RESIZE_DN:
+ finishResizeObject( i18n( "Resize Object Down" ), false );
+ break;
+ case MT_RESIZE_LF:
+ finishResizeObject( i18n( "Resize Object Left" ) );
+ break;
+ case MT_RESIZE_RT:
+ finishResizeObject( i18n( "Resize Object Right" ) );
+ break;
+ case MT_RESIZE_LU:
+ finishResizeObject( i18n( "Resize Object Left && Up" ) );
+ break;
+ case MT_RESIZE_LD:
+ finishResizeObject( i18n( "Resize Object Left && Down" ) );
+ break;
+ case MT_RESIZE_RU:
+ finishResizeObject( i18n( "Resize Object Right && Up" ) );
+ break;
+ case MT_RESIZE_RD:
+ finishResizeObject( i18n( "Resize Object Right && Down" ) );
+ break;
+ }
+ } break;
+ case INS_TEXT:
+ if ( !m_insertRect.isNull() )
+ {
+ KPrTextObject* kptextobject = insertTextObject( m_insertRect );
+ setToolEditMode( TEM_MOUSE );
+
+ // User-friendlyness: automatically start editing this textobject
+ createEditing( kptextobject );
+ //setTextBackground( kptextobject );
+ //setCursor( arrowCursor );
+ }
+ break;
+ case TEM_ZOOM:{
+ drawContour = FALSE;
+ if( modType == MT_NONE && drawRubber )
+ {
+ QPainter p;
+ p.begin( this );
+ p.setRasterOp( NotROP );
+ p.setPen( QPen( black, 0, DotLine ) );
+ p.translate( -diffx(), -diffy() );
+ p.drawRect( m_view->zoomHandler()->zoomRect( m_rubber ) );
+ p.end();
+ drawRubber = false;
+ m_rubber = m_rubber.normalize();
+ if ( m_zoomRubberDraw )
+ {
+ m_view->setZoomRect( m_rubber );
+ }
+ else
+ {
+ m_view->zoomPlus();
+ }
+ m_zoomRubberDraw = false;
+ }
+ }break;
+ case TEM_ROTATE: {
+ drawContour = FALSE;
+ if ( !m_rotateObject )
+ break;
+ if ( m_angleBeforeRotate != m_rotateObject->getAngle() ) {
+ QPtrList<KPrObject> objects;
+ objects.append( m_rotateObject );
+
+ /* As the object is allready rotated set the angle to
+ * the m_angleBeforeRotate for the creation of the command, and
+ * back afterwards. No need for executing the command */
+ float newAngle = m_rotateObject->getAngle();
+ m_rotateObject->rotate( m_angleBeforeRotate );
+
+ KPrRotateCmd *rotateCmd = new KPrRotateCmd( i18n( "Change Rotation" ), newAngle,
+ objects, m_view->kPresenterDoc() );
+ m_view->kPresenterDoc()->addCommand( rotateCmd );
+
+ m_rotateObject->rotate( newAngle );
+ m_rotateObject = NULL;
+ }
+ }break;
+ case INS_LINE:
+ if ( m_startPoint != m_endPoint )
+ {
+ insertLine( m_startPoint, m_endPoint );
+ m_endPoint = m_startPoint;
+ }
+ break;
+ case INS_RECT:
+ if ( !m_insertRect.isNull() )
+ {
+ insertRect( m_insertRect );
+ }
+ break;
+ case INS_ELLIPSE:
+ if ( !m_insertRect.isNull() )
+ {
+ insertEllipse( m_insertRect );
+ }
+ break;
+ case INS_PIE:
+ if ( !m_insertRect.isNull() )
+ {
+ insertPie( m_insertRect );
+ }
+ break;
+ case INS_OBJECT:
+ case INS_DIAGRAMM:
+ case INS_TABLE:
+ case INS_FORMULA:
+ if ( !m_insertRect.isNull() )
+ {
+ KPrPartObject *kpPartObject = insertObject( m_insertRect );
+ setToolEditMode( TEM_MOUSE );
+
+ if ( kpPartObject )
+ {
+ kpPartObject->activate( m_view );
+ m_editObject = kpPartObject;
+ }
+ }
+ break;
+ case INS_AUTOFORM:
+ if ( !m_insertRect.isNull() )
+ {
+ insertAutoform( m_insertRect );
+ }
+ setToolEditMode( TEM_MOUSE );
+ break;
+ case INS_FREEHAND:
+ if ( !m_pointArray.isNull() )
+ {
+ insertFreehand( m_pointArray );
+ }
+ break;
+ case INS_POLYGON:
+ if ( !m_pointArray.isNull() )
+ insertPolygon( m_pointArray );
+ break;
+ case INS_PICTURE:
+ case INS_CLIPART:
+ insertPicture( m_insertRect );
+ setToolEditMode( TEM_MOUSE );
+ break;
+ case INS_CLOSED_FREEHAND: {
+ if ( !m_pointArray.isNull() )
+ insertClosedLine( m_pointArray );
+ }break;
+ default: break;
+ }
+
+ m_gl.repaintAfterSnapping();
+
+ emit objectSelectedChanged();
+
+ if ( toolEditMode != TEM_MOUSE && editMode )
+ repaint( false );
+
+ m_view->disableAutoScroll();
+ mousePressed = false;
+ modType = MT_NONE;
+ m_insertRect = KoRect();
+ mouseMoveEvent( e );
+}
+
+void KPrCanvas::mouseMoveEvent( QMouseEvent *e )
+{
+ if ( editMode && m_view->kPresenterDoc()->showGuideLines() && toolEditMode == TEM_MOUSE && m_gl.mouseMoveEvent( e ) )
+ return;
+
+ QPoint contentsPoint( e->pos().x()+diffx(), e->pos().y()+diffy() );
+ KoPoint docPoint = m_view->zoomHandler()->unzoomPoint( contentsPoint );
+ if(m_currentTextObjectView)
+ {
+ if (m_currentTextObjectView->isLinkVariable(e->pos()) )
+ {
+ setCursor(Qt::PointingHandCursor);
+ return;
+ }
+ setCursor( arrowCursor );
+
+ KPrTextObject *txtObj=m_currentTextObjectView->kpTextObject();
+ Q_ASSERT(txtObj);
+ if(txtObj->contains( docPoint )&&mousePressed)
+ {
+ KoPoint pos = docPoint - txtObj->innerRect().topLeft();
+ m_currentTextObjectView->mouseMoveEvent( e, m_view->zoomHandler()->ptToLayoutUnitPix( pos ) ); // in LU pixels
+ }
+ return;
+ }
+
+ if (m_view->kPresenterDoc()->getVariableCollection()->variableSetting()->displayLink())
+ {
+ KPrObject *tmp_kpobject = getObjectAt( docPoint );
+ if(tmp_kpobject && tmp_kpobject->getType() == OT_TEXT)
+ {
+ KPrTextObject *kptextobject = static_cast<KPrTextObject*>( tmp_kpobject );
+ QPoint iPoint = kptextobject->viewToInternal( e->pos(), this );
+ KoLinkVariable* linkVar = dynamic_cast<KoLinkVariable *>( kptextobject->textObject()->variableAtPoint( iPoint ) );
+
+ if ( linkVar )
+ {
+ setCursor(Qt::PointingHandCursor);
+ return;
+ }
+ }
+ }
+
+ m_disableSnapping = e->state() & ShiftButton;
+
+ if ( editMode ) {
+ m_view->setRulerMousePos( e->x(), e->y() );
+
+ if ( toolEditMode == TEM_ROTATE )
+ {
+ setCursor( KPrUtils::rotateCursor() );
+ if ( !mousePressed )
+ return;
+ }
+ KPrObject *kpobject;
+ if ( ( !mousePressed || ( !drawRubber && modType == MT_NONE ) ) &&
+ toolEditMode == TEM_MOUSE )
+ {
+ bool cursorAlreadySet = false;
+ if ( (int)objectList().count() > 0 )
+ {
+ kpobject = m_activePage->getCursor( docPoint );
+ if( kpobject)
+ {
+ setCursor( kpobject->getCursor( docPoint, modType, m_view->kPresenterDoc() ) );
+
+ cursorAlreadySet = true;
+ }
+ }
+
+ if ( !cursorAlreadySet )
+ setCursor( arrowCursor );
+ else
+ return;
+ } else if ( mousePressed ) {
+ switch ( toolEditMode ) {
+ case TEM_MOUSE: {
+ drawContour = TRUE;
+ if ( modType == MT_NONE ) {
+ if ( drawRubber )
+ {
+ QPainter p;
+ p.begin( this );
+ p.setRasterOp( NotROP );
+ p.setPen( QPen( black, 0, DotLine ) );
+ p.translate( -diffx(), -diffy() );
+ p.drawRect( m_view->zoomHandler()->zoomRect( m_rubber ) );
+ m_rubber.setRight( docPoint.x() );
+ m_rubber.setBottom( docPoint.y() );
+ p.drawRect( m_view->zoomHandler()->zoomRect( m_rubber ) );
+ p.end();
+ }
+ } else if ( modType == MT_MOVE ) {
+ if ( !m_isMoving )
+ {
+ m_moveSnapDiff= KoPoint(0,0);
+ m_moveStartPoint = objectRect( false ).topLeft();
+ m_isMoving = true;
+ }
+ moveObjectsByMouse( docPoint, e->state() & AltButton || e->state() & ControlButton );
+ } else if ( modType != MT_NONE && m_resizeObject ) {
+ if ( !m_isResizing )
+ {
+ m_isResizing = true;
+ }
+
+ KoPoint sp( snapPoint( docPoint, false ) );
+
+ bool keepRatio = m_resizeObject->isKeepRatio();
+ if ( e->state() & AltButton )
+ {
+ keepRatio = true;
+ }
+ bool scaleAroundCenter = false;
+ if ( e->state() & ControlButton )
+ {
+ scaleAroundCenter = true;
+ }
+
+ resizeObject( modType, sp, keepRatio, scaleAroundCenter );
+ }
+ } break;
+ case TEM_ZOOM : {
+ if ( drawRubber ) {
+ QPainter p;
+ p.begin( this );
+ p.setRasterOp( NotROP );
+ p.setPen( QPen( black, 0, DotLine ) );
+ p.translate( -diffx(), -diffy() );
+ p.drawRect( m_view->zoomHandler()->zoomRect( m_rubber ) );
+ m_rubber.setRight( docPoint.x() );
+ m_rubber.setBottom( docPoint.y() );
+ p.drawRect( m_view->zoomHandler()->zoomRect( m_rubber ) );
+ p.end();
+ m_zoomRubberDraw = true;
+ }
+ }break;
+ case TEM_ROTATE: {
+ if ( m_rotateObject )
+ {
+ drawContour = TRUE;
+ // angle to mouse pos
+ double angle = KoPoint::getAngle( m_rotateCenter, docPoint );
+ // angle to start of mouse pos
+ double angle1 = KoPoint::getAngle( m_rotateCenter, m_rotateStart );
+
+ angle -= angle1;
+ angle += m_angleBeforeRotate;
+ if ( angle < 0 )
+ angle += 360;
+ else if ( angle > 360 )
+ angle -= 360;
+
+ m_rotateObject->rotate( angle );
+ _repaint( m_rotateObject );
+ }
+ }break;
+ case INS_AUTOFORM:
+ case INS_DIAGRAMM:
+ case INS_FORMULA:
+ case INS_CLIPART:
+ case INS_PICTURE:
+ case INS_OBJECT:
+ case INS_TABLE:
+ case INS_TEXT:
+ {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+
+ KoPoint sp( snapPoint( docPoint ) );
+ p.drawRect( m_view->zoomHandler()->zoomRect( m_insertRect.normalize() ) );
+ updateInsertRect( sp, e->state() );
+ p.drawRect( m_view->zoomHandler()->zoomRect( m_insertRect.normalize() ) );
+
+ p.end();
+
+ mouseSelectedObject = true;
+ } break;
+ case INS_ELLIPSE: {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+
+ KoPoint sp( snapPoint( docPoint ) );
+ p.drawEllipse( m_view->zoomHandler()->zoomRect( m_insertRect.normalize() ) );
+ updateInsertRect( sp, e->state() );
+ p.drawEllipse( m_view->zoomHandler()->zoomRect( m_insertRect.normalize() ) );
+
+ p.end();
+
+ mouseSelectedObject = true;
+ } break;
+ case INS_RECT: {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+
+ KoPoint sp( snapPoint( docPoint ) );
+ p.drawRoundRect( m_view->zoomHandler()->zoomRect( m_insertRect.normalize() ), m_view->getRndX(), m_view->getRndY() );
+ updateInsertRect( sp, e->state() );
+ p.drawRoundRect( m_view->zoomHandler()->zoomRect( m_insertRect.normalize() ), m_view->getRndX(), m_view->getRndY() );
+
+ p.end();
+
+ mouseSelectedObject = true;
+ } break;
+ case INS_LINE: {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+
+ KoPoint oldEndPoint( m_endPoint );
+ m_endPoint = snapPoint( docPoint );
+ //remove the old line
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( oldEndPoint ) );
+
+ if ( e->state() & AltButton )
+ {
+ m_startPoint += m_endPoint - oldEndPoint;
+ }
+
+ // print the new line
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+ p.end();
+
+ mouseSelectedObject = true;
+ } break;
+ case INS_PIE: {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+
+ KoPoint sp( snapPoint( docPoint ) );
+ drawPieObject( &p, m_insertRect );
+ updateInsertRect( sp, e->state() );
+ drawPieObject( &p, m_insertRect );
+
+ p.end();
+
+ mouseSelectedObject = true;
+ } break;
+ case INS_FREEHAND:
+ case INS_CLOSED_FREEHAND:
+ {
+ m_endPoint = snapPoint( docPoint );
+ if ( m_endPoint != m_startPoint )
+ {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+
+ if ( e->state() & AltButton )
+ {
+ QPointArray pointArray = m_pointArray.zoomPointArray( m_view->zoomHandler() );
+ // erase
+ p.drawPolyline( pointArray );
+ m_pointArray.translate( m_endPoint.x() - m_startPoint.x(),
+ m_endPoint.y() - m_startPoint.y() );
+ pointArray = m_pointArray.zoomPointArray( m_view->zoomHandler() );
+ // draw
+ p.drawPolyline( pointArray );
+ }
+ else
+ {
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+ }
+ p.end();
+
+ m_pointArray.putPoints( m_indexPointArray, 1, m_endPoint.x(), m_endPoint.y() );
+ ++m_indexPointArray;
+ m_startPoint = m_endPoint;
+ }
+
+ mouseSelectedObject = true;
+ } break;
+ case INS_POLYLINE: case INS_CLOSED_POLYLINE: {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+
+ KoPoint oldEndPoint( m_endPoint );
+ m_endPoint = snapPoint( docPoint );
+ //remove the old line
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( oldEndPoint ) );
+
+ if ( e->state() & AltButton )
+ {
+ QPointArray pointArray = m_pointArray.zoomPointArray( m_view->zoomHandler() );
+ // erase
+ p.drawPolyline( pointArray );
+ m_pointArray.translate( m_endPoint.x() - oldEndPoint.x(),
+ m_endPoint.y() - oldEndPoint.y() );
+ pointArray = m_pointArray.zoomPointArray( m_view->zoomHandler() );
+ // draw
+ p.drawPolyline( pointArray );
+ m_startPoint += m_endPoint - oldEndPoint;
+ }
+
+ // print the new line
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+ p.end();
+
+ mouseSelectedObject = true;
+ } break;
+ case INS_CUBICBEZIERCURVE: case INS_QUADRICBEZIERCURVE:
+ case INS_CLOSED_CUBICBEZIERCURVE: case INS_CLOSED_QUADRICBEZIERCURVE:{
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+
+ KoPoint newEndPoint( snapPoint( docPoint ) );
+
+ drawCubicBezierCurve( p, m_oldCubicBezierPointArray );
+
+ if ( e->state() & AltButton )
+ {
+ // erase
+ redrawCubicBezierCurve( p );
+
+ KoPoint diff( newEndPoint - m_endPoint );
+ m_pointArray.translate( diff.x(), diff.y() );
+ m_endPoint = newEndPoint;
+ m_startPoint += diff;
+
+ // draw
+ redrawCubicBezierCurve( p );
+ }
+ else
+ {
+ m_endPoint = newEndPoint;
+ }
+
+ KoPointArray points;
+ if ( !m_drawLineWithCubicBezierCurve )
+ {
+ double _firstX = m_pointArray.at( m_indexPointArray - 2 ).x();
+ double _firstY = m_pointArray.at( m_indexPointArray - 2 ).y();
+
+ double _fourthX = m_pointArray.at( m_indexPointArray - 1 ).x();
+ double _fourthY = m_pointArray.at( m_indexPointArray - 1 ).y();
+
+ double _midpointX = (_firstX + _fourthX ) / 2;
+ double _midpointY = (_firstY + _fourthY ) / 2;
+ double _diffX = _fourthX - _midpointX;
+ double _diffY = _fourthY - _midpointY;
+
+ double _secondX = m_endPoint.x() - _diffX;
+ double _secondY = m_endPoint.y() - _diffY;
+ m_CubicBezierSecondPoint = KoPoint( _secondX, _secondY );
+
+ m_symmetricEndPoint = m_startPoint * 2 - m_endPoint;
+
+ double _thirdX = m_symmetricEndPoint.x() - _diffX;
+ double _thirdY = m_symmetricEndPoint.y() - _diffY;
+ m_CubicBezierThirdPoint = KoPoint( _thirdX, _thirdY );
+
+ if ( toolEditMode == INS_QUADRICBEZIERCURVE || toolEditMode == INS_CLOSED_QUADRICBEZIERCURVE ) {
+ _secondX = _thirdX;
+ _secondY = _thirdY;
+ m_CubicBezierSecondPoint = KoPoint( _secondX, _secondY );
+ }
+ points.putPoints( 0, 4, _firstX,_firstY, _secondX,_secondY, _thirdX,_thirdY, _fourthX,_fourthY );
+ }
+
+ drawCubicBezierCurve( p, points );
+ if ( points.size() > 0 )
+ {
+ m_oldCubicBezierPointArray = points;
+ }
+
+ mouseSelectedObject = true;
+ } break;
+ case INS_POLYGON: {
+ QPainter p( this );
+ p.setPen( QPen( black, 1, SolidLine ) );
+ p.setBrush( NoBrush );
+ p.setRasterOp( NotROP );
+ p.translate( -diffx(), -diffy() );
+
+ KoPoint sp( snapPoint( docPoint ) );
+ // erase old
+ drawPolygon( p, m_insertRect );
+ updateInsertRect( sp, e->state() );
+ // print new
+ drawPolygon( p, m_insertRect );
+
+ mouseSelectedObject = true;
+ } break;
+ default: break;
+ }
+ }
+ } else if ( !editMode && m_drawMode && m_drawLineInDrawMode ) {
+ QPainter p;
+ p.begin( this );
+ p.setPen( m_view->kPresenterDoc()->presPen() );
+ p.drawLine( m_drawModeLines[m_drawModeLines.count() - 1].point( m_drawModeLineIndex - 1 ), e->pos() );
+ p.end();
+ m_drawModeLines[m_drawModeLines.count() - 1].putPoints( m_drawModeLineIndex++, 1, e->x(), e->y() );
+ }
+
+ if ( !editMode && !m_drawMode && !m_presMenu->isVisible() && fillBlack )
+ setCursor( blankCursor );
+}
+
+void KPrCanvas::mouseDoubleClickEvent( QMouseEvent *e )
+{
+ if(!m_view->koDocument()->isReadWrite())
+ return;
+ QPoint contentsPoint( e->pos().x()+diffx(), e->pos().y()+diffy() );
+ KoPoint docPoint = m_view->zoomHandler()->unzoomPoint( contentsPoint );
+ if(m_currentTextObjectView)
+ {
+ KPrTextObject *txtObj=m_currentTextObjectView->kpTextObject();
+ Q_ASSERT(txtObj);
+ if(txtObj->contains( docPoint ))
+ {
+ KoPoint pos = docPoint - txtObj->getOrig();
+ //pos=m_view->zoomHandler()->pixelToLayoutUnit(QPoint(pos.x(),pos.y()));
+ m_currentTextObjectView->mouseDoubleClickEvent( e, m_view->zoomHandler()->ptToLayoutUnitPix( pos ) );
+ return;
+ }
+ }
+
+ //disallow activating objects outside the "page"
+ if ( !m_activePage->getPageRect().contains(docPoint))
+ return;
+
+
+ if ( ( toolEditMode == INS_POLYLINE || toolEditMode == INS_CLOSED_POLYLINE ) && !m_pointArray.isNull() && m_drawPolyline )
+ {
+ m_startPoint = snapPoint( docPoint );
+
+ m_pointArray.putPoints( m_indexPointArray, 1, m_startPoint.x(), m_startPoint.y() );
+ ++m_indexPointArray;
+ endDrawPolyline();
+
+ mouseMoveEvent( e );
+ return;
+ }
+
+
+ if ( toolEditMode != TEM_MOUSE || !editMode ) return;
+
+ KPrObject *kpobject = getObjectAt( docPoint );
+ if(kpobject)
+ {
+ if ( kpobject->getType() == OT_TEXT )
+ {
+ deSelectAllObj();
+ KPrTextObject *kptextobject = dynamic_cast<KPrTextObject*>( kpobject );
+ if(kptextobject && (!kptextobject->isProtectContent() || kptextobject->isProtectContent()
+ && m_view->kPresenterDoc()->cursorInProtectedArea()))
+ {
+ if(m_currentTextObjectView)
+ {
+ m_currentTextObjectView->terminate();
+ delete m_currentTextObjectView;
+ }
+ m_currentTextObjectView=kptextobject->createKPTextView(this);
+
+ //setTextBackground( kptextobject );
+ setCursor( arrowCursor );
+ m_editObject = kpobject;
+ }
+ }
+ else if ( kpobject->getType() == OT_PART )
+ {
+ deSelectAllObj();
+ KPrPartObject * obj=dynamic_cast<KPrPartObject *>(kpobject);
+ if(obj)
+ {
+ obj->activate( m_view );
+ m_editObject = obj;
+ }
+ }
+ else
+ getView()->extraProperties();
+ }
+}
+
+void KPrCanvas::drawPieObject( QPainter *p, const KoRect & rect )
+{
+ QRect pRect( m_view->zoomHandler()->zoomRect( rect ) );
+ switch ( m_view->getPieType() ) {
+ case PT_PIE:
+ p->drawPie( pRect.x(), pRect.y(), pRect.width() - 2,
+ pRect.height() - 2, m_view->getPieAngle(), m_view->getPieLength() );
+ break;
+ case PT_ARC:
+ p->drawArc( pRect.x(), pRect.y(), pRect.width() - 2,
+ pRect.height() - 2, m_view->getPieAngle(), m_view->getPieLength() );
+ break;
+ case PT_CHORD:
+ p->drawChord( pRect.x(), pRect.y(), pRect.width() - 2,
+ pRect.height() - 2, m_view->getPieAngle(), m_view->getPieLength() );
+ break;
+ default: break;
+ }
+
+}
+
+void KPrCanvas::wheelEvent( QWheelEvent *e )
+{
+ if ( !editMode && !m_drawMode ) {
+ if ( e->delta() == -120 ) // wheel down
+ m_view->screenNext();
+ else if ( e->delta() == 120 ) // wheel up
+ m_view->screenPrev();
+ e->accept();
+ }
+ else if ( editMode )
+ emit sigMouseWheelEvent( e );
+}
+
+void KPrCanvas::keyPressEvent( QKeyEvent *e )
+{
+ if ( editMode && m_view->kPresenterDoc()->showGuideLines() && m_gl.keyPressEvent( e ) )
+ return;
+ if ( !editMode ) {
+ switch ( e->key() ) {
+ case Qt::Key_Space: case Key_Right: case Key_Down:
+ setSwitchingMode( false );
+ m_view->screenNext();
+ break;
+ case Qt::Key_Next:
+ setSwitchingMode( false );
+ m_view->screenNext( true );
+ break;
+ case Qt::Key_Backspace: case Key_Left: case Key_Up:
+ setSwitchingMode( false );
+ finishObjectEffects();
+ finishPageEffect( true );
+ m_view->screenPrev();
+ break;
+ case Qt::Key_Prior:
+ setSwitchingMode( false );
+ finishObjectEffects();
+ finishPageEffect( true );
+ m_view->screenPrev( true );
+ break;
+ case Qt::Key_Escape: case Key_Q: case Key_X:
+ setSwitchingMode( false );
+ finishObjectEffects();
+ finishPageEffect( true );
+ m_view->screenStop();
+ break;
+ case Qt::Key_G:
+ // setSwitchingMode( false ) not needed as it is allready done in slotGotoPage;
+ if ( !spManualSwitch() )
+ m_view->stopAutoPresTimer();
+ slotGotoPage();
+ break;
+ case Qt::Key_Home: // go to first page
+ setSwitchingMode( false );
+ presGotoFirstPage();
+ if ( !spManualSwitch() ) {
+ m_view->setAutoPresTimer( 1 );
+ m_setPageTimer = true;
+ }
+ break;
+ case Qt::Key_End: // go to last page
+ setSwitchingMode( false );
+ if ( m_presentationSlidesIterator != m_presentationSlides.end() ) {
+ gotoPage( *(--m_presentationSlides.end()) );
+ if ( !spManualSwitch() ) {
+ m_view->setAutoPresTimer( 1 );
+ m_setPageTimer = true;
+ }
+ }
+ break;
+ default: break;
+ }
+ } else if ( m_editObject ) {
+ if ( e->key() == Qt::Key_Escape ) {
+ exitEditMode();
+ }
+ else if ( m_currentTextObjectView )
+ {
+ if ( !m_currentTextObjectView->kpTextObject()->isProtectContent() || (e->text().length() == 0))
+ m_currentTextObjectView->keyPressEvent( e );
+ else
+ KMessageBox::information(this, i18n("Read-only content cannot be changed. No modifications will be accepted."));
+ }
+ }
+ else
+ {
+ switch ( e->key() )
+ {
+ case Qt::Key_Next:
+ m_view->nextPage();
+ break;
+ case Qt::Key_Prior:
+ m_view->prevPage();
+ break;
+ case Qt::Key_Home: // go to first page
+ m_view->screenFirst();
+ break;
+ case Qt::Key_End: // go to first page
+ m_view->screenLast();
+ break;
+ default:
+ break;
+ }
+
+ if ( mouseSelectedObject )
+ {
+ m_disableSnapping = e->state() & ShiftButton;
+
+ int offsetx = 1;
+ int offsety = 1;
+
+ if ( e->state() & ControlButton )
+ {
+ offsetx = QMAX(1,m_view->zoomHandler()->zoomItX(10));
+ offsety = QMAX(1,m_view->zoomHandler()->zoomItY(10));
+ }
+
+ if ( !m_keyPressEvent )
+ {
+ m_moveStartPosKey = objectRect( false ).topLeft();
+ }
+ switch ( e->key() )
+ {
+ case Qt::Key_Up:
+ m_keyPressEvent = true;
+ moveObjectsByKey( 0, -offsety );
+ break;
+ case Qt::Key_Down:
+ m_keyPressEvent = true;
+ moveObjectsByKey( 0, offsety );
+ break;
+ case Qt::Key_Right:
+ m_keyPressEvent = true;
+ moveObjectsByKey( offsetx, 0 );
+ break;
+ case Qt::Key_Left:
+ m_keyPressEvent = true;
+ moveObjectsByKey( -offsetx, 0 );
+ break;
+ case Qt::Key_Delete:
+ case Key_Backspace:
+ m_view->editDelete();
+ break;
+ case Qt::Key_Escape:
+ {
+ if ( mousePressed && toolEditMode == TEM_MOUSE )
+ {
+ switch (modType)
+ {
+ case MT_RESIZE_UP:
+ case MT_RESIZE_DN:
+ case MT_RESIZE_LF:
+ case MT_RESIZE_RT:
+ case MT_RESIZE_LU:
+ case MT_RESIZE_LD:
+ case MT_RESIZE_RU:
+ case MT_RESIZE_RD:
+ {
+ QRect oldBoundingRect = m_view->zoomHandler()->zoomRect( m_resizeObject->getRepaintRect() );
+ m_resizeObject->setOrig( m_rectBeforeResize.topLeft() );
+ m_resizeObject->setSize( m_rectBeforeResize.size() );
+ drawContour = false;
+ m_view->kPresenterDoc()->repaint( oldBoundingRect );
+ m_view->kPresenterDoc()->repaint( m_resizeObject );
+ m_ratio = 0.0;
+ m_resizeObject = 0;
+ m_isResizing = false;
+ m_view->disableAutoScroll();
+ mousePressed = false;
+ modType = MT_NONE;
+ return;
+ }
+ case MT_MOVE:
+ {
+ if ( m_isMoving )
+ {
+ drawContour = false;
+ KoPoint move( m_moveStartPoint - objectRect( false ).topLeft() );
+ m_activePage->moveObject( m_view, move, false );
+ m_view->disableAutoScroll();
+ mousePressed = false;
+ modType = MT_NONE;
+ m_isMoving = false;
+ return;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ setToolEditMode( TEM_MOUSE );
+ break;
+ }
+ case Qt::Key_Shift:
+ {
+ bool oldChangeSnap = m_disableSnapping;
+ m_disableSnapping = e->key() == Qt::Key_Shift;
+ if ( !oldChangeSnap && m_disableSnapping )
+ {
+ m_gl.repaintAfterSnapping();
+ }
+ // undo snapping for move by mouse
+ if ( e->state() & Qt::LeftButton && m_isMoving )
+ {
+ moveObjectsByMouse( m_origMousePos, e->state() & AltButton || e->state() & ControlButton );
+ }
+ break;
+ }
+ default: break;
+ }
+ }
+ else
+ {
+ switch ( e->key() ) {
+ case Qt::Key_Down:
+ m_view->getVScrollBar()->addLine();
+ break;
+ case Qt::Key_Up:
+ m_view->getVScrollBar()->subtractLine();
+ break;
+ case Qt::Key_Right:
+ m_view->getHScrollBar()->addLine();
+ break;
+ case Qt::Key_Left:
+ m_view->getHScrollBar()->subtractLine();
+ break;
+ case Qt::Key_Tab:
+ selectNext();
+ break;
+ case Qt::Key_Backtab:
+ selectPrev();
+ break;
+ case Qt::Key_Escape:
+ if ( toolEditMode == TEM_ZOOM )
+ setToolEditMode( TEM_MOUSE );
+ break;
+ default: break;
+ }
+ }
+ }
+}
+
+void KPrCanvas::keyReleaseEvent( QKeyEvent *e )
+{
+ if ( editMode && m_currentTextObjectView )
+ m_currentTextObjectView->keyReleaseEvent( e );
+ else
+ {
+ if ( mouseSelectedObject )
+ {
+ if(e->key()==Qt::Key_Up || e->key()==Key_Down || e->key()==Key_Right || e->key()==Key_Left)
+ {
+ if ( !e->isAutoRepeat() )
+ {
+ KoPoint move( objectRect( false ).topLeft() - m_moveStartPosKey);
+ KCommand *cmd=m_activePage->moveObject(m_view, move.x(), move.y());
+ if(cmd)
+ m_view->kPresenterDoc()->addCommand( cmd );
+ m_keyPressEvent = false;
+ }
+ emit objectSelectedChanged();
+ }
+ }
+ }
+}
+
+void KPrCanvas::imStartEvent( QIMEvent * e )
+{
+ if ( m_editObject && m_currentTextObjectView )
+ {
+ if ( !m_currentTextObjectView->kpTextObject()->isProtectContent() )
+ m_currentTextObjectView->imStartEvent( e );
+ else
+ KMessageBox::information(this, i18n("Read-only content cannot be changed. No modifications will be accepted."));
+ }
+}
+
+void KPrCanvas::imComposeEvent( QIMEvent * e )
+{
+ if ( m_editObject && m_currentTextObjectView )
+ {
+ if ( !m_currentTextObjectView->kpTextObject()->isProtectContent() )
+ m_currentTextObjectView->imComposeEvent( e );
+ }
+}
+
+void KPrCanvas::imEndEvent( QIMEvent * e )
+{
+ if ( m_editObject && m_currentTextObjectView )
+ {
+ if ( !m_currentTextObjectView->kpTextObject()->isProtectContent() )
+ m_currentTextObjectView->imEndEvent( e );
+ }
+}
+
+void KPrCanvas::resizeEvent( QResizeEvent *e )
+{
+ if ( editMode )
+ {
+ QWidget::resizeEvent( e );
+ }
+ else
+ QWidget::resizeEvent( new QResizeEvent( KGlobalSettings::desktopGeometry(this).size(),
+ e->oldSize() ) );
+ buffer.resize( size() );
+}
+
+bool KPrCanvas::close( bool alsoDelete )
+{
+ if ( editMode )
+ {
+ return QWidget::close(alsoDelete);
+ }
+ else
+ {
+ m_view->screenStop();
+ return false;
+ }
+}
+
+KPrObject * KPrCanvas::getObjectAt( const KoPoint &pos, bool withoutProtected )
+{
+ KPrObject *object = m_activePage->getObjectAt( pos, withoutProtected );
+ if ( objectIsAHeaderFooterHidden( object ) )
+ object = 0;
+
+ return object;
+}
+
+void KPrCanvas::selectObj( KPrObject *kpobject )
+{
+ kpobject->setSelected( true );
+ _repaint( kpobject );
+ emit objectSelectedChanged();
+
+ mouseSelectedObject = true;
+}
+
+void KPrCanvas::deSelectObj( KPrObject *kpobject )
+{
+ kpobject->setSelected( false );
+ _repaint( kpobject );
+
+ if ( !m_activePage->isOneObjectSelected() )
+ {
+ mouseSelectedObject = false;
+ }
+ emit objectSelectedChanged();
+}
+
+void KPrCanvas::selectAllObj()
+{
+ QPtrListIterator<KPrObject> it( m_activePage->objectList() );
+ for ( ; it.current() ; ++it )
+ {
+ if ( !objectIsAHeaderFooterHidden(it.current()) )
+ it.current()->setSelected( true );
+ }
+
+ mouseSelectedObject = true;
+ _repaint( false );
+ emit objectSelectedChanged();
+}
+
+
+void KPrCanvas::deSelectAllObj()
+{
+ if( m_activePage->numSelected() == 0 )
+ return;
+
+ lowerObject();
+
+ m_activePage->deSelectAllObj();
+
+ //desactivate kptextview when we switch of page
+ if(m_currentTextObjectView)
+ {
+ m_currentTextObjectView->terminate();
+ m_currentTextObjectView->kpTextObject()->setEditingTextObj( false );
+ delete m_currentTextObjectView;
+ m_currentTextObjectView=0L;
+ }
+ mouseSelectedObject = false;
+ emit objectSelectedChanged();
+}
+
+void KPrCanvas::setMouseSelectedObject(bool b)
+{
+ mouseSelectedObject = b;
+ emit objectSelectedChanged();
+}
+
+void KPrCanvas::setupMenus()
+{
+ // create right button presentation menu
+ m_presMenu = new KPopupMenu();
+ Q_CHECK_PTR( m_presMenu );
+ m_presMenu->setCheckable( true );
+ m_presMenu->insertTitle( i18n( "Slide Show" ) );
+ m_presMenu->insertItem( i18n( "&Continue" ), this, SLOT( setSwitchingMode() ) );
+ PM_DM = m_presMenu->insertItem( i18n( "&Drawing Mode" ), this, SLOT( setDrawingMode() ) );
+ m_presMenu->insertSeparator();
+ m_presMenu->insertItem( SmallIcon("goto"), i18n( "&Goto Slide..." ), this, SLOT( slotGotoPage() ) );
+ m_presMenu->insertSeparator();
+ m_presMenu->insertItem( i18n( "&End" ), this, SLOT( slotExitPres() ) );
+ m_presMenu->setItemChecked( PM_DM, false );
+ m_presMenu->setMouseTracking( true );
+}
+
+void KPrCanvas::clipCut()
+{
+ if ( m_currentTextObjectView )
+ m_currentTextObjectView->cut();
+ m_view->editCut();
+}
+
+void KPrCanvas::clipCopy()
+{
+ if ( m_currentTextObjectView )
+ m_currentTextObjectView->copy();
+ m_view->editCopy();
+}
+
+void KPrCanvas::clipPaste()
+{
+ if ( m_currentTextObjectView )
+ m_currentTextObjectView->paste();
+ m_view->editPaste();
+}
+
+void KPrCanvas::chPic()
+{
+ m_activePage->chPic( m_view );
+}
+
+bool KPrCanvas::exportPage( int nPage,
+ int nWidth,
+ int nHeight,
+ const KURL& _fileURL,
+ const char* format,
+ int quality )
+{
+ bool res = false;
+ const QCursor oldCursor( cursor() );
+ setCursor( waitCursor );
+ QPixmap pix( nWidth, nHeight );
+ drawPageInPix( pix, nPage, 0, true, nWidth, nHeight );
+ if( !pix.isNull() ){
+ // Depending on the desired target size due to rounding
+ // errors during zoom the resulting pixmap *might* be
+ // 1 pixel or 2 pixels wider/higher than desired: we just
+ // remove the additional columns/rows. This can be done
+ // since KPresenter is leaving a minimal border below/at
+ // the right of the image anyway.
+ const QSize desiredSize(nWidth, nHeight);
+ if( desiredSize != pix.size() )
+ pix.resize( desiredSize );
+ // save the pixmap to the desired file
+ KURL fileURL(_fileURL);
+ if( fileURL.protocol().isEmpty() )
+ fileURL.setProtocol( "file" );
+ const bool bLocalFile = fileURL.isLocalFile();
+ KTempFile* tmpFile = bLocalFile ? NULL : new KTempFile();
+ if( !bLocalFile )
+ tmpFile->setAutoDelete( true );
+ if( bLocalFile || 0 == tmpFile->status() ){
+ QFile file( bLocalFile ? fileURL.path(0) : tmpFile->name() );
+ if ( file.open( IO_ReadWrite ) ) {
+ res = pix.save( &file, format, quality );
+ file.close();
+ }
+ if( !bLocalFile ){
+ if( res ){
+ res = KIO::NetAccess::upload( tmpFile->name(), fileURL, this );
+ }
+ }
+ }
+ if( !bLocalFile ){
+ delete tmpFile;
+ }
+ }
+ setCursor( oldCursor );
+ return res;
+}
+
+void KPrCanvas::savePicture()
+{
+ m_activePage->savePicture( m_view );
+}
+
+void KPrCanvas::setTextFormat(const KoTextFormat &format, int flags)
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ KMacroCommand* macroCmd = new KMacroCommand( i18n("Change Text Font") );
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ for ( ; it.current() ; ++it ) {
+ KCommand *cmd = it.current()->setFormatCommand(&format, flags, true);
+
+ if (cmd)
+ macroCmd->addCommand( cmd );
+ }
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextColor( const QColor &color )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = new KMacroCommand( i18n("Set Text Color") );
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setTextColorCommand( color );
+ if (cmd)
+ macroCmd->addCommand( cmd );
+ }
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextBackgroundColor( const QColor &color )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setTextBackgroundColorCommand( color );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Set Text Background Color") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if (macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextBold( bool b )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setBoldCommand( b );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Make Text Bold") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextItalic( bool b )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setItalicCommand( b );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Make Text Italic") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if (macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextUnderline( bool b )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setUnderlineCommand( b );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Underline Text") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextStrikeOut( bool b )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ KMacroCommand* macroCmd = 0L;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ for ( ; it.current() ; ++it ) {
+ KCommand *cmd = it.current()->setStrikeOutCommand( b );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Make Text Italic") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextFamily( const QString &f )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ KMacroCommand* macroCmd = 0L;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setFamilyCommand( f );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Set Text Font") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd)
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextPointSize( int s )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ KMacroCommand* macroCmd = 0L;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setPointSizeCommand( s );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Change Text Size") );
+ macroCmd->addCommand( cmd );
+ }
+
+ }
+ if (macroCmd)
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextSubScript( bool b )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setTextSubScriptCommand( b );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Set Text Subscript") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextSuperScript( bool b )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setTextSuperScriptCommand( b );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Set Text Superscript") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextDefaultFormat( )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setDefaultFormatCommand( );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Apply Default Format") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if (macroCmd)
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setIncreaseFontSize()
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ int size = it.current()->currentFormat()->pointSize();
+ KMacroCommand* macroCmd =0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setPointSizeCommand( size+1 );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Increase Font Size") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd)
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setDecreaseFontSize()
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ int size = it.current()->currentFormat()->pointSize();
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setPointSizeCommand( size-1 );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Decrease Font Size") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextAlign( int align )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setAlignCommand(align);
+ if ( cmd )
+ {
+ if ( !macroCmd)
+ macroCmd = new KMacroCommand( i18n("Set Text Align") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTabList( const KoTabulatorList & tabList )
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setTabListCommand(tabList );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Change Tabulators") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd)
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setTextDepthPlus()
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ double leftMargin=0.0;
+ if(!lst.isEmpty())
+ leftMargin=lst.first()->currentParagLayoutFormat()->margins[QStyleSheetItem::MarginLeft];
+ double indent = m_view->kPresenterDoc()->getIndentValue();
+ double newVal = leftMargin + indent;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setMarginCommand(QStyleSheetItem::MarginLeft, newVal);
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Increase Paragraph Depth") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+ if(!lst.isEmpty())
+ {
+ const KoParagLayout *layout=lst.first()->currentParagLayoutFormat();
+ m_view->showRulerIndent( layout->margins[QStyleSheetItem::MarginLeft], layout->margins[QStyleSheetItem::MarginFirstLine],
+ layout->margins[QStyleSheetItem::MarginRight], lst.first()->rtl());
+ }
+}
+
+void KPrCanvas::setTextDepthMinus()
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ double leftMargin=0.0;
+ if(!lst.isEmpty())
+ leftMargin=lst.first()->currentParagLayoutFormat()->margins[QStyleSheetItem::MarginLeft];
+ double indent = m_view->kPresenterDoc()->getIndentValue();
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ double newVal = leftMargin - indent;
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setMarginCommand(QStyleSheetItem::MarginLeft, QMAX( newVal, 0 ));
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Decrease Paragraph Depth") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if (macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+ if(!lst.isEmpty())
+ {
+ const KoParagLayout *layout=lst.first()->currentParagLayoutFormat();
+ m_view->showRulerIndent( layout->margins[QStyleSheetItem::MarginLeft], layout->margins[QStyleSheetItem::MarginFirstLine],
+ layout->margins[QStyleSheetItem::MarginRight], lst.first()->rtl());
+ }
+}
+
+void KPrCanvas::setNewFirstIndent(double _firstIndent)
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setMarginCommand(QStyleSheetItem::MarginFirstLine, _firstIndent);
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Change First Line Indent") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setNewLeftIndent(double _leftIndent)
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setMarginCommand(QStyleSheetItem::MarginLeft, _leftIndent);
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Change Left Indent") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+void KPrCanvas::setNewRightIndent(double _rightIndent)
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setMarginCommand(QStyleSheetItem::MarginRight, _rightIndent);
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Change Right Indent") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}
+
+/*void KPrCanvas::setTextCounter(KoParagCounter counter)
+{
+ QPtrList<KoTextFormatInterface> lst = applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand* cmd = it.current()->setCounterCommand(counter );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Change Paragraph Type") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if ( macroCmd )
+ m_view->kPresenterDoc()->addCommand( macroCmd );
+}*/
+
+#ifndef NDEBUG
+void KPrCanvas::printRTDebug( int info )
+{
+ KPrTextObject *kpTxtObj = 0;
+ if ( m_currentTextObjectView )
+ kpTxtObj = m_currentTextObjectView->kpTextObject();
+ else
+ kpTxtObj = selectedTextObjs().first();
+ if ( kpTxtObj )
+ kpTxtObj->textObject()->printRTDebug( info );
+}
+#endif
+
+bool KPrCanvas::haveASelectedPartObj() const
+{
+ return m_activePage->haveASelectedPartObj();
+}
+
+bool KPrCanvas::haveASelectedGroupObj() const
+{
+ return m_activePage->haveASelectedGroupObj();
+}
+
+bool KPrCanvas::haveASelectedPixmapObj() const
+{
+ return m_activePage->haveASelectedPixmapObj();
+}
+
+QPtrList<KPrTextObject> KPrCanvas::applicableTextObjects() const
+{
+ QPtrList<KPrTextObject> lst;
+ // If we're editing a text object, then that's the one we return
+ if ( m_currentTextObjectView )
+ lst.append( m_currentTextObjectView->kpTextObject() );
+ else
+ lst = selectedTextObjs();
+ return lst;
+}
+
+QPtrList<KoTextFormatInterface> KPrCanvas::applicableTextInterfaces() const
+{
+ QPtrList<KoTextFormatInterface> lst;
+ QPtrList<KPrObject> lstObj;
+ // If we're editing a text object, then that's the one we return
+ if ( m_currentTextObjectView )
+ {
+ if ( !m_currentTextObjectView->kpTextObject()->isProtectContent())
+ lst.append( m_currentTextObjectView );
+ }
+ else
+ {
+ m_activePage->getAllObjectSelectedList(lstObj);
+ QPtrListIterator<KPrObject> it(lstObj);
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->getType() == OT_TEXT )
+ {
+ KPrTextObject * obj = static_cast<KPrTextObject*>( it.current() );
+ if ( !obj->isProtectContent() )
+ lst.append( obj->textObject() );
+ }
+ }
+ }
+ return lst;
+}
+
+QPtrList<KPrTextObject> KPrCanvas::selectedTextObjs() const
+{
+ QPtrList<KPrTextObject> lst;
+ QPtrListIterator<KPrObject> it(getObjectList());
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isSelected() && it.current()->getType() == OT_TEXT )
+ lst.append( static_cast<KPrTextObject*>( it.current() ) );
+ }
+ return lst;
+}
+
+void KPrCanvas::startScreenPresentation( double zoomX, double zoomY, int curPgNum /* 1-based */)
+{
+ //kdDebug(33001) << "KPrCanvas::startScreenPresentation curPgNum=" << curPgNum << endl;
+
+ //setup presentation menu
+ m_presMenu->setItemChecked( PM_DM, false );
+
+ setCursor( waitCursor );
+
+ exitEditMode();
+
+ KPrDocument * doc = m_view->kPresenterDoc();
+
+ // Text can't zoom with a different x and y factor, yet.
+ // So we have to choose the smallest zoom (but still paint background everywhere)
+ double zoom = kMin( zoomX, zoomY );
+
+ kdDebug() << "zoomX=" << zoomX << " zoomY=" << zoomY << " zoom=" << zoom << endl;
+
+ m_zoomBeforePresentation = doc->zoomHandler()->zoom();
+ kdDebug() << "old zoomed resolutions =" << doc->zoomHandler()->zoomedResolutionX() << "," << doc->zoomHandler()->zoomedResolutionY() << endl;
+ // Seems to fail (Qt uses the wrong font sizes...)
+ //doc->zoomHandler()->setZoomedResolution( zoomX * doc->zoomHandler()->zoomedResolutionX(),
+ // zoomY * doc->zoomHandler()->zoomedResolutionY() );
+ // Apply the new zooming to the existing one
+ doc->zoomHandler()->setZoomAndResolution( qRound( zoom * m_zoomBeforePresentation ),
+ KoGlobal::dpiX(), KoGlobal::dpiY() );
+
+ doc->newZoomAndResolution( false, false );
+
+ // add all selected slides
+ m_presentationSlides.clear();
+ QValueList<int> selected = doc->displaySelectedSlides();
+ for ( QValueList<int>::Iterator it = selected.begin() ; it != selected.end(); ++ it )
+ {
+ // ARGLLLRGLRLGRLG selectedSlides gets us 0-based numbers,
+ // and here we want 1-based numbers !
+ int slideno = *it + 1;
+ m_presentationSlides.append( slideno );
+ }
+
+ // no slide selected ? end the slide show immediately...
+ if( !m_presentationSlides.count() )
+ {
+ //kdDebug(33001) << "No slide: end the slide show" << endl;
+ stopScreenPresentation();
+ return;
+ }
+
+ // find first selected slide after curPgNum
+ unsigned slide = 0;
+ for( unsigned i = 0; i<m_presentationSlides.count(); i++ )
+ if( m_presentationSlides[i] >= curPgNum )
+ {
+ slide = m_presentationSlides[i];
+ break;
+ }
+
+ setCursor( blankCursor );
+
+ m_step.m_pageNumber = (unsigned int) -1; // force gotoPage to do something
+ gotoPage( slide );
+ //kdDebug(33001) << "Page::startScreenPresentation - done" << endl;
+}
+
+void KPrCanvas::stopScreenPresentation()
+{
+ //kdDebug(33001) << "KPrCanvas::stopScreenPresentation m_showOnlyPage=" << m_showOnlyPage << endl;
+ setCursor( waitCursor );
+
+ KPrDocument * doc = m_view->kPresenterDoc();
+ doc->zoomHandler()->setZoomAndResolution( m_zoomBeforePresentation,
+ KoGlobal::dpiX(), KoGlobal::dpiY() );
+ doc->newZoomAndResolution(false,false);
+ goingBack = false;
+ m_step.m_pageNumber = 0;
+ editMode = true;
+ m_drawMode = false;
+ repaint( false );
+ setToolEditMode( toolEditMode );
+ setWFlags( WResizeNoErase );
+}
+
+bool KPrCanvas::pNext( bool gotoNextPage )
+{
+ goingBack = false;
+
+ bool objectEffectFinished = finishObjectEffects();
+
+ KPrDocument * doc = m_view->kPresenterDoc();
+
+ if ( !gotoNextPage )
+ {
+ if ( finishPageEffect() )
+ return false;
+
+ // clear drawed lines
+ m_drawModeLines.clear();
+
+ //kdDebug(33001) << "\n-------\nKPrCanvas::pNext m_step =" << m_step.m_step << " m_subStep =" << m_step.m_subStep << endl;
+
+ // First try to go one sub-step further, if any object requires it
+ // ### should we also objects on the sticky page be checked for sub steps?
+ QPtrListIterator<KPrObject> oit( doc->pageList().at( m_step.m_pageNumber )->objectList() );
+ for ( int i = 0 ; oit.current(); ++oit, ++i )
+ {
+ KPrObject *kpobject = oit.current();
+ if ( kpobject->getAppearStep() == static_cast<int>( m_step.m_step )
+ && kpobject->getType() == OT_TEXT && kpobject->getEffect2() != EF2_NONE )
+ {
+ if ( static_cast<int>( m_step.m_subStep + 1 ) < kpobject->getSubPresSteps() )
+ {
+ m_step.m_subStep++;
+ //kdDebug(33001) << "Page::pNext addSubPres m_subStep is now " << m_subStep << endl;
+ doObjEffects();
+ return false;
+ }
+ }
+ }
+
+ // Then try to see if there is still one step to do in the current page
+ if ( m_step.m_step < *( --m_pageEffectSteps.end() ) )
+ {
+ QValueList<int>::ConstIterator it = m_pageEffectSteps.find( m_step.m_step );
+ m_step.m_step = *( ++it );
+ m_step.m_subStep = 0;
+ //kdDebug(33001) << "Page::pNext setting currentEffectStep to " << m_step.m_step << endl;
+
+ // if first step on page, draw background
+ if ( m_step.m_step == 0 )
+ {
+ QPainter p;
+ p.begin( this );
+ drawBackground( &p,
+ QRect( 0, 0, kapp->desktop()->width(), kapp->desktop()->height() ),
+ doc->pageList().at( m_step.m_pageNumber ) );
+ p.end();
+ }
+
+ doObjEffects();
+ return false;
+ }
+
+ /*
+ * don't go to next slide if we have finished an object effect
+ * so that we can see the hole slide before going to the next
+ */
+ if ( objectEffectFinished )
+ return false;
+ }
+
+ // No more steps in this page, try to go to the next page
+ QValueList<int>::ConstIterator test( m_presentationSlidesIterator );
+ if ( ++test != m_presentationSlides.end() )
+ {
+ if ( !spManualSwitch() && m_setPageTimer )
+ {
+ //TODO add global presentation speed
+ m_view->setAutoPresTimer( doc->pageList().at( (*m_presentationSlidesIterator) - 1 )->getPageTimer() / 1 );
+ m_setPageTimer = false;
+ return false;
+ }
+ m_setPageTimer = true;
+
+ QRect desk = KGlobalSettings::desktopGeometry(this);
+ QPixmap _pix1( desk.width(), desk.height() );
+ drawCurrentPageInPix( _pix1 );
+
+ m_view->setPageDuration( m_step.m_pageNumber );
+
+ m_step.m_pageNumber = *( ++m_presentationSlidesIterator ) - 1;
+ m_step.m_subStep = 0;
+
+ m_pageEffectSteps = doc->getPageEffectSteps( m_step.m_pageNumber );
+ m_step.m_step = *m_pageEffectSteps.begin();
+
+ QPixmap _pix2( desk.width(), desk.height() );
+ drawCurrentPageInPix( _pix2 );
+
+ QValueList<int>::ConstIterator it( m_presentationSlidesIterator );
+ --it;
+
+ KPrPage * page = doc->pageList().at( ( *it ) - 1 );
+ PageEffect _pageEffect = page->getPageEffect();
+
+ bool _soundEffect = page->getPageSoundEffect();
+ QString _soundFileName = page->getPageSoundFileName();
+
+ if ( _soundEffect && !_soundFileName.isEmpty() ) {
+ stopSound();
+ playSound( _soundFileName );
+ }
+
+ if ( m_pageEffect )
+ finishPageEffect();
+
+ m_pageEffect = new KPrPageEffects( this, _pix2, _pageEffect, page->getPageEffectSpeed() );
+ if ( m_pageEffect->doEffect() )
+ {
+ delete m_pageEffect;
+ m_pageEffect = 0;
+
+ doObjEffects( true );
+ }
+ else
+ {
+ connect( &m_pageEffectTimer, SIGNAL( timeout() ), SLOT( slotDoPageEffect() ) );
+ m_pageEffectTimer.start( 50, true );
+ }
+
+ return true;
+ }
+
+ //kdDebug(33001) << "Page::pNext last slide -> End of presentation" << endl;
+
+ // When we are in manual mode or in automatic mode with no infinite loop
+ // we display the 'End of presentation' slide, unles told explicitly by showEndOfPresentationSlide
+ if ( ( spManualSwitch() || !spInfiniteLoop() ) && !showingLastSlide && spShowEndOfPresentationSlide() )
+ {
+ m_view->setPageDuration( m_step.m_pageNumber );
+
+ QRect desk = KGlobalSettings::desktopGeometry(this);
+ QPixmap lastSlide( desk.width(), desk.height() );
+ QFont font( m_view->kPresenterDoc()->defaultFont().family() );
+ QPainter p( &lastSlide );
+
+ p.setFont( font );
+ p.setPen( white );
+ p.fillRect( p.viewport(), black );
+ p.drawText( 50, 50, i18n( "End of presentation. Click to exit." ) );
+ bitBlt( this, 0, 0, &lastSlide, 0, 0, lastSlide.width(), lastSlide.height() );
+ showingLastSlide = true;
+ emit stopAutomaticPresentation(); // no automatic mode for last slide
+ }
+ else if ( showingLastSlide || !spShowEndOfPresentationSlide() ) // after last slide stop presentation
+ {
+ showingLastSlide = false;
+ m_view->screenStop();
+ }
+ else
+ {
+ m_view->setPageDuration( m_step.m_pageNumber );
+ emit restartPresentation(); // tells automatic mode to restart
+ m_view->setAutoPresTimer( 1 );
+ }
+
+ return false;
+}
+
+bool KPrCanvas::pPrev( bool gotoPreviousPage )
+{
+ goingBack = true;
+ m_step.m_subStep = 0;
+
+ // clear drawed lines
+ m_drawModeLines.clear();
+
+ if ( !gotoPreviousPage && m_step.m_step > *m_pageEffectSteps.begin() ) {
+ QValueList<int>::ConstIterator it = m_pageEffectSteps.find( m_step.m_step );
+ m_step.m_step = *( --it );
+ //hopefully there are never more than 1000 sub steps :-)
+ m_step.m_subStep = 1000;
+ repaint( false );
+ return false;
+ } else {
+ // when we go back on the first slide, thats like starting the presentation again
+ if ( m_presentationSlidesIterator == m_presentationSlides.begin() ) {
+ m_pageEffectSteps = m_view->kPresenterDoc()->getPageEffectSteps( m_step.m_pageNumber );
+ m_step.m_step = *m_pageEffectSteps.begin();
+ goingBack = false;
+ doObjEffects();
+ return false;
+ }
+ m_view->setPageDuration( m_step.m_pageNumber );
+
+ m_step.m_pageNumber = *( --m_presentationSlidesIterator ) - 1;
+
+ KPrDocument * doc = m_view->kPresenterDoc();
+
+ m_pageEffectSteps = doc->getPageEffectSteps( m_step.m_pageNumber );
+
+ if ( gotoPreviousPage )
+ {
+ m_step.m_step = *( m_pageEffectSteps.begin() );
+ goingBack = false;
+ doObjEffects();
+ }
+ else
+ {
+ m_step.m_step = *( --m_pageEffectSteps.end() );
+ repaint( false );
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
+bool KPrCanvas::canAssignEffect( QPtrList<KPrObject> &objs ) const
+{
+ QPtrListIterator<KPrObject> oIt( m_activePage->objectList() );
+ for (; oIt.current(); ++oIt )
+ {
+ //can't assign a effect to header/footer
+ if(m_view->kPresenterDoc()->isHeaderFooter(oIt.current()))
+ continue;
+ if ( oIt.current()->isSelected() )
+ objs.append( oIt.current() );
+ }
+ return !objs.isEmpty();
+}
+
+bool KPrCanvas::isOneObjectSelected() const
+{
+ return m_activePage->isOneObjectSelected();
+}
+
+// This one is used to generate the pixmaps for the HTML presentation,
+// for the pres-structure-dialog, for the sidebar previews, for template icons.
+// Set forceWidth and/or forceHeight to override the zoom factor
+// and obtain a pixmap of the specified width and/or height.
+// By omitting one of them you make sure that the aspect ratio
+// of your page is used for the resulting image.
+void KPrCanvas::drawPageInPix( QPixmap &_pix, int pgnum, int zoom,
+ bool forceRealVariableValue,
+ int forceWidth,
+ int forceHeight )
+{
+ //kdDebug(33001) << "Page::drawPageInPix" << endl;
+
+ KPrDocument *doc = m_view->kPresenterDoc();
+ int oldZoom = doc->zoomHandler()->zoom();
+ bool oldDisplayFieldValue = false;
+
+ if( 0 < forceWidth || 0 < forceHeight )
+ {
+ const QRect rect( doc->getPageRect( true ) );
+ const double dRectHeight = static_cast<double>(rect.height());
+ const double dRectWidth = static_cast<double>(rect.width());
+ double dForceHeight = static_cast<double>(forceHeight);
+ double dForceWidth = static_cast<double>(forceWidth);
+
+ // adjust width or height, in case one of them is missing
+ if( 0 >= forceWidth )
+ dForceWidth = dForceHeight * dRectWidth / dRectHeight;
+ else if( 0 >= forceHeight )
+ dForceHeight = dForceWidth * dRectHeight / dRectWidth;
+
+ // set the stretching values
+ // ### TODO: this should probably be setZoomedResolution, please test
+ doc->zoomHandler()->setResolution( dForceWidth / dRectWidth,
+ dForceHeight / dRectHeight );
+ // As of yet (Feb. 2004) the following call results
+ // in a NOP but be prepared for the future...
+ doc->newZoomAndResolution( false, false );
+ }else{
+ m_view->zoomDocument(zoom);
+ }
+
+ if ( forceRealVariableValue )
+ {
+ oldDisplayFieldValue = m_view->kPresenterDoc()->getVariableCollection()->variableSetting()->displayFieldCode();
+ if ( oldDisplayFieldValue )
+ {
+ m_view->kPresenterDoc()->getVariableCollection()->variableSetting()->setDisplayFieldCode(false);
+ m_view->kPresenterDoc()->recalcVariables( VT_ALL );
+ }
+ }
+
+ KPrPage * page = m_view->kPresenterDoc()->pageList().at(pgnum);
+ QRect rect = page->getZoomPageRect( );
+ _pix.resize( rect.size() );
+ _pix.fill( Qt::white );
+
+ QPainter p;
+ p.begin( &_pix );
+
+ bool _editMode = editMode;
+ editMode = false;
+
+ drawBackground( &p, _pix.rect(), page, true );
+
+ // draw objects on master slide
+ if ( page->masterPage() && page->displayObjectFromMasterPage() )
+ drawAllObjectsInPage( &p, page->masterPage()->objectList(), pgnum );
+
+ //objects in current page
+ drawAllObjectsInPage( &p, page->objectList(), pgnum );
+
+ editMode = _editMode;
+ p.end();
+
+ if ( forceRealVariableValue )
+ {
+ if ( oldDisplayFieldValue )
+ {
+ m_view->kPresenterDoc()->getVariableCollection()->variableSetting()->setDisplayFieldCode(true);
+ m_view->kPresenterDoc()->recalcVariables( VT_ALL );
+ }
+ }
+
+ m_view->zoomDocument(oldZoom);
+}
+
+// This one is used in fullscreenmode, to generate the pixmaps used for the
+// page effects.
+void KPrCanvas::drawCurrentPageInPix( QPixmap &_pix ) const
+{
+ //kdDebug(33001) << "Page::drawCurrentPageInPix" << endl;
+
+ // avoid garbage on "weird" DPIs
+ _pix.fill(Qt::black);
+
+ QPainter p;
+ p.begin( &_pix );
+
+ drawBackground( &p, _pix.rect(), m_view->kPresenterDoc()->pageList().at( m_step.m_pageNumber ) );
+ PresStep step( m_step.m_pageNumber, m_step.m_step, m_step.m_subStep, true, true );
+ drawPresPage( &p, _pix.rect(), step );
+
+ p.end();
+}
+
+void KPrCanvas::printPage( QPainter* painter, PresStep step, KPrinter *printer, int rows, int cols )
+{
+ //kdDebug(33001) << "KPrCanvas::printPage" << endl;
+ KPrDocument *doc = m_view->kPresenterDoc();
+ KPrPage* page = doc->pageList().at( step.m_pageNumber );
+ QRect const rect = page->getZoomPageRect();
+ bool const drawBorder = printer->option("kde-kpresenter-printslideborders").toInt() && rows>1 && cols>1;
+
+ int height = rect.height();
+ int width = rect.width();
+
+ QPaintDeviceMetrics metrics( printer );
+ int begin_left = ( metrics.width() - rect.width() );
+ int begin_top = ( metrics.height() - rect.height() );
+
+ rows = cols = QMAX( rows, cols ); // all slides have the same size
+
+ if ( rows > 1 )
+ {
+ height = ( ( height - 80 ) / rows ) - 20;
+ begin_top = 40;
+ }
+ if ( cols > 1 )
+ {
+ width = (width -5) / cols;
+ begin_left = 5;
+ }
+ int top = begin_top;
+ int left = begin_left;
+ for (int r = 0; r < rows; r++ )
+ {
+ for (int c = 0; c < cols; c++ )
+ {
+ page = doc->pageList().at( step.m_pageNumber );
+ if ( !page )
+ return;
+ painter->setViewport( QRect(left, top, width, height) );
+ drawBackground( painter, rect, page, true );
+ drawPresPage( painter, rect, step );
+ if ( drawBorder )
+ painter->drawRect( rect );
+ step.m_pageNumber++;
+ left += width;
+ }
+ top += height + 20; // some y-space between the slides
+ left = begin_left;
+ }
+
+}
+
+void KPrCanvas::doObjEffects( bool isAllreadyPainted )
+{
+ if ( m_effectHandler )
+ {
+ m_effectTimer.stop();
+ QObject::disconnect( &m_effectTimer, SIGNAL( timeout() ), this, SLOT( slotDoEffect() ) );
+
+ m_effectHandler->finish();
+ delete m_effectHandler;
+ m_effectHandler = 0;
+ }
+
+ QPixmap screen_orig( kapp->desktop()->width(), kapp->desktop()->height() );
+
+ KPrPage *page = m_view->kPresenterDoc()->pageList().at( m_step.m_pageNumber );
+ // YABADABADOOOOOOO.... That's a hack :-)
+ if ( m_step.m_subStep == 0 && !isAllreadyPainted && isUpdatesEnabled() )
+ {
+ //kdDebug(33001) << "Page::doObjEffects - in the strange hack" << endl;
+ QPainter p;
+ p.begin( &screen_orig );
+ QRect desktopRect = QRect( 0, 0, kapp->desktop()->width(), kapp->desktop()->height() );
+ drawBackground( &p, desktopRect, page );
+ PresStep step( m_step.m_pageNumber, m_step.m_step, m_step.m_subStep, true, true );
+ drawPresPage( &p, desktopRect ,step );
+ p.end();
+ bitBlt( this, 0, 0, &screen_orig );
+ }
+ else
+ {
+ bitBlt( &screen_orig, 0, 0, this );
+ }
+
+ QPtrList<KPrObject> allObjects;
+ // master slide objects are below the objects of the normal slide
+ if ( page->displayObjectFromMasterPage() )
+ {
+ QPtrListIterator<KPrObject> it( page->masterPage()->objectList() );
+ for ( ; it.current(); ++it ) {
+ if ( objectIsAHeaderFooterHidden( it.current() ) )
+ continue;
+ else
+ allObjects.append( it.current() );
+ }
+ }
+
+ QPtrListIterator<KPrObject> it( page->objectList() );
+ for ( ; it.current(); ++it )
+ {
+ allObjects.append( it.current() );
+ }
+
+ //TODO add global presentation speed
+ m_effectHandler = new KPrEffectHandler( m_step, goingBack, this, &screen_orig, allObjects, m_view, 1 );
+ if ( m_effectHandler->doEffect() )
+ {
+ delete m_effectHandler;
+ m_effectHandler = 0;
+ }
+ else
+ {
+ connect( &m_effectTimer, SIGNAL( timeout() ), SLOT( slotDoEffect() ) );
+ m_effectTimer.start( 50, true );
+ }
+
+}
+
+void KPrCanvas::slotDoEffect()
+{
+ if ( m_effectHandler->doEffect() )
+ {
+ m_effectTimer.stop();
+ QObject::disconnect( &m_effectTimer, SIGNAL( timeout() ), this, SLOT( slotDoEffect() ) );
+ delete m_effectHandler;
+ m_effectHandler = 0;
+ }
+ else
+ {
+ m_effectTimer.start( 50, true );
+ }
+}
+
+
+void KPrCanvas::slotDoPageEffect()
+{
+ if ( m_pageEffect->doEffect() )
+ {
+ m_pageEffectTimer.stop();
+ QObject::disconnect( &m_pageEffectTimer, SIGNAL( timeout() ), this, SLOT( slotDoPageEffect() ) );
+ delete m_pageEffect;
+ m_pageEffect = 0;
+
+ doObjEffects( true );
+ }
+ else
+ {
+ m_pageEffectTimer.start( 50, true );
+ }
+}
+
+void KPrCanvas::slotAutoScroll(const QPoint &scrollDistance)
+{
+ //QPoint d = m_view->zoomHandler()->zoomPoint( scrollDistance );
+ QPoint d = scrollDistance;
+ m_view->getHScrollBar()->setValue( m_view->getHScrollBar()->value() + d.x() );
+ m_view->getVScrollBar()->setValue( m_view->getVScrollBar()->value() + d.y() );
+}
+
+
+bool KPrCanvas::finishObjectEffects()
+{
+ bool finished = false;
+ if ( m_effectHandler )
+ {
+ m_effectTimer.stop();
+ QObject::disconnect( &m_effectTimer, SIGNAL( timeout() ), this, SLOT( slotDoEffect() ) );
+ m_effectHandler->finish();
+ delete m_effectHandler;
+ m_effectHandler = 0;
+ finished = true;
+ }
+ return finished;
+}
+
+
+bool KPrCanvas::finishPageEffect( bool cancel )
+{
+ bool finished = false;
+ if ( m_pageEffect )
+ {
+ m_pageEffectTimer.stop();
+ QObject::disconnect( &m_pageEffectTimer, SIGNAL( timeout() ), this, SLOT( slotDoPageEffect() ) );
+ if ( !cancel )
+ m_pageEffect->finish();
+ delete m_pageEffect;
+ m_pageEffect = 0;
+
+ if ( !cancel )
+ {
+ doObjEffects( true );
+ }
+ else if ( !spManualSwitch() )
+ {
+ m_view->setAutoPresTimer( 1 );
+ m_setPageTimer = true;
+ }
+
+ finished = true;
+ }
+ return finished;
+}
+
+
+void KPrCanvas::print( QPainter *painter, KPrinter *printer, float /*left_margin*/, float /*top_margin*/ )
+{
+ PresStep step( 0, 1000, 1000 );
+ //deSelectAllObj(); // already done in KPrView::setupPrinter
+ int i = 0;
+
+ repaint( false );
+ kapp->processEvents();
+
+ editMode = false;
+ fillBlack = false;
+
+ //int _xOffset = diffx();
+ //int _yOffset = diffy();
+
+ //m_view->setDiffX( -static_cast<int>( MM_TO_POINT( left_margin ) ) );
+ //m_view->setDiffY( -static_cast<int>( MM_TO_POINT( top_margin ) ) );
+
+ QProgressDialog progress( i18n( "Printing..." ), i18n( "Cancel" ),
+ printer->pageList().count() + 2, this );
+
+ int j = 0;
+ progress.setProgress( 0 );
+
+
+ int rows = 1;
+ int cols = 1;
+ if ( !printer->previewOnly() )
+ {
+ rows = printer->option("kde-kpresenter-printrows").toInt();
+ cols = printer->option("kde-kpresenter-printcolumns").toInt();
+ }
+ int const slides_per_page = rows * cols;
+
+ /*if ( printer->fromPage() > 1 )
+ m_view->setDiffY( ( printer->fromPage() - 1 ) * ( getPageRect( 1, 1.0, false ).height() ) -
+ (int)MM_TO_POINT( top_margin ) );*/
+ int current_slide = 0;
+ QValueList<int> list=printer->pageList(); // 1-based
+ QValueList<int>::iterator it;
+ for( it=list.begin();it!=list.end();++it)
+ {
+ i=(*it);
+ progress.setProgress( ++j );
+ kapp->processEvents();
+
+ if ( progress.wasCancelled() )
+ break;
+
+ step.m_pageNumber = i - 1;
+
+ if ( step.m_pageNumber != current_slide )
+ continue;
+
+ if ( !list.isEmpty() && i > list.first() )
+ printer->newPage();
+
+ painter->resetXForm();
+ painter->fillRect( m_view->kPresenterDoc()->pageList().at( m_step.m_pageNumber )->getZoomPageRect(), white );
+
+ printPage( painter, step, printer, rows, cols );
+ kapp->processEvents();
+
+ painter->resetXForm();
+ kapp->processEvents();
+
+ current_slide += slides_per_page;
+
+ /*m_view->setDiffY( i * ( getPageRect( 1, 1.0, false ).height() )
+ - static_cast<int>( MM_TO_POINT( top_margin ) ) );*/
+ }
+
+ KConfig *config=KPrFactory::global()->config();
+ config->setGroup("Misc");
+ bool printNotes = config->readBoolEntry("PrintNotes", true);
+
+ KPrNoteBar *noteBar = m_view->getNoteBar();
+ //don't print notes when there is no note to print or it's disabled
+ if ( noteBar && !noteBar->getNotesTextForPrinting(list).isEmpty()
+ && !progress.wasCancelled() && printNotes )
+ {
+ printer->newPage();
+ painter->resetXForm();
+ noteBar->printNotes( painter, printer, list );
+ painter->resetXForm();
+ }
+
+ setToolEditMode( toolEditMode );
+ //m_view->setDiffX( _xOffset );
+ //m_view->setDiffY( _yOffset );
+
+ progress.setProgress( printer->pageList().count() + 2 );
+
+ fillBlack = true;
+ editMode = true;
+ repaint( false );
+}
+
+
+void KPrCanvas::updateInsertRect( const KoPoint &point, Qt::ButtonState state )
+{
+ if ( state & AltButton )
+ {
+ m_insertRect.moveBottomRight( point );
+ }
+ else
+ {
+ m_insertRect.setRight( point.x() );
+ m_insertRect.setBottom( point.y() );
+ }
+}
+
+
+KPrTextObject* KPrCanvas::insertTextObject( const KoRect &rect )
+{
+ KPrTextObject* obj = m_activePage->insertTextObject( rect );
+ selectObj( obj );
+ return obj;
+}
+
+void KPrCanvas::insertLine( const KoPoint &startPoint, const KoPoint &endPoint )
+{
+ KoRect rect( startPoint, endPoint );
+ bool rev = rect.width() < 0 || rect.height() < 0;
+ rect = rect.normalize();
+ LineType lt = LT_LU_RD;
+ if ( startPoint.x() == endPoint.x() )
+ {
+ lt = LT_VERT;
+ rect.setLeft( rect.left() - 5.0 );
+ rect.setRight( rect.right() + 5.0 );
+ }
+ else if ( startPoint.y() == endPoint.y() )
+ {
+ lt = LT_HORZ;
+ rect.setTop( startPoint.y() - 5.0 );
+ rect.setBottom( startPoint.y() + 5.0 );
+ }
+ else if ( ( startPoint.x() < endPoint.x() && startPoint.y() > endPoint.y() ) ||
+ ( startPoint.x() > endPoint.x() && startPoint.y() < endPoint.y() ) )
+ {
+ lt = LT_LD_RU;
+ }
+ m_activePage->insertLine( rect, m_view->getPen(),
+ !rev ? m_view->getLineBegin() : m_view->getLineEnd(), !rev ? m_view->getLineEnd() : m_view->getLineBegin(),
+ lt );
+}
+
+
+void KPrCanvas::insertRect( const KoRect &rect )
+{
+ m_activePage->insertRectangle( rect, m_view->getPen(), m_view->getBrush(), m_view->getFillType(),
+ m_view->getGColor1(), m_view->getGColor2(), m_view->getGType(), m_view->getRndX(), m_view->getRndY(),
+ m_view->getGUnbalanced(), m_view->getGXFactor(), m_view->getGYFactor() );
+}
+
+void KPrCanvas::insertEllipse( const KoRect &rect )
+{
+ m_activePage->insertCircleOrEllipse( rect, m_view->getPen(), m_view->getBrush(), m_view->getFillType(),
+ m_view->getGColor1(), m_view->getGColor2(),
+ m_view->getGType(), m_view->getGUnbalanced(), m_view->getGXFactor(), m_view->getGYFactor() );
+}
+
+void KPrCanvas::insertPie( const KoRect &rect )
+{
+ m_activePage->insertPie( rect, m_view->getPen(), m_view->getBrush(), m_view->getFillType(),
+ m_view->getGColor1(), m_view->getGColor2(), m_view->getGType(),
+ m_view->getPieType(), m_view->getPieAngle(), m_view->getPieLength(),
+ m_view->getLineBegin(), m_view->getLineEnd(), m_view->getGUnbalanced(), m_view->getGXFactor(),
+ m_view->getGYFactor() );
+}
+
+void KPrCanvas::insertAutoform( const KoRect &rect )
+{
+ m_activePage->insertAutoform( rect, m_view->getPen(), m_view->getBrush(),
+ m_view->getLineBegin(), m_view->getLineEnd(),
+ m_view->getFillType(), m_view->getGColor1(), m_view->getGColor2(), m_view->getGType(),
+ autoform, m_view->getGUnbalanced(), m_view->getGXFactor(), m_view->getGYFactor() );
+}
+
+KPrPartObject* KPrCanvas::insertObject( const KoRect &rect )
+{
+ KPrPartObject *kpPartObject = m_activePage->insertObject( rect, partEntry );
+ return kpPartObject;
+}
+
+void KPrCanvas::insertFreehand( const KoPointArray &_pointArray )
+{
+ KoRect rect = _pointArray.boundingRect();
+
+ m_activePage->insertFreehand( getObjectPoints( _pointArray ), rect, m_view->getPen(), m_view->getLineBegin(),
+ m_view->getLineEnd() );
+
+ m_pointArray = KoPointArray();
+ m_indexPointArray = 0;
+}
+
+void KPrCanvas::insertPolyline( const KoPointArray &_pointArray )
+{
+ if( _pointArray.count()> 1)
+ {
+ KoRect rect = _pointArray.boundingRect();
+ m_activePage->insertPolyline( getObjectPoints( _pointArray ), rect, m_view->getPen(), m_view->getLineBegin(),
+ m_view->getLineEnd() );
+ }
+ m_pointArray = KoPointArray();
+ m_indexPointArray = 0;
+}
+
+void KPrCanvas::insertCubicBezierCurve( const KoPointArray &_pointArray )
+{
+ if ( _pointArray.count() > 1 )
+ {
+ KoPointArray points( _pointArray );
+ KoPointArray bezierPoints( KPrBezierCurveObject::bezier2polyline( _pointArray ) );
+ KoRect rect = bezierPoints.boundingRect();
+ points = getObjectPoints( points );
+ bezierPoints = getObjectPoints( bezierPoints );
+
+ if ( toolEditMode == INS_CUBICBEZIERCURVE )
+ {
+ m_activePage->insertCubicBezierCurve( points, bezierPoints, rect, m_view->getPen(),
+ m_view->getLineBegin(), m_view->getLineEnd() );
+ }
+ else if ( toolEditMode == INS_QUADRICBEZIERCURVE )
+ {
+ m_activePage->insertQuadricBezierCurve( points, bezierPoints, rect, m_view->getPen(),
+ m_view->getLineBegin(), m_view->getLineEnd() );
+ }
+ else if ( toolEditMode == INS_CLOSED_CUBICBEZIERCURVE ||
+ toolEditMode == INS_CLOSED_QUADRICBEZIERCURVE )
+ {
+ m_activePage->insertClosedLine( bezierPoints, rect, m_view->getPen(), m_view->getBrush(),
+ m_view->getFillType(), m_view->getGColor1(), m_view->getGColor2(),
+ m_view->getGType(), m_view->getGUnbalanced(),
+ m_view->getGXFactor(), m_view->getGYFactor(), toolEditMode );
+ }
+ }
+ m_pointArray = KoPointArray();
+ m_indexPointArray = 0;
+}
+
+void KPrCanvas::insertPolygon( const KoPointArray &_pointArray )
+{
+ KoRect rect = _pointArray.boundingRect();
+
+ m_activePage->insertPolygon( getObjectPoints( _pointArray ), rect, m_view->getPen(), m_view->getBrush(), m_view->getFillType(),
+ m_view->getGColor1(), m_view->getGColor2(), m_view->getGType(), m_view->getGUnbalanced(),
+ m_view->getGXFactor(), m_view->getGYFactor(),
+ m_view->getCheckConcavePolygon(), m_view->getCornersValue(), m_view->getSharpnessValue() );
+
+ m_pointArray = KoPointArray();
+ m_indexPointArray = 0;
+}
+
+void KPrCanvas::insertPicture( const KoRect &rect )
+{
+ QString file = m_activePage->insPictureFile();
+
+ QCursor c = cursor();
+ setCursor( waitCursor );
+ if ( !file.isEmpty() ) {
+ if ( rect.width() > 10 && rect.height() > 10 )
+ {
+ m_activePage->insertPicture( file, rect );
+ }
+ else
+ {
+ KoPoint tl( rect.topLeft() );
+ m_activePage->insertPicture( file, tl );
+ }
+ m_activePage->setInsPictureFile( QString::null );
+ }
+ setCursor( c );
+}
+
+void KPrCanvas::insertClosedLine( const KoPointArray &_pointArray )
+{
+ KoRect rect = _pointArray.boundingRect();
+
+ m_activePage->insertClosedLine( getObjectPoints( _pointArray ), rect, m_view->getPen(), m_view->getBrush(), m_view->getFillType(),
+ m_view->getGColor1(), m_view->getGColor2(), m_view->getGType(), m_view->getGUnbalanced(),
+ m_view->getGXFactor(), m_view->getGYFactor(), toolEditMode );
+
+ m_pointArray = KoPointArray();
+ m_indexPointArray = 0;
+}
+
+void KPrCanvas::setToolEditMode( ToolEditMode _m, bool updateView )
+{
+ //store m_pointArray if !m_pointArray.isNull()
+ if ( ( toolEditMode == INS_POLYLINE || toolEditMode == INS_CLOSED_POLYLINE ) && !m_pointArray.isNull())
+ endDrawPolyline();
+
+ if ( ( toolEditMode == INS_CUBICBEZIERCURVE || toolEditMode == INS_QUADRICBEZIERCURVE
+ || toolEditMode == INS_CLOSED_CUBICBEZIERCURVE || toolEditMode == INS_CLOSED_QUADRICBEZIERCURVE ) && !m_pointArray.isNull() )
+ endDrawCubicBezierCurve();
+
+ exitEditMode();
+ toolEditMode = _m;
+
+ if ( toolEditMode == TEM_MOUSE )
+ {
+ setCursor( arrowCursor );
+ QPoint pos = QCursor::pos();
+ // ### missing some coord transformation here?
+ KoPoint docPoint( m_view->zoomHandler()->unzoomPoint( pos ) );
+ KPrObject *obj=m_activePage->getCursor( pos);
+ if(obj)
+ setCursor( obj->getCursor( docPoint, modType, m_view->kPresenterDoc() ) );
+ }
+ else if ( toolEditMode == INS_FREEHAND || toolEditMode == INS_CLOSED_FREEHAND )
+ setCursor( KPrUtils::penCursor() );
+ else if ( toolEditMode == TEM_ROTATE )
+ setCursor( KPrUtils::rotateCursor() );
+ else
+ setCursor( crossCursor );
+
+ if ( updateView )
+ m_view->setTool( toolEditMode );
+}
+
+
+void KPrCanvas::endDrawPolyline()
+{
+ m_drawPolyline = false;
+
+ if ( toolEditMode == INS_POLYLINE )
+ insertPolyline( m_pointArray );
+ else if ( toolEditMode == INS_CLOSED_POLYLINE )
+ insertClosedLine( m_pointArray );
+
+ emit objectSelectedChanged();
+ if ( toolEditMode != TEM_MOUSE && editMode )
+ repaint( false );
+ m_view->disableAutoScroll();
+ mousePressed = false;
+ modType = MT_NONE;
+}
+
+void KPrCanvas::endDrawCubicBezierCurve()
+{
+ m_drawCubicBezierCurve = false;
+ m_oldCubicBezierPointArray = KoPointArray();
+ insertCubicBezierCurve( m_pointArray );
+ emit objectSelectedChanged();
+ if ( toolEditMode != TEM_MOUSE && editMode )
+ repaint( false );
+ m_view->disableAutoScroll();
+ mousePressed = false;
+ modType = MT_NONE;
+}
+
+void KPrCanvas::selectNext()
+{
+ if ( objectList().count() == 0 ) return;
+
+ if ( m_activePage->numSelected() == 0 )
+ objectList().at( 0 )->setSelected( true );
+ else {
+ int i = objectList().findRef( m_activePage->getSelectedObj() );
+ if ( i < static_cast<int>( objectList().count() ) - 1 ) {
+ m_view->kPresenterDoc()->deSelectAllObj();
+ objectList().at( ++i )->setSelected( true );
+ } else {
+ m_view->kPresenterDoc()->deSelectAllObj();
+ objectList().at( 0 )->setSelected( true );
+ }
+ }
+ m_view->showObjectRect( m_activePage->getSelectedObj() );
+ _repaint( false );
+}
+
+void KPrCanvas::selectPrev()
+{
+ if ( objectList().count() == 0 ) return;
+ if ( m_activePage->numSelected() == 0 )
+ objectList().at( objectList().count() - 1 )->setSelected( true );
+ else {
+ int i = objectList().findRef( m_activePage->getSelectedObj() );
+ if ( i > 0 ) {
+ m_view->kPresenterDoc()->deSelectAllObj();
+ objectList().at( --i )->setSelected( true );
+ } else {
+ m_view->kPresenterDoc()->deSelectAllObj();
+ objectList().at( objectList().count() - 1 )->setSelected( true );
+ }
+ }
+ m_view->showObjectRect( m_activePage->getSelectedObj() );
+ _repaint( false );
+}
+
+void KPrCanvas::dragEnterEvent( QDragEnterEvent *e )
+{
+ if ( m_currentTextObjectView )
+ m_currentTextObjectView->dragEnterEvent( e );
+ else if ( QTextDrag::canDecode( e )
+ || QImageDrag::canDecode( e )
+ || KURLDrag::canDecode(e)) {
+ e->accept();
+ }
+ else
+ e->ignore();
+}
+
+void KPrCanvas::dragMoveEvent( QDragMoveEvent *e )
+{
+ if( m_currentTextObjectView)
+ {
+ KPrTextObject * obj = textUnderMouse( e->pos());
+ bool emitChanged = false;
+ if ( obj )
+ emitChanged = checkCurrentTextEdit( obj );
+ if ( m_currentTextObjectView )
+ {
+ m_currentTextObjectView->dragMoveEvent( e, QPoint() );
+ if ( emitChanged )
+ emit currentObjectEditChanged();
+ }
+ }
+ else if ( QTextDrag::canDecode( e )
+ || QImageDrag::canDecode( e )
+ || KURLDrag::canDecode(e)) {
+ e->accept();
+ }
+ else
+ e->ignore();
+}
+
+void KPrCanvas::dropImage( QMimeSource * data, bool resizeImageToOriginalSize, int posX, int posY )
+{
+ setToolEditMode( TEM_MOUSE );
+ deSelectAllObj();
+
+ QImage pix;
+ QImageDrag::decode( data, pix );
+
+ KTempFile tmpFile;
+ tmpFile.setAutoDelete(true);
+
+ if( tmpFile.status() != 0 )
+ return;
+
+ pix.save( tmpFile.name(), "PNG" );
+ QCursor c = cursor();
+ setCursor( waitCursor );
+
+ QPoint pos( posX + diffx(), posY + diffy() );
+ KoPoint docPoint( m_view->zoomHandler()->unzoomPoint( pos ) );
+
+ m_activePage->insertPicture( tmpFile.name(), docPoint );
+
+ tmpFile.close();
+
+ if ( resizeImageToOriginalSize )
+ picViewOriginalSize();
+ setCursor( c );
+}
+
+void KPrCanvas::dropEvent( QDropEvent *e )
+{
+ //disallow dropping objects outside the "page"
+ KoPoint docPoint = m_view->zoomHandler()->unzoomPoint( e->pos()+QPoint(diffx(),diffy()) );
+ if ( !m_activePage->getZoomPageRect().contains(e->pos()))
+ return;
+
+ if ( QImageDrag::canDecode( e ) ) {
+ dropImage( e, true, e->pos().x(), e->pos().y() );
+ e->accept();
+ } else if ( KURLDrag::canDecode( e ) ) {
+ setToolEditMode( TEM_MOUSE );
+ deSelectAllObj();
+
+ KURL::List lst;
+ KURLDrag::decode( e, lst );
+
+ KURL::List::ConstIterator it = lst.begin();
+ for ( ; it != lst.end(); ++it ) {
+ const KURL &url( *it );
+
+ QString filename;
+ if ( !url.isLocalFile() ) {
+ if ( !KIO::NetAccess::download( url, filename, this ) )
+ continue;
+ } else {
+ filename = url.path();
+ }
+
+ KMimeMagicResult *res = KMimeMagic::self()->findFileType( filename );
+
+ if ( res && res->isValid() ) {
+ QString mimetype = res->mimeType();
+ if ( mimetype.contains( "image" ) ) {
+ QCursor c = cursor();
+ setCursor( waitCursor );
+ m_activePage->insertPicture( filename, docPoint );
+ setCursor( c );
+ } else if ( mimetype.contains( "text" ) ) {
+ QCursor c = cursor();
+ setCursor( waitCursor );
+ QFile f( filename );
+ QTextStream t( &f );
+ QString text = QString::null, tmp;
+ kdDebug()<<" filename :"<<filename<<endl;
+ if ( f.open( IO_ReadOnly ) ) {
+ while ( !t.eof() ) {
+ tmp = t.readLine();
+ tmp += "\n";
+ text.append( tmp );
+ }
+ f.close();
+ }
+ kdDebug()<<" text :"<<endl;
+ m_activePage->insertTextObject( m_view->zoomHandler()->unzoomRect(QRect( e->pos().x(), e->pos().y(), 250, 250 )),
+ text, m_view );
+
+ setCursor( c );
+ }
+ }
+ KIO::NetAccess::removeTempFile( filename );
+ }
+ }
+ else if (m_currentTextObjectView)
+ {
+ m_currentTextObjectView->dropEvent( e );
+ }
+ else if ( QTextDrag::canDecode( e ) ) {
+ setToolEditMode( TEM_MOUSE );
+ deSelectAllObj();
+
+ QString text;
+ QTextDrag::decode( e, text );
+ //kdDebug()<<" QTextDrag::decode( e, text ); :"<<text<<endl;
+ m_activePage->insertTextObject( m_view->zoomHandler()->unzoomRect( QRect( e->pos().x(), e->pos().y(), 250, 250 )),
+ text, m_view );
+ e->accept();
+ } else
+ e->ignore();
+
+}
+
+void KPrCanvas::slotGotoPage()
+{
+ setSwitchingMode( false );
+ //setCursor( blankCursor );
+ int pg = m_step.m_pageNumber + 1;
+
+ m_view->setPageDuration( m_step.m_pageNumber );
+
+ pg = KPrGotoPage::gotoPage( m_view->kPresenterDoc(), m_presentationSlides, pg, this );
+ gotoPage( pg );
+
+ if ( !spManualSwitch() ) {
+ m_view->setAutoPresTimer( 1 );
+ m_setPageTimer = true;
+ }
+}
+
+void KPrCanvas::gotoPage( int pg )
+{
+ int page = pg - 1;
+ if ( page != m_step.m_pageNumber || m_step.m_step != *m_pageEffectSteps.begin() || m_step.m_subStep != 0 ) {
+ // clear drawed lines
+ m_drawModeLines.clear();
+ goingBack = false;
+
+ m_step.m_pageNumber = page;
+ kdDebug(33001) << "Page::gotoPage m_step.m_pageNumber =" << m_step.m_pageNumber << endl;
+ m_presentationSlidesIterator = m_presentationSlides.find( m_step.m_pageNumber + 1 );
+ editMode = false;
+ m_drawMode = false;
+ m_pageEffectSteps = m_view->kPresenterDoc()->getPageEffectSteps( m_step.m_pageNumber );
+ m_step.m_step = *m_pageEffectSteps.begin();
+ m_step.m_subStep = 0;
+#if 0
+ QRect desk = KGlobalSettings::desktopGeometry(this);
+ resize( desk.width(), desk.height() );
+#endif
+ doObjEffects();
+ setFocus();
+ m_view->refreshPageButton();
+ }
+}
+
+void KPrCanvas::presGotoFirstPage()
+{
+ gotoPage( *m_presentationSlides.begin() );
+}
+
+KPrTextObject* KPrCanvas::kpTxtObj() const
+{
+ return ( ( m_editObject && m_editObject->getType() == OT_TEXT ) ?
+ dynamic_cast<KPrTextObject*>( m_editObject ) : 0 );
+ // ### return m_currentTextObjectView->kpTextObject()
+}
+
+void KPrCanvas::copyOasisObjs()
+{
+ //todo copy object from selected object
+ KoStoreDrag *kd = new KoStoreDrag( "application/vnd.oasis.opendocument.presentation", 0L );
+ QDragObject* dragObject = kd;
+ QByteArray arr;
+ QBuffer buffer(arr);
+ KoStore* store = KoStore::createStore( &buffer, KoStore::Write, "application/vnd.oasis.opendocument.presentation" );
+
+ delete store;
+ kd->setEncodedData( arr );
+ QApplication::clipboard()->setData( dragObject, QClipboard::Clipboard );
+}
+
+void KPrCanvas::copyObjs()
+{
+ QDomDocument doc("DOC");
+ QDomElement presenter=doc.createElement("DOC");
+ presenter.setAttribute("editor", "KPresenter");
+ presenter.setAttribute("mime", "application/x-kpresenter");
+
+ doc.appendChild(presenter);
+
+ QPtrList<KoDocumentChild> embeddedObjectsActivePage;
+
+ KoStoreDrag *kd = new KoStoreDrag( "application/x-kpresenter", 0L );
+ QDragObject* dragObject = kd;
+ QByteArray arr;
+ QBuffer buffer(arr);
+ KoStore* store = KoStore::createStore( &buffer, KoStore::Write, "application/x-kpresenter" );
+
+ m_activePage->getAllEmbeddedObjectSelected(embeddedObjectsActivePage );
+
+ // Save internal embedded objects first, since it might change their URL
+ int i = 0;
+ QValueList<KoPictureKey> savePictures;
+ QPtrListIterator<KoDocumentChild> chl( embeddedObjectsActivePage );
+ for( ; chl.current(); ++chl ) {
+ KoDocument* childDoc = chl.current()->document();
+ if ( childDoc && !childDoc->isStoredExtern() )
+ (void) childDoc->saveToStore( store, QString::number( i++ ) );
+ }
+
+ m_activePage->copyObjs(doc, presenter, savePictures);
+
+ KPrDocument* kprdoc = m_view->kPresenterDoc();
+ if ( !embeddedObjectsActivePage.isEmpty())
+ {
+ kprdoc->saveEmbeddedObject(m_activePage, embeddedObjectsActivePage,doc,presenter);
+ }
+
+ if ( !savePictures.isEmpty() ) {
+ // Save picture list at the end of the main XML
+ presenter.appendChild( kprdoc->pictureCollection()->saveXML( KoPictureCollection::CollectionPicture, doc, savePictures ) );
+ // Save the actual picture data into the store
+ kprdoc->pictureCollection()->saveToStore( KoPictureCollection::CollectionPicture, store, savePictures );
+ // Single image -> put it in dragobject too
+ if ( savePictures.count() == 1 )
+ {
+ KoPicture pic = kprdoc->pictureCollection()->findPicture( savePictures.first() );
+ QDragObject* picDrag = pic.dragObject( 0L );
+ if ( picDrag ) {
+ KMultipleDrag* multipleDrag = new KMultipleDrag( 0L );
+ multipleDrag->addDragObject( kd );
+ multipleDrag->addDragObject( picDrag );
+ dragObject = multipleDrag;
+ }
+ }
+ }
+
+ if ( store->open( "root" ) )
+ {
+ QCString s = doc.toCString(); // this is already Utf8!
+ //kdDebug(33001) << "KPrCanvas::copyObject: " << s << endl;
+ (void)store->write( s.data(), s.size()-1 );
+ store->close();
+ }
+
+ delete store;
+ kd->setEncodedData( arr );
+ QApplication::clipboard()->setData( dragObject, QClipboard::Clipboard );
+}
+
+void KPrCanvas::deleteObjs()
+{
+ lowerObject();
+ KCommand *cmd=m_activePage->deleteSelectedObjects();
+ m_view->kPresenterDoc()->deSelectAllObj();
+ if( cmd )
+ m_view->kPresenterDoc()->addCommand( cmd );
+ emit objectSelectedChanged();
+ setToolEditMode( toolEditMode );
+}
+
+
+void KPrCanvas::enterEvent( QEvent *e )
+{
+ m_view->setRulerMousePos( ( ( QMouseEvent* )e )->x(), ( ( QMouseEvent* )e )->y() );
+ m_view->setRulerMouseShow( true );
+}
+
+void KPrCanvas::leaveEvent( QEvent * /*e*/ )
+{
+ m_view->setRulerMouseShow( false );
+}
+
+QPtrList<KPrObject> KPrCanvas::objectList() const
+{
+ return m_activePage->objectList();
+}
+
+const QPtrList<KPrObject> &KPrCanvas::getObjectList() const
+{
+ return m_activePage->objectList();
+}
+
+unsigned int KPrCanvas::currPgNum() const
+{
+ return m_view->getCurrPgNum();
+}
+
+QColor KPrCanvas::txtBackCol() const
+{
+ return m_view->kPresenterDoc()->txtBackCol();
+}
+
+bool KPrCanvas::spInfiniteLoop() const
+{
+ return m_view->kPresenterDoc()->spInfiniteLoop();
+}
+
+bool KPrCanvas::spShowEndOfPresentationSlide() const
+{
+ return m_view->kPresenterDoc()->spShowEndOfPresentationSlide();
+}
+
+bool KPrCanvas::spManualSwitch() const
+{
+ return m_view->kPresenterDoc()->spManualSwitch();
+}
+
+QRect KPrCanvas::getPageRect( bool decBorders ) const
+{
+ return m_view->kPresenterDoc()->getPageRect( decBorders );
+}
+
+unsigned int KPrCanvas::pageNums() const
+{
+ return m_view->kPresenterDoc()->getPageNums();
+}
+
+void KPrCanvas::_repaint( bool /*erase*/ )
+{
+ m_view->kPresenterDoc()->repaint( false );
+}
+
+void KPrCanvas::_repaint( const QRect &r )
+{
+ m_view->kPresenterDoc()->repaint( r );
+}
+
+void KPrCanvas::_repaint( KPrObject *o )
+{
+ m_view->kPresenterDoc()->repaint( o );
+}
+
+void KPrCanvas::slotExitPres()
+{
+ m_view->screenStop();
+}
+
+void KPrCanvas::setDrawingMode()
+{
+ m_presMenu->setItemChecked( PM_DM, true );
+ m_drawMode = true;
+
+ setCursor( KPrUtils::penCursor() );
+}
+
+void KPrCanvas::setSwitchingMode( bool continueTimer )
+{
+ m_presMenu->setItemChecked( PM_DM, false );
+
+ // the following have to be done even when nothing changed
+ // we don't want to see the cursor nor the automatic pesentation stopped
+ m_drawMode = false;
+ m_drawLineInDrawMode = false;
+ setCursor( blankCursor );
+
+ if ( continueTimer && !spManualSwitch() )
+ m_view->continueAutoPresTimer();
+}
+
+void KPrCanvas::exitEditMode( bool repaint )
+{
+ if ( m_editObject )
+ {
+ if ( m_editObject->getType() == OT_TEXT )
+ {
+ if(m_currentTextObjectView)
+ {
+ m_currentTextObjectView->clearSelection();
+ //hide cursor when we desactivate textObjectView
+ if ( repaint )
+ {
+ m_currentTextObjectView->drawCursor( false );
+ m_currentTextObjectView->terminate();
+ }
+ KPrTextObject *kpTextObj = m_currentTextObjectView->kpTextObject();
+ kpTextObj->setEditingTextObj( false );
+ delete m_currentTextObjectView;
+ m_currentTextObjectView = 0;
+
+ if ( repaint )
+ _repaint( static_cast<KPrObject*>( kpTextObj ) );
+ }
+ // Title of slide may have changed
+ m_view->kPresenterDoc()->updateSideBarItem( m_activePage );
+ emit objectSelectedChanged();
+ m_editObject = 0;
+ }
+ else if (m_editObject->getType() == OT_PART )
+ {
+ static_cast<KPrPartObject *>(m_editObject)->deactivate();
+ _repaint( m_editObject );
+ m_editObject = 0;
+ return;
+ }
+ }
+ //modType = MT_NONE;
+}
+
+bool KPrCanvas::getPixmapOrigAndCurrentSize( KPrPixmapObject *&obj, KoSize *origSize, KoSize *currentSize )
+{
+ *origSize = KoSize(obj->originalSize().width(),obj->originalSize().height());
+ *currentSize = obj->getSize();
+ return true;
+}
+
+void KPrCanvas::picViewOriginalSize()
+{
+ KPrDocument *doc = m_view->kPresenterDoc();
+ KPrPixmapObject *object = m_activePage->picViewOrigHelper();
+
+ KoSize newSize( doc->zoomHandler()->pixelXToPt( object->originalSize().width() ),
+ doc->zoomHandler()->pixelYToPt( object->originalSize().height() ) );
+
+ KoRect pageRect = m_activePage->getPageRect();
+ double fakt = 1.0;
+
+ if ( newSize.width() > pageRect.width() )
+ fakt = pageRect.width() / newSize.width();
+ if ( newSize.height() > pageRect.height() )
+ fakt = QMIN( fakt, pageRect.height() / newSize.height() );
+
+ KoSize diff( newSize.width() * fakt - object->getSize().width(),
+ newSize.height() * fakt - object->getSize().height() );
+
+ KPrResizeCmd *resizeCmd = new KPrResizeCmd( i18n( "Scale to Original Size" ),
+ KoPoint( 0, 0 ), diff, object, doc );
+ resizeCmd->execute();
+ doc->addCommand( resizeCmd );
+}
+
+void KPrCanvas::picViewOrig640x480()
+{
+ picViewOrigHelper(640, 480);
+}
+
+void KPrCanvas::picViewOrig800x600()
+{
+ picViewOrigHelper(800, 600);
+}
+
+void KPrCanvas::picViewOrig1024x768()
+{
+ picViewOrigHelper(1024, 768);
+}
+
+void KPrCanvas::picViewOrig1280x1024()
+{
+ picViewOrigHelper(1280, 1024);
+}
+
+void KPrCanvas::picViewOrig1600x1200()
+{
+ picViewOrigHelper(1600, 1200);
+}
+
+void KPrCanvas::picViewOrigHelper(int x, int y)
+{
+ KPrPixmapObject *obj = 0;
+ KoSize origSize;
+ KoSize currentSize;
+
+ obj=m_activePage->picViewOrigHelper();
+
+ if ( obj && !getPixmapOrigAndCurrentSize( obj, &origSize, &currentSize ) )
+ return;
+ KoSize pgSize = m_activePage->getPageRect().size();
+
+ if ( x == -1 && y == -1 ) {
+ x = (int)origSize.width();
+ y = (int)origSize.height();
+ }
+
+ QSize presSize( x, y );
+
+ scalePixmapToBeOrigIn( currentSize, pgSize, presSize, obj );
+}
+
+void KPrCanvas::picViewOrigFactor()
+{
+}
+
+void KPrCanvas::scalePixmapToBeOrigIn( const KoSize &currentSize, const KoSize &pgSize,
+ const QSize &presSize, KPrPixmapObject *obj )
+{
+ QRect desk = KGlobalSettings::desktopGeometry(this);
+ double faktX = (double)presSize.width() / (double)desk.width();
+ double faktY = (double)presSize.height() / (double)desk.height();
+ double w = pgSize.width() * faktX;
+ double h = pgSize.height() * faktY;
+
+ KPrResizeCmd *resizeCmd = new KPrResizeCmd( i18n( "Scale Picture to Be Shown 1:1 in Presentation Mode" ),
+ KoPoint( 0, 0 ), KoSize( w - currentSize.width(), h - currentSize.height() ),
+ obj, m_view->kPresenterDoc() );
+ resizeCmd->execute();
+ m_view->kPresenterDoc()->addCommand( resizeCmd );
+}
+
+void KPrCanvas::setTextBackground( KPrTextObject */*obj*/ )
+{
+ // This is called when double-clicking on a text object.
+ // What should happen exactly ? (DF)
+#if 0
+ QPixmap pix( m_activePage->getZoomPageRect().size() );
+ QPainter painter( &pix );
+ m_activePage->background()->drawBackground( &painter, FALSE );
+ QPixmap bpix( obj->getSize().toQSize() ); // ## zoom it !
+ bitBlt( &bpix, 0, 0, &pix, obj->getOrig().x(), obj->getOrig().y() -
+ m_activePage->getZoomPageRect().height() * ( m_view->getCurrPgNum() - 1 ), bpix.width(), bpix.height() );
+ QBrush b( white, bpix );
+ QPalette pal( obj->textObjectView()->palette() );
+ pal.setBrush( QColorGroup::Base, b );
+ obj->textObjectView()->setPalette( pal );
+#endif
+}
+
+
+KoPoint KPrCanvas::diffGrid( KoRect &rect, double diffx, double diffy )
+{
+ KPrDocument * doc( m_view->kPresenterDoc() );
+ KoPoint move( 0, 0 );
+
+ double tempx = ( int( rect.topLeft().x() / doc->getGridX() ) * doc->getGridX() ) - rect.topLeft().x();
+ if ( diffx > 0 )
+ {
+ tempx += doc->getGridX();
+ while ( diffx > tempx )
+ {
+ move.setX( tempx );
+ tempx += doc->getGridX();
+ }
+ }
+ else
+ {
+ while ( diffx < tempx )
+ {
+ move.setX( tempx );
+ tempx -= doc->getGridX();
+ }
+ }
+ double tempy = ( int( rect.topLeft().y() / doc->getGridY() ) * doc->getGridY() ) - rect.topLeft().y();
+ if ( diffy > 0 )
+ {
+ tempy += doc->getGridY();
+ while ( diffy > tempy )
+ {
+ move.setY( tempy );
+ tempy += doc->getGridY();
+ }
+ }
+ else
+ {
+ while ( diffy < tempy )
+ {
+ move.setY( tempy );
+ tempy -= doc->getGridY();
+ }
+ }
+
+ return move;
+}
+
+
+void KPrCanvas::moveObjectsByKey( int x, int y )
+{
+ KPrDocument *doc( m_view->kPresenterDoc() );
+
+ KoRect rect( objectRect( false ) );
+ double diffx = m_view->zoomHandler()->unzoomItX( x );
+ double diffy = m_view->zoomHandler()->unzoomItY( y );
+ KoPoint move( diffx, diffy );
+
+ bool snapToGrid = doc->snapToGrid() && !m_disableSnapping;
+ bool snapToGuideLines = doc->showGuideLines() && !m_disableSnapping;
+
+ if ( snapToGrid )
+ {
+ /*
+ * Find the distance to the next grid pos.
+ * The 1E-10 is needed when the object is on the grid when finding the next one, as
+ * calcualtion with doubles is tricky.
+ */
+ double tempx = int( rect.x() / doc->getGridX() ) * doc->getGridX();
+ if ( diffx > 0 )
+ {
+ move.setX( tempx - rect.x() );
+ while ( rect.x() - tempx >= -1E-10 )
+ {
+ tempx += doc->getGridX();
+ move.setX( tempx - rect.x() );
+ }
+ }
+ else if ( diffx < 0 )
+ {
+ move.setX( tempx - rect.x() );
+ while ( rect.x() - tempx <= 1E-10 )
+ {
+ tempx -= doc->getGridX();
+ move.setX( tempx - rect.x() );
+ }
+ }
+
+ double tempy = int( rect.y() / doc->getGridY() ) * doc->getGridY();
+ if ( diffy > 0 )
+ {
+ move.setY( tempy - rect.y() );
+ while ( rect.y() - tempy >= -1E-10 )
+ {
+ tempy += doc->getGridY();
+ move.setY( tempy - rect.y() );
+ }
+ }
+ else if ( diffy < 0 )
+ {
+ move.setY( tempy - rect.y() );
+ while ( rect.y() - tempy <= 1E-10 )
+ {
+ tempy -= doc->getGridY();
+ move.setY( tempy - rect.y() );
+ }
+ }
+ }
+
+ if ( snapToGuideLines )
+ {
+ if ( !snapToGrid )
+ {
+ // unwind last snapping
+ KoRect movedRect( rect );
+ movedRect.moveBy( diffx, diffy );
+ movedRect.moveBy( -m_moveSnapDiff.x(), -m_moveSnapDiff.y() );
+ move -= m_moveSnapDiff;
+
+ m_moveSnapDiff = KoPoint( 0, 0 );
+
+ KoGuides::SnapStatus snapStatus = KoGuides::SNAP_NONE;
+ m_gl.snapToGuideLines( movedRect, KEY_SNAP_DISTANCE, snapStatus, m_moveSnapDiff );
+
+ move += m_moveSnapDiff;
+ }
+ else
+ {
+ m_gl.diffNextGuide( rect, move );
+ }
+ }
+
+ // don't move object from canvas
+ KoRect pageRect( m_activePage->getPageRect() );
+ if ( rect.left() + move.x() < pageRect.left() )
+ {
+ move.setX( pageRect.left() - rect.left() );
+ }
+ else if ( rect.right() + move.x() > pageRect.right() )
+ {
+ move.setX( pageRect.right() - rect.right() );
+ }
+ if ( rect.top() + move.y() < pageRect.top() )
+ {
+ move.setY( pageRect.top() - rect.top() );
+ }
+ else if ( rect.bottom() + move.y() > pageRect.bottom() )
+ {
+ move.setY( pageRect.bottom() - rect.bottom() );
+ }
+
+ // we only want a repaint if we have guide lines
+ if ( snapToGuideLines )
+ {
+ // redraw guidelines (intentionally always)
+ KoRect movedRect( rect );
+ movedRect.moveBy( move.x(), move.y() );
+ m_gl.repaintSnapping( movedRect );
+ }
+
+ if ( move != KoPoint( 0, 0 ) )
+ {
+ //kdDebug(33001) << "moveObjectsByKey move = " << move << endl;
+ m_activePage->moveObject( m_view, move, false );
+ m_view->updateObjectStatusBarItem();
+ }
+}
+
+
+void KPrCanvas::moveObjectsByMouse( KoPoint &pos, bool keepXorYunchanged )
+{
+ KPrDocument *doc( m_view->kPresenterDoc() );
+
+ KoRect rect( objectRect( false ) );
+ KoPoint move( 0, 0 );
+ double diffx = pos.x() - m_origMousePos.x();
+ double diffy = pos.y() - m_origMousePos.y();
+
+ bool snapToGrid = doc->snapToGrid() && !m_disableSnapping;
+ bool snapToGuideLines = doc->showGuideLines() && !m_disableSnapping;
+
+ move = KoPoint( diffx, diffy );
+ m_origMousePos = pos;
+
+ // unwind last snapping
+ KoRect movedRect( rect );
+ movedRect.moveBy( diffx, diffy );
+ movedRect.moveBy( -m_moveSnapDiff.x(), -m_moveSnapDiff.y() );
+ move -= m_moveSnapDiff;
+
+ m_moveSnapDiff = KoPoint( 0, 0 ); // needed if all snapping is off
+ KoGuides::SnapStatus snapStatus = KoGuides::SNAP_NONE;
+
+ if ( snapToGrid )
+ {
+ m_moveSnapDiff.setX( qRound( movedRect.topLeft().x() / doc->getGridX()) * doc->getGridX()
+ - movedRect.topLeft().x() );
+ m_moveSnapDiff.setY( qRound( movedRect.topLeft().y() / doc->getGridY()) * doc->getGridY()
+ - movedRect.topLeft().y() );
+ snapStatus = KoGuides::SNAP_BOTH;
+ }
+
+ if ( snapToGuideLines )
+ {
+ m_gl.snapToGuideLines( movedRect, MOUSE_SNAP_DISTANCE, snapStatus, m_moveSnapDiff );
+ }
+
+ move += m_moveSnapDiff;
+
+ // don't move object off canvas
+ KoPoint diffDueToBorders(0,0);
+ KoRect pageRect( m_activePage->getPageRect() );
+ if ( rect.left() + move.x() < pageRect.left() )
+ diffDueToBorders.setX( pageRect.left() - (rect.left() + move.x()) );
+ else if ( rect.right() + move.x() > pageRect.right() )
+ diffDueToBorders.setX( pageRect.right() - (rect.right() + move.x()) );
+
+ if ( rect.top() + move.y() < pageRect.top() )
+ diffDueToBorders.setY( pageRect.top() - (rect.top() + move.y()) );
+ else if ( rect.bottom() + move.y() > pageRect.bottom() )
+ diffDueToBorders.setY( pageRect.bottom() - (rect.bottom() + move.y()) );
+
+ m_moveSnapDiff += diffDueToBorders;
+ move += diffDueToBorders;
+
+ movedRect.moveBy( m_moveSnapDiff.x(), m_moveSnapDiff.y() );
+ if ( keepXorYunchanged )
+ {
+ KoPoint diff( m_moveStartPosMouse - movedRect.topLeft() );
+ if ( fabs( diff.x() ) > fabs( diff.y() ) )
+ {
+ m_moveSnapDiff.setY( m_moveSnapDiff.y() + m_moveStartPosMouse.y() - movedRect.y() );
+ movedRect.moveTopLeft( KoPoint( movedRect.x(), m_moveStartPosMouse.y() ) );
+ move.setY( movedRect.y() - rect.y() );
+ }
+ else
+ {
+ m_moveSnapDiff.setX( m_moveSnapDiff.x() + m_moveStartPosMouse.x() - movedRect.x() );
+ movedRect.moveTopLeft( KoPoint( m_moveStartPosMouse.x(), movedRect.y() ) );
+ move.setX( movedRect.x() - rect.x() );
+ }
+ }
+
+ if ( snapToGuideLines )
+ {
+ // redraw guidelines (intentionally always)
+ m_gl.repaintSnapping( movedRect );
+ }
+
+ if ( move != KoPoint( 0, 0 ) )
+ {
+ //kdDebug(33001) << "moveObjectsByMouse move = " << move << endl;
+ m_activePage->moveObject( m_view, move, false );
+ }
+}
+
+
+void KPrCanvas::resizeObject( ModifyType _modType, const KoPoint & point, bool keepRatio, bool scaleAroundCenter )
+{
+ KPrObject *kpobject = m_resizeObject;
+
+ QRect oldBoundingRect( m_view->zoomHandler()->zoomRect( kpobject->getRepaintRect() ) );
+
+ KoRect objRect = kpobject->getRealRect();
+ KoGuides::SnapStatus snapStatus( KoGuides::SNAP_NONE );
+
+ bool left = false;
+ bool right = false;
+ bool top = false;
+ bool bottom = false;
+ if ( _modType == MT_RESIZE_UP || _modType == MT_RESIZE_LU || _modType == MT_RESIZE_RU )
+ {
+ top = true;
+ snapStatus |= KoGuides::SNAP_HORIZ;
+ }
+ if ( _modType == MT_RESIZE_DN || _modType == MT_RESIZE_LD || _modType == MT_RESIZE_RD )
+ {
+ bottom = true;
+ snapStatus |= KoGuides::SNAP_HORIZ;
+ }
+ if ( _modType == MT_RESIZE_LF || _modType == MT_RESIZE_LU || _modType == MT_RESIZE_LD )
+ {
+ left = true;
+ snapStatus |= KoGuides::SNAP_VERT;
+ }
+ if ( _modType == MT_RESIZE_RT || _modType == MT_RESIZE_RU || _modType == MT_RESIZE_RD )
+ {
+ right = true;
+ snapStatus |= KoGuides::SNAP_VERT;
+ }
+
+ double newLeft = objRect.left();
+ double newRight = objRect.right();
+ double newTop = objRect.top();
+ double newBottom = objRect.bottom();
+ if ( top )
+ {
+ if ( point.y() < objRect.bottom() - MIN_SIZE )
+ {
+ newTop = point.y();
+ }
+ else
+ {
+ newTop = objRect.bottom() - MIN_SIZE;
+ }
+ }
+ if ( bottom )
+ {
+ if ( point.y() > objRect.top() + MIN_SIZE )
+ {
+ newBottom = point.y();
+ }
+ else
+ {
+ newBottom = objRect.top() + MIN_SIZE;
+ }
+ }
+ if ( left )
+ {
+ if ( point.x() < objRect.right() - MIN_SIZE )
+ {
+ newLeft = point.x();
+ }
+ else
+ {
+ newLeft = objRect.right() - MIN_SIZE;
+ }
+ }
+ if ( right )
+ {
+ if ( point.x() > objRect.left() + MIN_SIZE )
+ {
+ newRight = point.x();
+ }
+ else
+ {
+ newRight = objRect.left() + MIN_SIZE;
+ }
+ }
+
+ double width = newRight - newLeft;
+ double height = newBottom - newTop;
+
+ if ( keepRatio && m_ratio != 0 )
+ {
+ if ( ( top || bottom ) && ( right || left ) )
+ {
+ if ( height * height * m_ratio > width * width / m_ratio )
+ {
+ width = height * m_ratio;
+ }
+ else
+ {
+ height = width / m_ratio;
+ }
+ }
+ else if ( top || bottom )
+ {
+ width = height * m_ratio;
+ }
+ else
+ {
+ height = width / m_ratio;
+ }
+
+ if ( top )
+ {
+ newTop = objRect.bottom() - height;
+ }
+ else
+ {
+ newBottom = objRect.top() + height;
+ }
+ if ( left )
+ {
+ newLeft = objRect.right() - width;
+ }
+ else
+ {
+ newRight = objRect.left() + width;
+ }
+ }
+
+ if ( scaleAroundCenter )
+ {
+ KoPoint center( m_rectBeforeResize.center() );
+
+ if ( newLeft != objRect.left() )
+ {
+ width = 2 * ( center.x() - newLeft );
+ }
+ else if ( newRight != objRect.right() )
+ {
+ width = 2 * ( newRight - center.x() );
+ }
+
+ // if keep ratio is set caluclate witdh by ratio
+ if ( keepRatio )
+ {
+ height = width / m_ratio;
+ }
+ else
+ {
+ if ( newTop != objRect.top() )
+ {
+ height = 2 * ( center.y() - newTop );
+ }
+ else if ( newBottom != objRect.bottom() )
+ {
+ height = 2 * ( newBottom - center.y() );
+ }
+ }
+
+ if ( width < MIN_SIZE )
+ {
+ width = MIN_SIZE;
+ }
+ if ( height < MIN_SIZE )
+ {
+ height = MIN_SIZE;
+ }
+
+ newLeft = center.x() - width / 2;
+ newRight = newLeft + width;
+ newTop = center.y() - height / 2;
+ newBottom = newTop + height;
+ }
+
+ if ( newLeft != objRect.left() || newRight != objRect.right() || newTop != objRect.top() || newBottom != objRect.bottom() )
+ {
+ // resizeBy and moveBy have to been used to make it work with rotated objects
+ kpobject->resizeBy( width - objRect.width(), height - objRect.height() );
+
+ if ( objRect.left() != newLeft || objRect.top() != newTop )
+ {
+ kpobject->moveBy( KoPoint( newLeft - objRect.left(), newTop - objRect.top() ) );
+ }
+
+ if ( m_view->kPresenterDoc()->showGuideLines() && !m_disableSnapping )
+ {
+ KoRect rect( kpobject->getRealRect() );
+ KoPoint sp( rect.topLeft() );
+ if ( right )
+ {
+ sp.setX( rect.right() );
+ }
+ if ( bottom )
+ {
+ sp.setY( rect.bottom() );
+ }
+ m_gl.repaintSnapping( sp, snapStatus );
+ }
+
+ _repaint( oldBoundingRect );
+ _repaint( kpobject );
+ emit objectSizeChanged();
+ }
+}
+
+
+void KPrCanvas::finishResizeObject( const QString &name, bool layout )
+{
+ if ( m_resizeObject )
+ {
+ KoPoint move = KoPoint( m_resizeObject->getOrig().x() - m_rectBeforeResize.x(),
+ m_resizeObject->getOrig().y() - m_rectBeforeResize.y() );
+ KoSize size = KoSize( m_resizeObject->getSize().width() - m_rectBeforeResize.width(),
+ m_resizeObject->getSize().height() - m_rectBeforeResize.height() );
+
+ if ( ( m_resizeObject->getRect() ) != m_rectBeforeResize )
+ {
+ KPrResizeCmd *resizeCmd = new KPrResizeCmd( name, move, size, m_resizeObject,
+ m_view->kPresenterDoc() );
+ // the command is not executed as the object is allready resized.
+ m_view->kPresenterDoc()->addCommand( resizeCmd );
+ }
+
+ if ( layout )
+ m_view->kPresenterDoc()->layout( m_resizeObject );
+
+ m_ratio = 0.0;
+ m_isResizing = false;
+ _repaint( m_resizeObject );
+ m_resizeObject = NULL;
+ }
+}
+
+void KPrCanvas::raiseObject( KPrObject *object )
+{
+ if ( objectList().count() <= 1 )
+ return;
+
+ if ( m_objectDisplayAbove == 0 )
+ {
+ if ( m_activePage->numSelected() == 1 )
+ {
+ m_objectDisplayAbove = object;
+ }
+ }
+}
+
+void KPrCanvas::lowerObject()
+{
+ m_objectDisplayAbove = 0;
+}
+
+const QPtrList<KPrObject> KPrCanvas::displayObjectList() const
+{
+ QPtrList<KPrObject> list = objectList();
+ list.setAutoDelete( false );
+
+ if ( m_objectDisplayAbove )
+ {
+ // it can happen that the object is no longer there e.g. when
+ // the insert of the object is undone
+ int pos = objectList().findRef( m_objectDisplayAbove );
+ if ( pos != -1 && m_objectDisplayAbove->isSelected() )
+ {
+ list.take( pos );
+ list.append( m_objectDisplayAbove );
+ }
+ else
+ {
+ //tz not possible due to const. should const be removed?
+ //m_objectDisplayAbove = 0;
+ }
+ }
+ return list;
+}
+
+void KPrCanvas::playSound( const QString &soundFileName )
+{
+ if(soundPlayer)
+ delete soundPlayer;
+ soundPlayer = new KPrSoundPlayer( soundFileName );
+ soundPlayer->play();
+}
+
+void KPrCanvas::stopSound()
+{
+ if ( soundPlayer ) {
+ soundPlayer->stop();
+ delete soundPlayer;
+ soundPlayer = 0;
+ }
+}
+
+void KPrCanvas::setXimPosition( int x, int y, int w, int h, QFont *f )
+{
+ QWidget::setMicroFocusHint( x - diffx(), y - diffy(), w, h, true, f );
+}
+
+void KPrCanvas::createEditing( KPrTextObject *textObj )
+{
+ if( m_currentTextObjectView)
+ {
+ m_currentTextObjectView->terminate();
+ delete m_currentTextObjectView;
+ m_currentTextObjectView = 0;
+ m_editObject = 0;
+ }
+ m_currentTextObjectView = textObj->createKPTextView( this );
+ m_editObject = textObj;
+}
+
+void KPrCanvas::terminateEditing( KPrTextObject *textObj )
+{
+ if ( m_currentTextObjectView && m_currentTextObjectView->kpTextObject() == textObj )
+ {
+ m_currentTextObjectView->terminate();
+ delete m_currentTextObjectView;
+ m_currentTextObjectView = 0;
+ m_editObject = 0;
+ }
+}
+
+void KPrCanvas::drawCubicBezierCurve( QPainter &p, KoPointArray &points )
+{
+ p.save();
+ if ( !m_drawLineWithCubicBezierCurve )
+ {
+ QPen pen = QPen( Qt::black, 1, Qt::DashLine );
+ p.setPen( pen );
+ double angle = KoPoint::getAngle( m_endPoint, m_startPoint );
+ drawFigure( L_SQUARE, &p, m_endPoint, pen.color(), pen.width(), angle,m_view->zoomHandler() );
+
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+
+ KoPoint symmetricEndPoint = m_startPoint * 2 - m_endPoint;
+
+ angle = KoPoint::getAngle( symmetricEndPoint, m_startPoint );
+ drawFigure( L_SQUARE, &p, symmetricEndPoint, pen.color(), pen.width(), angle,m_view->zoomHandler() );
+
+ // TODO only 1 draw line
+ p.drawLine( m_view->zoomHandler()->zoomPoint( m_startPoint ),
+ m_view->zoomHandler()->zoomPoint( symmetricEndPoint ) );
+
+ p.save();
+ p.setPen( QPen( Qt::black, 1, Qt::SolidLine ) );
+ p.drawCubicBezier( points.zoomPointArray( m_view->zoomHandler() ) );
+ p.restore();
+ }
+ else
+ {
+ KoPoint startPoint( m_pointArray.at( m_indexPointArray - 1 ) );
+
+ p.drawLine( m_view->zoomHandler()->zoomPoint( startPoint ),
+ m_view->zoomHandler()->zoomPoint( m_endPoint ) );
+ }
+ p.restore();
+}
+
+
+void KPrCanvas::redrawCubicBezierCurve( QPainter &p )
+{
+ if ( m_indexPointArray > 0 )
+ {
+ for ( int count = 0; count < m_indexPointArray - 4; count += 4 )
+ {
+ double _firstX = m_pointArray.at( count ).x();
+ double _firstY = m_pointArray.at( count ).y();
+
+ double _fourthX = m_pointArray.at( count + 1 ).x();
+ double _fourthY = m_pointArray.at( count + 1 ).y();
+
+ double _secondX = m_pointArray.at( count + 2 ).x();
+ double _secondY = m_pointArray.at( count + 2 ).y();
+
+ double _thirdX = m_pointArray.at( count + 3 ).x();
+ double _thirdY = m_pointArray.at( count + 3 ).y();
+
+ KoPointArray points;
+ points.putPoints( 0, 4, _firstX,_firstY, _secondX,_secondY, _thirdX,_thirdY, _fourthX,_fourthY );
+
+ p.drawCubicBezier( points.zoomPointArray( m_view->zoomHandler() ) );
+ }
+ }
+}
+
+
+void KPrCanvas::drawPolygon( QPainter &p, const KoRect &rect )
+{
+ KoRect nRect = rect.normalize();
+ bool checkConcavePolygon = m_view->getCheckConcavePolygon();
+ int cornersValue = m_view->getCornersValue();
+ int sharpnessValue = m_view->getSharpnessValue();
+
+ KoRect _rect( 0, 0, nRect.width(), nRect.height() );
+ double angle = 2 * M_PI / cornersValue;
+ double diameter = static_cast<double>( QMAX( _rect.width(), _rect.height() ) );
+ double radius = diameter * 0.5;
+
+ KoPointArray _points( checkConcavePolygon ? cornersValue * 2 : cornersValue );
+ _points.setPoint( 0, 0, qRound( -radius ) );
+
+ double xmin = 0;
+ double ymin = qRound( -radius );
+
+ if ( checkConcavePolygon ) {
+ angle = angle / 2.0;
+ double a = angle;
+ double r = radius - ( sharpnessValue / 100.0 * radius );
+ for ( int i = 1; i < cornersValue * 2; ++i ) {
+ double xp, yp;
+ if ( i % 2 ) {
+ xp = r * sin( a );
+ yp = -r * cos( a );
+ }
+ else {
+ xp = radius * sin( a );
+ yp = -radius * cos( a );
+ }
+ a += angle;
+ _points.setPoint( i, xp, yp );
+ if (xp < xmin)
+ xmin = xp;
+ if (yp < ymin)
+ ymin = yp;
+ }
+ }
+ else {
+ double a = angle;
+ for ( int i = 1; i < cornersValue; ++i ) {
+ double xp = radius * sin( a );
+ double yp = -radius * cos( a );
+ a += angle;
+ _points.setPoint( i, xp, yp );
+ if (xp < xmin)
+ xmin = xp;
+ if (yp < ymin)
+ ymin = yp;
+ }
+ }
+
+ // calculate the points as offsets to 0,0
+ KoRect _changRect = _points.boundingRect();
+ double fx = _rect.width() / _changRect.width();
+ double fy = _rect.height() / _changRect.height();
+
+ int _index = 0;
+ KoPointArray tmpPoints;
+ KoPointArray::ConstIterator it;
+ for ( it = _points.begin(); it != _points.end(); ++it ) {
+ KoPoint point = (*it);
+ double tmpX = ( point.x() - xmin) * fx + nRect.x();
+ double tmpY = ( point.y() - ymin) * fy + nRect.y();
+
+ tmpPoints.putPoints( _index, 1, tmpX,tmpY );
+ ++_index;
+ }
+ p.drawPolygon( tmpPoints.zoomPointArray( m_view->zoomHandler() ) );
+ m_pointArray = tmpPoints;
+}
+
+
+bool KPrCanvas::oneObjectTextSelected() const
+{
+ return m_activePage->oneObjectTextSelected();
+}
+
+bool KPrCanvas::oneObjectTextExist() const
+{
+ return m_activePage->oneObjectTextExist();
+}
+
+KPrPage* KPrCanvas::activePage() const
+{
+ return m_activePage;
+}
+
+void KPrCanvas::setActivePage( KPrPage* active )
+{
+ Q_ASSERT(active);
+ //kdDebug(33001)<<"KPrCanvas::setActivePage( KPrPage* active) :"<<active<<endl;
+ // reset the m_objectDisplayAbove so that it is not display wrong on the other page
+ m_objectDisplayAbove = 0;
+ m_activePage = active;
+}
+
+void KPrCanvas::setPaintGuides( bool state )
+{
+ m_paintGuides = state;
+}
+
+bool KPrCanvas::objectIsAHeaderFooterHidden(KPrObject *obj) const
+{
+ if (( m_view->kPresenterDoc()->isHeader(obj) && !m_activePage->hasHeader() )
+ || ( m_view->kPresenterDoc()->isFooter(obj) && !m_activePage->hasFooter() ) )
+ return true;
+ return false;
+}
+
+int KPrCanvas::numberOfObjectSelected() const
+{
+ int nb = m_activePage->numSelected();
+ return nb;
+}
+
+KPrObject *KPrCanvas::getSelectedObj() const
+{
+ KPrObject *obj = m_activePage->getSelectedObj();
+ return obj;
+}
+
+void KPrCanvas::ungroupObjects()
+{
+ KMacroCommand *macro = 0;
+ m_activePage->ungroupObjects( &macro );
+ if ( macro )
+ m_view->kPresenterDoc()->addCommand( macro );
+}
+
+void KPrCanvas::groupObjects()
+{
+ m_activePage->groupObjects();
+}
+
+KoRect KPrCanvas::objectRect( bool all ) const
+{
+ return m_activePage->getRealRect( all );
+}
+
+void KPrCanvas::scrollTopLeftPoint( const QPoint & pos )
+{
+ m_view->getHScrollBar()->setValue( pos.x() );
+ m_view->getVScrollBar()->setValue( pos.y() );
+}
+
+void KPrCanvas::changePicture( const KURL & url, QWidget *window )
+{
+ m_activePage->changePicture( url, window );
+}
+
+unsigned int KPrCanvas::objNums() const
+{
+ return m_activePage->objNums();
+}
+
+
+void KPrCanvas::ensureVisible( int x, int y, int xmargin, int ymargin )
+{
+
+ int newy= (y+ymargin)-(visibleRect().bottom()+diffy());
+
+ if( newy > 0)
+ m_view->getVScrollBar()->setValue(m_view->getVScrollBar()->value()+newy);
+ else
+ {
+ newy= (y )-(visibleRect().top()+diffy());
+ if( newy < 0)
+ m_view->getVScrollBar()->setValue(m_view->getVScrollBar()->value()+newy - ymargin);
+ }
+
+ int newx= (x+xmargin)-(visibleRect().right()+diffx());
+ if( newx > 0)
+ m_view->getHScrollBar()->setValue(m_view->getHScrollBar()->value()+newx);
+ else
+ {
+ newx= x -(visibleRect().left()+diffx());
+ if( newx < 0)
+ m_view->getHScrollBar()->setValue(m_view->getHScrollBar()->value()+newx - xmargin );
+ }
+}
+
+// "Extend Contents to Object Height"
+void KPrCanvas::textContentsToHeight()
+{
+ QPtrList<KPrTextObject> lst = applicableTextObjects();
+ if ( lst.isEmpty() )
+ return;
+ QPtrListIterator<KPrTextObject> it( lst );
+ KMacroCommand * macro = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand *cmd= it.current()->textContentsToHeight();
+ if( cmd )
+ {
+ if ( !macro )
+ macro = new KMacroCommand(i18n("Extend Text Contents to Height"));
+ macro->addCommand( cmd);
+ _repaint( it.current() );
+ }
+ }
+ if( macro )
+ {
+ macro->execute();
+ m_view->kPresenterDoc()->addCommand( macro );
+ m_view->kPresenterDoc()->repaint(this);
+ }
+}
+
+// "Resize Object to fit Contents"
+void KPrCanvas::textObjectToContents()
+{
+ QPtrList<KPrTextObject> lst = applicableTextObjects();
+ if ( lst.isEmpty() )
+ return;
+ QPtrListIterator<KPrTextObject> it( lst );
+ KMacroCommand * macro = 0L;
+ for ( ; it.current() ; ++it ) {
+ KCommand *cmd= it.current()->textObjectToContents();
+ if( cmd )
+ {
+ if (!macro )
+ macro = new KMacroCommand(i18n("Extend Text to Contents"));
+ macro->addCommand( cmd);
+ }
+ }
+
+ if( macro)
+ {
+ macro->execute();
+ m_view->kPresenterDoc()->addCommand( macro );
+ m_view->kPresenterDoc()->repaint(this);
+ }
+
+}
+
+void KPrCanvas::flipObject( bool _horizontal )
+{
+ QPtrList<KPrObject> lst;
+ QPtrListIterator<KPrObject> it(getObjectList());
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isSelected() &&
+ it.current()->getType() != OT_AUTOFORM &&
+ it.current()->getType() != OT_PART &&
+ it.current()->getType() != OT_TEXT )
+ {
+ lst.append( it.current() );
+ }
+ }
+ if ( lst.isEmpty() )
+ return;
+
+ KPrFlipObjectCommand *flipCmd = new KPrFlipObjectCommand( i18n("Flip Objects"),
+ m_view->kPresenterDoc(),
+ _horizontal, lst );
+ flipCmd->execute();
+ m_view->kPresenterDoc()->addCommand( flipCmd );
+}
+
+void KPrCanvas::lowerObjs( bool backward )
+{
+ lowerObject();
+ m_activePage->lowerObjs( backward );
+}
+
+void KPrCanvas::raiseObjs( bool forward )
+{
+ lowerObject();
+ m_activePage->raiseObjs( forward );
+}
+
+QPtrList<KPrTextObject> KPrCanvas::listOfTextObjs() const
+{
+ QPtrList<KPrTextObject> lst;
+ QPtrListIterator<KPrObject> it(getObjectList());
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->getType() == OT_TEXT )
+ {
+ if ( objectIsAHeaderFooterHidden(it.current()))
+ continue;
+ else
+ lst.append( static_cast<KPrTextObject*>( it.current() ));
+ }
+ }
+ return lst;
+}
+
+KPrTextObject* KPrCanvas::textUnderMouse( const QPoint & point )
+{
+ QPtrList<KPrTextObject> obj = listOfTextObjs();
+ QPtrListIterator<KPrTextObject> it2(obj );
+ for ( ; it2.current() ; ++it2 ) {
+ QRect outerRect( m_view->kPresenterDoc()->zoomHandler()->zoomRect( it2.current()->getRect()) );
+ if ( !it2.current()->isProtectContent() && outerRect.contains( point) )
+ return it2.current();
+ }
+ return 0L;
+}
+
+void KPrCanvas::speakTextUnderMouse(QWidget* w, const QPoint& p, uint flags)
+{
+ Q_UNUSED( flags );
+ if ( w != this ) return;
+ // Since text objects can't get focus without clicking with the mouse,
+ // no point in supporting focus speaking.
+ if ( p == QPoint() ) return;
+ KPrTextObject *to = textUnderMouse( w->mapFromGlobal( p ) );
+ if ( to == m_prevSpokenTO ) return;
+ m_prevSpokenTO = to;
+ if ( to ) {
+ QString text = to->textObject()->textDocument()->plainText();
+ if ( !text.isEmpty() ) kospeaker->sayWidget( text );
+ }
+}
+
+bool KPrCanvas::checkCurrentTextEdit( KPrTextObject * textObj )
+{
+ bool emitChanged = false;
+ if ( textObj && m_currentTextObjectView && m_currentTextObjectView->kpTextObject() != textObj )
+ {
+ m_currentTextObjectView->kpTextObject()->setEditingTextObj( false );
+ _repaint( m_currentTextObjectView->kpTextObject() );
+ //don't remove selection otherwise break dnd.
+ m_currentTextObjectView->terminate(false);
+ delete m_currentTextObjectView;
+ m_currentTextObjectView = 0L;
+ emitChanged = true;
+ }
+
+ // Edit the frameset under the mouse, if any
+ if ( textObj && !m_currentTextObjectView )
+ {
+ m_currentTextObjectView = textObj->createKPTextView( this );
+ emitChanged = true;
+ }
+ return emitChanged;
+}
+
+void KPrCanvas::alignObjects( AlignType at )
+{
+ KPrDocument * doc = m_view->kPresenterDoc();
+
+ QString name;
+
+ switch ( at )
+ {
+ case AT_LEFT:
+ name = i18n( "Align Objects Left" );
+ break;
+ case AT_TOP:
+ name = i18n( "Align Objects Top" );
+ break;
+ case AT_RIGHT:
+ name = i18n( "Align Objects Right" );
+ break;
+ case AT_BOTTOM:
+ name = i18n( "Align Objects Bottom" );
+ break;
+ case AT_HCENTER:
+ name = i18n( "Align Objects Centered (horizontal)" );
+ break;
+ case AT_VCENTER:
+ name = i18n( "Align Objects Center/Vertical" );
+ break;
+ }
+
+ QPtrList<KPrObject> objects;
+
+ QPtrListIterator<KPrObject> it( m_activePage->objectList() );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current() == m_view->kPresenterDoc()->header() ||
+ it.current() == m_view->kPresenterDoc()->footer() )
+ continue;
+
+ if( it.current()->isSelected() && !it.current()->isProtect() ) {
+ objects.append( it.current() );
+ }
+ }
+
+ if ( objects.count() )
+ {
+ KCommand * cmd = new KPrAlignCmd( name, objects, at, doc );
+ cmd->execute();
+ doc->addCommand( cmd );
+ }
+}
+
+bool KPrCanvas::canMoveOneObject() const
+{
+ return m_activePage->canMoveOneObject();
+}
+
+void KPrCanvas::closeObject(bool /*close*/)
+{
+ QPtrList<KPrObject> lst;
+ QPtrListIterator<KPrObject> it(getObjectList());
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isSelected()
+ && (it.current()->getType() == OT_POLYLINE || it.current()->getType() == OT_FREEHAND
+ || it.current()->getType() == OT_QUADRICBEZIERCURVE
+ || it.current()->getType() == OT_CUBICBEZIERCURVE ))
+ lst.append( it.current() );
+ }
+ if ( lst.isEmpty())
+ return;
+
+ KCommand * cmd= new KPrCloseObjectCommand( i18n("Close Object"), lst, m_view->kPresenterDoc() );
+ cmd->execute();
+ m_view->kPresenterDoc()->addCommand( cmd );
+}
+
+void KPrCanvas::layout()
+{
+ QPtrListIterator<KPrObject> it(getObjectList());
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->getType() == OT_TEXT )
+ static_cast<KPrTextObject *>( it.current() )->layout();
+ }
+}
+
+KoPoint KPrCanvas::snapPoint( KoPoint &pos, bool repaintSnapping )
+{
+ KoPoint sp( pos );
+ KPrDocument * doc( m_view->kPresenterDoc() );
+
+ bool snapToGrid = doc->snapToGrid() && !m_disableSnapping;
+ bool snapToGuideLines = doc->showGuideLines() && !m_disableSnapping;
+
+ KoPoint snapDiff = KoPoint( 0, 0 ); // needed if all snapping is off
+ KoGuides::SnapStatus snapStatus = KoGuides::SNAP_NONE;
+
+ if ( snapToGrid )
+ {
+ snapDiff.setX( qRound( sp.x() / doc->getGridX()) * doc->getGridX() - sp.x() );
+ snapDiff.setY( qRound( sp.y() / doc->getGridY()) * doc->getGridY() - sp.y() );
+ snapStatus = KoGuides::SNAP_BOTH;
+ }
+
+ if ( snapToGuideLines )
+ {
+ m_gl.snapToGuideLines( sp, MOUSE_SNAP_DISTANCE, snapStatus, snapDiff );
+ }
+
+ sp += snapDiff;
+
+ // don't snap out of canvas
+ KoRect pageRect( m_activePage->getPageRect() );
+ if ( sp.x() < pageRect.left() )
+ sp.setX( pageRect.left() );
+ else if ( sp.x() > pageRect.right() )
+ sp.setX( pageRect.right() );
+
+ if ( sp.y() < pageRect.top() )
+ sp.setY( pageRect.top() );
+ else if ( sp.y() > pageRect.bottom() )
+ sp.setY( pageRect.bottom() );
+
+ // redraw guidelines (intentionally always)
+ if ( repaintSnapping && snapToGuideLines )
+ {
+ m_gl.repaintSnapping( sp, KoGuides::SNAP_BOTH );
+ }
+
+ return sp;
+}
+
+
+void KPrCanvas::alignVertical( VerticalAlignmentType _type )
+{
+ KCommand *cmd = m_activePage->alignVertical( _type );
+ if ( cmd )
+ m_view->kPresenterDoc()->addCommand( cmd );
+}
+
+KPrPixmapObject * KPrCanvas::getSelectedImage() const
+{
+ return m_activePage->getSelectedImage();
+}
+
+
+KoPointArray KPrCanvas::getObjectPoints( const KoPointArray &pointArray )
+{
+ KoRect rect = pointArray.boundingRect();
+
+ KoPointArray points( pointArray );
+ points.translate( -rect.x(), -rect.y() );
+
+ return points;
+}
+
+void KPrCanvas::objectPopup( KPrObject *object, const QPoint &point )
+{
+ switch ( object->getType() )
+ {
+ case OT_PICTURE:
+ case OT_CLIPART:
+ m_view->openPopupMenuObject( "picmenu_popup", point );
+ break;
+ case OT_TEXT:
+ {
+ KPrTextObject *obj=dynamic_cast<KPrTextObject *>(object);
+ if ( obj )
+ m_view->changeVerticalAlignmentStatus( obj->verticalAlignment() );
+ m_view->openPopupMenuObject( "textobject_popup", point );
+ } break;
+ case OT_PIE:
+ m_view->openPopupMenuObject( "piemenu_popup", point );
+ break;
+ case OT_RECT:
+ case OT_ELLIPSE:
+ m_view->openPopupMenuObject( "rectangleobject_popup", point );
+ break;
+ case OT_PART:
+ m_view->openPopupMenuObject( "partobject_popup", point );
+ break;
+ case OT_POLYGON:
+ m_view->openPopupMenuObject( "polygonobject_popup", point );
+ break;
+ case OT_POLYLINE:
+ case OT_CUBICBEZIERCURVE:
+ case OT_QUADRICBEZIERCURVE:
+ case OT_FREEHAND:
+ m_view->openPopupMenuObject( "closed_popup", point );
+ break;
+ case OT_LINE:
+ case OT_CLOSED_LINE:
+ m_view->openPopupMenuObject( "flip_popup", point );
+ break;
+ case OT_GROUP:
+ if ( oneObjectTextSelected())
+ m_view->openPopupMenuObject( "textobject_popup", point );
+ else
+ m_view->openPopupMenuObject( "flip_popup", point );
+ break;
+ default:
+ m_view->openPopupMenuObject( "graphmenu_popup", point );
+ break;
+ }
+}
+
+void KPrCanvas::popupContextMenu()
+{
+ if ( !editMode ) {
+ if ( !m_drawMode && !spManualSwitch() )
+ {
+ finishObjectEffects();
+ finishPageEffect();
+ m_view->stopAutoPresTimer();
+ }
+ setCursor( arrowCursor );
+ QPoint p( width()/2, height()/2 );
+ int ret = m_presMenu->exec( p );
+ // we have to continue the timer if the menu was canceled and draw mode is not active
+ if ( ret == -1 && !m_presMenu->isItemChecked( PM_DM ) && !spManualSwitch() )
+ m_view->continueAutoPresTimer();
+ return;
+ }
+ if ( m_currentTextObjectView ) {
+ // TODO: Better to popup at caret position.
+ // KoTextCursor* cursor = m_currentTextObjectView->cursor();
+ KoPoint kop = m_currentTextObjectView->kpTextObject()->getOrig();
+ QPoint p = m_view->zoomHandler()->zoomPoint( kop );
+ p = mapToGlobal( p );
+ m_currentTextObjectView->showPopup( m_view, p, m_view->actionList() );
+ return;
+ }
+ if (!m_activePage) return;
+ KPrObject* obj = m_activePage->getSelectedObj();
+ if (obj) {
+ KoPoint kop = obj->getOrig();
+ QPoint p = m_view->zoomHandler()->zoomPoint( kop );
+ p = mapToGlobal( p );
+ objectPopup( obj, p );
+ } else {
+ QPoint p = mapToGlobal( QPoint() );
+ m_view->openPopupMenuMenuPage( p );
+ }
+}
diff --git a/kpresenter/KPrCanvas.h b/kpresenter/KPrCanvas.h
new file mode 100644
index 000000000..ca81fdfc6
--- /dev/null
+++ b/kpresenter/KPrCanvas.h
@@ -0,0 +1,938 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2002-2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+
+#ifndef __KPRCANVAS__
+#define __KPRCANVAS__
+
+#include <qwidget.h>
+#include <qptrlist.h>
+#include <qpicture.h>
+#include <qvaluelist.h>
+#include <qpixmap.h>
+#include <qpointarray.h>
+#include <qvaluevector.h>
+#include <qtimer.h>
+
+#include <KoGuides.h>
+#include <KoRuler.h>
+#include <KoQueryTrader.h>
+#include "KoPointArray.h"
+#include "global.h"
+#include <KoRect.h>
+#include <KoTextFormat.h>
+#include "presstep.h"
+
+class KURL;
+class KoTextFormatInterface;
+class KPrView;
+class KPrDocument;
+class QPainter;
+class KTextEdit;
+class KPrTextObject;
+class KPrObject;
+class KPopupMenu;
+class QResizeEvent;
+class QPaintEvent;
+class QDragEnterEvent;
+class QDragMoveEvent;
+class QDropEvent;
+class QFocusEvent;
+class QMouseEvent;
+class QWheelEvent;
+class QKeyEvent;
+class KPrPixmapObject;
+class KPrBackGround;
+class QRect;
+class QSize;
+class QPoint;
+class KPrSoundPlayer;
+class KoTextObject;
+class KoParagCounter;
+class KPrPage;
+class KPrinter;
+class KPrTextView;
+class KPrPartObject;
+class KCommand;
+class KPrEffectHandler;
+class KPrPageEffects;
+/**
+ * Class KPCanvas - There is a single instance of this class for a given view.
+ *
+ * It manages the graphical representation of all the objects.
+ */
+class KPrCanvas : public QWidget
+{
+ Q_OBJECT
+
+public:
+
+ /// constructor
+ KPrCanvas( QWidget *parent=0,const char *name=0,KPrView *_view=0 );
+ /// destructor
+ ~KPrCanvas();
+
+ KPrView * getView()const { return m_view; }
+
+ // The equivalent of contentsX() and contentsY() for a QScrollView
+ // The Canvas is a widget, not a scrollview (because we handle the scrollbars ourselves,
+ // to have the "goto page" buttons at the bottom of the scrollbars etc.)
+ int diffx() const { return m_xOffset; }
+ int diffy() const { return m_yOffset; }
+ void setDiffX( int _diffX ) { m_xOffset = _diffX; }
+ void setDiffY( int _diffY ) { m_yOffset = _diffY; }
+ void scrollX( int x );
+ void scrollY( int y );
+
+ // public functions
+ void selectAllObj();
+ void deSelectAllObj();
+ void selectObj( KPrObject* );
+ void deSelectObj( KPrObject* );
+ void setTextFormat(const KoTextFormat &format, int flags);
+
+ void setTextColor( const QColor & );
+ void setTextBackgroundColor( const QColor & );
+ void setTextAlign( int );
+ void setTextDepthPlus();
+ void setTextDepthMinus();
+ void setNewRightIndent(double _rightIndent);
+ void setNewLeftIndent(double _leftIndent);
+ void setNewFirstIndent(double _firstIndent);
+ //void setTextCounter(KoParagCounter counter);
+ void setTabList( const KoTabulatorList & tabList );
+ void setTextBold( bool b );
+ void setTextItalic( bool b );
+ void setTextUnderline( bool b );
+ void setTextStrikeOut( bool b );
+ void setTextFamily( const QString &f );
+ void setTextPointSize( int s );
+ void setTextSubScript( bool b );
+ void setTextSuperScript( bool b );
+ void setTextDefaultFormat( );
+ void setIncreaseFontSize();
+ void setDecreaseFontSize();
+ KPrTextObject* kpTxtObj() const;
+
+ /**
+ * Start a screen presentation
+ * All pages if @p curPgNum is -1, otherwise just @p curPgNum (1-based)
+ */
+ void startScreenPresentation( double zoomX, double zoomY, int curPgNum = -1);
+ void stopScreenPresentation();
+
+ /**
+ * Go to the next step in the presentation.
+ * gotoNextPage: if is set to true go to beginning of the
+ * next page.
+ */
+ bool pNext( bool gotoNextPage = false );
+
+ /**
+ * Go to previous step of the presentation.
+ * gotoPreviousPage: if is set to true go to beginning of the
+ * previous page.
+ */
+ bool pPrev( bool gotoPreviousPage = false );
+
+ /// returns the current page of the presentation 1 based
+ unsigned int presPage() const { return m_step.m_pageNumber + 1; }
+ /// returns the current step of the presentation
+ int presStep() const { return m_step.m_step; }
+ int numPresSteps() const { return m_pageEffectSteps.count(); }
+ int numPresPages() const { return m_presentationSlides.count(); }
+
+ bool canAssignEffect( QPtrList<KPrObject> &objs ) const;
+
+ void print( QPainter*, KPrinter*, float, float );
+
+
+ void setPartEntry( KoDocumentEntry& _e )
+ { partEntry = _e; }
+ void setToolEditMode( ToolEditMode _m, bool updateView = true );
+ void setAutoForm( const QString &_autoform )
+ { autoform = _autoform; }
+
+ /**
+ \brief Draw page into QPixmap.
+
+ Draws page pgnum of the currently open presentation into a QPixmap
+ using the specified zoom factor (or fixed width/height dimensions, resp.)
+
+ Set forceWidth and/or forceHeight to override the zoom factor
+ and obtain a pixmap of the specified width and/or height.
+ By omitting one of them you make sure that the aspect ratio
+ of your page is used for the resulting image.
+
+ \sa exportPage
+ */
+ void drawPageInPix( QPixmap&, int pgnum, int zoom,
+ bool forceRealVariableValue = false,
+ int forceWidth = 0,
+ int forceHeight = 0 );
+
+ /**
+ \brief Save page to bitmap file.
+
+ Export a page of the currently open presentation to disk
+ using a bitmap format like e.g. PNG.
+ This method uses a QPixmap::save() call.
+
+ \param nPage the internally used <b>0-based</b> page number
+ \param nWidth the desired image width in px
+ \param nHeight the desired image height in px
+ \param fileURL the URL of the image file to be created: if this
+ does not point to a local file a KTempFile is created by QPixmap::save()
+ which is then copied over to the desired location.
+ \param format the format of the image file (see QPixmap::save())
+ \param quality the quality of the image (see QPixmap::save())
+
+ example:
+\verbatim
+exportPage( 0, s, 800, 600, "/home/khz/page0.png", "PNG", 100 );
+\endverbatim
+ \returns True if the file was written successfully.
+
+ \sa drawPageInPix, KPrViewIface::exportPage
+ */
+ bool exportPage( int nPage, int nWidth, int nHeight,
+ const KURL& fileURL,
+ const char* format,
+ int quality = -1 );
+
+ void gotoPage( int pg );
+
+ /**
+ * Go to first slide of presentation.
+ * Used in presentation mode.
+ */
+ void presGotoFirstPage();
+
+ KPrPage* activePage() const;
+
+ bool oneObjectTextExist() const;
+ bool oneObjectTextSelected() const;
+ bool isOneObjectSelected() const;
+ /** Returns the list of selected text objects */
+ QPtrList<KPrTextObject> selectedTextObjs() const;
+ /**
+ * Returns the list of interfaces to use for changing the text format.
+ * This can be either the currently edited text object,
+ * or the list of text objects currently selected
+ */
+ QPtrList<KoTextFormatInterface> applicableTextInterfaces() const;
+ /**
+ * Returns the list of text objects, either selected or activated.
+ */
+ QPtrList<KPrTextObject> applicableTextObjects() const;
+
+ void setMouseSelectedObject(bool b);
+
+ bool haveASelectedPartObj() const;
+ bool haveASelectedGroupObj() const;
+ bool haveASelectedPixmapObj() const;
+
+ KPrTextView *currentTextObjectView() const { return m_currentTextObjectView; }
+
+ QPtrList<KPrObject> objectList() const;
+
+ // get - set data
+ const QPtrList<KPrObject> & getObjectList() const;
+
+ void playSound( const QString &soundFileName );
+ void stopSound();
+
+ ///for KPrTextView
+ void dragStarted() { mousePressed = false; }
+
+ void setXimPosition( int x, int y, int w, int h, QFont *f );
+ void createEditing( KPrTextObject *textObj );
+
+
+ /**
+ * @brief Add a line
+ *
+ * @param startPoint the start point of the line
+ * @param endPoint the end point of the line
+ */
+ void insertLine( const KoPoint &startPoint, const KoPoint &endPoint );
+
+ /**
+ * @brief Add a rectangle
+ *
+ * @param rect the size and position of the rectangle
+ */
+ void insertRect( const KoRect &rect);
+
+ /**
+ * @brief Add a ellipse
+ *
+ * @param rect the size and position of the ellipse
+ */
+ void insertEllipse( const KoRect &rect );
+
+ /**
+ * @brief Add a pie/arc/chord
+ *
+ * @param rect the size and position of the pie/arc/chord
+ */
+ void insertPie( const KoRect &rect );
+
+ /**
+ * @brief Add a text object
+ *
+ * @param rect the size and position of the text object
+ */
+ KPrTextObject* insertTextObject( const KoRect &rect );
+
+ /**
+ * @brief Add a picture
+ *
+ * @param rect the size and position of the picture
+ */
+ void insertPicture( const KoRect &rect );
+ void changePicture( const KURL & url, QWidget *window );
+
+ int numberOfObjectSelected() const;
+ KPrObject *getSelectedObj() const;
+ KPrPixmapObject *getSelectedImage() const;
+
+ bool getEditMode() const { return editMode; }
+
+ void ungroupObjects();
+ void groupObjects();
+
+ unsigned int objNums() const;
+
+ void ensureVisible( int x, int y, int xmargin, int ymargin );
+
+ /**
+ * @brief get the rect for the objects
+ *
+ * @param all true if the rect for all objects shoud be returned
+ * false if only the rect for selected objects sould be returned
+ *
+ * @return rect of the objects
+ */
+ KoRect objectRect( bool all ) const;
+
+ void scrollTopLeftPoint( const QPoint & pos );
+
+ void textContentsToHeight();
+ void textObjectToContents();
+
+ void flipObject( bool _horizontal );
+
+ void lowerObjs( bool backward );
+ void raiseObjs( bool forward );
+
+ /**
+ * @brief Align objects
+ *
+ * This will align all selected non protected objects according to the
+ * align type at.
+ *
+ * @param at the align type
+ */
+ void alignObjects( AlignType at );
+
+ bool canMoveOneObject()const;
+ QPtrList<KPrTextObject> listOfTextObjs() const;
+
+ QPixmap getPicturePixmap() const;
+ void closeObject(bool _close);
+ void layout();
+ void alignVertical( VerticalAlignmentType _type );
+ void savePicture();
+
+ void dropImage( QMimeSource * data, bool resizeImageToOriginalSize = false , int posX = 10, int posY=10 );
+ KoGuides & guideLines() { return m_gl; }
+
+ /**
+ * @brief Open the object popup
+ *
+ * @param object the selected object
+ * @param point where the popup should be displayed
+ */
+ void objectPopup( KPrObject *object, const QPoint &point );
+
+public slots:
+ // use repaint = false when the KPrCanvas is destroyed to avaid a possible crash
+ void exitEditMode( bool repaint = true );
+
+ void clipCut();
+ void clipCopy();
+ void clipPaste();
+ void deleteObjs();
+ void copyObjs();
+ void copyOasisObjs();
+
+ void chPic();
+ void picViewOriginalSize();
+ void picViewOrig640x480();
+ void picViewOrig800x600();
+ void picViewOrig1024x768();
+ void picViewOrig1280x1024();
+ void picViewOrig1600x1200();
+ void picViewOrigFactor();
+ void setActivePage( KPrPage* active );
+
+ /**
+ * @brief Set the guide move state
+ *
+ * @param state true set guide move state
+ * false unset guide move state
+ */
+ void setPaintGuides( bool state );
+
+signals:
+
+ // signals to notify of changes
+ void fontChanged( const QFont & );
+ void colorChanged( const QColor & );
+ void alignChanged( int );
+ /**
+ * Emmitted when presentation should be restarted
+ * This is used in automatic screen and infinite loop mode.
+ */
+ void stopAutomaticPresentation();
+ /**
+ * Emmitted when presentation should be restarted
+ * This is used in automatic screen and infinite loop mode.
+ */
+ void restartPresentation();
+ void objectSelectedChanged();
+ void objectSizeChanged();
+ /// Emitted when the current frameset edit changes
+ void currentObjectEditChanged();
+
+ void selectionChanged( bool hasSelection );
+ void sigMouseWheelEvent( QWheelEvent * );
+
+protected:
+ struct PicCache
+ {
+ QPicture pic;
+ int num;
+ int subPresStep;
+ };
+
+ // functions for displaying
+ /**
+ * This method is used for repainting the canvas.
+ */
+ virtual void paintEvent( QPaintEvent* );
+
+ /**
+ * Draws the background of page to painter.
+ * Set edit to true if in edit mode, false in presentation mode.
+ */
+ void drawBackground( QPainter* painter, const QRect& rect, KPrPage * page, bool edit = false ) const;
+
+ /**
+ * Draw obj to painter.
+ */
+ void drawAllObjectsInPage( QPainter *painter, const QPtrList<KPrObject> & obj, int pageNum ) const;
+
+ /**
+ * Draw _objects shown at step to painter.
+ * This method is used for presentation mode, printing.
+ */
+ void drawObjectsPres( QPainter *painter, const QPtrList<KPrObject> &_objects, PresStep step ) const;
+
+ /**
+ * Draw _objects to painter.
+ * Only rect is painted.
+ * This method is used for edit mode.
+ */
+ void drawObjectsEdit( QPainter *painter, const KoRect &rect, const QPtrList<KPrObject> &_objects,
+ SelectionMode selectionMode, int page ) const;
+
+ /**
+ * Draw _objects to painter.
+ * contour if true only countor of selected objects is drawn
+ * selectionMode selected objects use this selection mode
+ * textView if set print editable textobject (used by drawObjectsEdit)
+ * This method is used by drawObjectsPres and drawObjectsEdit.
+ */
+ void drawObjects( QPainter *painter, const QPtrList<KPrObject> &objects, SelectionMode selectionMode,
+ bool contour, KPrTextView * textView, int pageNum ) const;
+
+ /**
+ * Draw _objects of page to painter.
+ * This method is used for edit mode.
+ */
+ void drawEditPage( QPainter *painter, const QRect &_rect,
+ KPrPage *page, SelectionMode selectionMode ) const;
+
+ /**
+ * Draw _objects of page shown at step to painter.
+ * This method is used for presentation mode, printing.
+ */
+ void drawPresPage( QPainter *painter, const QRect &_rect, PresStep step ) const;
+
+ /// draw grid
+ void drawGrid(QPainter *painter, const QRect &rect2) const;
+
+ /**
+ * Finish the object effects.
+ * This shown the last step of the effect. It stops the effect timer and
+ * disconnect it and the effect handler deleted.
+ */
+ bool finishObjectEffects();
+
+ bool finishPageEffect( bool cancel = false );
+
+ void drawCurrentPageInPix( QPixmap& ) const;
+ virtual void mousePressEvent( QMouseEvent *e );
+ virtual void mouseReleaseEvent( QMouseEvent *e );
+ virtual void mouseMoveEvent( QMouseEvent *e );
+ virtual void mouseDoubleClickEvent( QMouseEvent *e );
+ virtual void wheelEvent( QWheelEvent *e );
+ virtual void resizeEvent( QResizeEvent *e );
+ virtual bool close( bool alsoDelete );
+ /**
+ * Returns the object at position pos
+ * @param pos the position in the document on which to look
+ * @param withoutProtected if set to true only unprotecred objects are returned
+ * @return the object at position pos
+ */
+ KPrObject *getObjectAt( const KoPoint &pos, bool withoutProtected = false );
+ virtual void focusInEvent( QFocusEvent* ) {}
+ virtual void focusOutEvent( QFocusEvent* ) {}
+ virtual void enterEvent( QEvent *e );
+ virtual void leaveEvent( QEvent *e );
+ virtual void dragEnterEvent( QDragEnterEvent *e );
+ virtual void dragMoveEvent( QDragMoveEvent *e );
+ virtual void dropEvent( QDropEvent *e );
+ virtual void keyPressEvent( QKeyEvent *e );
+ virtual void keyReleaseEvent( QKeyEvent *e );
+ virtual void imStartEvent( QIMEvent * e );
+ virtual void imComposeEvent( QIMEvent * e );
+ virtual void imEndEvent( QIMEvent * e );
+
+ void eraseEmptySpace( QPainter * painter, const QRegion & emptySpaceRegion, const QBrush & brush ) const;
+
+ /// setup popupmenus
+ void setupMenus();
+
+ unsigned int currPgNum() const;
+ QColor txtBackCol() const;
+ bool spInfiniteLoop() const;
+ bool spShowEndOfPresentationSlide() const;
+ bool spManualSwitch() const;
+ QRect getPageRect( bool decBorders = true ) const;
+ unsigned int pageNums() const;
+
+ void _repaint( bool erase=true );
+ void _repaint( const QRect &r );
+ void _repaint( KPrObject *o );
+
+ /**
+ * Draw page defined in step to painter.
+ * This method is used for printing a presentation.
+ */
+ void printPage( QPainter*, PresStep step, KPrinter *printer, int rows, int cols );
+
+ /**
+ * This method animates the objects in the presentation.
+ */
+ void doObjEffects( bool isAllreadyPainted = false );
+
+ /**
+ * @brief Add a object
+ *
+ * @param rect the size and position of the object
+ */
+ KPrPartObject *insertObject( const KoRect &rect );
+
+ /**
+ * @brief Add a autoform object
+ *
+ * @param rect the size and position of the autoform object
+ */
+ void insertAutoform( const KoRect &rect );
+ void insertFreehand( const KoPointArray &_pointArray );
+ void insertPolyline( const KoPointArray &_pointArray );
+ void insertCubicBezierCurve( const KoPointArray &_pointArray );
+ void insertPolygon( const KoPointArray &_pointArray );
+ void insertClosedLine( const KoPointArray &_pointArray );
+
+ void selectNext();
+ void selectPrev();
+
+ void scalePixmapToBeOrigIn( const KoSize &currentSize, const KoSize &pgSize,
+ const QSize &presSize, KPrPixmapObject *obj );
+ bool getPixmapOrigAndCurrentSize( KPrPixmapObject *&obj, KoSize *origSize, KoSize *currentSize );
+ void setTextBackground( KPrTextObject *obj );
+ virtual bool eventFilter( QObject *o, QEvent *e );
+ virtual bool focusNextPrevChild( bool );
+
+ void endDrawPolyline();
+
+ /**
+ * @brief Draw a cubic bezier curve.
+ */
+ void drawCubicBezierCurve( QPainter &p, KoPointArray &points );
+ //void drawCubicBezierCurve( int _dx, int _dy );
+ void endDrawCubicBezierCurve();
+
+ /**
+ * @brief Redraw the curve defined in m_pointArray
+ *
+ * @param p painter used for drawing
+ */
+ void redrawCubicBezierCurve( QPainter &p );
+
+
+#ifndef NDEBUG
+ void printRTDebug( int info );
+#endif
+
+ KoRect getAlignBoundingRect() const;
+
+private:
+ void picViewOrigHelper(int x, int y);
+
+ /**
+ * @brief Move object by key
+ *
+ * @param x The distance to move the objects in x direction
+ * @param y The distance to move the objects in y direction
+ */
+ void moveObjectsByKey( int x, int y );
+
+ /**
+ * @brief Move object by mouse
+ *
+ * @param pos The position of the mouse
+ * @param keepXorYunchanged if true keep x or y position unchanged
+ */
+ void moveObjectsByMouse( KoPoint &pos, bool keepXorYunchanged );
+
+ //---- stuff needed for resizing ----
+ /// resize the m_resizeObject
+ void resizeObject( ModifyType _modType, const KoPoint & point, bool keepRatio, bool scaleAroundCenter );
+ /// create KPrResizeCmd
+ void finishResizeObject( const QString &name, bool layout = true );
+
+ /**
+ * @brief Display object above the other objects in editiong mode
+ *
+ * This is used to bring a single slected object to front, so it is easier
+ * to modify.
+ *
+ * @param object which should be displayed above the other objects
+ */
+ void raiseObject( KPrObject *object );
+ /**
+ * @brief Don't display an object above the others
+ */
+ void lowerObject();
+ /**
+ * @brief Get the list of objects in the order they should be displayed.
+ *
+ * This takes into acount the object set in raiseObject so that it is
+ * the last one in the list returned (the one that is displayed above all
+ * the others).
+ *
+ * @return List of objects
+ */
+ const QPtrList<KPrObject> displayObjectList() const;
+
+ /**
+ * This is used in automatic presentation mode.
+ * If it is set to true and we are in automatic presentation
+ * mode the timer of the page will be activated after the last
+ * effect has been shown.
+ */
+ bool m_setPageTimer;
+
+ /// Helper function to draw a polygon
+ void drawPolygon( QPainter &p, const KoRect &rect );
+
+ /// Helper function to draw a pie/arc/chord
+ void drawPieObject( QPainter *p, const KoRect &rect );
+
+ QPoint limitOfPoint(const QPoint& _point) const;
+
+ /**
+ * Return true if object is a header/footer which is hidden.
+ */
+ bool objectIsAHeaderFooterHidden(KPrObject *obj) const;
+
+ KPrTextObject* textUnderMouse( const QPoint & point );
+ bool checkCurrentTextEdit( KPrTextObject * textObj );
+
+ /**
+ * @brief Snap @p pos to grid and guide lines.
+ *
+ * This method looks if the @p pos has to be snapped to a guide or grid or both.
+ * If so it returns the position it has snapped to.
+ *
+ * @param pos the point which should be snapped
+ * @param repaintSnapping true if the guides should be repainted.
+ * @param repaintSnapping false when the guides should not be repainted.
+ * You have to call repaint by yourself.
+ *
+ * @return the position of the snapped point
+ */
+ KoPoint snapPoint( KoPoint &pos, bool repaintSnapping = true );
+
+ /**
+ * @brief Find the next grid in distance
+ *
+ * Allways the top left corner is snapped to the grid.
+ *
+ * @param rect The rect which should be snapped to the grid.
+ * @param diffx The range in x distance in which the grid has to be.
+ * @param diffy The range in y distance in which the grid has to be.
+ *
+ * @return the distance to the guide or ( 0, 0 ) if there is no guide to snap to.
+ */
+ KoPoint diffGrid( KoRect &rect, double diffx, double diffy );
+
+ void recalcAutoGuides( );
+
+ /**
+ * @brief Calculate the points in distance to the top left corner
+ *
+ * @param pointArray the points in coordinate position
+ */
+ KoPointArray getObjectPoints( const KoPointArray &pointArray );
+
+
+ /**
+ * @brief Update m_insertRect
+ *
+ * This will set the bottom right corner of the insert rect to
+ * the given point. If the AltButton is pressed the insert rect
+ * is moved with its bottom right to the given point.
+ *
+ * @param point the bottom right point of the inserted object
+ * @param The state of the mouse and modifier buttons
+ *
+ */
+ void updateInsertRect( const KoPoint &point, Qt::ButtonState state );
+
+ /**
+ * @brief Popup context menu
+ *
+ * Popup context menu for current active or selected object,
+ * otherwise popup context menu for page.
+ */
+ void popupContextMenu();
+
+private slots:
+ void toFontChanged( const QFont &font ) { emit fontChanged( font ); }
+ void toColorChanged( const QColor &color ) { emit colorChanged( color ); }
+ void toAlignChanged( int a ) { emit alignChanged( a ); }
+ /**
+ * Switch to drawing mode. In drawing mode it is possible to draw on the
+ * current slide.
+ * Only to be used in presentation mode.
+ */
+ void setDrawingMode();
+ /**
+ * Set switching mode. This ends drawing mode and goes back to
+ * stepping between the pages.
+ * If continueTimer is true the autoPres timer is continued
+ * Only to be used in presentation mode.
+ */
+ void setSwitchingMode( bool continueTimer = true );
+ void slotGotoPage();
+ void slotExitPres();
+ void terminateEditing( KPrTextObject * );
+
+ /**
+ * Do the next step of the object effect.
+ * This restarts the effect tmer. If the effects are
+ * completed the timer is disconnected and the effect handler
+ * deleted.
+ */
+ void slotDoEffect();
+
+ void slotDoPageEffect();
+
+ /**
+ * Scroll canvas when receiving this signal
+ */
+ void slotAutoScroll(const QPoint &scrollDist);
+
+ /**
+ * Speak the text object under the mouse. This slot is normally
+ * connected to the kospeaker customSpeakWidget signal.
+ */
+ void speakTextUnderMouse(QWidget* w, const QPoint& p, uint flags);
+
+private:
+ /// Distance for snapping to guide line with mouse
+ static const int MOUSE_SNAP_DISTANCE;
+ /// Distance for snapping to guide line with key
+ static const int KEY_SNAP_DISTANCE;
+ // variables
+ /// Popup menu used in presentation mode.
+ KPopupMenu *m_presMenu;
+ bool showingLastSlide;
+ bool mousePressed;
+ bool drawContour;
+ ModifyType modType;
+
+ /// text or part object when it is edited
+ KPrObject * m_editObject;
+
+ bool fillBlack;
+ KPrView *m_view;
+ bool editMode, goingBack;
+ /**
+ * True when we are in drawing mode.
+ * False when we are in switching mode.
+ */
+ bool m_drawMode;
+ /**
+ * True if the a line should be drawn.
+ * Used in drawing mode.
+ */
+ bool m_drawLineInDrawMode;
+
+ /**
+ * Save the lines drawed in drawMode.
+ * This is used for paint events.
+ * Used in drawing mode.
+ */
+ QValueVector<QPointArray> m_drawModeLines;
+
+ /**
+ * Index into the QPointArray for the next point of the line in draw mode.
+ * Used in drawing mode.
+ */
+ int m_drawModeLineIndex;
+
+ bool mouseSelectedObject;
+ /// information about current step of the presentation
+ PresStep m_step;
+ float _presFakt;
+ int m_showOnlyPage; // 1-based (-1 = all)
+ /// list of all effect steps occuring on the active page
+ QValueList<int> m_pageEffectSteps;
+ /// List of the slides used in the presentation
+ QValueList<int> m_presentationSlides;
+ /// Iterator over the slides of a presentation
+ QValueList<int>::Iterator m_presentationSlidesIterator;
+ /// KPrEffectHandler for object effects
+ KPrEffectHandler *m_effectHandler;
+
+ KPrPageEffects *m_pageEffect;
+
+ /// EffectTimer
+ QTimer m_effectTimer;
+
+ QTimer m_pageEffectTimer;
+
+ /// menu identifier for draw mode
+ int PM_DM;
+ int delPageId;
+ bool drawRubber;
+ /// rect for drawing rubber
+ KoRect m_rubber;
+
+ //---- stuff needed for resizing ----
+ /// object which gets resized
+ KPrObject *m_resizeObject;
+ /// size of the object at when resizing is started
+ KoRect m_rectBeforeResize;
+ /// ratio of the object ( width / height )
+ double m_ratio;
+ bool m_isResizing;
+
+ //---- stuff needed for moving ----
+ bool m_isMoving;
+ KoPoint m_moveStartPoint;
+
+ //---- stuff needed for rotating ----
+ /// object which gets rotated
+ KPrObject *m_rotateObject;
+ /// center of the rotated object
+ KoPoint m_rotateCenter;
+ /// start point for rotation
+ KoPoint m_rotateStart;
+ /// angle of the object at start of rotate
+ double m_angleBeforeRotate;
+
+ ToolEditMode toolEditMode;
+ /// The rect of the object during insert.
+ KoRect m_insertRect;
+ KoDocumentEntry partEntry;
+ QString autoform;
+ QPixmap buffer;
+
+ KPrTextView *m_currentTextObjectView;
+
+ KPrSoundPlayer *soundPlayer;
+
+ KoPointArray m_pointArray, m_oldCubicBezierPointArray;
+ QPoint m_dragStartPoint, m_dragEndPoint, m_dragSymmetricEndPoint;
+ /// The start position of an insert for line objects
+ KoPoint m_startPoint;
+ /// The end position of an insert for line objects
+ KoPoint m_endPoint;
+ KoPoint m_symmetricEndPoint;
+ KoPoint m_CubicBezierSecondPoint, m_CubicBezierThirdPoint;
+ int m_indexPointArray;
+ bool m_drawPolyline;
+ bool m_drawCubicBezierCurve;
+ bool m_drawLineWithCubicBezierCurve;
+ bool m_zoomRubberDraw;
+
+ KPrPage *m_activePage;
+ int m_xOffset, m_yOffset;
+ int m_xOffsetSaved, m_yOffsetSaved; // saved when going fullscreen
+
+ /// Start position for move with mouse
+ KoPoint m_moveStartPosMouse;
+ /// This holds the distance it an object was snapped to a guide
+ KoPoint m_moveSnapDiff;
+ /// Set to true if snapping should be disabled (by pressing shift during move)
+ bool m_disableSnapping;
+ /// The last position of the mouse during moving
+ KoPoint m_origMousePos;
+ /// start position for move with key
+ KoPoint m_moveStartPosKey;
+
+ KPrPage * m_activePageBeforePresentation;
+ int m_zoomBeforePresentation;
+
+ bool m_keyPressEvent;
+ bool m_drawSymetricObject;
+
+ /// guides
+ KoGuides m_gl;
+ /// true if we are in guide move state, false otherwise
+ bool m_paintGuides;
+
+ /// object which is selected and should be shown above all the other objects
+ KPrObject * m_objectDisplayAbove;
+
+ /// Previously spoken text object.
+ KPrTextObject *m_prevSpokenTO;
+};
+
+#endif // __KPRCANVAS__
diff --git a/kpresenter/KPrClosedLineObject.cpp b/kpresenter/KPrClosedLineObject.cpp
new file mode 100644
index 000000000..4e11006ac
--- /dev/null
+++ b/kpresenter/KPrClosedLineObject.cpp
@@ -0,0 +1,339 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Toshitaka Fujioka <fujioka@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrClosedLineObject.h"
+#include "KPrPointObject.h"
+#include "KPrGradient.h"
+#include "KPrSVGPathParser.h"
+#include <KoTextZoomHandler.h>
+#include <kdebug.h>
+#include <qbitmap.h>
+#include <qregion.h>
+#include <qregexp.h>
+#include <qdom.h>
+#include <qpicture.h>
+#include <qpainter.h>
+#include <KoOasisContext.h>
+#include <math.h>
+#include <KoUnit.h>
+#include <KoXmlNS.h>
+#include <KoDom.h>
+
+using namespace std;
+
+KPrClosedLineObject::KPrClosedLineObject()
+ : KPr2DObject()
+{
+}
+
+KPrClosedLineObject::KPrClosedLineObject( const KoPointArray &_points, const KoSize &_size, const KoPen &_pen, const QBrush &_brush,
+ FillType _fillType, const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor, const QString _typeString )
+ : KPr2DObject( _pen, _brush, _fillType, _gColor1, _gColor2, _gType, _unbalanced, _xfactor, _yfactor )
+{
+ points = KoPointArray( _points );
+ ext = _size;
+ typeString = _typeString;
+}
+
+KPrClosedLineObject::KPrClosedLineObject( const KPrPointObject &object )
+: KPr2DObject( object.getPen(), QBrush::NoBrush, FT_BRUSH, QColor(), QColor(), BCT_PLAIN, false, 0, 0 )
+{
+ ext = object.getSize();
+ orig = object.getOrig();
+ objectName = object.getObjectName();
+ points = object.getPoints().copy();
+ points.putPoints( points.count(), 1, points.at( 0 ).x(), points.at( 0 ).y() );
+ switch ( object.getType() )
+ {
+ case OT_FREEHAND:
+ typeString = i18n( "Closed Freehand" );
+ break;
+ case OT_POLYLINE:
+ typeString = i18n( "Closed Polyline" );
+ break;
+ case OT_CUBICBEZIERCURVE:
+ typeString = i18n( "Closed Cubic Bezier Curve" );
+ break;
+ case OT_QUADRICBEZIERCURVE:
+ typeString = i18n( "Closed Quadric Bezier Curve" );
+ break;
+ default:
+ break;
+ }
+
+}
+
+KPrClosedLineObject &KPrClosedLineObject::operator=( const KPrClosedLineObject & )
+{
+ return *this;
+}
+
+#if 0
+DCOPObject* KPrClosedLineObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPClosedLineObjectIface( this );
+ return dcop;
+}
+#endif
+
+QDomDocumentFragment KPrClosedLineObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment = KPr2DObject::save( doc, offset );
+
+ QDomElement elemObjectsName = doc.createElement( "OBJECTSNAME" );
+
+ elemObjectsName.setAttribute( "NAME", typeString );
+
+ fragment.appendChild( elemObjectsName );
+
+ if ( !points.isNull() ) {
+ QDomElement elemPoints = doc.createElement( "POINTS" );
+ KoPointArray::ConstIterator it;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ QDomElement elemPoint = doc.createElement( "Point" );
+ KoPoint point = (*it);
+ elemPoint.setAttribute( "point_x", point.x() );
+ elemPoint.setAttribute( "point_y", point.y() );
+
+ elemPoints.appendChild( elemPoint );
+ }
+ fragment.appendChild( elemPoints );
+ }
+
+ return fragment;
+}
+
+bool KPrClosedLineObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ KPrShadowObject::saveOasisDrawPoints( points, sc );
+ return true;
+}
+
+const char * KPrClosedLineObject::getOasisElementName() const
+{
+ return "draw:polygon";
+}
+
+
+double KPrClosedLineObject::load( const QDomElement &element )
+{
+ double offset = KPr2DObject::load( element );
+
+ QDomElement e = element.namedItem( "OBJECTSNAME" ).toElement();
+ if ( !e.isNull() ) {
+ if ( e.hasAttribute( "NAME" ) )
+ typeString = e.attribute( "NAME" );
+ }
+
+ e = element.namedItem( "POINTS" ).toElement();
+ if ( !e.isNull() ) {
+ QDomElement elemPoint = e.firstChild().toElement();
+ unsigned int index = 0;
+ while ( !elemPoint.isNull() ) {
+ if ( elemPoint.tagName() == "Point" ) {
+ double tmpX = 0;
+ double tmpY = 0;
+ if( elemPoint.hasAttribute( "point_x" ) )
+ tmpX = elemPoint.attribute( "point_x" ).toDouble();
+ if( elemPoint.hasAttribute( "point_y" ) )
+ tmpY = elemPoint.attribute( "point_y" ).toDouble();
+
+ points.putPoints( index, 1, tmpX,tmpY );
+ }
+ elemPoint = elemPoint.nextSibling().toElement();
+ ++index;
+ }
+ }
+ return offset;
+}
+
+void KPrClosedLineObject::setSize( double _width, double _height )
+{
+ KoSize origSize( ext );
+ KPrObject::setSize( _width, _height );
+
+ double fx = ext.width() / origSize.width();
+ double fy = ext.height() / origSize.height();
+
+ updatePoints( fx, fy );
+}
+
+void KPrClosedLineObject::updatePoints( double _fx, double _fy )
+{
+ int index = 0;
+ KoPointArray tmpPoints;
+ KoPointArray::ConstIterator it;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint point = (*it);
+ double tmpX = point.x() * _fx;
+ double tmpY = point.y() * _fy;
+
+ tmpPoints.putPoints( index, 1, tmpX,tmpY );
+ ++index;
+ }
+ points = tmpPoints;
+}
+
+void KPrClosedLineObject::paint( QPainter* _painter,KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour )
+{
+ int _w = ( pen.style() == Qt::NoPen ) ? 1 : int( pen.pointWidth() );
+
+ if ( drawContour ) {
+ QPointArray pointArray2 = points.zoomPointArray( _zoomHandler );
+ QPen pen3( Qt::black, 1, Qt::DotLine );
+ _painter->setPen( pen3 );
+ _painter->setRasterOp( Qt::NotXorROP );
+ _painter->drawPolygon( pointArray2 );
+ return;
+ }
+
+ QPointArray pointArray = points.zoomPointArray( _zoomHandler, _w );
+ QPen pen2 = pen.zoomedPen( _zoomHandler );
+
+ if ( drawingShadow || getFillType() == FT_BRUSH || !gradient ) {
+ _painter->setPen( pen2 );
+ _painter->setBrush( getBrush() );
+ _painter->drawPolygon( pointArray );
+ }
+ else {
+ QSize size( _zoomHandler->zoomSize( ext ) );
+ if ( m_redrawGradientPix || gradient->size() != size )
+ {
+ m_redrawGradientPix = false;
+ gradient->setSize( size );
+ QRegion clipregion( pointArray );
+ m_gradientPix.resize( size );
+ m_gradientPix.fill( Qt::white );
+
+ QPainter p;
+ p.begin( &m_gradientPix );
+ p.setClipRegion( clipregion );
+ p.drawPixmap( 0, 0, gradient->pixmap() );
+ p.end();
+
+ m_gradientPix.setMask( m_gradientPix.createHeuristicMask() );
+ }
+
+ QRect _rect = pointArray.boundingRect();
+ _painter->drawPixmap( 0, 0, m_gradientPix, 0, 0, _rect.width(), _rect.height() );
+
+ _painter->setPen( pen2 );
+ _painter->setBrush( Qt::NoBrush );
+ _painter->drawPolygon( pointArray );
+ }
+}
+
+void KPrClosedLineObject::flip( bool horizontal )
+{
+ KPr2DObject::flip( horizontal );
+ // flip the points
+ KoPointArray tmpPoints;
+ int index = 0;
+ if ( ! horizontal )
+ {
+ KoPointArray::ConstIterator it;
+ double horiz = getSize().height()/2;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint point = (*it);
+ if ( point.y()> horiz )
+ tmpPoints.putPoints( index, 1, point.x(),point.y()- 2*(point.y()-horiz) );
+ else
+ tmpPoints.putPoints( index, 1, point.x(),point.y()+ 2*(horiz - point.y()) );
+ ++index;
+ }
+ }
+ else
+ {
+ KoPointArray::ConstIterator it;
+ double vert = getSize().width()/2;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint point = (*it);
+ if ( point.x()> vert )
+ tmpPoints.putPoints( index, 1, point.x()- 2*(point.x()-vert), point.y() );
+ else
+ tmpPoints.putPoints( index, 1, point.x()+ 2*(vert - point.x()),point.y() );
+ ++index;
+ }
+ }
+ points = tmpPoints;
+}
+
+void KPrClosedLineObject::loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info )
+{
+ kdDebug()<<"void KPrClosedLineObject::loadOasis( const QDomElement &element )***********\n";
+ KPr2DObject::loadOasis( element,context, info );
+ QString tag( element.tagName() );
+ if ( tag == "polygon" )
+ {
+ KPrShadowObject::loadOasisDrawPoints( points, element, context, info );
+ }
+ else if ( tag == "path" ) // this is used to load closed draw:path objects
+ {
+ QString d = element.attributeNS( KoXmlNS::svg, "d", QString::null);
+ kdDebug(33001) << "path d: " << d << endl;
+
+ KPrSVGPathParser parser;
+ points = parser.getPoints( d, true );
+ loadOasisApplyViewBox( element, points );
+ }
+ else if ( tag == "custom-shape" )
+ {
+ QDomElement enhancedGeometry = KoDom::namedItemNS( element, KoXmlNS::draw, "enhanced-geometry" );
+
+ if ( !enhancedGeometry.isNull() )
+ {
+ QString d = enhancedGeometry.attributeNS( KoXmlNS::draw, "enhanced-path", QString::null );
+ QRegExp rx( "^([0-9 MLZ]+)N$" );
+ if ( rx.search( d ) != -1 )
+ {
+ d = rx.cap( 1 );
+ kdDebug(33001) << "enhanced-path d: " << d << endl;
+
+ KPrSVGPathParser parser;
+ points = parser.getPoints( d, true );
+ loadOasisApplyViewBox( enhancedGeometry, points );
+ }
+ }
+ }
+ else
+ {
+ kdDebug(33001) << "KPrClosedLineObject::loadOasis unsupported tag" << endl;
+ }
+}
+
+KoSize KPrClosedLineObject::getRealSize() const {
+ KoSize size( ext );
+ KoPoint realOrig( orig );
+ KoPointArray p( points );
+ getRealSizeAndOrigFromPoints( p, angle, size, realOrig );
+ return size;
+}
+
+KoPoint KPrClosedLineObject::getRealOrig() const {
+ KoSize size( ext );
+ KoPoint realOrig( orig );
+ KoPointArray p( points );
+ getRealSizeAndOrigFromPoints( p, angle, size, realOrig );
+ return realOrig;
+}
diff --git a/kpresenter/KPrClosedLineObject.h b/kpresenter/KPrClosedLineObject.h
new file mode 100644
index 000000000..60c07ea68
--- /dev/null
+++ b/kpresenter/KPrClosedLineObject.h
@@ -0,0 +1,84 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Toshitaka Fujioka <fujioka@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpclosedlineoject_h
+#define kpclosedlineoject_h
+
+#include <qpointarray.h>
+#include "KoPointArray.h"
+#include "KPrObject.h"
+
+class KPrGradient;
+class QPainter;
+class DCOPObject;
+class KPrPointObject;
+
+class KPrClosedLineObject : public KPr2DObject
+{
+public:
+ KPrClosedLineObject();
+ KPrClosedLineObject( const KoPointArray &_points, const KoSize &_size, const KoPen &_pen, const QBrush &_brush,
+ FillType _fillType, const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor, const QString _type );
+ /**
+ * @brief Construct object form a KPrPointObject.
+ *
+ * This constructor is used when a KPrPointObject objects gets closed.
+ * It is then changed into a KPrClosedLineObject.
+ *
+ * @param object form which the KPrClosedLineObject is constructed
+ */
+ KPrClosedLineObject( const KPrPointObject &object );
+
+ virtual ~KPrClosedLineObject() {}
+ //virtual DCOPObject* dcopObject();
+
+ KPrClosedLineObject &operator=( const KPrClosedLineObject & );
+
+ virtual void setSize( double _width, double _height );
+ virtual void setSize( const KoSize & _size ) { setSize( _size.width(), _size.height() ); }
+
+ virtual ObjType getType() const { return OT_CLOSED_LINE; }
+ virtual QString getTypeString() const { return typeString; }
+
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+ virtual double load( const QDomElement &element );
+ virtual void loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info );
+
+ virtual void flip(bool horizontal );
+ virtual KoSize getRealSize() const;
+ virtual KoPoint getRealOrig() const;
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+ virtual void paint( QPainter *_painter,KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour );
+
+ void updatePoints( double _fx, double _fy );
+
+ KoPointArray points;
+
+ QString typeString;
+};
+
+#endif
diff --git a/kpresenter/KPrCommand.cpp b/kpresenter/KPrCommand.cpp
new file mode 100644
index 000000000..62119e9f5
--- /dev/null
+++ b/kpresenter/KPrCommand.cpp
@@ -0,0 +1,2827 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Laurent Montel <lmontel@mandrakesoft.com>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrDocument.h"
+#include "KPrPage.h"
+#include "KPrCommand.h"
+#include "KPrBackground.h"
+#include "KPrGroupObject.h"
+
+
+#include "KPrLineObject.h"
+#include "KPrEllipseObject.h"
+#include "KPrAutoformObject.h"
+#include "KPrFreehandObject.h"
+#include "KPrPolylineObject.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrPolygonObject.h"
+#include "KPrClosedLineObject.h"
+
+#include "KPrTextObject.h"
+#include "KPrPixmapObject.h"
+
+#include "KPrPartObject.h"
+#include <KoRuler.h>
+#include "KPrPieObject.h"
+#include "KPrRectObject.h"
+#include "KPrView.h"
+#include "KoTextObject.h"
+#include "KPrTextDocument.h"
+#include <kdebug.h>
+#include "KPrVariableCollection.h"
+#include <KoRect.h>
+#include <KoSize.h>
+#include <KoPoint.h>
+#include <KoDom.h>
+#include <KoTextParag.h>
+#include <KoXmlNS.h>
+#include <KoStore.h>
+#include <KoOasisContext.h>
+#include <KoOasisStyles.h>
+#include <KoOasisStore.h>
+
+#include <qxml.h>
+#include <qbuffer.h>
+
+
+KPrShadowCmd::KPrShadowCmd( const QString &_name, QPtrList<ShadowValues> &_oldShadow, ShadowValues _newShadow,
+ QPtrList<KPrObject> &_objects, KPrDocument *_doc )
+ : KNamedCommand( _name ), oldShadow( _oldShadow ), objects( _objects )
+{
+ objects.setAutoDelete( false );
+ oldShadow.setAutoDelete( false );
+ doc = _doc;
+ newShadow = _newShadow;
+
+ m_page = doc->findPage( objects );
+
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrShadowCmd::~KPrShadowCmd()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+ oldShadow.setAutoDelete( true );
+ oldShadow.clear();
+}
+
+void KPrShadowCmd::execute()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setShadowParameter(newShadow.shadowDistance,
+ newShadow.shadowDirection,
+ newShadow.shadowColor);
+ doc->repaint( false );
+
+ doc->updateSideBarItem( m_page );
+}
+
+void KPrShadowCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < objects.count(); i++ )
+ objects.at( i )->setShadowParameter(oldShadow.at(i)->shadowDistance,
+ oldShadow.at(i)->shadowDirection,
+ oldShadow.at(i)->shadowColor);
+ doc->repaint( false );
+
+ doc->updateSideBarItem( m_page );
+}
+
+
+KPrSetOptionsCmd::KPrSetOptionsCmd( const QString &_name, QValueList<KoPoint> &_diffs, QPtrList<KPrObject> &_objects,
+ double _gridX, double _gridY, double _oldGridX, double _oldGridY,
+ const QColor &_txtBackCol, const QColor &_otxtBackCol, KPrDocument *_doc )
+ : KNamedCommand( _name ),
+ diffs( _diffs ),
+ objects( _objects ),
+ txtBackCol( _txtBackCol ),
+ otxtBackCol( _otxtBackCol )
+{
+ gridX = _gridX;
+ gridY = _gridY;
+ oldGridX = _oldGridX;
+ oldGridY = _oldGridY;
+ doc = _doc;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrSetOptionsCmd::~KPrSetOptionsCmd()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+}
+
+void KPrSetOptionsCmd::execute()
+{
+ // ## use iterator
+ for ( unsigned int i = 0; i < objects.count(); i++ )
+ objects.at( i )->moveBy( *diffs.at( i ) );
+ doc->setGridValue( gridX, gridY, false );
+ doc->updateRuler();
+ doc->setTxtBackCol( txtBackCol );
+ doc->repaint( false );
+}
+
+void KPrSetOptionsCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < objects.count(); i++ )
+ objects.at( i )->moveBy( -(*diffs.at( i )).x(), -(*diffs.at( i )).y() );
+ doc->setGridValue( oldGridX, oldGridY, false );
+ doc->updateRuler();
+ doc->setTxtBackCol( otxtBackCol );
+ doc->repaint( false );
+}
+
+KPrSetBackCmd::KPrSetBackCmd( const QString &name, const KPrBackGround::Settings &settings,
+ const KPrBackGround::Settings &oldSettings,
+ bool useMasterBackground,
+ bool takeGlobal, KPrDocument *doc, KPrPage *page )
+: KNamedCommand( name )
+, m_settings( settings )
+, m_oldSettings( oldSettings )
+, m_useMasterBackground( useMasterBackground )
+, m_oldUseMasterBackground( page->useMasterBackground() )
+, m_takeGlobal( takeGlobal )
+, m_doc( doc )
+, m_page( page )
+{
+}
+
+void KPrSetBackCmd::execute()
+{
+ if ( !m_takeGlobal ) {
+ m_page->background()->setBackGround( m_settings );
+ m_page->setUseMasterBackground( m_useMasterBackground );
+ m_doc->restoreBackground( m_page );
+ } else {
+ QPtrListIterator<KPrPage> it( m_doc->getPageList() );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->background()->setBackGround( m_settings );
+ it.current()->setUseMasterBackground( m_useMasterBackground );
+ m_doc->restoreBackground(it.current());
+ }
+
+ }
+ m_doc->repaint( false );
+
+ if ( m_takeGlobal ) {
+ QPtrListIterator<KPrPage> it( m_doc->getPageList() );
+ for ( int pos = 0; it.current(); ++it, ++pos ) {
+ m_doc->updateSideBarItem( it.current() );
+ }
+ }
+ else {
+ m_doc->updateSideBarItem( m_page );
+ }
+}
+
+void KPrSetBackCmd::unexecute()
+{
+ if ( !m_takeGlobal ) {
+ m_page->background()->setBackGround( m_oldSettings );
+ m_page->setUseMasterBackground( m_oldUseMasterBackground );
+ m_doc->restoreBackground( m_page );
+ } else {
+ QPtrListIterator<KPrPage> it( m_doc->getPageList() );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->background()->setBackGround( m_oldSettings );
+ it.current()->setUseMasterBackground( m_oldUseMasterBackground );
+ m_doc->restoreBackground(it.current());
+ }
+ }
+ m_doc->repaint( false );
+
+ if ( m_takeGlobal ) {
+ QPtrListIterator<KPrPage> it( m_doc->getPageList() );
+ for ( int pos = 0; it.current(); ++it, ++pos ) {
+ m_doc->updateSideBarItem( it.current() );
+ }
+ }
+ else {
+ m_doc->updateSideBarItem( m_page );
+ }
+}
+
+KPrRotateCmd::KPrRotateCmd( const QString &_name, float newAngle, QPtrList<KPrObject> &objects,
+ KPrDocument *doc, bool addAngle )
+ : KNamedCommand( _name ), m_doc( doc ), m_newAngle( newAngle ), m_addAngle( addAngle )
+{
+ m_objects.setAutoDelete( false );
+ m_oldAngles.setAutoDelete( false );
+
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ {
+ m_objects.append( it.current() );
+
+ RotateValues *old = new RotateValues;
+ old->angle = it.current()->getAngle();
+ m_oldAngles.append( old );
+
+ it.current()->incCmdRef();
+ }
+
+ m_page = m_doc->findPage( m_objects );
+}
+
+KPrRotateCmd::~KPrRotateCmd()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+ m_oldAngles.setAutoDelete( true );
+ m_oldAngles.clear();
+}
+
+void KPrRotateCmd::execute()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ {
+ if ( m_addAngle )
+ it.current()->rotate( it.current()->getAngle() + m_newAngle );
+ else
+ it.current()->rotate( m_newAngle );
+ }
+ m_doc->updateRuler();
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrRotateCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < m_objects.count(); i++ )
+ m_objects.at(i)->rotate( m_oldAngles.at( i )->angle );
+ m_doc->updateRuler();
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+
+KPrChgPixCmd::KPrChgPixCmd( const QString &_name, KPrPixmapObject *_oldObject, KPrPixmapObject *_newObject,
+ KPrDocument *_doc, KPrPage *_page)
+ : KNamedCommand( _name )
+{
+ oldObject = _oldObject;
+ newObject = _newObject;
+ m_page=_page;
+ doc = _doc;
+ oldObject->incCmdRef();
+ newObject->incCmdRef();
+ newObject->setSize( oldObject->getSize() );
+ newObject->setOrig( oldObject->getOrig() );
+}
+
+KPrChgPixCmd::~KPrChgPixCmd()
+{
+ oldObject->decCmdRef();
+ newObject->decCmdRef();
+}
+
+void KPrChgPixCmd::execute()
+{
+ m_page->replaceObject( oldObject, newObject );
+ doc->repaint( newObject );
+
+ doc->updateSideBarItem( m_page );
+}
+
+void KPrChgPixCmd::unexecute()
+{
+ m_page->replaceObject( newObject, oldObject );
+ doc->repaint( oldObject );
+
+ doc->updateSideBarItem( m_page );
+}
+
+KPrDeleteCmd::KPrDeleteCmd( const QString &_name, QPtrList<KPrObject> &_objects,
+ KPrDocument *_doc, KPrPage *_page )
+: KNamedCommand( _name )
+, m_oldObjectList( _page->objectList() )
+, m_objectsToDelete( _objects )
+, m_doc( _doc )
+, m_page( _page )
+{
+ QPtrListIterator<KPrObject> it( m_oldObjectList );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrDeleteCmd::~KPrDeleteCmd()
+{
+ QPtrListIterator<KPrObject> it( m_oldObjectList );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+}
+
+void KPrDeleteCmd::execute()
+{
+ bool textObj=false;
+
+ QPtrListIterator<KPrObject> it( m_oldObjectList );
+ QPtrListIterator<KPrObject> itDelete( m_objectsToDelete );
+ QPtrList<KPrObject> newObjectList;
+ for ( ; it.current(); ++it )
+ {
+ if ( it.current() == itDelete.current() )
+ {
+ it.current()->setSelected( false );
+ it.current()->removeFromObjList();
+
+ if ( !textObj && it.current()->getType() == OT_TEXT )
+ {
+ KPrTextObject * tmp = dynamic_cast<KPrTextObject *>( it.current() );
+ if ( tmp )
+ tmp->setEditingTextObj( false );
+ textObj=true;
+ }
+ ++itDelete;
+ }
+ else
+ {
+ newObjectList.append( it.current() );
+ }
+ }
+
+ m_page->setObjectList( newObjectList );
+
+ for ( itDelete.toFirst(); itDelete.current(); ++itDelete )
+ {
+ QRect oldRect = m_doc->zoomHandler()->zoomRect( itDelete.current()->getRepaintRect() );
+ m_doc->repaint( oldRect );
+ }
+ if(textObj)
+ m_doc->updateRuler();
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrDeleteCmd::unexecute()
+{
+ m_page->setObjectList( m_oldObjectList );
+ QPtrListIterator<KPrObject> it( m_objectsToDelete );
+ for ( ; it.current(); ++it )
+ {
+ it.current()->addToObjList();
+ m_doc->repaint( it.current() );
+ }
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+
+KPrEffectCmd::KPrEffectCmd( const QString &_name, const QPtrList<KPrObject> &_objs,
+ const QValueList<EffectStruct> &_oldEffects, EffectStruct _newEffect )
+ : KNamedCommand( _name ), oldEffects( _oldEffects ),
+ newEffect( _newEffect ), objs( _objs )
+{
+ QPtrListIterator<KPrObject> it( objs );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrEffectCmd::~KPrEffectCmd()
+{
+ QPtrListIterator<KPrObject> it( objs );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+}
+
+void KPrEffectCmd::execute()
+{
+ QPtrListIterator<KPrObject> it( objs );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->setAppearStep( newEffect.appearStep );
+ it.current()->setEffect( newEffect.effect );
+ it.current()->setEffect2( newEffect.effect2 );
+ it.current()->setDisappear( newEffect.disappear );
+ it.current()->setEffect3( newEffect.effect3 );
+ it.current()->setDisappearStep( newEffect.disappearStep );
+ it.current()->setAppearSpeed( newEffect.m_appearSpeed );
+ it.current()->setDisappearSpeed( newEffect.m_disappearSpeed );
+ it.current()->setAppearTimer( newEffect.appearTimer );
+ it.current()->setDisappearTimer( newEffect.disappearTimer );
+ it.current()->setAppearSoundEffect( newEffect.appearSoundEffect );
+ it.current()->setDisappearSoundEffect( newEffect.disappearSoundEffect );
+ it.current()->setAppearSoundEffectFileName( newEffect.a_fileName );
+ it.current()->setDisappearSoundEffectFileName( newEffect.d_fileName );
+ }
+}
+
+void KPrEffectCmd::unexecute()
+{
+ KPrObject *object = 0;
+ for ( unsigned int i = 0; i < objs.count(); ++i ) {
+ object = objs.at( i );
+
+ object->setAppearStep( oldEffects[ i ].appearStep );
+ object->setEffect( oldEffects[ i ].effect );
+ object->setEffect2( oldEffects[ i ].effect2 );
+ object->setDisappear( oldEffects[ i ].disappear );
+ object->setEffect3( oldEffects[ i ].effect3 );
+ object->setDisappearStep( oldEffects[ i ].disappearStep );
+ object->setAppearSpeed( oldEffects[ i ].m_appearSpeed );
+ object->setDisappearSpeed( oldEffects[ i ].m_disappearSpeed );
+ object->setAppearTimer( oldEffects[ i ].appearTimer );
+ object->setDisappearTimer( oldEffects[ i ].disappearTimer );
+ object->setAppearSoundEffect( oldEffects[ i ].appearSoundEffect );
+ object->setDisappearSoundEffect( oldEffects[ i ].disappearSoundEffect );
+ object->setAppearSoundEffectFileName( oldEffects[ i ].a_fileName );
+ object->setDisappearSoundEffectFileName( oldEffects[ i ].d_fileName );
+ }
+}
+
+KPrGroupObjCmd::KPrGroupObjCmd( const QString &_name,
+ const QPtrList<KPrObject> &_objects,
+ KPrDocument *_doc, KPrPage *_page )
+: KNamedCommand( _name )
+, m_objectsToGroup( _objects )
+, m_oldObjectList( _page->objectList() )
+, m_doc( _doc )
+, m_page( _page )
+{
+ m_groupObject = new KPrGroupObject( m_objectsToGroup );
+ m_groupObject->incCmdRef();
+}
+
+KPrGroupObjCmd::~KPrGroupObjCmd()
+{
+ m_groupObject->decCmdRef();
+}
+
+void KPrGroupObjCmd::execute()
+{
+ KoRect r;
+ int position = 0;
+ QPtrListIterator<KPrObject> it( m_objectsToGroup );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->setSelected( false );
+ position = m_page->takeObject(it.current() );
+ r |= it.current()->getRealRect();
+ }
+
+ m_groupObject->setUpdateObjects( false );
+ m_groupObject->setOrig( r.x(), r.y() );
+ m_groupObject->setSize( r.width(), r.height() );
+ m_page->insertObject( m_groupObject, position );
+ m_groupObject->addToObjList();
+ m_groupObject->setUpdateObjects( true );
+ m_groupObject->setSelected( true );
+ m_doc->refreshGroupButton();
+
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrGroupObjCmd::unexecute()
+{
+ m_groupObject->setUpdateObjects( false );
+
+ m_page->setObjectList( m_oldObjectList );
+ m_groupObject->removeFromObjList();
+
+ QPtrListIterator<KPrObject> it( m_objectsToGroup );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->addToObjList();
+ it.current()->setSelected( true );
+ }
+
+ m_doc->refreshGroupButton();
+
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+UnGroupObjCmd::UnGroupObjCmd( const QString &_name,
+ KPrGroupObject *grpObj_,
+ KPrDocument *_doc, KPrPage *_page )
+: KNamedCommand( _name )
+, m_groupedObjects( grpObj_->getObjects() )
+, m_groupObject( grpObj_ )
+, m_doc( _doc )
+, m_page( _page )
+{
+ m_groupObject->incCmdRef();
+}
+
+UnGroupObjCmd::~UnGroupObjCmd()
+{
+ m_groupObject->decCmdRef();
+}
+
+void UnGroupObjCmd::execute()
+{
+ m_groupObject->setUpdateObjects( false );
+
+ int position = m_page->takeObject( m_groupObject );
+ m_groupObject->removeFromObjList();
+
+ QPtrListIterator<KPrObject> it( m_groupedObjects );
+ for ( it.toLast(); it.current() ; --it )
+ {
+ m_page->insertObject( it.current(), position );
+ it.current()->addToObjList();
+ it.current()->setSelected( true );
+ }
+
+ m_doc->refreshGroupButton();
+
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void UnGroupObjCmd::unexecute()
+{
+ KoRect r=KoRect();
+ int position = 0;
+ QPtrListIterator<KPrObject> it( m_groupedObjects );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->setSelected( false );
+ position = m_page->takeObject( it.current() );
+ r |= it.current()->getRealRect();
+ }
+
+ m_groupObject->setUpdateObjects( false );
+ m_groupObject->setOrig( r.x(), r.y() );
+ m_groupObject->setSize( r.width(), r.height() );
+ m_page->insertObject( m_groupObject, position );
+ m_groupObject->addToObjList();
+ m_groupObject->setUpdateObjects( true );
+ m_groupObject->setSelected( true );
+ m_doc->refreshGroupButton();
+
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+KPrInsertCmd::KPrInsertCmd( const QString &name, const QValueList<KPrObject *> objects,
+ KPrDocument *doc, KPrPage *page )
+: KNamedCommand( name )
+, m_objects( objects )
+, m_object( 0 )
+, m_doc( doc )
+, m_page( page )
+{
+ QValueListConstIterator<KPrObject *> it( m_objects.begin() );
+ for ( ; it != m_objects.end(); ++it )
+ {
+ ( *it )->incCmdRef();
+ }
+}
+
+KPrInsertCmd::KPrInsertCmd( const QString &name, KPrObject *object,
+ KPrDocument *doc, KPrPage *page )
+: KNamedCommand( name )
+, m_object( object )
+, m_doc( doc )
+, m_page( page )
+{
+ m_object->incCmdRef();
+}
+
+KPrInsertCmd::~KPrInsertCmd()
+{
+ if ( m_object )
+ {
+ m_object->decCmdRef();
+ }
+ else
+ {
+ QValueListConstIterator<KPrObject *> it( m_objects.begin() );
+ for ( ; it != m_objects.end(); ++it )
+ {
+ ( *it )->decCmdRef();
+ }
+ }
+}
+
+void KPrInsertCmd::execute()
+{
+ if ( m_object )
+ {
+ m_page->appendObject( m_object );
+ m_object->addToObjList();
+ if ( m_object->getType() == OT_TEXT )
+ m_doc->updateRuler();
+ m_doc->repaint( m_object );
+ }
+ else
+ {
+ m_page->appendObjects( m_objects );
+ QValueListConstIterator<KPrObject *> it( m_objects.begin() );
+ bool updateRuler = false;
+ for ( ; it != m_objects.end(); ++it )
+ {
+ ( *it )->addToObjList();
+ if ( ( *it )->getType() == OT_TEXT )
+ updateRuler = true;
+ m_doc->repaint( *it );
+ }
+ if ( updateRuler )
+ m_doc->updateRuler();
+ }
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrInsertCmd::unexecute()
+{
+ if ( m_object )
+ {
+ QRect oldRect = m_doc->zoomHandler()->zoomRect( m_object->getRepaintRect() );
+ QPtrList<KPrObject> list(m_page->objectList());
+ if ( list.findRef( m_object ) != -1 ) {
+ m_page->takeObject( m_object );
+ m_object->removeFromObjList();
+ if ( m_object->getType() == OT_TEXT )
+ {
+ m_doc->terminateEditing( (KPrTextObject*)m_object );
+ ((KPrTextObject*)m_object)->setEditingTextObj( false );
+ m_doc->updateRuler();
+ }
+ }
+ m_doc->repaint( oldRect );
+ }
+ else
+ {
+ QPtrList<KPrObject> list(m_page->objectList());
+ bool updateRuler = false;
+
+ QValueListConstIterator<KPrObject *> it( m_objects.begin() );
+ for ( ; it != m_objects.end(); ++it )
+ {
+ if ( list.findRef( *it ) != -1 )
+ {
+ m_page->takeObject( *it );
+ ( *it )->removeFromObjList();
+ if ( ( *it )->getType() == OT_TEXT )
+ {
+ m_doc->terminateEditing( (KPrTextObject*)( *it ) );
+ ( (KPrTextObject*) *it )->setEditingTextObj( false );
+ updateRuler = true;
+ }
+ }
+ }
+ if ( updateRuler )
+ m_doc->updateRuler();
+
+ m_doc->repaint( false );
+ }
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+KPrLowerRaiseCmd::KPrLowerRaiseCmd( const QString &_name, const QPtrList<KPrObject>& _oldList,
+ const QPtrList<KPrObject>& _newList, KPrDocument *_doc,
+ KPrPage *_page )
+ : KNamedCommand( _name )
+{
+ oldList = _oldList;
+ newList = _newList;
+ m_page=_page;
+ oldList.setAutoDelete( false );
+ newList.setAutoDelete( false );
+ doc = _doc;
+
+ QPtrListIterator<KPrObject> it( oldList );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrLowerRaiseCmd::~KPrLowerRaiseCmd()
+{
+ QPtrListIterator<KPrObject> it( oldList );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+}
+
+void KPrLowerRaiseCmd::execute()
+{
+ m_page->setObjectList( newList );
+ doc->repaint( false );
+
+ doc->updateSideBarItem( m_page );
+}
+
+void KPrLowerRaiseCmd::unexecute()
+{
+ m_page->setObjectList( oldList );
+ doc->repaint( false );
+
+ doc->updateSideBarItem( m_page );
+}
+
+
+KPrMoveByCmd::KPrMoveByCmd( const QString &_name, const KoPoint &_diff, QPtrList<KPrObject> &_objects,
+ KPrDocument *_doc,KPrPage *_page )
+ : KNamedCommand( _name ), diff( _diff ), objects( _objects )
+{
+ objects.setAutoDelete( false );
+ doc = _doc;
+ m_page=_page;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->incCmdRef();
+ }
+}
+
+KPrMoveByCmd::~KPrMoveByCmd()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+}
+
+void KPrMoveByCmd::execute()
+{
+ QRect oldRect;
+
+ for ( unsigned int i = 0; i < objects.count(); i++ ) {
+ oldRect = doc->zoomHandler()->zoomRect( objects.at( i )->getRepaintRect() );
+ objects.at( i )->moveBy( diff );
+ if ( objects.at( i )->getType() == OT_TEXT )
+ {
+ if(objects.at(i)->isSelected())
+ doc->updateRuler();
+ }
+ doc->repaint( oldRect );
+ doc->repaint( objects.at( i ) );
+ }
+
+ doc->updateSideBarItem( m_page );
+ doc->updateObjectStatusBarItem();
+}
+
+void KPrMoveByCmd::unexecute()
+{
+ QRect oldRect;
+
+ for ( unsigned int i = 0; i < objects.count(); i++ ) {
+ oldRect = doc->zoomHandler()->zoomRect( objects.at( i )->getRepaintRect() );
+ objects.at( i )->moveBy( -diff.x(), -diff.y() );
+ if ( objects.at( i )->getType() == OT_TEXT )
+ {
+ if(objects.at(i)->isSelected())
+ doc->updateRuler();
+ }
+ doc->repaint( oldRect );
+ doc->repaint( objects.at( i ) );
+ }
+
+ doc->updateSideBarItem( m_page );
+ doc->updateObjectStatusBarItem();
+}
+
+KPrAlignCmd::KPrAlignCmd( const QString &_name, QPtrList<KPrObject> &_objects, AlignType _at, KPrDocument *_doc )
+ : KNamedCommand( _name ), doc(_doc)
+{
+ objects.setAutoDelete( false );
+ diffs.setAutoDelete( true );
+ m_page = doc->findPage( _objects );
+
+ QPtrListIterator<KPrObject> it( _objects );
+ KoRect boundingRect;
+ for ( ; it.current() ; ++it )
+ {
+ boundingRect |= it.current()->getRealRect();
+ }
+
+ if ( _objects.count() == 1 )
+ boundingRect = m_page->getPageRect();
+
+ it.toFirst();
+ for ( ; it.current() ; ++it )
+ {
+ KoPoint * diff = NULL;
+ switch ( _at )
+ {
+ case AT_LEFT:
+ diff = new KoPoint( boundingRect.x() - it.current()->getRealOrig().x(), 0 );
+ break;
+ case AT_TOP:
+ diff = new KoPoint( 0, boundingRect.y() - it.current()->getRealOrig().y() );
+ break;
+ case AT_RIGHT:
+ diff = new KoPoint( boundingRect.x() + boundingRect.width() -
+ it.current()->getRealOrig().x() - it.current()->getRealSize().width(), 0 );
+ break;
+ case AT_BOTTOM:
+ diff = new KoPoint( 0, boundingRect.y() + boundingRect.height() -
+ it.current()->getRealOrig().y() - it.current()->getRealSize().height() );
+ break;
+ case AT_HCENTER:
+ diff = new KoPoint( ( boundingRect.width() - it.current()->getRealSize().width() ) / 2 -
+ it.current()->getRealOrig().x() + boundingRect.x(), 0 );
+ break;
+ case AT_VCENTER:
+ diff = new KoPoint( 0, ( boundingRect.height() - it.current()->getRealSize().height() ) / 2 -
+ it.current()->getRealOrig().y() + boundingRect.y() );
+ break;
+ }
+ if ( diff )
+ {
+ objects.append( it.current() );
+ diffs.append( diff );
+ it.current()->incCmdRef();
+ }
+ }
+}
+
+KPrAlignCmd::~KPrAlignCmd()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+
+ diffs.clear();
+}
+
+void KPrAlignCmd::execute()
+{
+ QRect oldRect;
+
+ for ( unsigned int i = 0; i < objects.count(); i++ ) {
+ oldRect = doc->zoomHandler()->zoomRect( objects.at( i )->getRepaintRect() );
+ objects.at( i )->moveBy( *diffs.at( i ) );
+ if ( objects.at( i )->getType() == OT_TEXT )
+ {
+ if(objects.at(i)->isSelected())
+ doc->updateRuler();
+ }
+
+ doc->repaint( oldRect );
+ doc->repaint( objects.at( i ) );
+ }
+
+ doc->updateSideBarItem( m_page );
+}
+
+void KPrAlignCmd::unexecute()
+{
+ QRect oldRect;
+
+ for ( unsigned int i = 0; i < objects.count(); i++ ) {
+ oldRect = doc->zoomHandler()->zoomRect(objects.at( i )->getRepaintRect() );
+ objects.at( i )->moveBy( -diffs.at( i )->x(), -diffs.at( i )->y() );
+ if ( objects.at( i )->getType() == OT_TEXT )
+ {
+ if(objects.at(i)->isSelected())
+ doc->updateRuler();
+ }
+ doc->repaint( oldRect );
+ doc->repaint( objects.at( i ) );
+ doc->updateRuler();
+ }
+
+ doc->updateSideBarItem( m_page );
+}
+
+KoPenCmd::KoPenCmd( const QString &_name, QPtrList<KPrObject> &_objects, Pen _newPen,
+ KPrDocument *_doc, KPrPage *_page, int _flags )
+: KNamedCommand(_name), doc(_doc), m_page( _page ), newPen(_newPen), flags(_flags)
+{
+ objects.setAutoDelete( false );
+ oldPen.setAutoDelete( false );
+
+ addObjects( _objects );
+}
+
+KoPenCmd::~KoPenCmd()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+
+ oldPen.setAutoDelete( true );
+ oldPen.clear();
+}
+
+void KoPenCmd::execute()
+{
+ for ( int i = 0; i < static_cast<int>( objects.count() ); i++ )
+ {
+ Pen tmpPen = *oldPen.at( i );
+
+ if ( flags & LineBegin )
+ tmpPen.lineBegin = newPen.lineBegin;
+
+ if ( flags & LineEnd )
+ tmpPen.lineEnd = newPen.lineEnd;
+
+ if ( flags & Color )
+ tmpPen.pen.setColor( newPen.pen.color() );
+
+ if ( flags & Width )
+ tmpPen.pen.setPointWidth( newPen.pen.pointWidth() );
+
+ if ( flags & Style )
+ tmpPen.pen.setStyle( newPen.pen.style() );
+
+ applyPen( objects.at( i ), &tmpPen );
+ }
+
+ // this has to be called as the outline could have been changed so
+ // that the toolbar is updated correctly
+ doc->updateObjectSelected();
+ doc->updateSideBarItem( m_page );
+}
+
+void KoPenCmd::applyPen( KPrObject *object, Pen *tmpPen )
+{
+ switch (object->getType()) {
+ case OT_LINE:
+ {
+ KPrLineObject* obj=dynamic_cast<KPrLineObject*>( object );
+ if( obj )
+ {
+ //obj->setPen( tmpPen->pen );
+ obj->setLineBegin( tmpPen->lineBegin );
+ obj->setLineEnd( tmpPen->lineEnd );
+ //doc->repaint( obj );
+ }
+ } break;
+ case OT_FREEHAND:
+ case OT_POLYLINE:
+ case OT_QUADRICBEZIERCURVE:
+ case OT_CUBICBEZIERCURVE:
+ {
+ KPrPointObject *obj = dynamic_cast<KPrPointObject*>( object );
+ if ( obj )
+ {
+ //obj->setPen( tmpPen->pen );
+ obj->setLineBegin( tmpPen->lineBegin );
+ obj->setLineEnd( tmpPen->lineEnd );
+ //doc->repaint( obj );
+ }
+ } break;
+ case OT_PIE:
+ {
+ KPrPieObject *obj = dynamic_cast<KPrPieObject*>( object );
+ if ( obj )
+ {
+ obj->setLineBegin( tmpPen->lineBegin );
+ obj->setLineEnd( tmpPen->lineEnd );
+ }
+ } break;
+ case OT_AUTOFORM:
+ {
+ KPrAutoformObject *obj = dynamic_cast<KPrAutoformObject*>( object );
+ if ( obj )
+ {
+ obj->setLineBegin( tmpPen->lineBegin );
+ obj->setLineEnd( tmpPen->lineEnd );
+ }
+ } break;
+ default:
+ break;
+ }
+
+ KPrShadowObject *obj = dynamic_cast<KPrShadowObject*>( object );
+ if ( obj )
+ {
+ obj->setPen( tmpPen->pen );
+ doc->repaint( obj );
+ }
+}
+
+void KoPenCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < objects.count(); ++i ) {
+ if( oldPen.count() > i )
+ applyPen( objects.at( i ), oldPen.at( i ) );
+ }
+
+ // this has to be called as the outline could have been changed so
+ // that the toolbar is updated correctly
+ doc->updateObjectSelected();
+ doc->updateSideBarItem( m_page );
+}
+
+void KoPenCmd::addObjects( const QPtrList<KPrObject> &_objects )
+{
+ QPtrListIterator<KPrObject> it( _objects );
+ for ( ; it.current(); ++it )
+ {
+ KPrObject * object( it.current() );
+ if ( object->getType() == OT_GROUP )
+ {
+ KPrGroupObject * obj=dynamic_cast<KPrGroupObject*>( object );
+ if ( obj )
+ {
+ addObjects( obj->objectList() );
+ }
+ }
+ else
+ {
+ // tz TODO fix name
+ ::LineEnd lineBegin = L_NORMAL;
+ ::LineEnd lineEnd = L_NORMAL;
+ switch ( it.current()->getType() ) {
+ case OT_LINE:
+ {
+ KPrLineObject *obj=dynamic_cast<KPrLineObject*>( object );
+ if ( obj )
+ {
+ lineBegin = obj->getLineBegin();
+ lineEnd = obj->getLineEnd();
+ }
+ } break;
+ case OT_FREEHAND:
+ case OT_POLYLINE:
+ case OT_QUADRICBEZIERCURVE:
+ case OT_CUBICBEZIERCURVE:
+ {
+ KPrPointObject *obj = dynamic_cast<KPrPointObject*>( object );
+ if ( obj )
+ {
+ lineBegin = obj->getLineBegin();
+ lineEnd = obj->getLineEnd();
+ }
+ } break;
+ case OT_PIE:
+ {
+ KPrPieObject *obj = dynamic_cast<KPrPieObject*>( object );
+ if ( obj )
+ {
+ lineBegin = obj->getLineBegin();
+ lineEnd = obj->getLineEnd();
+ }
+ } break;
+ case OT_AUTOFORM:
+ {
+ KPrAutoformObject *obj = dynamic_cast<KPrAutoformObject*>( object );
+ if ( obj )
+ {
+ lineBegin = obj->getLineBegin();
+ lineEnd = obj->getLineEnd();
+ }
+ } break;
+ default:
+ break;
+ }
+
+ KPrShadowObject *obj = dynamic_cast<KPrShadowObject*>( object );
+ if ( obj )
+ {
+ objects.append( obj );
+ obj->incCmdRef();
+
+ Pen * pen = new KoPenCmd::Pen( obj->getPen(), lineBegin, lineEnd );
+
+ oldPen.append( pen );
+ }
+ }
+ }
+}
+
+
+KPrBrushCmd::KPrBrushCmd( const QString &_name, QPtrList<KPrObject> &_objects, Brush _newBrush,
+ KPrDocument *_doc, KPrPage *_page, int _flags )
+: KNamedCommand(_name), doc(_doc), newBrush(_newBrush), m_page(_page), flags(_flags)
+{
+ objects.setAutoDelete( false );
+ oldBrush.setAutoDelete( false );
+
+ addObjects( _objects );
+}
+
+void KPrBrushCmd::addObjects( const QPtrList<KPrObject> &_objects )
+{
+ QPtrListIterator<KPrObject> it( _objects );
+ for ( ; it.current(); ++it )
+ {
+ if ( it.current()->getType() == OT_GROUP )
+ {
+ KPrGroupObject * obj=dynamic_cast<KPrGroupObject*>( it.current() );
+ if ( obj )
+ {
+ addObjects( obj->objectList() );
+ }
+ }
+ else
+ {
+ KPr2DObject * obj = dynamic_cast<KPr2DObject *>( it.current() );
+ if( obj )
+ {
+ objects.append( obj );
+ obj->incCmdRef();
+
+ Brush * brush = new KPrBrushCmd::Brush;
+ brush->brush = obj->getBrush();
+ brush->fillType = obj->getFillType();
+ brush->gColor1 = obj->getGColor1();
+ brush->gColor2 = obj->getGColor2();
+ brush->gType = obj->getGType();
+ brush->unbalanced = obj->getGUnbalanced();
+ brush->xfactor = obj->getGXFactor();
+ brush->yfactor = obj->getGYFactor();
+
+ oldBrush.append( brush );
+ }
+ }
+ }
+}
+
+KPrBrushCmd::~KPrBrushCmd()
+{
+ QPtrListIterator<KPr2DObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+
+ oldBrush.setAutoDelete( true );
+ oldBrush.clear();
+}
+
+void KPrBrushCmd::execute()
+{
+ for ( int i = 0; i < static_cast<int>( objects.count() ); i++ )
+ {
+ Brush tmpBrush = *oldBrush.at( i );
+
+ if ( flags & BrushColor )
+ tmpBrush.brush.setColor( newBrush.brush.color() );
+
+ if ( flags & BrushStyle )
+ tmpBrush.brush.setStyle( newBrush.brush.style() );
+
+ if ( flags & BrushGradientSelect )
+ tmpBrush.fillType = newBrush.fillType;
+
+ if ( flags & GradientColor1 )
+ tmpBrush.gColor1 = newBrush.gColor1;
+
+ if ( flags & GradientColor2 )
+ tmpBrush.gColor2 = newBrush.gColor2;
+
+ if ( flags & GradientType )
+ tmpBrush.gType = newBrush.gType;
+
+ if ( flags & GradientBalanced )
+ tmpBrush.unbalanced = newBrush.unbalanced;
+
+ if ( flags & GradientXFactor )
+ tmpBrush.xfactor = newBrush.xfactor;
+
+ if ( flags & GradientYFactor )
+ tmpBrush.yfactor = newBrush.yfactor;
+
+ applyBrush( objects.at( i ), &tmpBrush );
+ }
+
+ doc->updateSideBarItem( m_page );
+}
+
+void KPrBrushCmd::applyBrush( KPr2DObject *object, Brush *tmpBrush )
+{
+ object->setBrush( tmpBrush->brush );
+ object->setFillType( tmpBrush->fillType );
+ object->setGColor1( tmpBrush->gColor1 );
+ object->setGColor2( tmpBrush->gColor2 );
+ object->setGType( tmpBrush->gType );
+ object->setGUnbalanced( tmpBrush->unbalanced );
+ object->setGXFactor( tmpBrush->xfactor );
+ object->setGYFactor( tmpBrush->yfactor );
+ doc->repaint( object );
+}
+
+void KPrBrushCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < objects.count(); i++ ) {
+ applyBrush( objects.at( i ), oldBrush.at( i ) );
+ }
+
+ doc->updateSideBarItem( m_page );
+}
+
+
+KPrPgConfCmd::KPrPgConfCmd( const QString &_name, bool _manualSwitch, bool _infiniteLoop,
+ bool _showEndOfPresentationSlide, bool _showPresentationDuration, QPen _pen,
+ QValueList<bool> _selectedSlides, const QString & _presentationName,
+ bool _oldManualSwitch, bool _oldInfiniteLoop,
+ bool _oldShowEndOfPresentationSlide, bool _oldShowPresentationDuration, QPen _oldPen,
+ QValueList<bool> _oldSelectedSlides, const QString & _oldPresentationName,
+ KPrDocument *_doc )
+ : KNamedCommand( _name )
+{
+ manualSwitch = _manualSwitch;
+ infiniteLoop = _infiniteLoop;
+ showEndOfPresentationSlide = _showEndOfPresentationSlide;
+ showPresentationDuration = _showPresentationDuration;
+ pen = _pen;
+ selectedSlides = _selectedSlides;
+ oldManualSwitch = _oldManualSwitch;
+ oldInfiniteLoop = _oldInfiniteLoop;
+ oldShowEndOfPresentationSlide = _oldShowEndOfPresentationSlide;
+ oldShowPresentationDuration = _oldShowPresentationDuration;
+ oldPen = _oldPen;
+ oldSelectedSlides = _oldSelectedSlides;
+ oldPresentationName = _oldPresentationName;
+ presentationName = _presentationName;
+ doc = _doc;
+}
+
+void KPrPgConfCmd::execute()
+{
+ doc->setManualSwitch( manualSwitch );
+ doc->setInfiniteLoop( infiniteLoop );
+ doc->setShowEndOfPresentationSlide ( showEndOfPresentationSlide );
+ doc->setPresentationDuration( showPresentationDuration );
+ doc->setPresPen( pen );
+ doc->setPresentationName( presentationName );
+ QPtrList<KPrPage> pages = doc->pageList();
+ unsigned count = selectedSlides.count();
+ if( count > pages.count() ) count = pages.count();
+ for( unsigned i = 0; i < selectedSlides.count(); i++ )
+ pages.at( i )->slideSelected( selectedSlides[ i ] );
+}
+
+void KPrPgConfCmd::unexecute()
+{
+ doc->setManualSwitch( oldManualSwitch );
+ doc->setInfiniteLoop( oldInfiniteLoop );
+ doc->setShowEndOfPresentationSlide( oldShowEndOfPresentationSlide );
+ doc->setPresentationDuration( oldShowPresentationDuration );
+ doc->setPresPen( oldPen );
+ doc->setPresentationName( oldPresentationName );
+
+ QPtrList<KPrPage> pages = doc->pageList();
+ unsigned count = oldSelectedSlides.count();
+ if( count > pages.count() ) count = pages.count();
+ for( unsigned i = 0; i < oldSelectedSlides.count(); i++ )
+ pages.at( i )->slideSelected( oldSelectedSlides[ i ] );
+}
+
+
+KPrTransEffectCmd::KPrTransEffectCmd( QValueVector<PageEffectSettings> oldSettings,
+ PageEffectSettings newSettings,
+ KPrPage* page, KPrDocument* doc )
+{
+ m_newSettings = newSettings;
+ m_oldSettings = oldSettings;
+ Q_ASSERT( !m_oldSettings.isEmpty() );
+ m_page = page;
+ m_doc = doc;
+}
+
+void KPrTransEffectCmd::PageEffectSettings::applyTo( KPrPage *page )
+{
+ page->setPageEffect( pageEffect );
+ page->setPageEffectSpeed( effectSpeed );
+ page->setPageSoundEffect( soundEffect );
+ page->setPageSoundFileName( soundFileName );
+ // TODO page->setAutoAdvance( autoAdvance );
+ page->setPageTimer( slideTime );
+}
+
+void KPrTransEffectCmd::execute()
+{
+ if ( m_page )
+ m_newSettings.applyTo( m_page );
+ else
+ for( QPtrListIterator<KPrPage> it( m_doc->getPageList() ); *it; ++it )
+ m_newSettings.applyTo( it.current() );
+}
+
+void KPrTransEffectCmd::unexecute()
+{
+ if ( m_page )
+ m_oldSettings[0].applyTo( m_page );
+ else {
+ int i = 0;
+ for( QPtrListIterator<KPrPage> it( m_doc->getPageList() ); *it; ++it, ++i )
+ m_oldSettings[i].applyTo( it.current() );
+ }
+}
+
+QString KPrTransEffectCmd::name() const
+{
+ if ( m_page )
+ return i18n( "Modify Slide Transition" );
+ else
+ return i18n( "Modify Slide Transition For All Pages" );
+}
+
+KPrPgLayoutCmd::KPrPgLayoutCmd( const QString &_name, KoPageLayout _layout, KoPageLayout _oldLayout,
+ KoUnit::Unit _oldUnit, KoUnit::Unit _unit,KPrDocument *_doc )
+ : KNamedCommand( _name )
+{
+ m_doc=_doc;
+ layout = _layout;
+ oldLayout = _oldLayout;
+ oldUnit = _oldUnit;
+ unit = _unit;
+}
+
+void KPrPgLayoutCmd::execute()
+{
+ m_doc->setUnit( unit );
+ m_doc->setPageLayout( layout );
+ m_doc->updateHeaderFooterPosition();
+ m_doc->updateRuler();
+ m_doc->updateRulerPageLayout();
+}
+
+void KPrPgLayoutCmd::unexecute()
+{
+ m_doc->setUnit( oldUnit );
+ m_doc->setPageLayout( oldLayout );
+ m_doc->updateHeaderFooterPosition();
+ m_doc->updateRuler();
+ m_doc->updateRulerPageLayout();
+}
+
+
+KPrPieValueCmd::KPrPieValueCmd( const QString &name, PieValues newValues,
+ QPtrList<KPrObject> &objects, KPrDocument *doc,
+ KPrPage *page, int flags )
+: KNamedCommand( name )
+, m_doc( doc )
+, m_page( page )
+, m_newValues( newValues )
+, m_flags( flags )
+{
+ m_objects.setAutoDelete( false );
+ m_oldValues.setAutoDelete( false );
+
+ addObjects( objects );
+}
+
+KPrPieValueCmd::KPrPieValueCmd( const QString &_name, QPtrList<PieValues> &_oldValues, PieValues _newValues,
+ QPtrList<KPrObject> &_objects, KPrDocument *_doc, KPrPage *_page, int _flags )
+ : KNamedCommand( _name ), m_oldValues( _oldValues ), m_objects( _objects ), m_flags(_flags)
+{
+ m_objects.setAutoDelete( false );
+ m_oldValues.setAutoDelete( false );
+ m_doc = _doc;
+ m_page = _page;
+ m_newValues = _newValues;
+
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrPieValueCmd::~KPrPieValueCmd()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+ m_oldValues.setAutoDelete( true );
+ m_oldValues.clear();
+}
+
+void KPrPieValueCmd::addObjects( const QPtrList<KPrObject> &objects )
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current(); ++it )
+ {
+ if ( it.current()->getType() == OT_GROUP )
+ {
+ KPrGroupObject * obj = dynamic_cast<KPrGroupObject*>( it.current() );
+ if ( obj )
+ {
+ addObjects( obj->objectList() );
+ }
+ }
+ else
+ {
+ KPrPieObject *obj = dynamic_cast<KPrPieObject*>( it.current() );
+ if( obj )
+ {
+ m_objects.append( obj );
+ obj->incCmdRef();
+
+ PieValues * pieValues = new PieValues;
+ pieValues->pieType = obj->getPieType();
+ pieValues->pieAngle = obj->getPieAngle();
+ pieValues->pieLength = obj->getPieLength();
+ m_oldValues.append( pieValues );
+ }
+ }
+ }
+}
+
+void KPrPieValueCmd::execute()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ {
+ KPrPieObject* obj=dynamic_cast<KPrPieObject*>( it.current() );
+ if(obj)
+ {
+ if (m_flags & Type)
+ obj->setPieType( m_newValues.pieType );
+ if (m_flags & Angle)
+ obj->setPieAngle( m_newValues.pieAngle );
+ if (m_flags & Length)
+ obj->setPieLength( m_newValues.pieLength );
+ }
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrPieValueCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < m_objects.count(); i++ )
+ {
+ KPrPieObject* obj=dynamic_cast<KPrPieObject*>( m_objects.at( i ) );
+ if(obj)
+ {
+ obj->setPieType( m_oldValues.at( i )->pieType );
+ obj->setPieAngle( m_oldValues.at( i )->pieAngle );
+ obj->setPieLength( m_oldValues.at( i )->pieLength );
+ }
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+
+KPrPolygonSettingCmd::KPrPolygonSettingCmd( const QString &name, PolygonSettings newSettings,
+ QPtrList<KPrObject> &objects, KPrDocument *doc,
+ KPrPage *page, int flags )
+: KNamedCommand( name )
+, m_doc( doc )
+, m_page( page )
+, m_newSettings( newSettings )
+, m_flags( flags )
+{
+ m_objects.setAutoDelete( false );
+ m_oldSettings.setAutoDelete( false );
+
+ addObjects( objects );
+}
+
+
+KPrPolygonSettingCmd::~KPrPolygonSettingCmd()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+ m_oldSettings.setAutoDelete( true );
+ m_oldSettings.clear();
+}
+
+void KPrPolygonSettingCmd::addObjects( const QPtrList<KPrObject> &objects )
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current(); ++it )
+ {
+ if ( it.current()->getType() == OT_GROUP )
+ {
+ KPrGroupObject * obj = dynamic_cast<KPrGroupObject*>( it.current() );
+ if ( obj )
+ {
+ addObjects( obj->objectList() );
+ }
+ }
+ else
+ {
+ KPrPolygonObject *obj = dynamic_cast<KPrPolygonObject*>( it.current() );
+ if( obj )
+ {
+ m_objects.append( obj );
+ obj->incCmdRef();
+
+ PolygonSettings * polygonSettings = new PolygonSettings;
+
+ polygonSettings->checkConcavePolygon = obj->getCheckConcavePolygon();
+ polygonSettings->cornersValue = obj->getCornersValue();
+ polygonSettings->sharpnessValue = obj->getSharpnessValue();
+
+ m_oldSettings.append( polygonSettings );
+ }
+ }
+ }
+}
+
+void KPrPolygonSettingCmd::execute()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ {
+ KPrPolygonObject * obj=dynamic_cast<KPrPolygonObject*>( it.current() );
+ if(obj)
+ {
+ if (m_flags & ConcaveConvex)
+ obj->setCheckConcavePolygon(m_newSettings.checkConcavePolygon);
+ if (m_flags & Corners)
+ obj->setCornersValue(m_newSettings.cornersValue);
+ if (m_flags & Sharpness)
+ obj->setSharpnessValue(m_newSettings.sharpnessValue );
+ }
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrPolygonSettingCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < m_objects.count(); ++i )
+ {
+ KPrPolygonObject * obj=dynamic_cast<KPrPolygonObject*>( m_objects.at(i) );
+ if(obj)
+ {
+ obj->setCheckConcavePolygon(m_oldSettings.at( i )->checkConcavePolygon);
+ obj->setCornersValue(m_oldSettings.at( i )->cornersValue);
+ obj->setSharpnessValue(m_oldSettings.at( i )->sharpnessValue);
+ }
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+
+KPrPictureSettingCmd::KPrPictureSettingCmd( const QString &name, PictureSettings newSettings,
+ QPtrList<KPrObject> &objects, KPrDocument *doc,
+ KPrPage *page, int flags )
+: KNamedCommand( name )
+, m_doc( doc )
+, m_newSettings( newSettings )
+, m_page( page )
+, m_flags( flags )
+{
+ m_objects.setAutoDelete( false );
+ m_oldValues.setAutoDelete( false );
+
+ addObjects( objects );
+}
+
+KPrPictureSettingCmd::KPrPictureSettingCmd( const QString &_name, QPtrList<PictureSettings> &_oldSettings,
+ PictureSettings _newSettings, QPtrList<KPrObject> &_objects,
+ KPrDocument *_doc, int flags )
+ : KNamedCommand( _name ), m_oldValues( _oldSettings ), m_objects( _objects ), m_flags( flags )
+{
+ m_objects.setAutoDelete( false );
+ m_oldValues.setAutoDelete( false );
+ m_doc = _doc;
+ m_newSettings = _newSettings;
+
+ m_page = m_doc->findPage( m_objects );
+
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrPictureSettingCmd::~KPrPictureSettingCmd()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+ m_oldValues.setAutoDelete( true );
+ m_oldValues.clear();
+}
+
+void KPrPictureSettingCmd::addObjects( const QPtrList<KPrObject> &objects )
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current(); ++it )
+ {
+ if ( it.current()->getType() == OT_GROUP )
+ {
+ KPrGroupObject * obj = dynamic_cast<KPrGroupObject*>( it.current() );
+ if ( obj )
+ {
+ addObjects( obj->objectList() );
+ }
+ }
+ else
+ {
+ KPrPixmapObject *obj = dynamic_cast<KPrPixmapObject*>( it.current() );
+ if( obj )
+ {
+ m_objects.append( obj );
+ obj->incCmdRef();
+
+ PictureSettings * pictureSettings = new PictureSettings;
+
+ pictureSettings->mirrorType = obj->getPictureMirrorType();
+ pictureSettings->depth = obj->getPictureDepth();
+ pictureSettings->swapRGB = obj->getPictureSwapRGB();
+ pictureSettings->grayscal = obj->getPictureGrayscal();
+ pictureSettings->bright = obj->getPictureBright();
+
+ m_oldValues.append( pictureSettings );
+ }
+ }
+ }
+}
+
+void KPrPictureSettingCmd::execute()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it ) {
+ KPrPixmapObject * obj = dynamic_cast<KPrPixmapObject*>( it.current() );
+ if ( obj ) {
+ if ( m_flags & MirrorType )
+ obj->setPictureMirrorType( m_newSettings.mirrorType );
+ if ( m_flags & Depth )
+ obj->setPictureDepth( m_newSettings.depth );
+ if ( m_flags & SwapRGB )
+ obj->setPictureSwapRGB( m_newSettings.swapRGB );
+ if ( m_flags & Grayscal )
+ obj->setPictureGrayscal( m_newSettings.grayscal );
+ if ( m_flags & Bright )
+ obj->setPictureBright( m_newSettings.bright );
+ }
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrPictureSettingCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < m_objects.count(); ++i ) {
+ KPrPixmapObject * obj = dynamic_cast<KPrPixmapObject*>( m_objects.at(i) );
+ if ( obj ) {
+ PictureSettings *pictureSettings = m_oldValues.at( i );
+ obj->setPictureMirrorType( pictureSettings->mirrorType );
+ obj->setPictureDepth( pictureSettings->depth );
+ obj->setPictureSwapRGB( pictureSettings->swapRGB );
+ obj->setPictureGrayscal( pictureSettings->grayscal );
+ obj->setPictureBright( pictureSettings->bright );
+ }
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+
+KPrRectValueCmd::KPrRectValueCmd( const QString &_name, QPtrList<RectValues> &_oldValues, RectValues _newValues,
+ QPtrList<KPrObject> &_objects, KPrDocument *_doc, KPrPage *_page, int _flags )
+ : KNamedCommand( _name ), m_oldValues( _oldValues ), m_objects( _objects ), m_flags(_flags)
+{
+ m_objects.setAutoDelete( false );
+ m_oldValues.setAutoDelete( false );
+ m_doc = _doc;
+ m_page = _page;
+ m_newValues = _newValues;
+
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+
+KPrRectValueCmd::KPrRectValueCmd( const QString &name, QPtrList<KPrObject> &objects, RectValues newValues,
+ KPrDocument *doc, KPrPage *page, int flags )
+: KNamedCommand( name )
+, m_doc( doc )
+, m_page( page )
+, m_newValues( newValues )
+, m_flags( flags )
+{
+ m_objects.setAutoDelete( false );
+ m_oldValues.setAutoDelete( false );
+
+ addObjects( objects );
+}
+
+
+KPrRectValueCmd::~KPrRectValueCmd()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+
+ m_oldValues.setAutoDelete( true );
+ m_oldValues.clear();
+}
+
+
+void KPrRectValueCmd::addObjects( const QPtrList<KPrObject> &objects )
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current(); ++it )
+ {
+ if ( it.current()->getType() == OT_GROUP )
+ {
+ KPrGroupObject * obj = dynamic_cast<KPrGroupObject*>( it.current() );
+ if ( obj )
+ {
+ addObjects( obj->objectList() );
+ }
+ }
+ else
+ {
+ KPrRectObject *obj = dynamic_cast<KPrRectObject*>( it.current() );
+ if( obj )
+ {
+ m_objects.append( obj );
+ obj->incCmdRef();
+
+ RectValues * rectValue = new RectValues;
+
+ int xtmp, ytmp;
+ obj->getRnds( xtmp, ytmp );
+ rectValue->xRnd = xtmp;
+ rectValue->yRnd = ytmp;
+
+ m_oldValues.append( rectValue );
+ }
+ }
+ }
+}
+
+
+void KPrRectValueCmd::execute()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ {
+ KPrRectObject *obj = dynamic_cast<KPrRectObject*>( it.current() );
+ if( obj )
+ {
+ int xtmp, ytmp;
+ obj->getRnds( xtmp, ytmp );
+
+ if ( m_flags & XRnd )
+ {
+ xtmp = m_newValues.xRnd;
+ }
+
+ if ( m_flags & YRnd )
+ {
+ ytmp = m_newValues.yRnd;
+ }
+
+ obj->setRnds( xtmp, ytmp );
+ }
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrRectValueCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < m_objects.count(); i++ )
+ {
+ KPrRectObject *obj = dynamic_cast<KPrRectObject*>( m_objects.at( i ) );
+
+ if( obj )
+ obj->setRnds( m_oldValues.at( i )->xRnd, m_oldValues.at( i )->yRnd );
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+
+KPrResizeCmd::KPrResizeCmd( const QString &_name, const KoPoint &_m_diff, const KoSize &_r_diff,
+ KPrObject *_object, KPrDocument *_doc )
+ : KNamedCommand( _name ), m_diff( _m_diff ), r_diff( _r_diff )
+{
+ object = _object;
+ doc = _doc;
+ m_page = doc->findPage( object );
+
+ object->incCmdRef();
+}
+
+KPrResizeCmd::~KPrResizeCmd()
+{
+ object->decCmdRef();
+}
+
+void KPrResizeCmd::execute()
+{
+ QRect oldRect;
+
+ oldRect = doc->zoomHandler()->zoomRect( object->getRepaintRect() );
+ object->moveBy( m_diff );
+ object->resizeBy( r_diff );
+ if ( object->getType() == OT_TEXT )
+ {
+ if(object->isSelected())
+ doc->updateRuler();
+ doc->layout( object );
+ }
+ if ( object->isSelected())
+ doc->updateObjectStatusBarItem();
+ doc->repaint( oldRect );
+ doc->repaint( object );
+
+ doc->updateSideBarItem( m_page );
+}
+
+void KPrResizeCmd::unexecute()
+{
+ QRect oldRect;
+
+ oldRect = doc->zoomHandler()->zoomRect( object->getRepaintRect() );
+ object->moveBy( -m_diff.x(), -m_diff.y() );
+ object->resizeBy( -r_diff.width(), -r_diff.height() );
+ if ( object->getType() == OT_TEXT )
+ {
+ if(object->isSelected())
+ doc->updateRuler();
+ doc->layout( object );
+ }
+ if ( object->isSelected())
+ doc->updateObjectStatusBarItem();
+
+ doc->repaint( oldRect );
+ doc->repaint( object );
+
+ doc->updateSideBarItem( m_page );
+}
+
+
+KPrOasisPasteTextCommand::KPrOasisPasteTextCommand( KoTextDocument *d, int parag, int idx,
+ const QByteArray &data )
+ : KoTextDocCommand( d ), m_parag( parag ), m_idx( idx ), m_data( data ), m_oldParagLayout( 0 )
+{
+}
+
+KoTextCursor * KPrOasisPasteTextCommand::execute( KoTextCursor *c )
+{
+ KoTextParag *firstParag = doc->paragAt( m_parag );
+ if ( !firstParag ) {
+ qWarning( "can't locate parag at %d, last parag: %d", m_parag, doc->lastParag()->paragId() );
+ return 0;
+ }
+ //kdDebug() << "KWOasisPasteCommand::execute m_parag=" << m_parag << " m_idx=" << m_idx
+ // << " firstParag=" << firstParag << " " << firstParag->paragId() << endl;
+ cursor.setParag( firstParag );
+ cursor.setIndex( m_idx );
+ c->setParag( firstParag );
+ c->setIndex( m_idx );
+
+ QBuffer buffer( m_data );
+ KoStore * store = KoStore::createStore( &buffer, KoStore::Read );
+
+ if ( store->bad() || !store->hasFile( "content.xml" ) )
+ {
+ kdError(33001) << "Invalid ZIP store in memory" << endl;
+ if ( !store->hasFile( "content.xml" ) )
+ kdError(33001) << "No content.xml file" << endl;
+ return c;
+ }
+ store->disallowNameExpansion();
+
+ KoOasisStore oasisStore( store );
+ QDomDocument contentDoc;
+ QString errorMessage;
+ bool ok = oasisStore.loadAndParse( "content.xml", contentDoc, errorMessage );
+ if ( !ok ) {
+ kdError(33001) << "Error parsing content.xml: " << errorMessage << endl;
+ return c;
+ }
+
+ KoOasisStyles oasisStyles;
+ QDomDocument stylesDoc;
+ (void)oasisStore.loadAndParse( "styles.xml", stylesDoc, errorMessage );
+ // Load styles from style.xml
+ oasisStyles.createStyleMap( stylesDoc, true );
+ // Also load styles from content.xml
+ oasisStyles.createStyleMap( contentDoc, false );
+
+ QDomElement content = contentDoc.documentElement();
+
+ QDomElement body ( KoDom::namedItemNS( content, KoXmlNS::office, "body" ) );
+
+ // We then want to use whichever element is the child of <office:body>,
+ // whether that's <office:text> or <office:presentation> or whatever.
+ QDomElement iter, realBody;
+ forEachElement( iter, body ) {
+ realBody = iter;
+ }
+ if ( realBody.isNull() ) {
+ kdError(33001) << "No element found inside office:body!" << endl;
+ return c;
+ }
+
+ KPrTextDocument * textdoc = static_cast<KPrTextDocument *>(c->parag()->document());
+ KPrDocument *doc = textdoc->textObject()->kPresenterDocument();
+ KoOasisContext context( doc, *doc->getVariableCollection(), oasisStyles, store );
+
+ *c = textdoc->textObject()->textObject()->pasteOasisText( realBody, context, cursor, doc->styleCollection() );
+ textdoc->textObject()->textObject()->setNeedSpellCheck( true );
+
+ m_lastParag = c->parag()->paragId();
+ m_lastIndex = c->index();
+ return c;
+}
+
+KoTextCursor * KPrOasisPasteTextCommand::unexecute( KoTextCursor *c )
+{
+ KoTextParag *firstParag = doc->paragAt( m_parag );
+ if ( !firstParag ) {
+ qWarning( "can't locate parag at %d, last parag: %d", m_parag, doc->lastParag()->paragId() );
+ return 0;
+ }
+ cursor.setParag( firstParag );
+ cursor.setIndex( m_idx );
+ doc->setSelectionStart( KoTextDocument::Temp, &cursor );
+
+ KoTextParag *lastParag = doc->paragAt( m_lastParag );
+ if ( !lastParag ) {
+ qWarning( "can't locate parag at %d, last parag: %d", m_lastParag, doc->lastParag()->paragId() );
+ return 0;
+ }
+ //Q_ASSERT( lastParag->document() );
+ // Get hold of the document before deleting the parag
+ //KoTextDocument* textdoc = lastParag->document();
+
+ //kdDebug() << "Undoing paste: deleting from (" << firstParag->paragId() << "," << m_idx << ")"
+ // << " to (" << lastParag->paragId() << "," << m_lastIndex << ")" << endl;
+
+ cursor.setParag( lastParag );
+ cursor.setIndex( m_lastIndex );
+ doc->setSelectionEnd( KoTextDocument::Temp, &cursor );
+ doc->removeSelectedText( KoTextDocument::Temp, c /* sets c to the correct position */ );
+
+ if ( m_idx == 0 ) {
+ Q_ASSERT( m_oldParagLayout );
+ if ( m_oldParagLayout )
+ firstParag->setParagLayout( *m_oldParagLayout );
+ }
+ return c;
+}
+
+
+KPrChangeStartingPageCommand::KPrChangeStartingPageCommand( const QString &name, KPrDocument *_doc,
+ int _oldStartingPage, int _newStartingPage):
+ KNamedCommand(name),
+ m_doc(_doc),
+ oldStartingPage(_oldStartingPage),
+ newStartingPage(_newStartingPage)
+{
+}
+
+void KPrChangeStartingPageCommand::execute()
+{
+ m_doc->getVariableCollection()->variableSetting()->setStartingPageNumber(newStartingPage);
+ m_doc->recalcVariables( VT_PGNUM );
+}
+
+void KPrChangeStartingPageCommand::unexecute()
+{
+ m_doc->getVariableCollection()->variableSetting()->setStartingPageNumber(oldStartingPage);
+ m_doc->recalcVariables( VT_PGNUM );
+}
+
+
+KPrChangeVariableSettingsCommand::KPrChangeVariableSettingsCommand( const QString &name, KPrDocument *_doc,
+ bool _oldValue, bool _newValue,
+ VariableProperties _type):
+ KNamedCommand(name),
+ m_doc(_doc),
+ type(_type),
+ m_bOldValue(_oldValue),
+ m_bNewValue(_newValue)
+{
+}
+
+void KPrChangeVariableSettingsCommand::changeValue( bool b )
+{
+ switch(type)
+ {
+ case VS_DISPLAYLINK:
+ m_doc->getVariableCollection()->variableSetting()->setDisplayLink(b);
+ m_doc->recalcVariables( VT_LINK );
+ break;
+ case VS_UNDERLINELINK:
+ m_doc->getVariableCollection()->variableSetting()->setUnderlineLink(b);
+ m_doc->recalcVariables( VT_LINK );
+ break;
+ case VS_DISPLAYCOMMENT:
+ m_doc->getVariableCollection()->variableSetting()->setDisplayComment(b);
+ m_doc->recalcVariables( VT_NOTE );
+ break;
+ case VS_DISPLAYFIELDCODE:
+ m_doc->getVariableCollection()->variableSetting()->setDisplayFieldCode(b);
+ m_doc->recalcVariables( VT_ALL );
+ break;
+ }
+}
+
+void KPrChangeVariableSettingsCommand::execute()
+{
+ changeValue(m_bNewValue);
+}
+
+void KPrChangeVariableSettingsCommand::unexecute()
+{
+ changeValue(m_bOldValue);
+}
+
+KPrDeletePageCmd::KPrDeletePageCmd( const QString &name, int pageNum, KPrDocument *doc )
+: KNamedCommand( name )
+, m_doc( doc )
+, m_pageNum( pageNum )
+{
+ m_page = m_doc->pageList().at( m_pageNum );
+}
+
+KPrDeletePageCmd::~KPrDeletePageCmd()
+{
+}
+
+void KPrDeletePageCmd::execute()
+{
+ m_doc->deSelectAllObj();
+ m_doc->takePage( m_page, QMAX( m_pageNum - 1, 0 ) );
+ m_doc->updatePresentationButton();
+}
+
+void KPrDeletePageCmd::unexecute()
+{
+ m_doc->deSelectAllObj();
+ m_doc->insertPage( m_page, QMAX( m_pageNum - 1, 0 ), m_pageNum );
+ m_doc->updatePresentationButton();
+}
+
+KPrInsertPageCmd::KPrInsertPageCmd( const QString &name, int pageNum, InsertPos pos,
+ KPrPage *page, KPrDocument *doc )
+: KNamedCommand(name)
+, m_doc( doc )
+, m_page( page )
+, m_currentPageNum( pageNum )
+, m_insertPageNum( 0 )
+{
+ switch( pos )
+ {
+ case IP_BEFORE:
+ m_insertPageNum = m_currentPageNum;
+ break;
+ case IP_AFTER:
+ m_insertPageNum = m_currentPageNum + 1;
+ break;
+ }
+}
+
+KPrInsertPageCmd::~KPrInsertPageCmd()
+{
+}
+
+void KPrInsertPageCmd::execute()
+{
+ m_doc->deSelectAllObj();
+ m_doc->insertPage( m_page, m_currentPageNum, m_insertPageNum );
+ m_page->completeLoading( false, -1 );
+ m_doc->updatePresentationButton();
+}
+
+void KPrInsertPageCmd::unexecute()
+{
+ m_doc->deSelectAllObj();
+ m_doc->takePage( m_page, m_currentPageNum );
+ m_doc->updatePresentationButton();
+}
+
+KPrMovePageCmd::KPrMovePageCmd( const QString &_name,int from, int to, KPrDocument *_doc ) :
+ KNamedCommand( _name ),
+ m_doc( _doc ),
+ m_oldPosition( from ),
+ m_newPosition( to )
+{
+}
+
+KPrMovePageCmd::~KPrMovePageCmd()
+{
+}
+
+void KPrMovePageCmd::execute()
+{
+ m_doc->deSelectAllObj();
+ m_doc->movePageTo( m_oldPosition, m_newPosition );
+}
+
+void KPrMovePageCmd::unexecute()
+{
+ m_doc->deSelectAllObj();
+ m_doc->movePageTo( m_newPosition, m_oldPosition );
+}
+
+
+KPrChangeTitlePageNameCommand::KPrChangeTitlePageNameCommand( const QString &_name,KPrDocument *_doc,
+ const QString &_oldPageName,
+ const QString &_newPageName, KPrPage *_page ) :
+ KNamedCommand(_name),
+ m_doc(_doc),
+ oldPageName(_oldPageName),
+ newPageName(_newPageName),
+ m_page(_page)
+{
+}
+
+void KPrChangeTitlePageNameCommand::execute()
+{
+ m_page->insertManualTitle(newPageName);
+ m_doc->updateSideBarItem( m_page );
+ m_doc->recalcVariables( VT_PGNUM );
+}
+
+void KPrChangeTitlePageNameCommand::unexecute()
+{
+ m_page->insertManualTitle(oldPageName);
+ m_doc->updateSideBarItem( m_page );
+ m_doc->recalcVariables( VT_PGNUM );
+}
+
+KPrChangeCustomVariableValue::KPrChangeCustomVariableValue( const QString &name, KPrDocument *_doc,
+ const QString & _oldValue, const QString & _newValue,
+ KoCustomVariable *var):
+ KNamedCommand(name),
+ m_doc(_doc),
+ newValue(_newValue),
+ oldValue(_oldValue),
+ m_var(var)
+{
+}
+
+void KPrChangeCustomVariableValue::execute()
+{
+ Q_ASSERT(m_var);
+ m_var->setValue(newValue);
+ m_doc->recalcVariables( VT_CUSTOM );
+}
+
+void KPrChangeCustomVariableValue::unexecute()
+{
+ Q_ASSERT(m_var);
+ m_var->setValue(oldValue);
+ m_doc->recalcVariables( VT_CUSTOM );
+}
+
+KPrChangeLinkVariable::KPrChangeLinkVariable( const QString &name, KPrDocument *_doc,
+ const QString & _oldHref, const QString & _newHref,
+ const QString & _oldLink,const QString &_newLink,
+ KoLinkVariable *var):
+ KNamedCommand(name),
+ m_doc(_doc),
+ oldHref(_oldHref),
+ newHref(_newHref),
+ oldLink(_oldLink),
+ newLink(_newLink),
+ m_var(var)
+{
+}
+
+
+void KPrChangeLinkVariable::execute()
+{
+ m_var->setLink(newLink,newHref);
+ m_doc->recalcVariables(VT_LINK);
+}
+
+void KPrChangeLinkVariable::unexecute()
+{
+ m_var->setLink(oldLink,oldHref);
+ m_doc->recalcVariables(VT_LINK);
+}
+
+
+KPrNameObjectCommand::KPrNameObjectCommand( const QString &_name, const QString &_objectName,
+ KPrObject *_obj, KPrDocument *_doc ):
+ KNamedCommand( _name ),
+ newObjectName( _objectName ),
+ object( _obj ),
+ doc( _doc )
+{
+ oldObjectName = object->getObjectName();
+
+ m_page = doc->findPage( object );
+}
+
+KPrNameObjectCommand::~KPrNameObjectCommand()
+{
+}
+
+void KPrNameObjectCommand::execute()
+{
+ object->setObjectName( newObjectName );
+ m_page->unifyObjectName( object );
+
+ doc->updateSideBarItem( m_page );
+}
+
+void KPrNameObjectCommand::unexecute()
+{
+ object->setObjectName( oldObjectName );
+
+ doc->updateSideBarItem( m_page );
+}
+
+KPrDisplayObjectFromMasterPage::KPrDisplayObjectFromMasterPage(const QString &name, KPrDocument *_doc, KPrPage *_page, bool _newValue)
+ :KNamedCommand(name),
+ m_doc( _doc ),
+ m_page(_page),
+ newValue(_newValue)
+{
+}
+
+void KPrDisplayObjectFromMasterPage::execute()
+{
+ m_page->setDisplayObjectFromMasterPage( newValue );
+ m_doc->updateSideBarItem( m_doc->masterPage() );
+}
+
+void KPrDisplayObjectFromMasterPage::unexecute()
+{
+ m_page->setDisplayObjectFromMasterPage( !newValue );
+ m_doc->updateSideBarItem( m_doc->masterPage() );
+}
+
+
+KPrDisplayBackgroundPage::KPrDisplayBackgroundPage(const QString &name, KPrDocument *_doc, KPrPage *_page, bool _newValue)
+ :KNamedCommand(name),
+ m_doc( _doc ),
+ m_page(_page),
+ newValue(_newValue)
+{
+}
+
+void KPrDisplayBackgroundPage::execute()
+{
+ m_page->setDisplayBackground( newValue );
+ m_doc->updateSideBarItem( m_doc->masterPage() );
+}
+
+void KPrDisplayBackgroundPage::unexecute()
+{
+ m_page->setDisplayBackground( !newValue );
+ m_doc->updateSideBarItem( m_doc->masterPage() );
+}
+
+
+KPrHideShowHeaderFooter::KPrHideShowHeaderFooter( const QString &name, KPrDocument *_doc, KPrPage *_page,
+ bool _newValue, KPrTextObject *_textObject):
+ KNamedCommand(name),
+ m_doc( _doc ),
+ m_page(_page),
+ m_textObject(_textObject),
+ newValue(_newValue)
+{
+}
+
+
+void KPrHideShowHeaderFooter::execute()
+{
+ if( m_textObject==m_doc->footer())
+ m_page->setFooter( newValue );
+ else if( m_textObject==m_doc->header())
+ m_page->setHeader( newValue );
+ else
+ kdDebug(33001)<<"Error in void KPrHideShowHeaderFooter::execute()\n";
+
+ m_doc->updateSideBarItem( m_doc->masterPage() );
+}
+
+void KPrHideShowHeaderFooter::unexecute()
+{
+ if( m_textObject==m_doc->footer())
+ m_page->setFooter( !newValue );
+ else if( m_textObject==m_doc->header())
+ m_page->setHeader( !newValue );
+ else
+ kdDebug(33001)<<"Error in void KPrHideShowHeaderFooter::unexecute()\n";
+
+ m_doc->updateSideBarItem( m_doc->masterPage() );
+}
+
+KPrFlipObjectCommand::KPrFlipObjectCommand( const QString &name, KPrDocument *_doc,
+ bool _horizontal, QPtrList<KPrObject> &_objects ):
+ KNamedCommand( name ),
+ m_doc( _doc ),
+ objects( _objects ),
+ horizontal( _horizontal )
+{
+ objects.setAutoDelete( false );
+
+ m_page = m_doc->findPage( objects );
+
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrFlipObjectCommand::~KPrFlipObjectCommand()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+}
+
+void KPrFlipObjectCommand::execute()
+{
+ flipObjects();
+}
+
+void KPrFlipObjectCommand::unexecute()
+{
+ flipObjects();
+}
+
+void KPrFlipObjectCommand::flipObjects()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->flip( horizontal );
+ m_doc->repaint( it.current() );
+ }
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+
+KPrGeometryPropertiesCommand::KPrGeometryPropertiesCommand( const QString &name, QPtrList<KPrObject> &objects,
+ bool newValue, KgpType type,KPrDocument *_doc )
+: KNamedCommand( name )
+, m_objects( objects )
+, m_newValue( newValue )
+, m_type( type )
+ , m_doc( _doc )
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->incCmdRef();
+ if ( m_type == ProtectSize )
+ m_oldValue.append( it.current()->isProtect() );
+ else if ( m_type == KeepRatio)
+ m_oldValue.append( it.current()->isKeepRatio() );
+ }
+}
+
+KPrGeometryPropertiesCommand::KPrGeometryPropertiesCommand( const QString &name, QValueList<bool> &lst,
+ QPtrList<KPrObject> &objects, bool newValue,
+ KgpType type, KPrDocument *_doc)
+: KNamedCommand( name )
+, m_oldValue( lst )
+, m_objects( objects )
+, m_newValue( newValue )
+, m_type( type )
+, m_doc ( _doc )
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrGeometryPropertiesCommand::~KPrGeometryPropertiesCommand()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+}
+
+void KPrGeometryPropertiesCommand::execute()
+{
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ {
+ if ( m_type == ProtectSize )
+ {
+ it.current()->setProtect( m_newValue );
+ if ( it.current()->isSelected() )
+ m_doc->repaint( it.current() );
+ }
+ else if ( m_type == KeepRatio)
+ it.current()->setKeepRatio( m_newValue );
+ }
+}
+
+void KPrGeometryPropertiesCommand::unexecute()
+{
+ KPrObject *obj = 0;
+ for ( unsigned int i = 0; i < m_objects.count(); ++i ) {
+ obj = m_objects.at( i );
+ if ( m_type == ProtectSize )
+ {
+ obj->setProtect( *m_oldValue.at(i) );
+ if ( obj->isSelected() )
+ m_doc->repaint( obj );
+ }
+ else if ( m_type == KeepRatio)
+ obj->setKeepRatio( *m_oldValue.at(i) );
+ }
+}
+
+KPrProtectContentCommand::KPrProtectContentCommand( const QString &name, QPtrList<KPrObject> &objects,
+ bool protectContent, KPrDocument *doc )
+: KNamedCommand( name )
+, m_protectContent( protectContent )
+, m_doc( doc )
+{
+ m_objects.setAutoDelete( false );
+
+ addObjects( objects );
+}
+
+KPrProtectContentCommand::KPrProtectContentCommand( const QString &name, bool protectContent,
+ KPrTextObject *obj, KPrDocument *doc )
+: KNamedCommand( name )
+, m_protectContent( protectContent )
+, m_doc( doc )
+{
+ obj->incCmdRef();
+ m_objects.append( obj );
+ m_oldValues.append( obj->isProtectContent() );
+}
+
+KPrProtectContentCommand::~KPrProtectContentCommand()
+{
+ QPtrListIterator<KPrTextObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+}
+
+void KPrProtectContentCommand::addObjects( const QPtrList<KPrObject> &objects )
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current(); ++it )
+ {
+ if ( it.current()->getType() == OT_GROUP )
+ {
+ KPrGroupObject * obj = dynamic_cast<KPrGroupObject*>( it.current() );
+ if ( obj )
+ {
+ addObjects( obj->objectList() );
+ }
+ }
+ else
+ {
+ KPrTextObject *obj = dynamic_cast<KPrTextObject*>( it.current() );
+ if( obj )
+ {
+ m_objects.append( obj );
+ obj->incCmdRef();
+
+ m_oldValues.append( obj->isProtectContent() );
+ }
+ }
+ }
+}
+
+void KPrProtectContentCommand::execute()
+{
+ QPtrListIterator<KPrTextObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->setProtectContent( m_protectContent );
+ }
+ m_doc->updateObjectSelected();
+ m_doc->updateRulerInProtectContentMode();
+
+}
+
+void KPrProtectContentCommand::unexecute()
+{
+ for ( unsigned int i = 0; i < m_objects.count(); i++ )
+ {
+ m_objects.at( i )->setProtectContent( m_oldValues[i] );
+ }
+ m_doc->updateObjectSelected();
+ m_doc->updateRulerInProtectContentMode();
+}
+
+KPrCloseObjectCommand::KPrCloseObjectCommand( const QString &name, QPtrList<KPrObject> objects, KPrDocument *doc )
+: KNamedCommand( name )
+, m_doc( doc )
+, m_page( doc->findPage( objects.at( 0 ) ) )
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current(); ++it )
+ {
+ KPrPointObject * pointObject = dynamic_cast<KPrPointObject *>( *it );
+ if ( pointObject )
+ {
+ m_openObjects.append( *it );
+ ( *it )->incCmdRef();
+ KPrClosedLineObject * closedObject = new KPrClosedLineObject( *pointObject );
+ closedObject->incCmdRef();
+ m_closedObjects.append( closedObject );
+ }
+ }
+}
+
+KPrCloseObjectCommand::~KPrCloseObjectCommand()
+{
+ QPtrListIterator<KPrObject> it( m_openObjects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+ QPtrListIterator<KPrObject> it2( m_closedObjects );
+ for ( ; it2.current() ; ++it2 )
+ it2.current()->decCmdRef();
+}
+
+void KPrCloseObjectCommand::execute()
+{
+ QPtrListIterator<KPrObject> openIt( m_openObjects );
+ QPtrListIterator<KPrObject> closeIt( m_closedObjects );
+ for ( ; openIt.current() ; ++openIt, ++closeIt )
+ {
+ m_page->replaceObject( *openIt, *closeIt );
+ bool selected = ( *openIt )->isSelected();
+ ( *openIt )->removeFromObjList();
+ ( *closeIt )->addToObjList();
+ ( *openIt )->setSelected( false );
+ ( *closeIt )->setSelected( selected );
+ m_doc->repaint( *closeIt );
+ }
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrCloseObjectCommand::unexecute()
+{
+ QPtrListIterator<KPrObject> openIt( m_openObjects );
+ QPtrListIterator<KPrObject> closeIt( m_closedObjects );
+ for ( ; openIt.current() ; ++openIt, ++closeIt )
+ {
+ m_page->replaceObject( *closeIt, *openIt );
+ bool selected = ( *closeIt )->isSelected();
+ ( *closeIt )->removeFromObjList();
+ ( *openIt )->addToObjList();
+ ( *closeIt )->setSelected( false );
+ ( *openIt )->setSelected( selected );
+ m_doc->repaint( *openIt );
+ }
+ m_doc->updateSideBarItem( m_page );
+}
+
+MarginsStruct::MarginsStruct( KPrTextObject *obj )
+{
+ topMargin = obj->bTop();
+ bottomMargin= obj->bBottom();
+ leftMargin = obj->bLeft();
+ rightMargin= obj->bRight();
+}
+
+MarginsStruct::MarginsStruct( double _left, double _top, double _right, double _bottom ):
+ topMargin(_top),
+ bottomMargin(_bottom),
+ leftMargin(_left),
+ rightMargin(_right)
+{
+}
+
+
+KPrChangeMarginCommand::KPrChangeMarginCommand( const QString &name, QPtrList<KPrObject> &objects,
+ MarginsStruct newMargins, KPrDocument *doc,
+ KPrPage *page )
+: KNamedCommand( name )
+, m_newMargins( newMargins )
+, m_page( page )
+, m_doc( doc )
+{
+ m_objects.setAutoDelete( false );
+ m_oldMargins.setAutoDelete( false );
+
+ addObjects( objects );
+}
+
+
+KPrChangeMarginCommand::~KPrChangeMarginCommand()
+{
+ QPtrListIterator<KPrTextObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+ m_oldMargins.setAutoDelete( true );
+ m_oldMargins.clear();
+}
+
+
+void KPrChangeMarginCommand::addObjects( const QPtrList<KPrObject> &objects )
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current(); ++it )
+ {
+ if ( it.current()->getType() == OT_GROUP )
+ {
+ KPrGroupObject * obj = dynamic_cast<KPrGroupObject*>( it.current() );
+ if ( obj )
+ {
+ addObjects( obj->objectList() );
+ }
+ }
+ else
+ {
+ KPrTextObject *obj = dynamic_cast<KPrTextObject*>( it.current() );
+ if( obj )
+ {
+ m_objects.append( obj );
+ obj->incCmdRef();
+
+ m_oldMargins.append( new MarginsStruct( obj ) );
+ }
+ }
+ }
+}
+
+
+void KPrChangeMarginCommand::execute()
+{
+ QPtrListIterator<KPrTextObject> it( m_objects );
+ for ( ; it.current() ; ++it )
+ {
+ it.current()->setTextMargins( m_newMargins.leftMargin, m_newMargins.topMargin,
+ m_newMargins.rightMargin, m_newMargins.bottomMargin);
+ it.current()->resizeTextDocument();
+ it.current()->layout();
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrChangeMarginCommand::unexecute()
+{
+ for ( unsigned int i = 0; i < m_objects.count(); i++ )
+ {
+ KPrTextObject *object = m_objects.at( i );
+ MarginsStruct *marginsStruct = m_oldMargins.at( i );
+ object->setTextMargins( marginsStruct->leftMargin, marginsStruct->topMargin,
+ marginsStruct->rightMargin, marginsStruct->bottomMargin);
+ object->resizeTextDocument();
+ object->layout();
+ }
+ m_doc->repaint( false );
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+
+KPrChangeVerticalAlignmentCommand::KPrChangeVerticalAlignmentCommand( const QString &name, KPrTextObject *_obj,
+ VerticalAlignmentType _oldAlign,
+ VerticalAlignmentType _newAlign,
+ KPrDocument *_doc) :
+ KNamedCommand(name),
+ m_obj( _obj ),
+ m_oldAlign(_oldAlign),
+ m_newAlign(_newAlign),
+ m_doc( _doc )
+{
+ m_page = m_doc->findPage( _obj );
+}
+
+void KPrChangeVerticalAlignmentCommand::execute()
+{
+ m_obj->setVerticalAligment( m_newAlign );
+ m_obj->kPresenterDocument()->layout(m_obj);
+ m_obj->kPresenterDocument()->repaint(m_obj);
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+void KPrChangeVerticalAlignmentCommand::unexecute()
+{
+ m_obj->setVerticalAligment( m_oldAlign );
+ m_obj->kPresenterDocument()->layout(m_obj);
+ m_obj->kPresenterDocument()->repaint(m_obj);
+
+ m_doc->updateSideBarItem( m_page );
+}
+
+
+KPrChangeTabStopValueCommand::KPrChangeTabStopValueCommand( const QString &name, double _oldValue, double _newValue,
+ KPrDocument *_doc):
+ KNamedCommand(name),
+ m_doc( _doc ),
+ m_oldValue(_oldValue),
+ m_newValue(_newValue)
+{
+}
+
+void KPrChangeTabStopValueCommand::execute()
+{
+ m_doc->setTabStopValue ( m_newValue );
+}
+
+void KPrChangeTabStopValueCommand::unexecute()
+{
+ m_doc->setTabStopValue ( m_oldValue );
+}
+
+KPrImageEffectCmd::KPrImageEffectCmd(const QString &_name, QPtrList<ImageEffectSettings> &_oldSettings,
+ ImageEffectSettings _newSettings, QPtrList<KPrObject> &_objects,
+ KPrDocument *_doc )
+ :KNamedCommand( _name ), oldSettings( _oldSettings ), objects( _objects )
+{
+ objects.setAutoDelete( false );
+ oldSettings.setAutoDelete( false );
+ doc = _doc;
+ newSettings = _newSettings;
+
+ m_page = doc->findPage( objects );
+
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+}
+
+KPrImageEffectCmd::~KPrImageEffectCmd()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+ oldSettings.setAutoDelete( true );
+ oldSettings.clear();
+}
+
+void KPrImageEffectCmd::execute()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it ) {
+ KPrPixmapObject * obj = dynamic_cast<KPrPixmapObject*>( it.current() );
+ if ( obj ) {
+ obj->setImageEffect(newSettings.effect);
+ obj->setIEParams(newSettings.param1, newSettings.param2, newSettings.param3);
+ }
+ }
+ doc->repaint( false );
+
+ doc->updateSideBarItem( m_page );
+}
+
+void KPrImageEffectCmd::unexecute()
+{
+ for ( unsigned int i = 0; i < objects.count(); ++i ) {
+ KPrPixmapObject * obj = dynamic_cast<KPrPixmapObject*>( objects.at(i) );
+ if ( obj ) {
+ obj->setImageEffect(oldSettings.at( i )->effect);
+ obj->setIEParams(oldSettings.at( i )->param1, oldSettings.at( i )->param2,
+ oldSettings.at( i )->param3);
+ }
+ }
+ doc->repaint( false );
+
+ doc->updateSideBarItem( m_page );
+}
+
+KPrChangeVariableNoteText::KPrChangeVariableNoteText( const QString &name, KPrDocument *_doc,
+ const QString &_oldValue,const QString &_newValue,
+ KoNoteVariable *var):
+ KNamedCommand(name),
+ m_doc(_doc),
+ newValue(_newValue),
+ oldValue(_oldValue),
+ m_var(var)
+{
+}
+
+KPrChangeVariableNoteText::~KPrChangeVariableNoteText()
+{
+}
+
+void KPrChangeVariableNoteText::execute()
+{
+ Q_ASSERT(m_var);
+ m_var->setNote(newValue);
+}
+
+void KPrChangeVariableNoteText::unexecute()
+{
+ Q_ASSERT(m_var);
+ m_var->setNote(oldValue);
+}
diff --git a/kpresenter/KPrCommand.h b/kpresenter/KPrCommand.h
new file mode 100644
index 000000000..a3e06e3ee
--- /dev/null
+++ b/kpresenter/KPrCommand.h
@@ -0,0 +1,1094 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Laurent Montel <lmontel@mandrakesoft.com>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kprcommand_h
+#define kprcommand_h
+
+#include <kcommand.h>
+#include <qptrlist.h>
+#include <qpoint.h>
+#include <qcolor.h>
+#include <qsize.h>
+#include "global.h"
+#include <KoPictureCollection.h>
+#include <qvaluelist.h>
+#include <qpen.h>
+#include <qbrush.h>
+#include <KoPageLayoutDia.h>
+#include <KoParagLayout.h>
+#include <KoTextCommand.h>
+#include <KoPoint.h>
+#include <KoSize.h>
+#include <qvariant.h>
+#include <qvaluevector.h>
+#include "KPrBackground.h"
+#include "KPrVariableCollection.h"
+#include <KoPen.h>
+
+class KPrDocument;
+class KPrTextObject;
+class KPrObject;
+class KPr2DObject;
+class KPrPixmapObject;
+class KPrGroupObject;
+class KPrView;
+class KoParagLayout;
+class KPrPage;
+class KoCustomVariable;
+class KoLinkVariable;
+class KPrPolylineObject;
+class KPrFieldVariable;
+class KPrTimeVariable;
+class KPrDateVariable;
+class KPrPgNumVariable;
+
+class KPrShadowCmd : public KNamedCommand
+{
+public:
+ struct ShadowValues
+ {
+ int shadowDistance;
+ ShadowDirection shadowDirection;
+ QColor shadowColor;
+ };
+
+ KPrShadowCmd( const QString &_name, QPtrList<ShadowValues> &_oldShadow, ShadowValues _newShadow,
+ QPtrList<KPrObject> &_objects, KPrDocument *_doc );
+ ~KPrShadowCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ KPrDocument *doc;
+ QPtrList<ShadowValues> oldShadow;
+ QPtrList<KPrObject> objects;
+ ShadowValues newShadow;
+ KPrPage *m_page;
+};
+
+class KPrSetOptionsCmd : public KNamedCommand
+{
+public:
+ KPrSetOptionsCmd( const QString &_name, QValueList<KoPoint> &_diffs, QPtrList<KPrObject> &_objects,
+ double _rastX, double _rastY, double _orastX, double _orastY,
+ const QColor &_txtBackCol, const QColor &_otxtBackCol, KPrDocument *_doc );
+ ~KPrSetOptionsCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+
+ QValueList<KoPoint> diffs;
+ QPtrList<KPrObject> objects;
+ double gridX;
+ double gridY;
+ double oldGridX;
+ double oldGridY;
+ KPrDocument *doc;
+ QColor txtBackCol;
+ QColor otxtBackCol;
+};
+
+class KPrSetBackCmd : public KNamedCommand
+{
+public:
+ KPrSetBackCmd( const QString &name, const KPrBackGround::Settings &settings,
+ const KPrBackGround::Settings &oldSettings,
+ bool useMasterBackground,
+ bool takeGlobal, KPrDocument *doc, KPrPage *page );
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+
+ KPrBackGround::Settings m_settings;
+ KPrBackGround::Settings m_oldSettings;
+ bool m_useMasterBackground;
+ bool m_oldUseMasterBackground;
+ bool m_takeGlobal;
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+};
+
+class KPrRotateCmd : public KNamedCommand
+{
+public:
+ struct RotateValues
+ {
+ float angle;
+ };
+
+ KPrRotateCmd( const QString &_name, float newAngle, QPtrList<KPrObject> &objects,
+ KPrDocument *doc, bool addAngle = false );
+ ~KPrRotateCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ KPrDocument *m_doc;
+ QPtrList<RotateValues> m_oldAngles;
+ QPtrList<KPrObject> m_objects;
+ float m_newAngle;
+ //necessary for duplicate object, we can duplicated and add angle.
+ bool m_addAngle;
+ KPrPage *m_page;
+};
+
+class KPrResizeCmd : public KNamedCommand
+{
+public:
+ KPrResizeCmd( const QString &_name, const KoPoint &_m_diff, const KoSize &_r_diff,
+ KPrObject *_object, KPrDocument *_doc );
+ ~KPrResizeCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+
+ KoPoint m_diff;
+ KoSize r_diff;
+ KPrObject *object;
+ KPrDocument *doc;
+ KPrPage *m_page;
+};
+
+class KPrChgPixCmd : public KNamedCommand
+{
+public:
+ KPrChgPixCmd( const QString &_name, KPrPixmapObject *_oldObject, KPrPixmapObject *_newObject,
+ KPrDocument *_doc, KPrPage *_page );
+ ~KPrChgPixCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+
+ KPrPixmapObject *oldObject, *newObject;
+ KPrDocument *doc;
+ KPrPage *m_page;
+};
+
+class KPrDeleteCmd : public KNamedCommand
+{
+public:
+ KPrDeleteCmd( const QString &_name, QPtrList<KPrObject> &_objects, KPrDocument *_doc,
+ KPrPage *_page);
+ ~KPrDeleteCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ QPtrList<KPrObject> m_oldObjectList;
+ QPtrList<KPrObject> m_objectsToDelete;
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+};
+
+class KPrEffectCmd : public KNamedCommand
+{
+public:
+ struct EffectStruct {
+ int appearStep, disappearStep;
+ Effect effect;
+ Effect2 effect2;
+ Effect3 effect3;
+ EffectSpeed m_appearSpeed;
+ EffectSpeed m_disappearSpeed;
+ bool disappear;
+ int appearTimer, disappearTimer;
+ bool appearSoundEffect, disappearSoundEffect;
+ QString a_fileName, d_fileName;
+ };
+
+ KPrEffectCmd( const QString &_name, const QPtrList<KPrObject> &_objs,
+ const QValueList<EffectStruct> &_oldEffects, EffectStruct _newEffect );
+ ~KPrEffectCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+
+ QValueList<EffectStruct> oldEffects;
+ EffectStruct newEffect;
+ QPtrList<KPrObject> objs;
+};
+
+class KPrGroupObjCmd : public KNamedCommand
+{
+public:
+ KPrGroupObjCmd( const QString &_name,
+ const QPtrList<KPrObject> &_objects,
+ KPrDocument *_doc, KPrPage *_page );
+ ~KPrGroupObjCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+
+ QPtrList<KPrObject> m_objectsToGroup;
+ QPtrList<KPrObject> m_oldObjectList;
+ KPrDocument *m_doc;
+ KPrGroupObject *m_groupObject;
+ KPrPage *m_page;
+
+};
+
+class UnGroupObjCmd : public KNamedCommand
+{
+public:
+ UnGroupObjCmd( const QString &_name,
+ KPrGroupObject *grpObj_,
+ KPrDocument *_doc, KPrPage *_page );
+ ~UnGroupObjCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+
+ QPtrList<KPrObject> m_groupedObjects;
+ KPrGroupObject *m_groupObject;
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+};
+
+
+class KPrInsertCmd : public KNamedCommand
+{
+public:
+ KPrInsertCmd( const QString &name, const QValueList<KPrObject *> objects, KPrDocument *doc, KPrPage *page );
+ KPrInsertCmd( const QString &name, KPrObject *object, KPrDocument *doc, KPrPage *page );
+ ~KPrInsertCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ QValueList<KPrObject *> m_objects;
+ KPrObject *m_object;
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+};
+
+
+class KPrLowerRaiseCmd : public KNamedCommand
+{
+public:
+ KPrLowerRaiseCmd( const QString &_name, const QPtrList<KPrObject>& _oldList,
+ const QPtrList<KPrObject>& _newList,
+ KPrDocument *_doc, KPrPage *_page );
+ ~KPrLowerRaiseCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+
+ QPtrList<KPrObject> oldList, newList;
+ KPrDocument *doc;
+ KPrPage *m_page;
+};
+
+class KPrMoveByCmd : public KNamedCommand
+{
+public:
+ KPrMoveByCmd( const QString &_name, const KoPoint &_diff, QPtrList<KPrObject> &_objects,
+ KPrDocument *_doc, KPrPage *_page );
+ ~KPrMoveByCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+
+ KoPoint diff;
+ QPtrList<KPrObject> objects;
+ KPrDocument *doc;
+ KPrPage *m_page;
+};
+
+/**
+ * Command to align objects
+ */
+class KPrAlignCmd : public KNamedCommand
+{
+public:
+ KPrAlignCmd( const QString &_name, QPtrList<KPrObject> &_objects, AlignType _at, KPrDocument *_doc );
+ ~KPrAlignCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ QPtrList<KoPoint> diffs;
+ QPtrList<KPrObject> objects;
+ KPrDocument *doc;
+ KPrPage *m_page;
+};
+
+class KoPenCmd : public KNamedCommand
+{
+public:
+ struct Pen {
+ Pen( KoPen p, LineEnd lb, LineEnd le )
+ : pen( p )
+ , lineBegin( lb )
+ , lineEnd( le )
+ {}
+
+ KoPen pen;
+ LineEnd lineBegin, lineEnd;
+
+ Pen &operator=( const Pen &_pen ) {
+ pen = _pen.pen;
+ lineBegin = _pen.lineBegin;
+ lineEnd = _pen.lineEnd;
+ return *this;
+ }
+ };
+
+ // the flags indicate what has changed
+ enum PenConfigChange {
+ LineBegin = 1,
+ LineEnd = 2,
+ Color = 4,
+ Width = 8,
+ Style = 16,
+ All = LineBegin | LineEnd | Color | Width | Style
+ };
+
+ KoPenCmd( const QString &_name, QPtrList<KPrObject> &_objects, Pen _newPen,
+ KPrDocument *_doc, KPrPage *_page, int _flags = All);
+ ~KoPenCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ void addObjects( const QPtrList<KPrObject> &_objects );
+ void applyPen( KPrObject *object, Pen *tmpPen );
+
+ KPrDocument *doc;
+ KPrPage *m_page;
+ QPtrList<Pen> oldPen;
+ QPtrList<KPrObject> objects;
+ Pen newPen;
+ int flags;
+};
+
+class KPrBrushCmd : public KNamedCommand
+{
+public:
+ struct Brush {
+ Brush() {}
+ Brush( QBrush _brush, QColor _gColor1, QColor _gColor2,
+ BCType _gType, FillType _fillType, bool _unbalanced,
+ int _xfactor, int _yfactor )
+ : brush( _brush )
+ , gColor1( _gColor1 )
+ , gColor2( _gColor2 )
+ , gType( _gType )
+ , fillType( _fillType )
+ , unbalanced( _unbalanced )
+ , xfactor( _xfactor )
+ , yfactor( _yfactor )
+ {}
+
+ QBrush brush;
+ QColor gColor1;
+ QColor gColor2;
+ BCType gType;
+ FillType fillType;
+ bool unbalanced;
+ int xfactor, yfactor;
+
+ Brush &operator=( const Brush &_brush ) {
+ brush = _brush.brush;
+ gColor1 = _brush.gColor1;
+ gColor2 = _brush.gColor2;
+ gType = _brush.gType;
+ fillType = _brush.fillType;
+ unbalanced = _brush.unbalanced;
+ xfactor = _brush.xfactor;
+ yfactor = _brush.yfactor;
+ return *this;
+ }
+ };
+
+ // the flags indicate what has changed
+ enum BrushConfigChange {
+ BrushColor = 1,
+ BrushStyle = 2,
+ BrushGradientSelect = 4,
+ GradientColor1 = 8,
+ GradientColor2 = 16,
+ GradientType = 32,
+ GradientBalanced = 64,
+ GradientXFactor = 128,
+ GradientYFactor = 256,
+ All = BrushColor | BrushStyle | BrushGradientSelect | GradientColor1 | GradientColor2 | GradientType | GradientBalanced | GradientXFactor | GradientYFactor
+ };
+
+ KPrBrushCmd( const QString &_name, QPtrList<KPrObject> &_objects, Brush _newBrush,
+ KPrDocument *_doc, KPrPage *_page, int _flags = All );
+ ~KPrBrushCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ void addObjects( const QPtrList<KPrObject> &_objects );
+ void applyBrush( KPr2DObject *object, Brush *tmpBrush );
+
+ KPrDocument *doc;
+ QPtrList<Brush> oldBrush;
+ QPtrList<KPr2DObject> objects;
+ Brush newBrush;
+ KPrPage *m_page;
+ int flags;
+};
+
+class KPrPgConfCmd : public KNamedCommand
+{
+public:
+ KPrPgConfCmd( const QString &_name, bool _manualSwitch, bool _infiniteLoop,
+ bool _showEndOfPresentationSlide, bool _showPresentationDuration, QPen _pen,
+ QValueList<bool> _selectedSlides, const QString & _presentationName,
+ bool _oldManualSwitch, bool _oldInfiniteLoop,
+ bool _oldShowEndOfPresentationSlide, bool _oldShowPresentationDuration, QPen _oldPen,
+ QValueList<bool> _oldSelectedSlides, const QString & _oldPresentationName,
+ KPrDocument *_doc );
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ bool manualSwitch, oldManualSwitch;
+ bool infiniteLoop, oldInfiniteLoop;
+ bool showEndOfPresentationSlide, oldShowEndOfPresentationSlide;
+ bool showPresentationDuration, oldShowPresentationDuration;
+ QPen pen, oldPen;
+ QValueList<bool> selectedSlides, oldSelectedSlides;
+ QString oldPresentationName, presentationName;
+
+ KPrDocument *doc;
+};
+
+class KPrTransEffectCmd : public KCommand
+{
+public:
+ struct PageEffectSettings {
+ PageEffect pageEffect;
+ EffectSpeed effectSpeed;
+ bool soundEffect;
+ QString soundFileName;
+ bool autoAdvance;
+ int slideTime;
+ void applyTo( KPrPage * );
+ };
+ // TODO also pass a flag to know which settings need to be applied (especially for "all pages")
+ KPrTransEffectCmd( QValueVector<PageEffectSettings> oldSettings,
+ PageEffectSettings newSettings,
+ KPrPage* page, KPrDocument* doc );
+
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const;
+
+private:
+ void exec( KPrPage* page );
+ void unexec( KPrPage* page );
+
+ QValueVector<PageEffectSettings> m_oldSettings;
+ PageEffectSettings m_newSettings;
+ KPrPage *m_page;
+ KPrDocument *m_doc;
+};
+
+class KPrPgLayoutCmd : public KNamedCommand
+{
+public:
+ KPrPgLayoutCmd( const QString &_name, KoPageLayout _layout, KoPageLayout _oldLayout,
+ KoUnit::Unit _oldUnit, KoUnit::Unit _unit,KPrDocument *_doc );
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ KPrDocument *m_doc;
+ KoPageLayout layout, oldLayout;
+ KoUnit::Unit unit, oldUnit;
+};
+
+class KPrPieValueCmd : public KNamedCommand
+{
+public:
+ struct PieValues
+ {
+ PieType pieType;
+ int pieAngle, pieLength;
+ };
+
+ // the flags indicate what has changed
+ enum PieConfigChange {
+ Type = 1,
+ Angle = 2,
+ Length = 4,
+ All = Type | Angle | Length
+ };
+
+ KPrPieValueCmd( const QString &name, PieValues newValues,
+ QPtrList<KPrObject> &objects, KPrDocument *doc,
+ KPrPage *page, int flags = All );
+ KPrPieValueCmd( const QString &_name, QPtrList<PieValues> &_oldValues, PieValues _newValues,
+ QPtrList<KPrObject> &_objects, KPrDocument *_doc, KPrPage *_page, int _flags = All );
+ ~KPrPieValueCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ void addObjects( const QPtrList<KPrObject> &objects );
+
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+ QPtrList<PieValues> m_oldValues;
+ QPtrList<KPrObject> m_objects;
+ PieValues m_newValues;
+ int m_flags;
+};
+
+class KPrPolygonSettingCmd : public KNamedCommand
+{
+public:
+ struct PolygonSettings
+ {
+ bool checkConcavePolygon;
+ int cornersValue;
+ int sharpnessValue;
+ };
+
+ // the flags indicate what has changed
+ enum PolygonConfigChange {
+ ConcaveConvex = 1,
+ Corners = 2,
+ Sharpness = 4,
+ All = ConcaveConvex | Corners | Sharpness
+ };
+
+ KPrPolygonSettingCmd( const QString &name, PolygonSettings newSettings,
+ QPtrList<KPrObject> &objects, KPrDocument *doc,
+ KPrPage *page, int flags = All );
+ ~KPrPolygonSettingCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ void addObjects( const QPtrList<KPrObject> &objects );
+
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+ QPtrList<PolygonSettings> m_oldSettings;
+ QPtrList<KPrObject> m_objects;
+ PolygonSettings m_newSettings;
+ int m_flags;
+};
+
+class KPrPictureSettingCmd : public KNamedCommand
+{
+public:
+ struct PictureSettings
+ {
+ PictureMirrorType mirrorType;
+ int depth;
+ bool swapRGB;
+ bool grayscal;
+ int bright;
+ };
+
+ enum PictureConfigChange {
+ MirrorType = 1,
+ Depth = 2,
+ SwapRGB = 4,
+ Grayscal = 8,
+ Bright = 16,
+ All = MirrorType | Depth | SwapRGB | Grayscal | Bright
+ };
+
+ KPrPictureSettingCmd( const QString &name, PictureSettings newSettings,
+ QPtrList<KPrObject> &objects, KPrDocument *doc,
+ KPrPage *page, int flags = All );
+ KPrPictureSettingCmd( const QString &_name, QPtrList<PictureSettings> &_oldSettings,
+ PictureSettings _newSettings, QPtrList<KPrObject> &_objects,
+ KPrDocument *_doc, int flags = All );
+ ~KPrPictureSettingCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ void addObjects( const QPtrList<KPrObject> &_objects );
+
+ KPrDocument *m_doc;
+ QPtrList<PictureSettings> m_oldValues;
+ QPtrList<KPrObject> m_objects;
+ PictureSettings m_newSettings;
+ KPrPage *m_page;
+ int m_flags;
+};
+
+class KPrImageEffectCmd : public KNamedCommand
+{
+public:
+ struct ImageEffectSettings
+ {
+ ImageEffect effect;
+ QVariant param1;
+ QVariant param2;
+ QVariant param3;
+ };
+
+ KPrImageEffectCmd(const QString &_name, QPtrList<ImageEffectSettings> &_oldSettings,
+ ImageEffectSettings _newSettings, QPtrList<KPrObject> &_objects,
+ KPrDocument *_doc );
+ ~KPrImageEffectCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ KPrDocument *doc;
+ QPtrList<ImageEffectSettings> oldSettings;
+ QPtrList<KPrObject> objects;
+ ImageEffectSettings newSettings;
+ KPrPage *m_page;
+
+};
+
+class KPrRectValueCmd : public KNamedCommand
+{
+public:
+ struct RectValues
+ {
+ int xRnd, yRnd;
+ };
+
+ // the flags indicate what has changed
+ enum RectangleConfigChange {
+ XRnd = 1,
+ YRnd = 2,
+ All = XRnd | YRnd
+ };
+
+ KPrRectValueCmd( const QString &_name, QPtrList<RectValues> &_oldValues, RectValues _newValues,
+ QPtrList<KPrObject> &_objects, KPrDocument *_doc, KPrPage *_page, int _flags = All );
+ KPrRectValueCmd( const QString &_name, QPtrList<KPrObject> &_objects, RectValues _newValues,
+ KPrDocument *_doc, KPrPage *_page, int _flags = All );
+ ~KPrRectValueCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ void addObjects( const QPtrList<KPrObject> &_objects );
+
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+ QPtrList<RectValues> m_oldValues;
+ QPtrList<KPrObject> m_objects;
+ RectValues m_newValues;
+ int m_flags;
+};
+
+class KPrDeletePageCmd : public KNamedCommand
+{
+public:
+ KPrDeletePageCmd( const QString &name, int pageNum, KPrDocument *doc );
+ ~KPrDeletePageCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+ int m_pageNum;
+};
+
+class KPrInsertPageCmd : public KNamedCommand
+{
+public:
+ KPrInsertPageCmd( const QString &name, int currentPageNum, InsertPos pos,
+ KPrPage *page, KPrDocument *doc );
+ ~KPrInsertPageCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+protected:
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+ int m_currentPageNum;
+ int m_insertPageNum;
+};
+
+class KPrMovePageCmd : public KNamedCommand
+{
+public:
+ KPrMovePageCmd( const QString &_name, int from,int to, KPrDocument *_doc );
+ ~KPrMovePageCmd();
+
+ virtual void execute();
+ virtual void unexecute();
+protected:
+ KPrDocument *m_doc;
+ int m_oldPosition;
+ int m_newPosition;
+};
+
+/**
+ * Command created when pasting oasis-formatted text
+ */
+class KPrOasisPasteTextCommand : public KoTextDocCommand
+{
+public:
+ KPrOasisPasteTextCommand( KoTextDocument *d, int parag, int idx,
+ const QByteArray &data );
+ KoTextCursor *execute( KoTextCursor *c );
+ KoTextCursor *unexecute( KoTextCursor *c );
+protected:
+ int m_parag;
+ int m_idx;
+ QByteArray m_data;
+ // filled in by execute(), for unexecute()
+ int m_lastParag;
+ int m_lastIndex;
+ KoParagLayout* m_oldParagLayout;
+};
+
+/**
+ * Command to change variable setting
+ */
+class KPrChangeStartingPageCommand : public KNamedCommand
+{
+public:
+ KPrChangeStartingPageCommand( const QString &name, KPrDocument *_doc,
+ int _oldStartingPage, int _newStartingPage);
+ ~KPrChangeStartingPageCommand(){}
+
+ void execute();
+ void unexecute();
+protected:
+ KPrDocument *m_doc;
+ int oldStartingPage;
+ int newStartingPage;
+};
+
+/**
+ * Command to display link setting
+ */
+class KPrChangeVariableSettingsCommand : public KNamedCommand
+{
+public:
+ enum VariableProperties { VS_DISPLAYLINK, VS_UNDERLINELINK, VS_DISPLAYCOMMENT, VS_DISPLAYFIELDCODE};
+ KPrChangeVariableSettingsCommand( const QString &name, KPrDocument *_doc, bool _oldValue,
+ bool _newValue, VariableProperties _type);
+ ~KPrChangeVariableSettingsCommand(){}
+
+ void execute();
+ void unexecute();
+protected:
+ void changeValue( bool b );
+ KPrDocument *m_doc;
+ VariableProperties type;
+ bool m_bOldValue;
+ bool m_bNewValue;
+};
+
+/**
+ * Command to change title page name
+ */
+class KPrChangeTitlePageNameCommand : public KNamedCommand
+{
+public:
+ KPrChangeTitlePageNameCommand( const QString &name, KPrDocument *_doc, const QString &_oldPageName,
+ const QString &_newPageName, KPrPage *_page);
+ ~KPrChangeTitlePageNameCommand(){}
+
+ void execute();
+ void unexecute();
+protected:
+ KPrDocument *m_doc;
+ QString oldPageName;
+ QString newPageName;
+ KPrPage *m_page;
+};
+
+class KPrChangeCustomVariableValue : public KNamedCommand
+{
+public:
+ KPrChangeCustomVariableValue( const QString &name, KPrDocument *_doc,const QString & _oldValue,
+ const QString & _newValue, KoCustomVariable *var);
+
+ void execute();
+ void unexecute();
+protected:
+ KPrDocument *m_doc;
+ QString newValue;
+ QString oldValue;
+ KoCustomVariable *m_var;
+};
+
+class KPrChangeLinkVariable : public KNamedCommand
+{
+public:
+ KPrChangeLinkVariable( const QString &name, KPrDocument *_doc,const QString & _oldHref,
+ const QString & _newHref, const QString & _oldLink,const QString &_newLink, KoLinkVariable *var);
+ ~KPrChangeLinkVariable(){};
+ void execute();
+ void unexecute();
+protected:
+ KPrDocument *m_doc;
+ QString oldHref;
+ QString newHref;
+ QString oldLink;
+ QString newLink;
+ KoLinkVariable *m_var;
+};
+
+
+class KPrNameObjectCommand : public KNamedCommand
+{
+public:
+ KPrNameObjectCommand( const QString &_name, const QString &_objectName, KPrObject *_obj, KPrDocument *_doc );
+ ~KPrNameObjectCommand();
+ void execute();
+ void unexecute();
+protected:
+ QString oldObjectName, newObjectName;
+ KPrObject *object;
+ KPrDocument *doc;
+ KPrPage *m_page;
+};
+
+class KPrDisplayObjectFromMasterPage : public KNamedCommand
+{
+public:
+ KPrDisplayObjectFromMasterPage( const QString &name, KPrDocument *_doc, KPrPage *_page, bool _newValue);
+ ~KPrDisplayObjectFromMasterPage(){};
+ void execute();
+ void unexecute();
+protected:
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+ bool newValue;
+};
+
+class KPrDisplayBackgroundPage : public KNamedCommand
+{
+public:
+ KPrDisplayBackgroundPage( const QString &name, KPrDocument *_doc, KPrPage *_page, bool _newValue);
+ ~KPrDisplayBackgroundPage(){};
+ void execute();
+ void unexecute();
+protected:
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+ bool newValue;
+};
+
+class KPrHideShowHeaderFooter : public KNamedCommand
+{
+public:
+ KPrHideShowHeaderFooter( const QString &name, KPrDocument *_doc, KPrPage *_page, bool _newValue,KPrTextObject *_textObject);
+ ~KPrHideShowHeaderFooter(){};
+ void execute();
+ void unexecute();
+protected:
+ KPrDocument *m_doc;
+ KPrPage *m_page;
+ KPrTextObject *m_textObject;
+ bool newValue;
+};
+
+class KPrFlipObjectCommand : public KNamedCommand
+{
+public:
+ KPrFlipObjectCommand( const QString &name, KPrDocument *_doc, bool _horizontal ,
+ QPtrList<KPrObject> &_objects );
+ ~KPrFlipObjectCommand();
+ void execute();
+ void unexecute();
+protected:
+ void flipObjects();
+ KPrDocument *m_doc;
+ QPtrList<KPrObject> objects;
+ bool horizontal;
+ KPrPage *m_page;
+};
+
+class KPrGeometryPropertiesCommand : public KNamedCommand
+{
+public:
+ enum KgpType { ProtectSize, KeepRatio};
+ KPrGeometryPropertiesCommand( const QString &name, QPtrList<KPrObject> &objects,
+ bool newValue, KgpType type, KPrDocument *_doc );
+ KPrGeometryPropertiesCommand( const QString &name, QValueList<bool> &lst, QPtrList<KPrObject> &objects,
+ bool newValue, KgpType type, KPrDocument *_doc );
+ ~KPrGeometryPropertiesCommand();
+
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ QValueList<bool> m_oldValue;
+ QPtrList<KPrObject> m_objects;
+ bool m_newValue;
+ KgpType m_type;
+ KPrDocument *m_doc;
+};
+
+class KPrProtectContentCommand : public KNamedCommand
+{
+public:
+ KPrProtectContentCommand( const QString &name, QPtrList<KPrObject> &objects,
+ bool protectContent, KPrDocument *doc );
+ KPrProtectContentCommand( const QString &name, bool protectContent,
+ KPrTextObject *obj, KPrDocument *doc );
+
+ ~KPrProtectContentCommand();
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ void addObjects( const QPtrList<KPrObject> &objects );
+
+ QPtrList<KPrTextObject> m_objects;
+ bool m_protectContent;
+ QValueList<bool> m_oldValues;
+ KPrDocument *m_doc;
+};
+
+class KPrCloseObjectCommand : public KNamedCommand
+{
+public:
+ KPrCloseObjectCommand( const QString &name, QPtrList<KPrObject> objects, KPrDocument *doc );
+
+ ~KPrCloseObjectCommand();
+ virtual void execute();
+ virtual void unexecute();
+
+protected:
+ void closeObject(bool close);
+
+ QPtrList<KPrObject> m_openObjects;
+ QPtrList<KPrObject> m_closedObjects;
+ KPrDocument * m_doc;
+ KPrPage *m_page;
+};
+
+struct MarginsStruct {
+ MarginsStruct() {}
+ MarginsStruct( KPrTextObject *obj );
+ MarginsStruct( double _left, double top, double right, double bottom );
+ double topMargin;
+ double bottomMargin;
+ double leftMargin;
+ double rightMargin;
+};
+
+class KPrChangeMarginCommand : public KNamedCommand
+{
+public:
+ KPrChangeMarginCommand( const QString &name, QPtrList<KPrObject> &objects, MarginsStruct newMargins,
+ KPrDocument *doc, KPrPage *page );
+ ~KPrChangeMarginCommand();
+
+ virtual void execute();
+ virtual void unexecute();
+protected:
+ void addObjects( const QPtrList<KPrObject> &objects );
+ QPtrList<MarginsStruct> m_oldMargins;
+ QPtrList<KPrTextObject> m_objects;
+ MarginsStruct m_newMargins;
+ KPrPage *m_page;
+ KPrDocument *m_doc;
+};
+
+
+class KPrChangeVerticalAlignmentCommand : public KNamedCommand
+{
+public:
+ KPrChangeVerticalAlignmentCommand( const QString &name, KPrTextObject *_obj, VerticalAlignmentType _oldAlign,
+ VerticalAlignmentType _newAlign, KPrDocument *_doc);
+ ~KPrChangeVerticalAlignmentCommand() {}
+
+ virtual void execute();
+ virtual void unexecute();
+protected:
+ KPrTextObject *m_obj;
+ VerticalAlignmentType m_oldAlign;
+ VerticalAlignmentType m_newAlign;
+ KPrPage *m_page;
+ KPrDocument *m_doc;
+};
+
+
+class KPrChangeTabStopValueCommand : public KNamedCommand
+{
+public:
+ KPrChangeTabStopValueCommand( const QString &name, double _oldValue, double _newValue, KPrDocument *_doc);
+
+ ~KPrChangeTabStopValueCommand() {}
+
+ virtual void execute();
+ virtual void unexecute();
+protected:
+ KPrDocument *m_doc;
+ double m_oldValue;
+ double m_newValue;
+};
+
+class KPrChangeVariableNoteText : public KNamedCommand
+{
+ public:
+ KPrChangeVariableNoteText( const QString &name, KPrDocument *_doc, const QString &_oldValue,const QString &_newValue, KoNoteVariable *var);
+ ~KPrChangeVariableNoteText();
+ void execute();
+ void unexecute();
+ protected:
+ KPrDocument *m_doc;
+ QString newValue;
+ QString oldValue;
+ KoNoteVariable *m_var;
+};
+
+
+#endif
diff --git a/kpresenter/KPrConfig.cpp b/kpresenter/KPrConfig.cpp
new file mode 100644
index 000000000..6722edd20
--- /dev/null
+++ b/kpresenter/KPrConfig.cpp
@@ -0,0 +1,1128 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <kapplication.h>
+#include <KoUnitWidgets.h>
+#include <klocale.h>
+#include <kconfig.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <knuminput.h>
+#include <kcolorbutton.h>
+#include "KPrVariableCollection.h"
+#include "KPrCanvas.h"
+#include <tkcoloractions.h>
+
+#include <KoSpeaker.h>
+
+#include <qgroupbox.h>
+#include <qvgroupbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qvbox.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qtabwidget.h>
+#include <qwhatsthis.h>
+
+#include "KPrPenStyleWidget.h"
+#include "KPrBrushProperty.h"
+#include "KPrPieProperty.h"
+#include "KPrRectProperty.h"
+#include "KPrPolygonProperty.h"
+
+#include "KPrConfig.h"
+#include "KPrView.h"
+#include "KPrDocument.h"
+#include "KPrPage.h"
+#include <KoUnit.h>
+
+#include <float.h>
+#include <knumvalidator.h>
+#include <qlineedit.h>
+#include "KPrCommand.h"
+#include <qvgroupbox.h>
+#include <kfontdialog.h>
+#include <klineedit.h>
+#include <KoRect.h>
+#include <kmessagebox.h>
+#include <kdeversion.h>
+#include <kurlrequesterdlg.h>
+#include <klistview.h>
+#include <kfiledialog.h>
+#include <KoEditPath.h>
+
+#include <kspell2/configwidget.h>
+#include <kspell2/settings.h>
+#include <kspell2/broker.h>
+using namespace KSpell2;
+
+KPrConfig::KPrConfig( KPrView* parent )
+ : KDialogBase(KDialogBase::IconList,i18n("Configure KPresenter") ,
+ KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel| KDialogBase::Default,
+ KDialogBase::Ok, parent)
+
+{
+ m_doc = parent->kPresenterDoc();
+ QVBox *page = addVBoxPage( i18n("Interface"), i18n("Interface"),
+ BarIcon("misc", KIcon::SizeMedium) );
+ _interfacePage=new KPrConfigureInterfacePage( parent, page );
+ page = addVBoxPage( i18n("Color"), i18n("Color"),
+ BarIcon("colorize", KIcon::SizeMedium) );
+ _colorBackground = new KPrConfigureColorBackground( parent, page );
+
+ page = addVBoxPage( i18n("Spelling"), i18n("Spellchecker Behavior"),
+ BarIcon("spellcheck", KIcon::SizeMedium) );
+ _spellPage=new KPrConfigureSpellPage(parent, page);
+
+ page = addVBoxPage( i18n("Misc"), i18n("Misc"),
+ BarIcon("misc", KIcon::SizeMedium) );
+ _miscPage=new KPrConfigureMiscPage(parent, page);
+
+ page = addVBoxPage( i18n("Document"), i18n("Document Settings"),
+ BarIcon("kpresenter_kpr", KIcon::SizeMedium) );
+
+ _defaultDocPage=new KPrConfigureDefaultDocPage(parent, page);
+
+ page = addVBoxPage( i18n("Tools"), i18n("Default Tools Settings"),
+ BarIcon("configure", KIcon::SizeMedium) );
+
+ _toolsPage=new KPrConfigureToolsPage(parent, page);
+
+ page = addVBoxPage( i18n("Paths"), i18n("Path Settings"),
+ BarIcon("path") );
+
+ m_pathPage=new KPrConfigurePathPage(parent, page);
+
+ if (KoSpeaker::isKttsdInstalled()) {
+ page = addVBoxPage( i18n("Abbreviation for Text-to-Speech", "TTS"), i18n("Text-to-Speech Settings"),
+ BarIcon("access", KIcon::SizeMedium) );
+ m_ttsPage=new KPrConfigureTTSPage(parent, page);
+ } else m_ttsPage = 0;
+
+ connect( this, SIGNAL( okClicked() ),this, SLOT( slotApply() ) );
+}
+
+void KPrConfig::openPage(int flags)
+{
+ if(flags & KP_INTERFACE)
+ showPage( 0 );
+ else if(flags & KP_COLOR)
+ showPage(1 );
+ else if(flags & KP_KSPELL)
+ showPage(2);
+ else if(flags & KP_MISC)
+ showPage(3 );
+ else if(flags & KP_DOC)
+ showPage(4 );
+ else if(flags & KP_TOOLS)
+ showPage(5);
+ else if(flags & KP_PATH)
+ showPage(6);
+}
+
+void KPrConfig::slotApply()
+{
+ KMacroCommand *macro = 0L;
+ _interfacePage->apply();
+ _colorBackground->apply();
+ if (_spellPage) _spellPage->apply();
+ m_pathPage->apply();
+ KCommand *cmd = _miscPage->apply();
+ if ( cmd )
+ {
+ if ( !macro )
+ macro = new KMacroCommand(i18n("Change Config") );
+ macro->addCommand( cmd );
+ }
+ cmd = _defaultDocPage->apply();
+ if ( cmd )
+ {
+ if ( !macro )
+ macro = new KMacroCommand(i18n("Change Config") );
+
+ macro->addCommand( cmd );
+ }
+
+ _toolsPage->apply();
+ if (m_ttsPage) m_ttsPage->apply();
+ if ( macro )
+ m_doc->addCommand( macro);
+}
+
+void KPrConfig::slotDefault()
+{
+ switch( activePageIndex() ) {
+ case 0:
+ _interfacePage->slotDefault();
+ break;
+ case 1:
+ _colorBackground->slotDefault();
+ break;
+ case 2:
+ if (_spellPage) _spellPage->slotDefault();
+ break;
+ case 3:
+ _miscPage->slotDefault();
+ break;
+ case 4:
+ _defaultDocPage->slotDefault();
+ break;
+ case 5:
+ _toolsPage->slotDefault();
+ break;
+ case 6:
+ m_pathPage->slotDefault();
+ break;
+ case 7:
+ m_ttsPage->slotDefault();
+ default:
+ break;
+ }
+}
+
+KPrConfigureInterfacePage::KPrConfigureInterfacePage( KPrView *_view, QWidget *parent , char *name )
+ :QWidget ( parent,name )
+{
+ QVBoxLayout *box = new QVBoxLayout( this, 0, 0 );
+
+ m_pView=_view;
+ config = KPrFactory::global()->config();
+
+ KoUnit::Unit unit = m_pView->kPresenterDoc()->unit();
+
+ oldNbRecentFiles=10;
+ double ptIndent = MM_TO_POINT(10.0);
+ bool bShowRuler=true;
+ bool oldShowStatusBar = true;
+
+ if( config->hasGroup("Interface") ) {
+ config->setGroup( "Interface" );
+ oldNbRecentFiles=config->readNumEntry("NbRecentFile",oldNbRecentFiles);
+ ptIndent = config->readDoubleNumEntry("Indent", ptIndent);
+ bShowRuler=config->readBoolEntry("Rulers",true);
+ oldShowStatusBar = config->readBoolEntry( "ShowStatusBar" , true );
+
+ }
+
+ showRuler= new QCheckBox(i18n("Show rulers"),this);
+ QWhatsThis::add(showRuler, i18n( "When checked, both vertical and horizontal rulers are shown on the KPresenter slide (this is the default). When unchecked, the rulers are not shown on any slide." ) );
+ showRuler->setChecked(bShowRuler);
+ box->addWidget(showRuler);
+
+ showStatusBar = new QCheckBox(i18n("Show status bar"),this);
+ QWhatsThis::add(showStatusBar, i18n( "Toggle the statusbar, which is shown by default." ) );
+ showStatusBar->setChecked(oldShowStatusBar);
+ box->addWidget(showStatusBar);
+
+
+ recentFiles=new KIntNumInput( oldNbRecentFiles, this);
+ recentFiles->setRange(1, 20, 1);
+ recentFiles->setLabel(i18n("Number of recent files:"));
+ QWhatsThis::add(recentFiles, i18n( "Set the number of recent files which will be opened using the File->Open Recent menu. Default is to remember 10 filenames. The maximum you can set is 20 and the minimum is 1." ) );
+
+ box->addWidget(recentFiles);
+
+ QString suffix = KoUnit::unitName( unit ).prepend(' ');
+ indent = new KDoubleNumInput( this );
+ indent->setValue( KoUnit::toUserValue( ptIndent, unit ) );
+ indent->setRange(KoUnit::toUserValue( 0.1, unit ), KoUnit::toUserValue( 50, unit ), KoUnit::toUserValue( 0.1, unit ));
+
+
+ indent->setSuffix( suffix );
+ indent->setLabel(i18n("Text indentation depth:"));
+ QWhatsThis::add(indent, i18n( "This setting is used by Increase Depth and Decrease Depth menu items (in the Text menu) to change the indentation depth. The Default is 1 centimeter." ) );
+
+ box->addWidget(indent);
+
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ box->addItem( spacer);
+}
+
+void KPrConfigureInterfacePage::apply()
+{
+ bool ruler=showRuler->isChecked();
+ bool statusBar=showStatusBar->isChecked();
+
+ KPrDocument * doc = m_pView->kPresenterDoc();
+
+ config->setGroup( "Interface" );
+
+ double newIndent = KoUnit::fromUserValue( indent->value(), doc->unit() );
+ if( newIndent != doc->getIndentValue() )
+ {
+ config->writeEntry( "Indent", newIndent, true, false, 'g', DBL_DIG /* 6 is not enough */ );
+ doc->setIndentValue( newIndent );
+ }
+ int nbRecent=recentFiles->value();
+ if(nbRecent!=oldNbRecentFiles)
+ {
+ config->writeEntry( "NbRecentFile", nbRecent);
+ m_pView->changeNbOfRecentFiles(nbRecent);
+ oldNbRecentFiles=nbRecent;
+ }
+ bool refreshGUI=false;
+ if(ruler != doc->showRuler())
+ {
+ config->writeEntry( "Rulers", ruler );
+ doc->setShowRuler( ruler );
+ refreshGUI=true;
+
+ }
+ if( statusBar != doc->showStatusBar() )
+ {
+ config->writeEntry( "ShowStatusBar", statusBar );
+ doc->setShowStatusBar( statusBar );
+ refreshGUI=true;
+ }
+
+ if( refreshGUI )
+ doc->reorganizeGUI();
+
+}
+
+void KPrConfigureInterfacePage::slotDefault()
+{
+ double newIndent = KoUnit::toUserValue( MM_TO_POINT( 10 ), m_pView->kPresenterDoc()->unit() );
+ indent->setValue( newIndent );
+ recentFiles->setValue(10);
+ showRuler->setChecked(true);
+ showStatusBar->setChecked(true);
+}
+
+KPrConfigureColorBackground::KPrConfigureColorBackground( KPrView* _view, QWidget *parent , char *name )
+ :QWidget ( parent,name )
+{
+ m_pView = _view;
+ config = KPrFactory::global()->config();
+
+ oldBgColor = m_pView->kPresenterDoc()->txtBackCol();
+ oldGridColor = m_pView->kPresenterDoc()->gridColor();
+ QVBoxLayout *box = new QVBoxLayout( this, 0, 0 );
+
+ QLabel *lab = new QLabel( this, "label20" );
+ lab->setText( i18n( "Background object color:" ) );
+ QWhatsThis::add(lab, i18n( "Change the background color of the text box. The background is white by default. If you have a dark background color and you want to put some white text on it, you can change the color of the text box so that you can see what you are typing. When you have finished, the area around the text will revert to the background color. The Defaults button restores the original settings." ) );
+ box->addWidget(lab);
+
+ bgColor = new KColorButton( oldBgColor,
+ oldBgColor,
+ this );
+ bgColor->setColor( oldBgColor );
+ box->addWidget(bgColor);
+
+
+ lab = new QLabel( this, "label20" );
+ lab->setText( i18n( "Grid color:" ) );
+ QWhatsThis::add(lab, i18n( "Here you can change the grid color, which is black by default." ) );
+ box->addWidget(lab);
+
+ gridColor = new KColorButton( oldGridColor,
+ oldGridColor,
+ this );
+ box->addWidget(gridColor);
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ box->addItem( spacer);
+
+}
+
+void KPrConfigureColorBackground::apply()
+{
+ KPrDocument * doc = m_pView->kPresenterDoc();
+ bool repaintNeeded = false;
+ QColor _col = bgColor->color();
+ if( oldBgColor != _col ) {
+ config->setGroup( "KPresenter Color" );
+ config->writeEntry( "BackgroundColor", _col );
+ doc->setTxtBackCol( _col );
+ doc->replaceObjs();
+ oldBgColor=_col;
+ repaintNeeded = true;
+ }
+ _col = gridColor->color();
+ if( oldGridColor != _col ) {
+ config->setGroup( "KPresenter Color" );
+ config->writeEntry( "GridColor", _col );
+ doc->repaint( false );
+ doc->setGridColor( _col );
+ oldGridColor=_col;
+ repaintNeeded = true;
+ }
+ if (repaintNeeded)
+ doc->repaint( false );
+}
+
+void KPrConfigureColorBackground::slotDefault()
+{
+ bgColor->setColor( Qt::white );
+ gridColor->setColor( Qt::black );
+}
+
+
+
+KPrConfigureSpellPage::KPrConfigureSpellPage( KPrView *_view, QWidget *parent, char *name )
+ : QWidget( parent, name )
+{
+ m_pView=_view;
+ config = KPrFactory::global()->config();
+ m_spellConfigWidget = new ConfigWidget( _view->broker(), parent );
+ m_spellConfigWidget->setBackgroundCheckingButtonShown( true );
+}
+
+void KPrConfigureSpellPage::apply()
+{
+
+ KPrDocument* doc = m_pView->kPresenterDoc();
+ m_spellConfigWidget->save();
+
+
+ m_pView->kPresenterDoc()->setSpellCheckIgnoreList(
+ m_pView->broker()->settings()->currentIgnoreList() );
+ //FIXME reactivate just if there are changes.
+ doc->enableBackgroundSpellCheck( m_pView->broker()->settings()->backgroundCheckerEnabled() );
+ doc->reactivateBgSpellChecking();
+}
+
+void KPrConfigureSpellPage::slotDefault()
+{
+ m_spellConfigWidget->slotDefault();
+}
+
+KPrConfigureMiscPage::KPrConfigureMiscPage( KPrView *_view, QWidget *parent, char *name )
+ : QWidget( parent, name )
+{
+ QVBoxLayout *box = new QVBoxLayout( this, 0, 0 );
+
+ m_pView=_view;
+ config = KPrFactory::global()->config();
+
+ QGroupBox* tmpQGroupBox = new QGroupBox( 0, Qt::Vertical, i18n("Misc"), this, "GroupBox" );
+ tmpQGroupBox->layout()->setSpacing(KDialog::spacingHint());
+ tmpQGroupBox->layout()->setMargin(KDialog::marginHint());
+ QGridLayout *grid = new QGridLayout( tmpQGroupBox->layout(), 8, 1 );
+
+ m_oldNbRedo=30;
+ m_printNotes=true;
+ if( config->hasGroup("Misc") )
+ {
+ config->setGroup( "Misc" );
+ m_oldNbRedo=config->readNumEntry("UndoRedo",m_oldNbRedo);
+ m_printNotes = config->readBoolEntry("PrintNotes", true);
+ }
+
+ m_undoRedoLimit=new KIntNumInput( m_oldNbRedo, tmpQGroupBox );
+ m_undoRedoLimit->setLabel(i18n("Undo/redo limit:"));
+ m_undoRedoLimit->setRange(10, 60, 1);
+ QWhatsThis::add(m_undoRedoLimit, i18n( "Set the number of actions you can undo and redo (how many actions KPresenter keeps in its Undo buffer). This ranges from a minimum of 10 to a maximum of 60 (the default is 30). Once the number of actions reaches the number set here, earlier actions will be forgotten." ) );
+ grid->addWidget(m_undoRedoLimit,0,0);
+
+ KPrDocument* doc = m_pView->kPresenterDoc();
+
+ m_displayLink=new QCheckBox(i18n("Display links"),tmpQGroupBox);
+ QWhatsThis::add(m_displayLink, i18n( "When you want to include a link in your slide, you can use the Insert->Link... menu, which allows you to insert URL, mail or file links. If the option Display links is checked, all links will be active and displayed in a different color (this is the default behavior). If the option is unchecked, the links will be inactive and the same color as the text. This affects both the edited slides and the slide show." ) );
+ grid->addWidget(m_displayLink,3,0);
+ m_displayLink->setChecked(doc->getVariableCollection()->variableSetting()->displayLink());
+
+ m_underlineLink=new QCheckBox(i18n("&Underline all links"),tmpQGroupBox);
+ m_underlineLink->setChecked(doc->getVariableCollection()->variableSetting()->underlineLink());
+ QWhatsThis::add(m_underlineLink, i18n( "If this is checked, all links will be underlined (this is the default). If it is not checked, the links will not be underlined." ) );
+ grid->addWidget(m_underlineLink,4,0);
+
+
+ m_displayComment=new QCheckBox(i18n("Display comments"),tmpQGroupBox);
+ m_displayComment->setChecked(doc->getVariableCollection()->variableSetting()->displayComment());
+ QWhatsThis::add(m_displayComment, i18n( "Comments are inserted in the text at the cursor using the Insert->Comment... menu. Comments can only be viewed in edit mode and not in the slide show. If this option is checked (default) then each comment will be shown as a small yellow rectangle. You can then right-click on them to edit them, remove them or copy the text." ) );
+ grid->addWidget(m_displayComment,5,0);
+
+ m_displayFieldCode=new QCheckBox(i18n("Display field code"),tmpQGroupBox);
+ m_displayFieldCode->setChecked(doc->getVariableCollection()->variableSetting()->displayFieldCode());
+ QWhatsThis::add(m_displayFieldCode, i18n( "In editor mode (not in slide show) this option will display all the variable codes as well as Link at links location. This is very useful to see what variable is displayed. Variables are inserted using the Insert -> Variable menu." ) );
+ grid->addWidget(m_displayFieldCode,6,0);
+
+ m_cbPrintNotes=new QCheckBox(i18n("Print slide notes"),tmpQGroupBox);
+ m_cbPrintNotes->setChecked(m_printNotes);
+ QWhatsThis::add(m_cbPrintNotes, i18n( "If checked, all notes will be printed on paper. The notes will all be printed separately on the last page, from the first slide to the last and finally the Master Page Note. You can see the notes for each slide using the View->Show notebar menu." ) );
+ grid->addWidget(m_cbPrintNotes,7,0);
+
+ box->addWidget(tmpQGroupBox);
+
+ tmpQGroupBox = new QGroupBox( 0, Qt::Vertical, i18n("Grid"), this, "GroupBox" );
+ tmpQGroupBox->layout()->setSpacing(KDialog::spacingHint());
+ tmpQGroupBox->layout()->setMargin(KDialog::marginHint());
+ grid = new QGridLayout( tmpQGroupBox->layout(), 8, 1 );
+
+ KoRect rect = doc->masterPage()->getPageRect();
+ QLabel *lab=new QLabel(i18n("Horizontal grid size:"), tmpQGroupBox);
+ QWhatsThis::add(lab, i18n( "Set the space in millimeters between two horizontal points on the grid. Default is 5 millimeters." ) );
+ grid->addWidget(lab,0,0);
+ KoUnit::Unit unit = doc->unit();
+ resolutionX = new KoUnitDoubleSpinBox(tmpQGroupBox, 5.0,rect.width(),1,doc->getGridX() );
+ resolutionX->setUnit( unit );
+
+ grid->addWidget(resolutionX,1,0);
+
+ lab=new QLabel(i18n("Vertical grid size:"), tmpQGroupBox);
+ QWhatsThis::add(lab, i18n( "Set the space in millimeters between two vertical points on the grid. Default is 5 millimeters." ) );
+ grid->addWidget(lab,2,0);
+
+ resolutionY = new KoUnitDoubleSpinBox(tmpQGroupBox, 5.0,rect.height(),1,doc->getGridY() );
+ resolutionY->setUnit( unit );
+
+ grid->addWidget(resolutionY, 3, 0);
+ box->addWidget(tmpQGroupBox);
+
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ box->addItem( spacer);
+
+
+}
+
+KCommand * KPrConfigureMiscPage::apply()
+{
+ config->setGroup( "Misc" );
+ int newUndo=m_undoRedoLimit->value();
+ KPrDocument* doc = m_pView->kPresenterDoc();
+ if(newUndo!=m_oldNbRedo)
+ {
+ config->writeEntry("UndoRedo",newUndo);
+ doc->setUndoRedoLimit(newUndo);
+ m_oldNbRedo=newUndo;
+ }
+ config->writeEntry("PrintNotes", m_cbPrintNotes->isChecked());
+
+ KMacroCommand * macroCmd=0L;
+ bool b=m_displayLink->isChecked();
+ bool b_new=doc->getVariableCollection()->variableSetting()->displayLink();
+ if(b_new!=b)
+ {
+ if(!macroCmd)
+ macroCmd=new KMacroCommand(i18n("Change Display Link Command"));
+
+ KPrChangeVariableSettingsCommand *cmd=new KPrChangeVariableSettingsCommand(
+ i18n("Change Display Link Command"), doc, b_new, b, KPrChangeVariableSettingsCommand::VS_DISPLAYLINK);
+ cmd->execute();
+ macroCmd->addCommand(cmd);
+ }
+
+ b=m_underlineLink->isChecked();
+ if(doc->getVariableCollection()->variableSetting()->underlineLink()!=b)
+ {
+ if(!macroCmd)
+ macroCmd=new KMacroCommand(i18n("Change Display Link Command"));
+
+ KPrChangeVariableSettingsCommand *cmd=new KPrChangeVariableSettingsCommand(
+ i18n("Change Display Link Command"), doc, doc->getVariableCollection()->variableSetting()->underlineLink(),
+ b, KPrChangeVariableSettingsCommand::VS_UNDERLINELINK);
+ cmd->execute();
+ macroCmd->addCommand(cmd);
+ }
+
+ b=m_displayComment->isChecked();
+ if(doc->getVariableCollection()->variableSetting()->displayComment()!=b)
+ {
+ if(!macroCmd)
+ macroCmd=new KMacroCommand(i18n("Change Display Link Command"));
+
+ KPrChangeVariableSettingsCommand *cmd=new KPrChangeVariableSettingsCommand(
+ i18n("Change Display Link Command"), doc, doc->getVariableCollection()->variableSetting()->displayComment(),
+ b, KPrChangeVariableSettingsCommand::VS_DISPLAYCOMMENT);
+ cmd->execute();
+ macroCmd->addCommand(cmd);
+ }
+
+ b=m_displayFieldCode->isChecked();
+ if(doc->getVariableCollection()->variableSetting()->displayFieldCode()!=b)
+ {
+ if(!macroCmd)
+ macroCmd=new KMacroCommand(i18n("Change Display Field Code Command"));
+
+ KPrChangeVariableSettingsCommand *cmd=new KPrChangeVariableSettingsCommand(
+ i18n("Change Display Field Code Command"), doc, doc->getVariableCollection()->variableSetting()->displayComment(),
+ b, KPrChangeVariableSettingsCommand::VS_DISPLAYFIELDCODE);
+ cmd->execute();
+ macroCmd->addCommand(cmd);
+ }
+
+ doc->setGridValue( resolutionX->value(),
+ resolutionY->value(), true);
+ doc->repaint( false );
+
+ config->sync();
+
+ return macroCmd;
+}
+
+void KPrConfigureMiscPage::slotDefault()
+{
+ m_undoRedoLimit->setValue(30);
+ m_displayLink->setChecked(true);
+ m_displayComment->setChecked(true);
+ m_underlineLink->setChecked(true);
+ m_displayFieldCode->setChecked( false );
+ m_cbPrintNotes->setChecked(true);
+ //KPrDocument* doc = m_pView->kPresenterDoc();
+
+ resolutionY->setValue( MM_TO_POINT( 5.0 ));
+ resolutionX->setValue( MM_TO_POINT( 5.0 ));
+}
+
+KPrConfigureDefaultDocPage::KPrConfigureDefaultDocPage(KPrView *_view, QWidget *parent, char *name )
+ : QWidget( parent, name )
+{
+ QVBoxLayout *box = new QVBoxLayout( this, 0, 0 );
+
+ m_pView=_view;
+ config = KPrFactory::global()->config();
+ KPrDocument *doc = m_pView->kPresenterDoc();
+ oldAutoSaveValue = doc->defaultAutoSave()/60;
+ m_oldBackupFile = true;
+ m_oldLanguage = doc->globalLanguage();
+ m_oldHyphenation = doc->globalHyphenation();
+ if( config->hasGroup("Interface") ) {
+ config->setGroup( "Interface" );
+ oldAutoSaveValue = config->readNumEntry( "AutoSave", oldAutoSaveValue );
+ m_oldBackupFile=config->readBoolEntry("BackupFile",m_oldBackupFile);
+ m_oldLanguage = config->readEntry( "language", m_oldLanguage );
+ m_oldHyphenation = config->readBoolEntry( "hyphenation", m_oldHyphenation);
+ }
+
+ QVGroupBox* gbDocumentDefaults = new QVGroupBox( i18n("Document Defaults"), this, "GroupBox" );
+ gbDocumentDefaults->setMargin( KDialog::marginHint() );
+ gbDocumentDefaults->setInsideSpacing( 5 );
+
+ QWidget *fontContainer = new QWidget(gbDocumentDefaults);
+ QGridLayout * fontLayout = new QGridLayout(fontContainer, 1, 3);
+
+ fontLayout->setColStretch(0, 0);
+ fontLayout->setColStretch(1, 1);
+ fontLayout->setColStretch(2, 0);
+
+ QLabel *fontTitle = new QLabel(i18n("Default font:"), fontContainer);
+
+ font= new QFont( doc->defaultFont() );
+
+ QString labelName = font->family() + ' ' + QString::number(font->pointSize());
+ fontName = new QLabel(labelName, fontContainer);
+ fontName->setFont(*font);
+ fontName->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
+
+ QPushButton *chooseButton = new QPushButton(i18n("Choose..."), fontContainer);
+ QWhatsThis::add(chooseButton, i18n( "Click here if you want to set a new font. The KDE default Select Font dialog will then be displayed." ) );
+ connect(chooseButton, SIGNAL(clicked()), this, SLOT(selectNewDefaultFont()));
+
+ fontLayout->addWidget(fontTitle, 0, 0);
+ fontLayout->addWidget(fontName, 0, 1);
+ fontLayout->addWidget(chooseButton, 0, 2);
+
+ QWidget *languageContainer = new QWidget(gbDocumentDefaults);
+ QGridLayout * languageLayout = new QGridLayout(languageContainer, 1, 3);
+
+ languageLayout->setColStretch(0, 0);
+ languageLayout->setColStretch(1, 1);
+
+ QLabel *languageTitle = new QLabel(i18n("Global language:"), languageContainer);
+ QWhatsThis::add(languageTitle, i18n( "Use this drop down box to determine the default language for the document. This setting is used by the hyphenation and spelling tools." ) );
+
+ m_globalLanguage = new QComboBox( languageContainer );
+ m_globalLanguage->insertStringList( KoGlobal::listOfLanguages() );
+ m_globalLanguage->setCurrentText( KoGlobal::languageFromTag( doc->globalLanguage() ) );
+
+ languageLayout->addWidget(languageTitle, 0, 0);
+ languageLayout->addWidget(m_globalLanguage, 0, 1);
+
+ m_autoHyphenation = new QCheckBox( i18n("Automatic hyphenation"), gbDocumentDefaults);
+ QWhatsThis::add(m_autoHyphenation, i18n( "Check this box if you want KPresenter to automatically hyphenate long words when it determines the word wrap in text frames. This is not set by default." ) );
+ m_autoHyphenation->setChecked( m_oldHyphenation );
+
+ box->addWidget(gbDocumentDefaults);
+
+ QVGroupBox* gbDocumentSettings = new QVGroupBox( i18n("Document Settings"), this );
+ gbDocumentSettings->setMargin( KDialog::marginHint() );
+ gbDocumentSettings->setInsideSpacing( KDialog::spacingHint() );
+
+ m_createBackupFile = new QCheckBox( i18n("Create backup file"), gbDocumentSettings);
+ QWhatsThis::add(m_createBackupFile, i18n( "If checked, this will create a .<name>.kpr.autosave.kpr in the folder where your file is. This backup file can then be used in case of a problem.\nThe backup file is updated every time you save your document or every time there is an autosave." ) );
+ m_createBackupFile->setChecked( m_oldBackupFile );
+
+
+ autoSave = new KIntNumInput( oldAutoSaveValue, gbDocumentSettings );
+ autoSave->setRange( 0, 60, 1 );
+ autoSave->setLabel( i18n("Autosave (min):") );
+ autoSave->setSpecialValueText( i18n("No autosave") );
+ autoSave->setSuffix( i18n("min") );
+ QWhatsThis::add(autoSave, i18n( "You can use this to adjust how often KPresenter saves a temporary file. If you set this value to No autosave, KPresenter will not autosave. You can adjust the autosave from 1 to 60 minutes." ) );
+
+ new QLabel(i18n("Starting page number:"), gbDocumentSettings);
+ m_oldStartingPage=doc->getVariableCollection()->variableSetting()->startingPageNumber();
+ m_variableNumberOffset=new KIntNumInput(gbDocumentSettings);
+ m_variableNumberOffset->setRange(1, 9999, 1, false);
+ m_variableNumberOffset->setValue(m_oldStartingPage);
+ QWhatsThis::add(m_variableNumberOffset, i18n( "Here you can change the number for the first page. It is set to 1 by default.\nTip: this is helpful if you have split a single document into multiple files." ) );
+
+ new QLabel(i18n("Tab stop:"), gbDocumentSettings);
+ m_oldTabStopWidth = doc->tabStopValue();
+ KoRect rect = doc->masterPage()->getPageRect();
+ m_tabStopWidth = new KoUnitDoubleSpinBox( gbDocumentSettings , MM_TO_POINT(2), rect.width() ,0.1, m_oldTabStopWidth );
+
+ m_tabStopWidth->setUnit( doc->unit() );
+
+ QWhatsThis::add(m_tabStopWidth, i18n( "Each KPresenter document has a default set of tab stops. If you add tab stops to your document, the newly added tab stops override the default ones. You can use this text box to define the spacing between default tab stops. As an example, if you enter 1.5 in this text box, and the unit of measurement is in centimeters, the first default tab stop will be located 1.5 cm to the right of the frame's left-hand margin. The second default tab stop will be located at 3 cm from the left-hand margin, and so on." ) );
+
+ box->addWidget(gbDocumentSettings);
+ QVGroupBox* gbDocumentCursor = new QVGroupBox( i18n("Cursor"), this );
+ gbDocumentCursor->setMargin( KDialog::marginHint() );
+ gbDocumentCursor->setInsideSpacing( KDialog::spacingHint() );
+
+ m_cursorInProtectedArea= new QCheckBox(i18n("Cursor in protected area"),gbDocumentCursor);
+ m_cursorInProtectedArea->setChecked(doc->cursorInProtectedArea());
+ QWhatsThis::add(m_cursorInProtectedArea, i18n( "When this box is checked and you click in a protected frame within your document, a cursor will appear. When this box is unchecked, and you click in a protected frame, no cursor will be visible." ) );
+
+ m_directInsertCursor= new QCheckBox(i18n("Direct insert cursor"),gbDocumentCursor);
+ m_directInsertCursor->setChecked(doc->insertDirectCursor());
+ QWhatsThis::add(m_directInsertCursor, i18n( "When this box is checked, you can select a section of text using your mouse. Move the mouse to a new area in your document and click once with the middle mouse button and a copy of the selected text will be copied and pasted to the new location in the document.\nWhen this box is unchecked, in order to copy text from one section to another, you must select the text, manually copy the text to the clipboard, then manually paste the text in the new location." ) );
+ box->addWidget(gbDocumentCursor);
+
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ box->addItem(spacer);
+
+}
+
+KPrConfigureDefaultDocPage::~KPrConfigureDefaultDocPage()
+{
+ delete font;
+}
+
+KCommand *KPrConfigureDefaultDocPage::apply()
+{
+ config->setGroup( "Document defaults" );
+ KPrDocument* doc = m_pView->kPresenterDoc();
+ config->writeEntry("DefaultFont",font->toString());
+
+ config->setGroup( "Interface" );
+ int autoSaveVal = autoSave->value();
+ if( autoSaveVal != oldAutoSaveValue ) {
+ config->writeEntry( "AutoSave", autoSaveVal );
+ m_pView->kPresenterDoc()->setAutoSave( autoSaveVal*60 );
+ oldAutoSaveValue=autoSaveVal;
+ }
+ bool state =m_createBackupFile->isChecked();
+
+ if(state!=m_oldBackupFile)
+ {
+ config->writeEntry( "BackupFile", state );
+ doc->setBackupFile( state);
+ m_oldBackupFile=state;
+ }
+
+ state = m_cursorInProtectedArea->isChecked();
+ if ( state != doc->cursorInProtectedArea() )
+ {
+ config->writeEntry( "cursorInProtectArea", state );
+ m_pView->kPresenterDoc()->setCursorInProtectedArea( state );
+ }
+
+ state = m_directInsertCursor->isChecked();
+ if ( state != doc->insertDirectCursor() )
+ doc->setInsertDirectCursor( state );
+
+ //Laurent Todo add a message box to inform user that
+ //global language will change after re-launch kword
+ const QString lang = KoGlobal::tagOfLanguage( m_globalLanguage->currentText() );
+ config->writeEntry( "language" , lang);
+ m_oldLanguage = lang;
+ //don't call this function otherwise we can have a textobject with
+ // a default language and other textobject with other default language.
+ //doc->setGlobalLanguage( lang );
+
+
+ state = m_autoHyphenation->isChecked();
+ config->writeEntry( "hyphenation", state );
+ m_oldHyphenation = state;
+
+ KMacroCommand *macro = 0L;
+ int newStartingPage=m_variableNumberOffset->value();
+ if(newStartingPage!=m_oldStartingPage)
+ {
+ macro = new KMacroCommand( i18n("Change Starting Page Number") );
+ KPrChangeStartingPageCommand *cmd = new KPrChangeStartingPageCommand( i18n("Change Starting Page Number"), doc, m_oldStartingPage,newStartingPage );
+ cmd->execute();
+ macro->addCommand( cmd);
+ m_oldStartingPage=newStartingPage;
+ }
+ double newTabStop = m_tabStopWidth->value();
+ if ( newTabStop != m_oldTabStopWidth)
+ {
+ if ( !macro )
+ macro = new KMacroCommand( i18n("Change Tab Stop Value") );
+ KPrChangeTabStopValueCommand *cmd = new KPrChangeTabStopValueCommand( i18n("Change Tab Stop Value"), m_oldTabStopWidth, newTabStop, doc);
+ cmd->execute();
+ macro->addCommand( cmd );
+ m_oldTabStopWidth = newTabStop;
+ }
+ return macro;
+}
+
+void KPrConfigureDefaultDocPage::slotDefault()
+{
+ autoSave->setValue( m_pView->kPresenterDoc()->defaultAutoSave()/60 );
+ m_variableNumberOffset->setValue(1);
+ m_cursorInProtectedArea->setChecked(true);
+ m_tabStopWidth->setValue( MM_TO_POINT(15));
+ m_createBackupFile->setChecked( true );
+ m_directInsertCursor->setChecked( false );
+ m_globalLanguage->setCurrentText( KoGlobal::languageFromTag( KGlobal::locale()->language() ) );
+ m_autoHyphenation->setChecked( false );
+}
+
+void KPrConfigureDefaultDocPage::selectNewDefaultFont() {
+ QStringList list;
+ KFontChooser::getFontList(list, KFontChooser::SmoothScalableFonts);
+ KFontDialog dlg( this, "Font Selector", false, true, list, true );
+ dlg.setFont(*font);
+ int result = dlg.exec();
+ if (KDialog::Accepted == result) {
+ delete font;
+ font = new QFont(dlg.font());
+ fontName->setText(font->family() + ' ' + QString::number(font->pointSize()));
+ fontName->setFont(*font);
+ m_pView->kPresenterDoc()->setDefaultFont( *font );
+ }
+}
+
+KPrConfigureToolsPage::KPrConfigureToolsPage( KPrView *_view, QWidget *parent, char *name )
+ : QWidget( parent, name )
+{
+ QVBoxLayout *box = new QVBoxLayout( this, 0, 0 );
+
+ m_pView = _view;
+ config = KPrFactory::global()->config();
+ m_pView->getCanvas()->deSelectAllObj();
+
+ QTabWidget *tab = new QTabWidget(this);
+
+ KoPenCmd::Pen pen( m_pView->getPen(), m_pView->getLineBegin(), m_pView->getLineEnd() );
+ m_confPenDia = new KPrPenStyleWidget(tab, 0, pen, true );
+ tab->addTab( m_confPenDia, i18n( "Outl&ine" ) );
+
+ KPrBrushCmd::Brush brush( m_pView->getBrush(),
+ m_pView->getGColor1(),
+ m_pView->getGColor2(),
+ m_pView->getGType(),
+ m_pView->getFillType(),
+ m_pView->getGUnbalanced(),
+ m_pView->getGXFactor(),
+ m_pView->getGYFactor() );
+ m_brushProperty = new KPrBrushProperty( this, 0, brush );
+ tab->addTab( m_brushProperty, i18n( "&Fill" ) );
+
+ KPrRectValueCmd::RectValues rectValues;
+ rectValues.xRnd = m_pView->getRndX();
+ rectValues.yRnd = m_pView->getRndY();
+ m_rectProperty = new KPrRectProperty( this, 0, rectValues );
+ tab->addTab( m_rectProperty, i18n( "&Rectangle" ) );
+
+ KPrPolygonSettingCmd::PolygonSettings polygonSettings;
+ polygonSettings.checkConcavePolygon = m_pView->getCheckConcavePolygon();
+ polygonSettings.cornersValue = m_pView->getCornersValue();
+ polygonSettings.sharpnessValue = m_pView->getSharpnessValue();
+ m_polygonProperty = new KPrPolygonProperty( this, 0, polygonSettings );
+ tab->addTab( m_polygonProperty, i18n( "Polygo&n" ) );
+
+ KPrPieValueCmd::PieValues pieValues;
+ pieValues.pieType = m_pView->getPieType();
+ pieValues.pieAngle = m_pView->getPieAngle();
+ pieValues.pieLength = m_pView->getPieLength();
+ m_pieProperty = new KPrPieProperty( this, 0, pieValues );
+ tab->addTab( m_pieProperty, i18n( "&Pie" ) );
+
+ box->addWidget(tab);
+}
+
+KPrConfigureToolsPage::~KPrConfigureToolsPage()
+{
+}
+
+void KPrConfigureToolsPage::apply()
+{
+ KoPenCmd::Pen pen = m_confPenDia->getPen();
+ m_pView->setPen( pen.pen );
+ m_pView->setLineBegin( pen.lineBegin );
+ m_pView->setLineEnd( pen.lineEnd );
+ m_pView->getActionPenColor()->setCurrentColor( pen.pen.color() );
+
+ KPrBrushCmd::Brush brush = m_brushProperty->getBrush();
+ m_pView->setBrush( brush.brush );
+ m_pView->setFillType( brush.fillType );
+ m_pView->setGColor1( brush.gColor1 );
+ m_pView->setGColor2( brush.gColor2 );
+ m_pView->setGType( brush.gType );
+ m_pView->setGUnbalanced( brush.unbalanced );
+ m_pView->setGXFactor( brush.xfactor );
+ m_pView->setGYFactor( brush.yfactor );
+ m_pView->getActionBrushColor()->setCurrentColor( brush.brush.color() );
+
+ KPrRectValueCmd::RectValues rectValues = m_rectProperty->getRectValues();
+ m_pView->setRndX( rectValues.xRnd );
+ m_pView->setRndY( rectValues.yRnd );
+
+ KPrPolygonSettingCmd::PolygonSettings polygonSettings = m_polygonProperty->getPolygonSettings();
+ m_pView->setCheckConcavePolygon( polygonSettings.checkConcavePolygon );
+ m_pView->setCornersValue( polygonSettings.cornersValue );
+ m_pView->setSharpnessValue( polygonSettings.sharpnessValue );
+
+ KPrPieValueCmd::PieValues pieValues = m_pieProperty->getPieValues();
+ m_pView->setPieType( pieValues.pieType );
+ m_pView->setPieAngle( pieValues.pieAngle );
+ m_pView->setPieLength( pieValues.pieLength );
+
+ //TODO set pen brush in m_rectProperty
+ //TODO set pen brush in m_polygonProperty
+ //TODO set pen brush in m_pieProperty
+}
+
+void KPrConfigureToolsPage::slotDefault()
+{
+ KoPenCmd::Pen pen( KoPen(black, 1.0, SolidLine), L_NORMAL, L_NORMAL );
+ m_confPenDia->setPen( pen );
+ m_pView->getActionPenColor()->setCurrentColor( pen.pen.color() );
+
+ KPrBrushCmd::Brush brush( QBrush( white, SolidPattern ), red, green,
+ BCT_GHORZ, FT_BRUSH, false, 100, 100 );
+ m_brushProperty->setBrush( brush );
+ m_pView->getActionBrushColor()->setCurrentColor( brush.brush.color() );
+
+ KPrRectValueCmd::RectValues rectValues;
+ rectValues.xRnd = 0;
+ rectValues.yRnd = 0;
+ m_rectProperty->setRectValues( rectValues );
+
+ KPrPolygonSettingCmd::PolygonSettings polygonSettings;
+ polygonSettings.checkConcavePolygon = false;
+ polygonSettings.cornersValue = 3;
+ polygonSettings.sharpnessValue = 0;
+ m_polygonProperty->setPolygonSettings( polygonSettings );
+
+ KPrPieValueCmd::PieValues pieValues;
+ pieValues.pieType = PT_PIE;
+ pieValues.pieAngle = 45 * 16;
+ pieValues.pieLength = 270 * 16;
+}
+
+KPrConfigurePathPage::KPrConfigurePathPage( KPrView *_view, QWidget *parent, char *name )
+ : QWidget( parent, name )
+{
+ QVBoxLayout *box = new QVBoxLayout( this, 0, 0 );
+
+ m_pView=_view;
+ KPrDocument* doc = m_pView->kPresenterDoc();
+ config = KPrFactory::global()->config();
+
+ m_pPathView = new KListView( this );
+ m_pPathView->setResizeMode(QListView::NoColumn);
+ m_pPathView->addColumn( i18n( "Type" ) );
+ m_pPathView->addColumn( i18n( "Path" ) );
+ (void) new QListViewItem( m_pPathView, i18n("Picture Path"),doc->picturePath() );
+ (void) new QListViewItem( m_pPathView, i18n("Backup Path"),doc->backupPath() );
+ QWhatsThis::add(m_pPathView, i18n( "There are two paths that are set here: the Backup Path and the Picture Path. The Backup path is the folder where your backup files are saved and the Picture Path is the folder where your pictures are saved." ) );
+ box->addWidget(m_pPathView);
+
+ m_modifyPath = new QPushButton( i18n("Modify Path..."), this);
+ connect( m_modifyPath, SIGNAL( clicked ()), this, SLOT( slotModifyPath()));
+ connect( m_pPathView, SIGNAL( doubleClicked (QListViewItem *, const QPoint &, int )),
+ this, SLOT( slotModifyPath()));
+ connect( m_pPathView, SIGNAL( selectionChanged ( QListViewItem * )),
+ this, SLOT( slotSelectionChanged(QListViewItem * )));
+ slotSelectionChanged(m_pPathView->currentItem());
+ QWhatsThis::add(m_modifyPath, i18n( "When you click this button, a small dialog will appear and, if Default path is unchecked, you can either enter a path yourself or choose one using the standard KDE file dialog." ) );
+ box->addWidget(m_modifyPath);
+
+}
+
+void KPrConfigurePathPage::slotSelectionChanged(QListViewItem * item)
+{
+ m_modifyPath->setEnabled( item );
+}
+
+void KPrConfigurePathPage::slotModifyPath()
+{
+ QListViewItem *item = m_pPathView->currentItem ();
+ if ( item )
+ {
+ if ( item->text(0)==i18n("Picture Path"))
+ {
+ KURLRequesterDlg * dlg = new KURLRequesterDlg( item->text(1), 0L,
+ "picture path dlg");
+ dlg->fileDialog()->setMode(KFile::Directory | KFile::LocalOnly);
+ if ( dlg->exec() )
+ item->setText( 1, dlg->selectedURL().path());
+ delete dlg;
+ }
+ else if ( item->text(0)==i18n("Backup Path"))
+ {
+ KoChangePathDia *dlg = new KoChangePathDia( item->text(1), 0L,
+ "backup path" );
+ if (dlg->exec() )
+ item->setText(1, dlg->newPath());
+ delete dlg;
+ }
+ }
+}
+
+void KPrConfigurePathPage::slotDefault()
+{
+ QListViewItem * item = m_pPathView->findItem(i18n("Picture Path"), 0);
+ if ( item )
+ item->setText(1, KGlobalSettings::documentPath());
+ item = m_pPathView->findItem(i18n("Backup Path"), 0);
+ if ( item )
+ item->setText(1, QString::null );
+}
+
+void KPrConfigurePathPage::apply()
+{
+ QListViewItem *item = m_pPathView->findItem(i18n("Backup Path"), 0);
+ if ( item )
+ {
+ QString res = item->text(1 );
+ if ( res != m_pView->kPresenterDoc()->backupPath())
+ {
+ config->setGroup( "Kpresenter Path" );
+ m_pView->kPresenterDoc()->setBackupPath( res );
+#if KDE_IS_VERSION(3,1,3)
+ config->writePathEntry( "backup path",res );
+#else
+ config->writeEntry( "backup path",res );
+#endif
+ }
+ }
+ item = m_pPathView->findItem(i18n("Picture Path"), 0);
+ if ( item )
+ {
+ QString res = item->text(1 );
+ if ( res != m_pView->kPresenterDoc()->picturePath())
+ {
+ config->setGroup( "Kpresenter Path" );
+ m_pView->kPresenterDoc()->setPicturePath( res );
+#if KDE_IS_VERSION(3,1,3)
+ config->writePathEntry( "picture path",res );
+#else
+ config->writeEntry( "picture path",res );
+#endif
+ }
+ }
+}
+
+////
+
+KPrConfigureTTSPage::KPrConfigureTTSPage( KPrView *_view, QWidget *parent, char *name )
+ : QWidget( parent, name )
+{
+ Q_UNUSED(_view);
+
+ QVBoxLayout *box = new QVBoxLayout( this, 0, 0 );
+
+ m_cbSpeakPointerWidget = new QCheckBox(i18n("Speak widget under &mouse pointer"), this);
+ m_cbSpeakFocusWidget = new QCheckBox(i18n("Speak widget with &focus"), this);
+ m_gbScreenReaderOptions = new QVGroupBox("", this);
+ box->add(m_cbSpeakPointerWidget);
+ box->add(m_cbSpeakFocusWidget);
+ box->add(m_gbScreenReaderOptions);
+ m_gbScreenReaderOptions->setMargin( KDialog::marginHint() );
+ m_gbScreenReaderOptions->setInsideSpacing( KDialog::spacingHint() );
+ m_cbSpeakTooltips = new QCheckBox(i18n("Speak &tool tips"), m_gbScreenReaderOptions);
+ m_cbSpeakWhatsThis = new QCheckBox(i18n("Speak &What's This?"), m_gbScreenReaderOptions);
+ m_cbSpeakDisabled = new QCheckBox(i18n("Verbal indication if widget is disabled (grayed)",
+ "&Say whether disabled"), m_gbScreenReaderOptions);
+ m_cbSpeakAccelerators = new QCheckBox(i18n("Spea&k accelerators"), m_gbScreenReaderOptions);
+ QHBox* hbAcceleratorPrefix = new QHBox(m_gbScreenReaderOptions);
+ QWidget* spacer = new QWidget(hbAcceleratorPrefix);
+ spacer->setMinimumWidth(2 * KDialog::marginHint());
+ m_lblAcceleratorPrefix =
+ new QLabel(i18n("A word spoken before another word", "Pr&efaced by the word:"),
+ hbAcceleratorPrefix);
+ m_leAcceleratorPrefixWord = new QLineEdit(i18n("Keyboard accelerator, such as Alt+F", "Accelerator"),
+ hbAcceleratorPrefix);
+ m_lblAcceleratorPrefix->setBuddy(m_leAcceleratorPrefixWord);
+ QHBox* hbPollingInterval = new QHBox(m_gbScreenReaderOptions);
+ hbPollingInterval->setMargin( 0 );
+ QLabel* lblPollingInterval = new QLabel(i18n("&Polling interval:"), hbPollingInterval);
+ m_iniPollingInterval = new KIntNumInput(hbPollingInterval);
+ m_iniPollingInterval->setSuffix(" ms");
+ m_iniPollingInterval->setRange(100, 5000, 100, true);
+ lblPollingInterval->setBuddy(m_iniPollingInterval);
+
+ config = KPrFactory::global()->config();
+ config->setGroup("TTS");
+ m_cbSpeakPointerWidget->setChecked(config->readBoolEntry("SpeakPointerWidget", false));
+ m_cbSpeakFocusWidget->setChecked(config->readBoolEntry("SpeakFocusWidget", false));
+ m_cbSpeakTooltips->setChecked(config->readBoolEntry("SpeakTooltips", true));
+ m_cbSpeakWhatsThis->setChecked(config->readBoolEntry("SpeakWhatsThis", false));
+ m_cbSpeakDisabled->setChecked(config->readBoolEntry("SpeakDisabled", true));
+ m_cbSpeakAccelerators->setChecked(config->readBoolEntry("SpeakAccelerators", true));
+ m_leAcceleratorPrefixWord->setText(config->readEntry("AcceleratorPrefixWord",
+ i18n("Keyboard accelerator, such as Alt+F", "Accelerator")));
+ m_iniPollingInterval->setValue(config->readNumEntry("PollingInterval", 600));
+
+ screenReaderOptionChanged();
+ connect(m_cbSpeakPointerWidget, SIGNAL(toggled(bool)), this, SLOT(screenReaderOptionChanged()));
+ connect(m_cbSpeakFocusWidget, SIGNAL(toggled(bool)), this, SLOT(screenReaderOptionChanged()));
+ connect(m_cbSpeakAccelerators, SIGNAL(toggled(bool)), this, SLOT(screenReaderOptionChanged()));
+}
+
+void KPrConfigureTTSPage::slotDefault()
+{
+ m_cbSpeakPointerWidget->setChecked(false);
+ m_cbSpeakFocusWidget->setChecked(false);
+ m_cbSpeakTooltips->setChecked(true);
+ m_cbSpeakWhatsThis->setChecked(false);
+ m_cbSpeakDisabled->setChecked(true);
+ m_cbSpeakAccelerators->setChecked(true);
+ m_leAcceleratorPrefixWord->setText(i18n("Keyboard accelerator, such as Alt+F", "Accelerator"));
+ m_iniPollingInterval->setValue(600);
+}
+
+void KPrConfigureTTSPage::apply()
+{
+ config->setGroup("TTS");
+ config->writeEntry("SpeakPointerWidget", m_cbSpeakPointerWidget->isChecked());
+ config->writeEntry("SpeakFocusWidget", m_cbSpeakFocusWidget->isChecked());
+ config->writeEntry("SpeakTooltips", m_cbSpeakTooltips->isChecked());
+ config->writeEntry("SpeakWhatsThis", m_cbSpeakWhatsThis->isChecked());
+ config->writeEntry("SpeakDisabled", m_cbSpeakDisabled->isChecked());
+ config->writeEntry("SpeakAccelerators", m_cbSpeakAccelerators->isChecked());
+ config->writeEntry("AcceleratorPrefixWord", m_leAcceleratorPrefixWord->text());
+ config->writeEntry("PollingInterval", m_iniPollingInterval->value());
+ if (kospeaker) kospeaker->readConfig(config);
+}
+
+void KPrConfigureTTSPage::screenReaderOptionChanged()
+{
+ m_gbScreenReaderOptions->setEnabled(
+ m_cbSpeakPointerWidget->isChecked() | m_cbSpeakFocusWidget->isChecked());
+ m_leAcceleratorPrefixWord->setEnabled(m_cbSpeakAccelerators->isChecked());
+ m_lblAcceleratorPrefix->setEnabled(m_cbSpeakAccelerators->isChecked());
+}
+
+#include "KPrConfig.moc"
diff --git a/kpresenter/KPrConfig.h b/kpresenter/KPrConfig.h
new file mode 100644
index 000000000..da99cf446
--- /dev/null
+++ b/kpresenter/KPrConfig.h
@@ -0,0 +1,228 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __kpresenter_dlg_config__
+#define __kpresenter_dlg_config__
+
+#include <kdialogbase.h>
+
+class KPrView;
+class KPrDocument;
+class KIntNumInput;
+class KColorButton;
+class KConfig;
+class QCheckBox;
+class KLineEdit;
+class KDoubleNumInput;
+class KoSpellConfigWidget;
+class KPrPenStyleWidget;
+class KPrBrushProperty;
+class KPrRectProperty;
+class KPrPolygonProperty;
+class KPrPieProperty;
+class KoUnitDoubleSpinBox;
+class QVGroupBox;
+
+namespace KSpell2 {
+ class ConfigWidget;
+}
+
+
+class KPrConfigureInterfacePage : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrConfigureInterfacePage( KPrView *_view, QWidget *parent = 0, char *name = 0 );
+ void apply();
+ void slotDefault();
+private:
+ KPrView* m_pView;
+ KConfig* config;
+ int oldNbRecentFiles;
+ KDoubleNumInput* indent;
+ KIntNumInput* recentFiles;
+ QCheckBox *showRuler, *showStatusBar;
+};
+
+class KPrConfigureColorBackground : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrConfigureColorBackground( KPrView* _view, QWidget *parent = 0, char *name = 0 );
+ void apply();
+ void slotDefault();
+protected:
+ KPrView* m_pView;
+ KColorButton* bgColor;
+ KColorButton* gridColor;
+ KConfig* config;
+ QColor oldBgColor;
+ QColor oldGridColor;
+} ;
+
+class KPrConfigureSpellPage : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrConfigureSpellPage( KPrView *_view, QWidget *parent, char *name = 0 );
+ void apply();
+ void slotDefault();
+private:
+ KPrView* m_pView;
+ KSpell2::ConfigWidget *m_spellConfigWidget;
+ KConfig* config;
+};
+
+class KPrConfigureMiscPage : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrConfigureMiscPage( KPrView *_view, QWidget *parent, char *name = 0 );
+ KCommand *apply();
+ void slotDefault();
+private:
+ KPrView* m_pView;
+ KConfig* config;
+ KIntNumInput* m_undoRedoLimit;
+ int m_oldNbRedo;
+ bool m_printNotes;
+ QCheckBox* m_displayLink, *m_displayComment, *m_underlineLink, *m_displayFieldCode, *m_cbPrintNotes;
+ KoUnitDoubleSpinBox * resolutionY, * resolutionX;
+ KDoubleNumInput *m_rotation;
+};
+
+class KPrConfigureDefaultDocPage : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrConfigureDefaultDocPage( KPrView *_view, QWidget *parent, char *name = 0 );
+ ~KPrConfigureDefaultDocPage();
+ KCommand *apply();
+ void slotDefault();
+public slots:
+ void selectNewDefaultFont();
+private:
+ int oldAutoSaveValue;
+ int m_oldStartingPage;
+ double m_oldTabStopWidth;
+ bool m_oldBackupFile;
+ QString m_oldLanguage;
+ KPrView* m_pView;
+ KConfig* config;
+ QFont *font;
+ QLabel *fontName;
+ KIntNumInput* autoSave;
+ KIntNumInput* m_variableNumberOffset;
+ KoUnitDoubleSpinBox *m_tabStopWidth;
+ QCheckBox *m_cursorInProtectedArea;
+ QCheckBox *m_createBackupFile;
+ QCheckBox *m_directInsertCursor;
+ QComboBox *m_globalLanguage;
+ QCheckBox *m_autoHyphenation;
+ bool m_oldHyphenation;
+};
+
+class KPrConfigureToolsPage : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrConfigureToolsPage( KPrView *_view, QWidget *parent, char *name = 0 );
+ ~KPrConfigureToolsPage();
+ void apply();
+ void slotDefault();
+public slots:
+
+private:
+ KPrView* m_pView;
+ KConfig* config;
+
+ KPrPenStyleWidget *m_confPenDia;
+ KPrBrushProperty *m_brushProperty;
+ KPrRectProperty *m_rectProperty;
+ KPrPolygonProperty *m_polygonProperty;
+ KPrPieProperty *m_pieProperty;
+};
+
+class KPrConfigurePathPage : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrConfigurePathPage( KPrView *_view, QWidget *parent, char *name = 0 );
+ void slotDefault();
+ void apply();
+private slots:
+ void slotModifyPath();
+ void slotSelectionChanged(QListViewItem *);
+private:
+ KPrView* m_pView;
+ KConfig* config;
+ KListView* m_pPathView;
+ QPushButton *m_modifyPath;
+};
+
+class KPrConfigureTTSPage : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrConfigureTTSPage( KPrView *_view, QWidget *parent, char *name = 0 );
+ void slotDefault();
+ void apply();
+private slots:
+ void screenReaderOptionChanged();
+private:
+ KConfig* config;
+ QCheckBox* m_cbSpeakPointerWidget;
+ QCheckBox* m_cbSpeakFocusWidget;
+ QVGroupBox* m_gbScreenReaderOptions;
+ QCheckBox* m_cbSpeakTooltips;
+ QCheckBox* m_cbSpeakWhatsThis;
+ QCheckBox* m_cbSpeakDisabled;
+ QCheckBox* m_cbSpeakAccelerators;
+ QLabel* m_lblAcceleratorPrefix;
+ QLineEdit* m_leAcceleratorPrefixWord;
+ KIntNumInput* m_iniPollingInterval;
+};
+
+
+class KPrConfig : public KDialogBase
+{
+ Q_OBJECT
+public:
+ enum { KP_INTERFACE = 1, KP_COLOR=2, KP_KSPELL=4,KP_MISC=8, KP_DOC=16, KP_TOOLS=32,KP_PATH = 64 };
+ KPrConfig( KPrView* parent );
+public slots:
+ void slotApply();
+ void slotDefault();
+ void openPage(int flags);
+private:
+ KPrConfigureInterfacePage *_interfacePage;
+ KPrConfigureColorBackground *_colorBackground;
+ KPrConfigureSpellPage *_spellPage;
+ KPrConfigureMiscPage *_miscPage;
+ KPrConfigureDefaultDocPage *_defaultDocPage;
+ KPrConfigureToolsPage *_toolsPage;
+ KPrConfigurePathPage *m_pathPage;
+ KPrConfigureTTSPage *m_ttsPage;
+ KPrDocument* m_doc;
+
+};
+
+#endif
diff --git a/kpresenter/KPrCubicBezierCurveObjectIface.cpp b/kpresenter/KPrCubicBezierCurveObjectIface.cpp
new file mode 100644
index 000000000..169cce6fe
--- /dev/null
+++ b/kpresenter/KPrCubicBezierCurveObjectIface.cpp
@@ -0,0 +1,65 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrCubicBezierCurveObjectIface.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrUtils.h"
+#include <kdebug.h>
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrCubicBezierCurveObjectIface::KPrCubicBezierCurveObjectIface( KPrCubicBezierCurveObject *_obj )
+ : KPrObjectIface(_obj)
+{
+ obj = _obj;
+}
+
+void KPrCubicBezierCurveObjectIface::setLineBegin( const QString & type)
+{
+ obj->setLineBegin(lineEndBeginFromString( type ));
+}
+
+void KPrCubicBezierCurveObjectIface::setLineEnd( const QString & type)
+{
+ obj->setLineEnd(lineEndBeginFromString( type ));
+}
+
+QString KPrCubicBezierCurveObjectIface::lineBegin()const
+{
+ LineEnd type=obj->getLineBegin();
+ return lineEndBeginName( type );
+}
+
+QString KPrCubicBezierCurveObjectIface::lineEnd() const
+{
+ LineEnd type=obj->getLineEnd();
+ return lineEndBeginName( type );
+}
+
+void KPrCubicBezierCurveObjectIface::horizontalFlip()
+{
+ obj->flip( true );
+}
+
+void KPrCubicBezierCurveObjectIface::verticalFlip()
+{
+ obj->flip( false );
+}
diff --git a/kpresenter/KPrCubicBezierCurveObjectIface.h b/kpresenter/KPrCubicBezierCurveObjectIface.h
new file mode 100644
index 000000000..771e3d1fc
--- /dev/null
+++ b/kpresenter/KPrCubicBezierCurveObjectIface.h
@@ -0,0 +1,50 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPCUBIC_OBJECT_IFACE_H
+#define KPCUBIC_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObjectIface.h"
+#include <qstring.h>
+
+class KPrCubicBezierCurveObject;
+
+class KPrCubicBezierCurveObjectIface : public KPrObjectIface
+{
+ K_DCOP
+public:
+ KPrCubicBezierCurveObjectIface( KPrCubicBezierCurveObject *obj_ );
+
+k_dcop:
+
+ void setLineBegin( const QString & );
+ void setLineEnd( const QString & );
+ QString lineBegin()const;
+ QString lineEnd() const;
+ void horizontalFlip();
+ void verticalFlip();
+
+private:
+ KPrCubicBezierCurveObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrCustomSlideShowDia.cpp b/kpresenter/KPrCustomSlideShowDia.cpp
new file mode 100644
index 000000000..004652b95
--- /dev/null
+++ b/kpresenter/KPrCustomSlideShowDia.cpp
@@ -0,0 +1,461 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qtoolbutton.h>
+#include <qapplication.h>
+#include <qlayout.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+
+#include "KPrPage.h"
+#include "KPrDocument.h"
+#include "KPrView.h"
+
+#include "KPrCustomSlideShowDia.h"
+
+
+KPrCustomSlideShowDia::KPrCustomSlideShowDia( KPrView* _view, KPrDocument *_doc, const char* name )
+ : KDialogBase( _view, name, true, i18n("Custom Slide Show"), Ok|Cancel ), m_doc( _doc ), m_view( _view )
+ , m_customSlideShowMap( m_doc->customSlideShows() )
+{
+ QWidget* page = new QWidget( this );
+ setMainWidget( page );
+
+ QGridLayout *grid1 = new QGridLayout( page,10,3,KDialog::marginHint(), KDialog::spacingHint());
+
+ list=new QListBox(page);
+ grid1->addMultiCellWidget(list,0,8,0,0);
+
+ m_pAdd=new QPushButton(i18n("&Add..."),page);
+ grid1->addWidget(m_pAdd,1,2);
+
+ m_pModify=new QPushButton(i18n("&Modify..."),page);
+ grid1->addWidget(m_pModify,2,2);
+
+ m_pRemove=new QPushButton(i18n("&Remove"),page);
+ grid1->addWidget(m_pRemove,3,2);
+
+ m_pCopy=new QPushButton(i18n("Co&py"),page);
+ grid1->addWidget(m_pCopy,4,2);
+
+ m_pTest=new QPushButton(i18n("Test"),page);
+ grid1->addWidget(m_pTest,5,2);
+
+
+ connect( m_pRemove, SIGNAL( clicked() ), this, SLOT( slotRemove() ) );
+ connect( m_pAdd, SIGNAL( clicked() ), this, SLOT( slotAdd() ) );
+ connect( m_pModify, SIGNAL( clicked() ), this, SLOT( slotModify() ) );
+ connect( m_pCopy, SIGNAL( clicked() ), this, SLOT( slotCopy() ) );
+ connect( m_pTest, SIGNAL( clicked() ), this, SLOT( slotTest() ) );
+
+ connect( list, SIGNAL(doubleClicked(QListBoxItem *)),this,SLOT(slotDoubleClicked(QListBoxItem *)));
+ connect( list, SIGNAL(clicked ( QListBoxItem * )),this,SLOT(slotTextClicked(QListBoxItem * )));
+
+ connect( m_view, SIGNAL( presentationFinished() ), this, SLOT( slotPresentationFinished() ) );
+
+ init();
+ updateButton();
+
+ resize( 600, 250 );
+
+ m_bChanged=false;
+}
+
+
+KPrCustomSlideShowDia::~KPrCustomSlideShowDia()
+{
+ kdDebug()<<"KPrCustomSlideShowDia::~KPrCustomSlideShowDia()********************\n";
+}
+
+void KPrCustomSlideShowDia::init()
+{
+ CustomSlideShowMap::ConstIterator it( m_customSlideShowMap.begin() );
+ for ( ; it != m_customSlideShowMap.end(); ++it )
+ {
+ list->insertItem( it.key() );
+ }
+}
+
+void KPrCustomSlideShowDia::updateButton()
+{
+ bool state = ( list->currentItem() >= 0 );
+ m_pRemove->setEnabled( state );
+ m_pModify->setEnabled( state );
+ m_pCopy->setEnabled( state );
+ m_pTest->setEnabled( state );
+}
+
+void KPrCustomSlideShowDia::slotTextClicked(QListBoxItem*)
+{
+ updateButton();
+}
+
+void KPrCustomSlideShowDia::slotDoubleClicked(QListBoxItem *)
+{
+ updateButton();
+ slotModify();
+}
+
+void KPrCustomSlideShowDia::slotPresentationFinished()
+{
+ kdDebug()<<"void KPrCustomSlideShowDia::slotPresentationFinished()*************************\n";
+ show();
+}
+
+
+void KPrCustomSlideShowDia::hideEvent( QHideEvent* )
+{
+}
+
+void KPrCustomSlideShowDia::slotTest()
+{
+ QListBoxItem *item = list->selectedItem();
+ if ( item )
+ {
+ m_doc->testCustomSlideShow( m_customSlideShowMap[item->text()], m_view );
+ hide();
+ }
+}
+
+void KPrCustomSlideShowDia::slotAdd()
+{
+ QStringList listCustomName;
+ CustomSlideShowMap::Iterator it( m_customSlideShowMap.begin() ) ;
+ for ( ; it != m_customSlideShowMap.end(); ++it )
+ {
+ listCustomName.append( it.key() );
+ }
+
+ KPrDefineCustomSlideShow * dlg = new KPrDefineCustomSlideShow( this, listCustomName, m_doc->getPageList() );
+ if ( dlg->exec() )
+ {
+ //insert new element
+ m_customSlideShowMap.insert( dlg->customSlideShowName(), dlg->customSlides() );
+ list->insertItem( dlg->customSlideShowName() );
+ updateButton();
+ }
+ delete dlg;
+
+}
+
+void KPrCustomSlideShowDia::slotRemove()
+{
+ if (list->selectedItem() )
+ {
+ m_customSlideShowMap.remove( list->selectedItem()->text() );
+ list->removeItem( list->currentItem() );
+ updateButton();
+ }
+}
+
+void KPrCustomSlideShowDia::slotOk()
+{
+ m_doc->setCustomSlideShows( m_customSlideShowMap );
+ accept();
+}
+
+void KPrCustomSlideShowDia::slotModify()
+{
+ QListBoxItem *item = list->selectedItem();
+ if ( item )
+ {
+ QStringList listCustomName;
+ CustomSlideShowMap::ConstIterator it( m_customSlideShowMap.begin() );
+ for ( ; it != m_customSlideShowMap.end(); ++it )
+ {
+ if ( it.key() !=item->text() )
+ listCustomName.append( it.key() );
+ }
+
+ KPrDefineCustomSlideShow * dlg = new KPrDefineCustomSlideShow( this, item->text(), listCustomName,
+ m_doc->getPageList(), m_customSlideShowMap[item->text()]);
+ if ( dlg->exec() )
+ {
+ //insert new element
+ m_customSlideShowMap.remove( list->selectedItem()->text() );
+ m_customSlideShowMap.insert( dlg->customSlideShowName(), dlg->customSlides() );
+ list->changeItem( dlg->customSlideShowName(), list->currentItem() );
+ }
+ delete dlg;
+ }
+
+}
+
+void KPrCustomSlideShowDia::slotCopy()
+{
+ QListBoxItem *item = list->selectedItem();
+ if ( item )
+ {
+ QString str( list->selectedItem()->text() );
+ str+=i18n( "(Copy %1)" );
+ for ( int i =1;; ++i )
+ {
+ if ( !uniqueName( i, str ) )
+ {
+ str = str.arg( i );
+ m_customSlideShowMap.insert( str, m_customSlideShowMap[item->text()] );
+ list->insertItem( str );
+ break;
+ }
+ }
+ }
+}
+
+bool KPrCustomSlideShowDia::uniqueName( int val, const QString & name ) const
+{
+ QString str = name.arg( val );
+ for ( int i= 0; i < ( int )list->count(); ++i )
+ {
+ if ( list->text ( i ) == str )
+ return true;
+ }
+ return false;
+}
+
+
+KPrCustomSlideShowItem::KPrCustomSlideShowItem( QListBox * listbox, KPrPage * page )
+: QListBoxText( listbox, page->pageTitle() )
+, m_page( page )
+{
+}
+
+KPrCustomSlideShowItem::KPrCustomSlideShowItem( KPrPage * page )
+: QListBoxText( page->pageTitle() )
+, m_page( page )
+{
+}
+
+KPrCustomSlideShowItem::KPrCustomSlideShowItem( QListBox * listbox, KPrPage * page, QListBoxItem * after )
+: QListBoxText( listbox, page->pageTitle(), after )
+, m_page( page )
+{
+}
+
+KPrDefineCustomSlideShow::KPrDefineCustomSlideShow( QWidget* parent, QStringList &_listNameSlideShow,
+ const QPtrList<KPrPage> &pages, const char *name )
+: KDialogBase( parent, name, true, i18n("Define Custom Slide Show"), Ok|Cancel )
+, listNameCustomSlideShow( _listNameSlideShow )
+{
+ init();
+ for ( QPtrList<KPrPage>::ConstIterator it = pages.begin(); it != pages.end(); ++it )
+ {
+ listSlide->insertItem( new KPrCustomSlideShowItem( *it ) );
+ }
+}
+
+KPrDefineCustomSlideShow::KPrDefineCustomSlideShow( QWidget* parent, const QString &_customName, QStringList &_listNameSlideShow,
+ const QPtrList<KPrPage> &pages, QValueList<KPrPage *> &customPages, const char* name )
+: KDialogBase( parent, name, true, i18n("Define Custom Slide Show"), Ok|Cancel )
+, listNameCustomSlideShow( _listNameSlideShow )
+{
+ init();
+ m_name->setText( _customName );
+ for ( QPtrList<KPrPage>::ConstIterator it = pages.begin(); it != pages.end(); ++it )
+ {
+ listSlide->insertItem( new KPrCustomSlideShowItem( *it ) );
+ }
+ for ( QValueList<KPrPage *>::ConstIterator it = customPages.begin(); it != customPages.end(); ++it )
+ {
+ listSlideShow->insertItem( new KPrCustomSlideShowItem( *it ) );
+ }
+}
+
+void KPrDefineCustomSlideShow::init()
+{
+ QWidget* page = new QWidget( this );
+ setMainWidget( page );
+
+ QVBoxLayout *lov = new QVBoxLayout( page );
+ lov->setSpacing( KDialog::spacingHint() );
+ QHBoxLayout *loh = new QHBoxLayout( lov );
+
+ QLabel *lab = new QLabel( i18n( "Name:" ), page );
+ loh->addWidget( lab );
+ m_name = new QLineEdit( page );
+ loh->addWidget( m_name );
+
+ QHBoxLayout *lo = new QHBoxLayout( lov );
+ lo->setSpacing( KDialog::spacingHint() );
+
+ QVBoxLayout *loAv = new QVBoxLayout( lo );
+ lab = new QLabel( i18n("Existing slides:"), page );
+ loAv->addWidget( lab );
+ listSlide = new QListBox( page );
+ loAv->addWidget( listSlide );
+ lab->setBuddy( listSlide );
+
+ QVBoxLayout *loHBtns = new QVBoxLayout( lo );
+ loHBtns->addStretch( 1 );
+ m_insertSlide = new QToolButton( page );
+ loHBtns->addWidget( m_insertSlide );
+ m_removeSlide = new QToolButton( page );
+ loHBtns->addWidget( m_removeSlide );
+ loHBtns->addStretch( 1 );
+
+ QVBoxLayout *loS = new QVBoxLayout( lo );
+ lab = new QLabel( i18n("Selected slides:"), page );
+ loS->addWidget( lab );
+ listSlideShow = new QListBox( page );
+ loS->addWidget( listSlideShow );
+ lab->setBuddy( listSlideShow );
+
+ QVBoxLayout *loVBtns = new QVBoxLayout( lo );
+ loVBtns->addStretch( 1 );
+ m_moveUpSlide = new QToolButton( page );
+ m_moveUpSlide->setAutoRepeat( true );
+ loVBtns->addWidget( m_moveUpSlide );
+ m_moveDownSlide = new QToolButton( page );
+ m_moveDownSlide->setAutoRepeat( true );
+ loVBtns->addWidget( m_moveDownSlide );
+ loVBtns->addStretch( 1 );
+
+
+ m_name->setFocus();
+
+ connect( m_insertSlide, SIGNAL(clicked()), this, SLOT(slotMoveInsertSlide() ) );
+ connect( m_removeSlide, SIGNAL(clicked()), this, SLOT(slotMoveRemoveSlide()) );
+ connect( m_moveUpSlide, SIGNAL(clicked()), this, SLOT( slotMoveUpSlide() ) );
+ connect( m_moveDownSlide, SIGNAL(clicked()), this, SLOT(slotMoveDownSlide()) );
+ connect( m_name, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slideNameChanged( const QString & ) ) );
+ connect( listSlideShow, SIGNAL( clicked ( QListBoxItem * ) ), this, SLOT( updateButton() ) );
+ connect( listSlide, SIGNAL( clicked ( QListBoxItem * ) ), this, SLOT( updateButton() ) );
+ connect( listSlide, SIGNAL( doubleClicked ( QListBoxItem * ) ), this, SLOT( slotMoveInsertSlide() ) );
+ connect( listSlideShow, SIGNAL( doubleClicked( QListBoxItem * ) ), this, SLOT( slotMoveRemoveSlide() ) );
+ m_insertSlide->setIconSet( SmallIconSet( ( QApplication::reverseLayout() ? "back" : "forward" ) ) );
+ m_removeSlide->setIconSet( SmallIconSet( ( QApplication::reverseLayout() ? "forward" : "back") ) );
+ m_moveUpSlide->setIconSet( SmallIconSet( "up" ) );
+ m_moveDownSlide->setIconSet( SmallIconSet( "down" ) );
+
+ slideNameChanged( m_name->text() );
+ updateButton();
+ resize( 600, 250 );
+
+}
+
+void KPrDefineCustomSlideShow::slideNameChanged( const QString & _name)
+{
+ enableButtonOK( !_name.isEmpty() );
+}
+
+void KPrDefineCustomSlideShow::updateButton()
+{
+ int pos = listSlideShow->currentItem();
+ m_moveUpSlide->setEnabled( pos>0 );
+ m_moveDownSlide->setEnabled( pos< (( int ) listSlideShow->count()-1 ) );
+ m_removeSlide->setEnabled( listSlideShow->count()>0 );
+ m_insertSlide->setEnabled( listSlide->currentItem()>-1 );
+}
+
+void KPrDefineCustomSlideShow::slotMoveUpSlide()
+{
+ int c = listSlideShow->currentItem();
+ if ( c < 1 ) return;
+ QListBoxItem *item = listSlideShow->item( c );
+ listSlideShow->takeItem( item );
+ listSlideShow->insertItem( item, c-1 );
+ listSlideShow->setCurrentItem( item );
+
+ updateButton();
+}
+
+void KPrDefineCustomSlideShow::slotMoveDownSlide()
+{
+ int c = listSlideShow->currentItem();
+ if ( c < 0 || c == int( listSlideShow->count() ) - 1 ) return;
+ QListBoxItem *item = listSlideShow->item( c );
+ listSlideShow->takeItem( item );
+ listSlideShow->insertItem( item, c+1 );
+ listSlideShow->setCurrentItem( item );
+ updateButton();
+}
+
+void KPrDefineCustomSlideShow::slotMoveRemoveSlide()
+{
+ // move all selected items from selected to available listbox
+ QListBoxItem *item = listSlideShow->firstItem();
+ while ( item ) {
+ if ( item->isSelected() ) {
+ listSlideShow->takeItem( item );
+ }
+ item = item->next();
+ }
+ updateButton();
+}
+
+void KPrDefineCustomSlideShow::slotMoveInsertSlide()
+{
+ QListBoxItem *item = listSlide->firstItem();
+ while ( item ) {
+ if ( item->isSelected() ) {
+ KPrCustomSlideShowItem * i = dynamic_cast<KPrCustomSlideShowItem *>( item );
+ if ( i )
+ {
+ listSlideShow->insertItem( new KPrCustomSlideShowItem( i->getPage() ), ( listSlideShow->count() ) );
+ }
+ }
+ item = item->next();
+ }
+ listSlideShow->setFocus();
+ updateButton();
+}
+
+QValueList<KPrPage *> KPrDefineCustomSlideShow::customSlides()
+{
+ QValueList<KPrPage *> pages;
+ QListBoxItem *item = listSlideShow->firstItem();
+ while ( item )
+ {
+ KPrCustomSlideShowItem * i = dynamic_cast<KPrCustomSlideShowItem *>( item );
+ if ( i )
+ {
+ pages.push_back( i->getPage() );
+ }
+ item = item->next();
+ }
+ return pages;
+}
+
+QString KPrDefineCustomSlideShow::customSlideShowName() const
+{
+ return m_name->text();
+}
+
+
+void KPrDefineCustomSlideShow::slotOk()
+{
+ if ( listNameCustomSlideShow.contains( m_name->text() ) )
+ {
+ KMessageBox::error(this, i18n("Custom Slide Show name is already used."), i18n("Define Custom Slide Show"));
+ }
+ else
+ {
+ if ( listSlideShow->count() == 0 )
+ KMessageBox::error(this, i18n("You did not select any slides. Please select some slides."), i18n("Define Custom Slide Show"));
+ else
+ accept();
+ }
+}
+
+#include "KPrCustomSlideShowDia.moc"
diff --git a/kpresenter/KPrCustomSlideShowDia.h b/kpresenter/KPrCustomSlideShowDia.h
new file mode 100644
index 000000000..203405bd5
--- /dev/null
+++ b/kpresenter/KPrCustomSlideShowDia.h
@@ -0,0 +1,117 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __CUSTOM_SLIDE_SHOW__
+#define __CUSTOM_SLIDE_SHOW__
+
+#include <kdialogbase.h>
+#include <qlistbox.h>
+#include "global.h"
+
+class QLineEdit;
+class QPushButton;
+class KPrDocument;
+class QToolButton;
+class KPrView;
+class KPrPage;
+
+class KPrCustomSlideShowDia : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KPrCustomSlideShowDia( KPrView* _view, KPrDocument *_doc, const char* name );
+ ~KPrCustomSlideShowDia();
+public slots:
+ virtual void slotOk();
+ void slotDoubleClicked(QListBoxItem *);
+ void slotTextClicked(QListBoxItem*);
+ void slotRemove();
+ void slotAdd();
+ void slotModify();
+ void slotCopy();
+ void slotTest();
+ void slotPresentationFinished();
+
+protected:
+ void hideEvent( QHideEvent* );
+
+ void init();
+ void updateButton();
+ bool uniqueName( int val, const QString & name ) const;
+
+ QListBox * list;
+ QPushButton* m_pRemove;
+ QPushButton* m_pAdd;
+ QPushButton* m_pModify;
+ QPushButton* m_pCopy;
+ QPushButton* m_pTest;
+ bool m_bChanged;
+ KPrDocument *m_doc;
+ KPrView *m_view;
+ CustomSlideShowMap m_customSlideShowMap;
+ QStringList listPageName;
+};
+
+class KPrCustomSlideShowItem : public QListBoxText
+{
+public:
+ KPrCustomSlideShowItem( QListBox * listbox, KPrPage * page );
+ KPrCustomSlideShowItem( KPrPage * page );
+ KPrCustomSlideShowItem( QListBox * listbox, KPrPage * page, QListBoxItem * after );
+
+ KPrPage * getPage() { return m_page; }
+private:
+ KPrPage * m_page;
+};
+
+class KPrDefineCustomSlideShow : public KDialogBase
+{
+ Q_OBJECT
+public:
+ KPrDefineCustomSlideShow( QWidget* parent, QStringList &_listNameSlideShow, const QPtrList<KPrPage> &pages, const char *name = 0L);
+ KPrDefineCustomSlideShow( QWidget* parent, const QString &_customName, QStringList &_listNameSlideShow,
+ const QPtrList<KPrPage> &pages, QValueList<KPrPage *> &customPages, const char* name = 0L );
+
+ QString customSlideShowName() const;
+ QValueList<KPrPage *> customSlides();
+
+protected slots:
+ void slotMoveUpSlide();
+ void slotMoveDownSlide();
+ void slotMoveRemoveSlide();
+ void slotMoveInsertSlide();
+ void slideNameChanged( const QString & _name);
+ void updateButton();
+ virtual void slotOk();
+
+protected:
+ void init();
+ QStringList listNameCustomSlideShow;
+ QListBox *listSlide;
+ QListBox *listSlideShow;
+ QToolButton *m_insertSlide;
+ QToolButton *m_removeSlide;
+ QToolButton *m_moveUpSlide;
+ QToolButton *m_moveDownSlide;
+ QLineEdit *m_name;
+
+};
+
+#endif
diff --git a/kpresenter/KPrDocument.cpp b/kpresenter/KPrDocument.cpp
new file mode 100644
index 000000000..595f49813
--- /dev/null
+++ b/kpresenter/KPrDocument.cpp
@@ -0,0 +1,4857 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrDocument.h"
+#include "KPrView.h"
+#include "KPrCanvas.h"
+#include "KPrPage.h"
+#include "KPrObject.h"
+#include "KPrLineObject.h"
+#include "KPrRectObject.h"
+#include "KPrEllipseObject.h"
+#include "KPrAutoformObject.h"
+#include "KPrTextObject.h"
+#include "KPrTextDocument.h"
+#include "KPrPixmapObject.h"
+#include "KPrPieObject.h"
+#include "KPrPartObject.h"
+#include "KPrGroupObject.h"
+#include "KPrCommand.h"
+#include "insertpagedia.h"
+#include "KPrFreehandObject.h"
+#include "KPrPolylineObject.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrPolygonObject.h"
+#include "KPrClosedLineObject.h"
+#include "KPrSVGPathParser.h"
+
+#include <qpopupmenu.h>
+#include <qclipboard.h>
+#include <qregexp.h>
+#include <qfileinfo.h>
+#include <qdom.h>
+#include <qdict.h>
+
+#include <KoDom.h>
+#include <KoXmlNS.h>
+
+#include <kurl.h>
+#include <kdebug.h>
+#include <KoGlobal.h>
+#include <kapplication.h>
+#include <kurldrag.h>
+#include <ktempfile.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kio/netaccess.h>
+
+#include <KoTemplateChooseDia.h>
+#include <KoRuler.h>
+#include <KoGenStyles.h>
+#include <KoFilterManager.h>
+#include <KoStore.h>
+#include <KoStoreDevice.h>
+#include <KoQueryTrader.h>
+#include <KoXmlWriter.h>
+#include <KoOasisSettings.h>
+#include <KoMainWindow.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <unistd.h>
+#include <config.h>
+
+#include <KoRichText.h>
+#include <KoTextObject.h>
+#include <KoTextZoomHandler.h>
+#include <KoStyleCollection.h>
+#include <kcommand.h>
+#include "KPrDocumentIface.h"
+
+#include <kspell2/settings.h>
+
+#include <KoVariable.h>
+#include <KoAutoFormat.h>
+#include <KoDocumentInfo.h>
+#include "KPrVariableCollection.h"
+#include "KPrBackground.h"
+#include "KPrNoteBar.h"
+#include "KPrBgSpellCheck.h"
+#include <kglobalsettings.h>
+#include <KoCommandHistory.h>
+#include "KoApplication.h"
+#include <KoOasisStyles.h>
+#include <KoOasisContext.h>
+
+#include "KPrLoadingInfo.h"
+
+using namespace std;
+
+static const int CURRENT_SYNTAX_VERSION = 2;
+// Make sure an appropriate DTD is available in www/koffice/DTD if changing this value
+static const char * CURRENT_DTD_VERSION = "1.2";
+
+KPrChild::KPrChild( KPrDocument *_kpr, KoDocument* _doc, const QRect& _rect )
+ : KoDocumentChild( _kpr, _doc, _rect )
+{
+ m_parent = _kpr;
+}
+
+KPrChild::KPrChild( KPrDocument *_kpr ) :
+ KoDocumentChild( _kpr )
+{
+ m_parent = _kpr;
+}
+
+KPrChild::~KPrChild()
+{
+}
+
+KoDocument *KPrChild::hitTest( const QPoint &, const QWMatrix & )
+{
+ // hitTest functionality is disabled because kpresenter handles activation
+ // of embedded parts by itself. See KPrPartObject::activate().
+ return 0;
+}
+
+KPrDocument::KPrDocument( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name,
+ bool singleViewMode )
+ : KoDocument( parentWidget,widgetName, parent, name, singleViewMode ),
+ _gradientCollection(), m_customListTest( 0L ),
+ m_childCountBeforeInsert( 0 )
+{
+ setInstance( KPrFactory::global() );
+ setTemplateType( "kpresenter_template" );
+ //Necessary to define page where we load object otherwise copy-duplicate page doesn't work.
+ m_pageWhereLoadObject=0L;
+ m_loadingInfo=0L;
+ m_tabStop = MM_TO_POINT( 15.0 );
+ m_styleColl=new KoStyleCollection();
+ m_insertFilePage = 0;
+ m_picturePath= KGlobalSettings::documentPath();
+ m_globalLanguage = KGlobal::locale()->language();
+ m_bGlobalHyphenation = false;
+ _duplicatePage=false;
+
+ KoParagStyle* m_standardStyle = new KoParagStyle( "Standard" );
+ m_styleColl->addStyle( m_standardStyle );
+
+ KConfig *config = KPrFactory::global()->config();
+ config->setGroup("Document defaults" );
+ QString defaultFontname=config->readEntry("DefaultFont");
+ if ( !defaultFontname.isEmpty() )
+ m_defaultFont.fromString( defaultFontname );
+ // If not found, we automatically fallback to the application font (the one from KControl's font module)
+
+ // Try to force a scalable font.
+ m_defaultFont.setStyleStrategy( QFont::ForceOutline );
+ //kdDebug(33001) << "Default font: requested family: " << m_defaultFont.family() << endl;
+ //kdDebug(33001) << "Default font: real family: " << QFontInfo(m_defaultFont).family() << endl;
+
+ int ptSize = m_defaultFont.pointSize();
+ if ( ptSize == -1 ) // specified with a pixel size ?
+ ptSize = QFontInfo(m_defaultFont).pointSize();
+ //kdDebug(33001) << "KPrDocument::KPrDocument[2] ptSize=" << ptSize << endl;
+ // Ok, this is KPresenter. A default font of 10 makes no sense. Let's go for 20.
+ ptSize = QMAX( 20, ptSize );
+
+ m_standardStyle->format().setFont( m_defaultFont );
+
+ /// KPresenter isn't color-scheme aware, it defaults to black on white.
+ m_standardStyle->format().setColor( Qt::black );
+
+ if( config->hasGroup("Interface") ) {
+ config->setGroup( "Interface" );
+ m_globalLanguage=config->readEntry("language", KGlobal::locale()->language());
+ m_bGlobalHyphenation=config->readBoolEntry("hyphenation", false);
+ }
+
+ m_standardStyle->format().setLanguage( m_globalLanguage);
+
+ m_zoomHandler = new KoTextZoomHandler;
+
+ m_varFormatCollection = new KoVariableFormatCollection;
+ m_varColl = new KPrVariableCollection( new KoVariableSettings(), m_varFormatCollection );
+ m_bgSpellCheck = new KPrBgSpellCheck(this);
+ dcop = 0;
+ m_initialActivePage=0;
+ m_bShowStatusBar = true;
+ m_autoFormat = new KoAutoFormat(this,m_varColl,m_varFormatCollection);
+ _clean = true;
+ _spInfiniteLoop = false;
+ _spShowEndOfPresentationSlide = true;
+ _spManualSwitch = true;
+ _showPresentationDuration = false;
+ tmpSoundFileList = QPtrList<KTempFile>();
+ _xRnd = 20;
+ _yRnd = 20;
+ _txtBackCol = lightGray;
+ _otxtBackCol = lightGray;
+
+ m_bShowRuler=true;
+ m_bAllowAutoFormat = true;
+
+ m_bViewFormattingChars = false;
+ m_bShowGuideLines = true;
+
+ m_bShowGrid = true;
+
+ m_bSnapToGrid = true;
+
+ m_cursorInProtectectedArea=true;
+
+ usedSoundFile = QStringList();
+ haveNotOwnDiskSoundFile = QStringList();
+
+ m_zoomHandler->setZoomAndResolution( 100, KoGlobal::dpiX(), KoGlobal::dpiY() );
+ newZoomAndResolution(false,false);
+
+ // _pageLayout.format = PG_SCREEN;
+ // _pageLayout.orientation = PG_PORTRAIT;
+ // _pageLayout.width = PG_SCREEN_WIDTH;
+ // _pageLayout.height = PG_SCREEN_HEIGHT;
+ // _pageLayout.left = 0;
+ // _pageLayout.right = 0;
+ // _pageLayout.top = 0;
+ // _pageLayout.bottom = 0;
+ // _pageLayout.ptWidth = cMM_TO_POINT( PG_SCREEN_WIDTH );
+ // _pageLayout.ptHeight = cMM_TO_POINT( PG_SCREEN_HEIGHT );
+ // _pageLayout.ptLeft = 0;
+ // _pageLayout.ptRight = 0;
+ // _pageLayout.ptTop = 0;
+ // _pageLayout.ptBottom = 0;
+
+ m_indent = MM_TO_POINT( 10.0 );
+ m_gridX = MM_TO_POINT( 5.0 );
+ m_gridY = MM_TO_POINT( 5.0 );
+
+ oldGridX = m_gridX;
+ oldGridY = m_gridY;
+
+ m_masterPage=new KPrPage(this);
+ KPrPage *newpage = new KPrPage( this, m_masterPage );
+ m_pageList.insert( 0,newpage);
+ m_bInsertDirectCursor = false;
+
+ objStartY = 0;
+ _presPen = QPen( red, 3, SolidLine );
+ ignoreSticky = TRUE;
+
+ m_gridColor=Qt::black;
+
+ _header = new KPrTextObject( this );
+ _header->setDrawEditRect( false );
+ _header->setDrawEmpty( false );
+
+ _footer = new KPrTextObject( this );
+ _footer->setDrawEditRect( false );
+ _footer->setDrawEmpty( false );
+
+ saveOnlyPage = -1;
+ m_maxRecentFiles = 10;
+
+ connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
+ this, SLOT( clipboardDataChanged() ) );
+
+ m_commandHistory = new KoCommandHistory( actionCollection(), true ) ;
+ initConfig();
+
+ connect( m_commandHistory, SIGNAL( documentRestored() ), this, SLOT( slotDocumentRestored() ) );
+ connect( m_commandHistory, SIGNAL( commandExecuted() ), this, SLOT( slotCommandExecuted() ) );
+
+ dcopObject();
+}
+
+void KPrDocument::refreshMenuCustomVariable()
+{
+ emit sig_refreshMenuCustomVariable();
+}
+
+void KPrDocument::slotDocumentRestored()
+{
+ setModified( false );
+}
+
+void KPrDocument::slotCommandExecuted()
+{
+ setModified( true );
+}
+
+void KPrDocument::saveConfig()
+{
+ if ( !isReadWrite())
+ return;
+ KConfigGroup group( KoGlobal::kofficeConfig(), "Spelling" );
+ group.writeEntry( "PersonalDict", m_spellCheckPersonalDict );
+ if ( !isEmbedded() )
+ {
+ KConfig *config = KPrFactory::global()->config();
+ config->setGroup( "Interface" );
+ config->writeEntry( "Zoom", m_zoomHandler->zoom() );
+ config->writeEntry( "AllowAutoFormat" , m_bAllowAutoFormat );
+ config->writeEntry( "ViewFormattingChars", m_bViewFormattingChars );
+ config->writeEntry( "ShowGrid" , m_bShowGrid );
+ config->writeEntry( "SnapToGrid" , m_bSnapToGrid );
+ config->writeEntry( "ResolutionX", m_gridX );
+ config->writeEntry( "ResolutionY", m_gridY );
+ }
+}
+
+void KPrDocument::initConfig()
+{
+ int zoom;
+ KConfig* config = KPrFactory::global()->config();
+ if( config->hasGroup("Interface") ) {
+ config->setGroup( "Interface" );
+ setAutoSave( config->readNumEntry( "AutoSave", defaultAutoSave()/60 ) * 60 );
+ setBackupFile( config->readBoolEntry("BackupFile", true));
+ setCursorInProtectedArea( config->readBoolEntry( "cursorInProtectArea", true ));
+
+ // Config-file value in mm, default 10 pt
+ double indent = config->readDoubleNumEntry("Indent", MM_TO_POINT(10.0) ) ;
+ setIndentValue(indent);
+ m_maxRecentFiles = config->readNumEntry( "NbRecentFile", 10 );
+ setShowRuler(config->readBoolEntry("Rulers",true));
+ zoom = config->readNumEntry( "Zoom", 100 );
+ setShowStatusBar( config->readBoolEntry( "ShowStatusBar" , true ));
+ setAllowAutoFormat( config->readBoolEntry( "AllowAutoFormat" , true ));
+ setViewFormattingChars( config->readBoolEntry( "ViewFormattingChars", false ) );
+ setShowGrid( config->readBoolEntry( "ShowGrid" , true ));
+ setSnapToGrid( config->readBoolEntry( "SnapToGrid", true ));
+ setGridX( config->readDoubleNumEntry( "ResolutionX", MM_TO_POINT( 5.0 ) ));
+ setGridY( config->readDoubleNumEntry( "ResolutionY", MM_TO_POINT( 5.0 ) ));
+
+ m_bInsertDirectCursor= config->readBoolEntry( "InsertDirectCursor", false );
+ m_globalLanguage=config->readEntry("language", KGlobal::locale()->language());
+
+ }
+ else
+ zoom=100;
+
+ QColor oldBgColor = Qt::white;
+ QColor oldGridColor = Qt::black;
+ if ( config->hasGroup( "KPresenter Color" ) ) {
+ config->setGroup( "KPresenter Color" );
+ setTxtBackCol(config->readColorEntry( "BackgroundColor", &oldBgColor ));
+ setGridColor(config->readColorEntry( "GridColor", &oldGridColor ));
+ }
+
+
+ if( config->hasGroup("KSpell kpresenter" ) )
+ {
+ config->setGroup( "KSpell kpresenter" );
+
+ // Default is false for spellcheck, but the spell-check config dialog
+ // should write out "true" when the user configures spell checking.
+ if ( isReadWrite() )
+ m_bgSpellCheck->setEnabled(config->readBoolEntry( "SpellCheck", false ));
+ else
+ m_bgSpellCheck->setEnabled( false );
+ }
+ int undo=30;
+ if(config->hasGroup("Misc" ) )
+ {
+ config->setGroup( "Misc" );
+ undo=config->readNumEntry("UndoRedo",-1);
+ }
+ if(undo!=-1)
+ setUndoRedoLimit(undo);
+
+ if(config->hasGroup("Kpresenter Path" ) )
+ {
+ config->setGroup( "Kpresenter Path" );
+ m_picturePath=config->readPathEntry( "picture path",KGlobalSettings::documentPath());
+ setBackupPath(config->readPathEntry( "backup path" ));
+ }
+
+ // Load personal dict
+ KConfigGroup group( KoGlobal::kofficeConfig(), "Spelling" );
+ m_spellCheckPersonalDict = group.readListEntry( "PersonalDict" );
+
+ // Apply configuration, without creating an undo/redo command
+ replaceObjs( false );
+ zoomHandler()->setZoom( zoom );
+ newZoomAndResolution(false,false);
+}
+
+DCOPObject* KPrDocument::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrDocumentIface( this );
+
+ return dcop;
+}
+
+KPrDocument::~KPrDocument()
+{
+ if(isReadWrite())
+ saveConfig();
+ clearTestCustomSlideShow();
+ //Be carefull !!!!!! don't delete this pointer delete in stickypage
+#if 0
+ delete _header;
+ delete _footer;
+#endif
+
+ delete m_commandHistory;
+ delete m_zoomHandler;
+ delete m_autoFormat;
+ delete m_varColl;
+ delete m_varFormatCollection;
+ delete dcop;
+ delete m_masterPage;
+ delete m_bgSpellCheck;
+ delete m_styleColl;
+
+ m_pageList.setAutoDelete( true );
+ m_pageList.clear();
+ m_deletedPageList.setAutoDelete( true );
+ m_deletedPageList.clear();
+ tmpSoundFileList.setAutoDelete( true );
+ tmpSoundFileList.clear();
+}
+
+void KPrDocument::addCommand( KCommand * cmd )
+{
+ kdDebug(33001) << "KPrDocument::addCommand " << cmd->name() << endl;
+ m_commandHistory->addCommand( cmd, false );
+ setModified( true );
+}
+
+bool KPrDocument::saveChildren( KoStore* _store )
+{
+ int i = 0;
+
+ QPtrListIterator<KoDocumentChild> it( children() );
+ for( ; it.current(); ++it ) {
+ // Don't save children that are only in the undo/redo history
+ // but not anymore in the presentation
+ QPtrListIterator<KPrPage> pageIt( m_pageList );
+ for ( int pagePos = 0; pageIt.current(); ++pageIt, ++pagePos )
+ {
+ if ( saveOnlyPage == -1 || pagePos == saveOnlyPage )
+ {
+ QPtrListIterator<KPrObject> oIt(pageIt.current()->objectList());
+ for (; oIt.current(); ++oIt )
+ {
+ if ( oIt.current()->getType() == OT_PART &&
+ dynamic_cast<KPrPartObject*>( oIt.current() )->getChild() == it.current() )
+ {
+ if (((KoDocumentChild*)(it.current()))->document()!=0)
+ if ( !((KoDocumentChild*)(it.current()))->document()->saveToStore( _store, QString::number( i++ ) ) )
+ return false;
+ }
+ }
+ }
+ }
+ if ( saveOnlyPage == -1 )
+ {
+ QPtrListIterator<KPrObject> oIt(m_masterPage->objectList());
+ for (; oIt.current(); ++oIt )
+ {
+ if ( oIt.current()->getType() == OT_PART &&
+ dynamic_cast<KPrPartObject*>( oIt.current() )->getChild() == it.current() )
+ {
+ if (((KoDocumentChild*)(it.current()))->document()!=0)
+ if ( !((KoDocumentChild*)(it.current()))->document()->saveToStore( _store, QString::number( i++ ) ) )
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+QDomDocument KPrDocument::saveXML()
+{
+ if ( saveOnlyPage == -1 ) {
+ emit sigProgress( 0 );
+ }
+
+ m_varColl->variableSetting()->setModificationDate(QDateTime::currentDateTime());
+ recalcVariables( VT_DATE );
+ recalcVariables( VT_TIME );
+ recalcVariables( VT_STATISTIC );
+ QDomDocument doc = createDomDocument( "DOC", CURRENT_DTD_VERSION );
+ QDomElement presenter=doc.documentElement();
+ presenter.setAttribute("editor", "KPresenter");
+ presenter.setAttribute("mime", "application/x-kpresenter");
+ presenter.setAttribute("syntaxVersion", CURRENT_SYNTAX_VERSION);
+ QDomElement paper=doc.createElement("PAPER");
+ paper.setAttribute("format", static_cast<int>( m_pageLayout.format ));
+ paper.setAttribute("ptWidth", QString::number( m_pageLayout.ptWidth, 'g', 10 ));
+ paper.setAttribute("ptHeight", QString::number( m_pageLayout.ptHeight, 'g', 10 ));
+
+ paper.setAttribute("orientation", static_cast<int>( m_pageLayout.orientation ));
+ paper.setAttribute("unit", unit() );
+ paper.setAttribute("tabStopValue", m_tabStop );
+
+ QDomElement paperBorders=doc.createElement("PAPERBORDERS");
+
+ paperBorders.setAttribute("ptLeft", m_pageLayout.ptLeft);
+ paperBorders.setAttribute("ptTop", m_pageLayout.ptTop);
+ paperBorders.setAttribute("ptRight", m_pageLayout.ptRight);
+ paperBorders.setAttribute("ptBottom", m_pageLayout.ptBottom);
+ paper.appendChild(paperBorders);
+ presenter.appendChild(paper);
+
+ m_varColl->variableSetting()->save(presenter );
+
+ presenter.appendChild(saveAttribute( doc ));
+
+ if ( saveOnlyPage == -1 )
+ emit sigProgress( 5 );
+
+ QDomElement element=doc.createElement("BACKGROUND");
+ element.appendChild(saveBackground( doc ));
+ presenter.appendChild(element);
+
+ if ( saveOnlyPage == -1 )
+ emit sigProgress( 10 );
+
+ //TODO save correct page info for header/footer
+ element=doc.createElement("HEADER");
+ element.setAttribute("show", static_cast<int>( m_pageList.at(0)->hasHeader() ));
+ element.appendChild(_header->save( doc,0 ));
+ presenter.appendChild(element);
+
+ element=doc.createElement("FOOTER");
+ element.setAttribute("show", static_cast<int>( m_pageList.at(0)->hasFooter() ));
+ element.appendChild(_footer->save( doc,0 ));
+ presenter.appendChild(element);
+
+ element = doc.createElement( "HEADERFOOTERBYPAGE" );
+ element.setAttribute( "value", "true" );
+ presenter.appendChild( element );
+
+ element=doc.createElement("HELPLINES");
+ element.setAttribute("show", static_cast<int>( showGuideLines() ));
+ saveGuideLines( doc, element );
+ presenter.appendChild(element);
+
+ if ( saveOnlyPage == -1 )
+ {
+ if( !m_spellCheckIgnoreList.isEmpty() )
+ {
+ QDomElement spellCheckIgnore = doc.createElement( "SPELLCHECKIGNORELIST" );
+ presenter.appendChild( spellCheckIgnore );
+ for ( QStringList::Iterator it = m_spellCheckIgnoreList.begin(); it != m_spellCheckIgnoreList.end(); ++it )
+ {
+ QDomElement spellElem = doc.createElement( "SPELLCHECKIGNOREWORD" );
+ spellCheckIgnore.appendChild( spellElem );
+ spellElem.setAttribute( "word", *it );
+ }
+ }
+ }
+
+ if ( saveOnlyPage == -1 )
+ emit sigProgress( 20 );
+
+ presenter.appendChild(saveTitle( doc ));
+
+ presenter.appendChild(saveNote( doc ));
+
+ if ( saveOnlyPage == -1 )
+ emit sigProgress( 30 );
+
+ presenter.appendChild(saveObjects(doc));
+
+ // ### If we will create a new version of the file format, fix that spelling error
+ element=doc.createElement("INFINITLOOP");
+ element.setAttribute("value", _spInfiniteLoop);
+ element=doc.createElement("SHOWENDOFPRESENTATIONSLIDE");
+ element.setAttribute("value", _spShowEndOfPresentationSlide);
+ presenter.appendChild(element);
+ element=doc.createElement("MANUALSWITCH");
+ element.setAttribute("value", _spManualSwitch);
+ presenter.appendChild(element);
+ element=doc.createElement("PRESSPEED");
+//TODO FIXME !!!!!!!!!!
+//element.setAttribute("value", static_cast<int>( presSpeed ));
+ presenter.appendChild(element);
+ element=doc.createElement("SHOWPRESENTATIONDURATION");
+ element.setAttribute("value", _showPresentationDuration);
+ presenter.appendChild(element);
+
+ if ( saveOnlyPage == -1 )
+ {
+ if ( !m_customListSlideShow.isEmpty() )
+ {
+ QMap<KPrPage *, QString> page2name;
+ int pos = 1;
+ for ( QPtrListIterator<KPrPage> it( m_pageList ); it.current(); ++it )
+ {
+ page2name.insert( it.current(), "page" + QString::number( pos++ ) ) ;
+ }
+
+ element = doc.createElement( "CUSTOMSLIDESHOWCONFIG" );
+ CustomSlideShowMap::Iterator it;
+ for ( it = m_customListSlideShow.begin(); it != m_customListSlideShow.end(); ++it )
+ {
+ QDomElement slide=doc.createElement("CUSTOMSLIDESHOW");
+ slide.setAttribute("name", it.key() );
+ QString tmp;
+ QValueListIterator<KPrPage*> itPage ;
+ for( itPage = ( *it ).begin(); itPage != ( *it ).end(); ++itPage )
+ {
+ int posPage = m_pageList.find( *itPage );
+ if ( posPage != -1 )
+ {
+ if ( itPage != ( *it ).begin() )
+ tmp += ",";
+ tmp += page2name[*itPage];
+ }
+ }
+ slide.setAttribute( "pages", tmp );
+ element.appendChild(slide);
+ }
+ presenter.appendChild(element);
+
+ }
+
+ if ( !m_presentationName.isEmpty() )
+ {
+ element = doc.createElement( "DEFAULTCUSTOMSLIDESHOWNAME" );
+ element.setAttribute( "name", m_presentationName );
+ presenter.appendChild(element);
+ }
+ }
+
+ if ( saveOnlyPage == -1 )
+ emit sigProgress( 40 );
+
+ if ( saveOnlyPage == -1 )
+ {
+ element=doc.createElement("SELSLIDES");
+ for ( uint i = 0; i < m_pageList.count(); i++ ) {
+ QDomElement slide=doc.createElement("SLIDE");
+ slide.setAttribute("nr", i);
+ slide.setAttribute("show", m_pageList.at(i)->isSlideSelected());
+ element.appendChild(slide);
+ }
+ presenter.appendChild(element);
+
+ emit sigProgress( 50 );
+ }
+
+ if ( saveOnlyPage == -1 )
+ {
+ QDomElement styles = doc.createElement( "STYLES" );
+ presenter.appendChild( styles );
+ QValueList<KoUserStyle *> styleList(m_styleColl->styleList());
+ for ( QValueList<KoUserStyle *>::const_iterator it = styleList.begin(), end = styleList.end();
+ it != end ; ++it )
+ saveStyle( static_cast<KoParagStyle *>( *it ), styles );
+
+ emit sigProgress( 60 );
+ }
+
+ // Write "OBJECT" tag for every child
+ QPtrListIterator<KoDocumentChild> chl( children() );
+ for( ; chl.current(); ++chl ) {
+ // Don't save children that are only in the undo/redo history
+ // but not anymore in the presentation
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ ) {
+ if ( saveOnlyPage != -1 && i != saveOnlyPage )
+ continue;
+ double offset=0;
+ if ( saveOnlyPage == -1 )
+ {
+ offset = i * m_pageList.at(i)->getPageRect().height();
+ }
+ saveEmbeddedObject(m_pageList.at(i), chl.current(),doc,presenter,offset );
+ }
+ if ( saveOnlyPage == -1 )
+ {
+ saveEmbeddedObject(m_masterPage, chl.current(),doc,presenter,0.0 );
+ }
+ }
+
+ if ( saveOnlyPage == -1 )
+ emit sigProgress( 70 );
+ makeUsedPixmapList();
+
+ QDomElement pictures = m_pictureCollection.saveXML( KoPictureCollection::CollectionPicture, doc, usedPictures );
+ presenter.appendChild( pictures );
+
+ if ( saveOnlyPage == -1 )
+ emit sigProgress( 90 );
+
+ // Save sound file list.
+ makeUsedSoundFileList();
+ QDomElement soundFiles = saveUsedSoundFileToXML( doc, usedSoundFile );
+ presenter.appendChild( soundFiles );
+
+ if ( saveOnlyPage == -1 )
+ setModified( false );
+ return doc;
+}
+
+void KPrDocument::saveEmbeddedObject(KPrPage *page, const QPtrList<KoDocumentChild>& childList,
+ QDomDocument &doc,QDomElement &presenter )
+{
+ QPtrListIterator<KoDocumentChild> chl( childList );
+ double offset = 0.0;
+ // we need no offset for objects on the master page and when we copy a page
+ if ( m_pageList.findRef( page ) )
+ {
+ offset=m_pageList.findRef(page)*page->getPageRect().height();
+ }
+ for( ; chl.current(); ++chl )
+ saveEmbeddedObject(page, chl.current(),doc,presenter, offset );
+}
+
+void KPrDocument::saveEmbeddedObject(KPrPage *page, KoDocumentChild *chl, QDomDocument &doc,
+ QDomElement &presenter, double offset )
+{
+ QPtrListIterator<KPrObject> oIt(page->objectList());
+ for ( int pos = 0; oIt.current(); ++oIt, ++pos )
+ {
+ if ( oIt.current()->getType() == OT_PART &&
+ static_cast<KPrPartObject*>( oIt.current() )->getChild() == chl )
+ {
+ QDomElement embedded=doc.createElement("EMBEDDED");
+ KPrChild* curr = (KPrChild*)chl;
+
+ // geometry is no zoom value !
+ QRect _rect = curr->geometry();
+ int tmpX = (int)zoomHandler()->unzoomItX( _rect.x() );
+ int tmpY = (int)zoomHandler()->unzoomItY( _rect.y() );
+ int tmpWidth = (int)zoomHandler()->unzoomItX( _rect.width() );
+ int tmpHeight = (int)zoomHandler()->unzoomItY( _rect.height() );
+ curr->setGeometry( QRect( tmpX, tmpY, tmpWidth, tmpHeight ) );
+
+ embedded.appendChild(curr->save(doc, true));
+
+ curr->setGeometry( _rect ); // replace zoom value
+
+ QDomElement settings=doc.createElement("SETTINGS");
+ settings.setAttribute( "z-index", pos );
+ if ( page == m_masterPage )
+ settings.setAttribute("sticky", 1 );
+ QPtrListIterator<KPrObject> setOIt(page->objectList());
+ for (; setOIt.current(); ++setOIt )
+ {
+ if ( setOIt.current()->getType() == OT_PART &&
+ dynamic_cast<KPrPartObject*>( setOIt.current() )->getChild() == curr )
+ settings.appendChild(setOIt.current()->save( doc,offset ));
+ }
+ embedded.appendChild(settings);
+ presenter.appendChild(embedded);
+ }
+ }
+
+}
+
+//TODO with changes with new file format header/footer can't be change
+void KPrDocument::compatibilityFromOldFileFormat()
+{
+ //function to keep compatibility with old file format
+ //for example for presSpeed
+ if ( m_loadingInfo && m_loadingInfo->oldFormat() )
+ {
+ EffectSpeed newValue = ES_MEDIUM;
+ bool presSpeedChanged = ( m_loadingInfo->presSpeed != -1 );
+ if ( presSpeedChanged )
+ {
+ if ( m_loadingInfo->presSpeed < 3 )
+ newValue = ES_SLOW;
+ else if ( m_loadingInfo->presSpeed > 7 )
+ newValue = ES_FAST;
+ }
+ if ( !m_loadingInfo->m_headerFooterByPage )
+ {
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ )
+ {
+ if ( presSpeedChanged )
+ m_pageList.at(i)->setPageEffectSpeed( newValue );
+ m_pageList.at( i )->setHeader( m_loadingInfo->m_header );
+ m_pageList.at( i )->setFooter( m_loadingInfo->m_footer );
+ }
+ }
+
+ }
+ delete m_loadingInfo;
+ m_loadingInfo = 0L;
+
+}
+
+void KPrDocument::enableEmbeddedParts( bool f )
+{
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it )
+ it.current()->enableEmbeddedParts(f);
+}
+
+QDomDocumentFragment KPrDocument::saveBackground( QDomDocument &doc )
+{
+ QDomDocumentFragment fragment=doc.createDocumentFragment();
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ ) {
+ if ( saveOnlyPage != -1 && i != saveOnlyPage )
+ continue;
+ fragment.appendChild( m_pageList.at(i)->save( doc ) );
+ }
+ // save backgound of masterpage only when the complete doc is saved
+ if ( saveOnlyPage == -1 )
+ {
+ fragment.appendChild( m_masterPage->save( doc ) );
+ }
+ return fragment;
+}
+
+QDomElement KPrDocument::saveObjects( QDomDocument &doc )
+{
+ QDomElement objects=doc.createElement("OBJECTS");
+ double yoffset=0.0;
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ ) {
+ if ( saveOnlyPage != -1 && saveOnlyPage!=i)
+ continue;
+ yoffset=i*m_pageList.at(i)->getPageRect().height(); // yoffset is not zoom value !!
+ objects=m_pageList.at(i)->saveObjects( doc, objects, yoffset, saveOnlyPage );
+
+ }
+ if ( !_duplicatePage ) //don't copy objects on master slide when we duplicate page
+ {
+ objects = m_masterPage->saveObjects( doc, objects, 0.0, saveOnlyPage );
+ }
+
+ return objects;
+}
+
+QDomElement KPrDocument::saveTitle( QDomDocument &doc )
+{
+ QDomElement titles=doc.createElement("PAGETITLES");
+
+ if ( saveOnlyPage == -1 )
+ { // All page titles.
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ )
+ {
+ QDomElement title=doc.createElement("Title");
+ title.setAttribute("title", m_pageList.at(i)->manualTitle());
+ titles.appendChild(title);
+ }
+ }
+ else
+ { // Only current page title.
+ QDomElement title=doc.createElement("Title");
+ title.setAttribute("title", m_pageList.at(saveOnlyPage)->manualTitle());
+ titles.appendChild(title);
+ }
+ return titles;
+}
+
+QDomElement KPrDocument::saveNote( QDomDocument &doc )
+{
+ QDomElement notes=doc.createElement("PAGENOTES");
+
+ if ( saveOnlyPage == -1 ) { // All page notes.
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ )
+ {
+ QDomElement note=doc.createElement("Note");
+ note.setAttribute("note", m_pageList.at(i)->noteText( ));
+ notes.appendChild(note);
+ }
+ }
+ else { // Only current page note.
+ QDomElement note=doc.createElement("Note");
+ note.setAttribute("note", m_pageList.at(saveOnlyPage)->noteText( ));
+ notes.appendChild(note);
+ }
+
+ return notes;
+}
+
+QDomElement KPrDocument::saveAttribute( QDomDocument &doc )
+{
+ QDomElement attributes=doc.createElement("ATTRIBUTES");
+ //store first view parameter.
+ int activePage=0;
+
+ if ( m_initialActivePage )
+ activePage=m_pageList.findRef(m_initialActivePage);
+ activePage = QMAX( activePage, 0);
+ attributes.setAttribute("activePage",activePage );
+ attributes.setAttribute("gridx", m_gridX );
+ attributes.setAttribute("gridy", m_gridY );
+ attributes.setAttribute("snaptogrid", (int)m_bSnapToGrid );
+ return attributes;
+}
+
+QDomElement KPrDocument::saveUsedSoundFileToXML( QDomDocument &_doc, QStringList _list )
+{
+ QDomElement soundFiles = _doc.createElement( "SOUNDS" );
+
+ unsigned int i = 0;
+ QStringList::Iterator it = _list.begin();
+ for ( ; it != _list.end(); ++it ) {
+ QString soundFileName = *it;
+ int position = soundFileName.findRev( '.' );
+ QString format = soundFileName.right( soundFileName.length() - position - 1 );
+ QString _name = QString( "sounds/sound%1.%2" ).arg( ++i ).arg( format.lower() );
+
+ QDomElement fileElem = _doc.createElement( "FILE" );
+ soundFiles.appendChild( fileElem );
+ fileElem.setAttribute( "filename", soundFileName );
+ fileElem.setAttribute( "name", _name );
+ }
+
+ return soundFiles;
+}
+
+bool KPrDocument::completeSaving( KoStore* _store )
+{
+ if ( !_store ) {
+ if ( saveOnlyPage == -1 ) {
+ emit sigProgress( 100 );
+ emit sigProgress( -1 );
+ }
+ return true;
+ }
+
+ m_pictureCollection.saveToStore( KoPictureCollection::CollectionPicture, _store, usedPictures );
+
+ saveUsedSoundFileToStore( _store, usedSoundFile );
+
+ if ( saveOnlyPage == -1 ) {
+ emit sigProgress( 100 );
+ emit sigProgress( -1 );
+ }
+
+ return true;
+}
+
+int KPrDocument::supportedSpecialFormats() const
+{
+ return KoDocument::supportedSpecialFormats();
+}
+
+void KPrDocument::saveUsedSoundFileToStore( KoStore *_store, QStringList _list )
+{
+ unsigned int i = 0;
+ QStringList::Iterator it = _list.begin();
+ for ( ; it != _list.end(); ++it ) {
+ QString soundFileName = *it;
+ int position = soundFileName.findRev( '.' );
+ QString format = soundFileName.right( soundFileName.length() - position - 1 );
+ QString _storeURL = QString( "sounds/sound%1.%2" ).arg( ++i ).arg( format.lower() );
+
+ if ( _store->open( _storeURL ) ) {
+ KoStoreDevice dev( _store );
+ QFile _file( soundFileName );
+ if ( _file.open( IO_ReadOnly ) ) {
+ dev.writeBlock( ( _file.readAll() ).data(), _file.size() );
+ _file.close();
+ }
+ _store->close();
+ }
+ }
+}
+
+bool KPrDocument::loadChildren( KoStore* _store )
+{
+ if ( objStartY == 0 && _clean) // Don't do this when inserting a template or a page...
+ {
+ QPtrListIterator<KoDocumentChild> it( children() );
+ for( ; it.current(); ++it ) {
+ if ( !((KoDocumentChild*)it.current())->loadDocument( _store ) )
+ return false;
+ }
+ }
+ else // instead load form the correct child on, m_childCountBeforeInsert has the be set
+ {
+ QPtrListIterator<KoDocumentChild> it( children() );
+ for( int i = 0; it.current(); ++it, ++i ) {
+ if ( i < m_childCountBeforeInsert )
+ continue;
+ if ( !((KoDocumentChild*)it.current())->loadDocument( _store ) )
+ return false;
+ }
+ }
+ return true;
+}
+
+bool KPrDocument::saveOasis( KoStore* store, KoXmlWriter* manifestWriter )
+{
+
+ //todo necessary for new format ?
+ if ( saveOnlyPage == -1 ) {
+ emit sigProgress( 0 );
+ }
+ if ( !store->open( "content.xml" ) )
+ return false;
+ m_pictureCollection.assignUniqueIds();
+ KoStoreDevice contentDev( store );
+ KoXmlWriter* contentWriter = createOasisXmlWriter( &contentDev, "office:document-content" );
+
+
+ m_varColl->variableSetting()->setModificationDate(QDateTime::currentDateTime());
+ recalcVariables( VT_DATE );
+ recalcVariables( VT_TIME );
+ recalcVariables( VT_STATISTIC );
+ KoGenStyles mainStyles;
+ KoSavingContext savingContext( mainStyles, 0, false, KoSavingContext::Store );
+
+ // Save user styles as KoGenStyle objects
+ m_styleColl->saveOasis( mainStyles, KoGenStyle::STYLE_USER, savingContext );
+
+ KTempFile contentTmpFile;
+ contentTmpFile.setAutoDelete( true );
+ QFile* tmpFile = contentTmpFile.file();
+ KoXmlWriter contentTmpWriter( tmpFile, 1 );
+
+
+ //For sticky objects
+ KTempFile stickyTmpFile;
+ stickyTmpFile.setAutoDelete( true );
+ QFile* masterStyles = stickyTmpFile.file();
+ KoXmlWriter stickyTmpWriter( masterStyles, 1 );
+
+
+ contentTmpWriter.startElement( "office:body" );
+ contentTmpWriter.startElement( "office:presentation" );
+
+ saveOasisCustomFied( contentTmpWriter );
+
+ int indexObj = 1;
+ int partIndexObj = 0;
+//save page
+
+ QMap<QString, int> pageNames;
+
+ if ( !_duplicatePage )
+ {
+ m_masterPage->saveOasisPage( store, stickyTmpWriter, 0, savingContext, indexObj, partIndexObj, manifestWriter, pageNames );
+
+ // Now mark all autostyles as "for styles.xml" since headers/footers need them
+ QValueList<KoGenStyles::NamedStyle> autoStyles = mainStyles.styles( KoGenStyle::STYLE_AUTO );
+ for ( QValueList<KoGenStyles::NamedStyle>::const_iterator it = autoStyles.begin();
+ it != autoStyles.end(); ++it ) {
+ kdDebug() << "marking for styles.xml:" << ( *it ).name << endl;
+ mainStyles.markStyleForStylesXml( ( *it ).name );
+ }
+
+ }
+
+ if ( saveOnlyPage != -1 )
+ {
+ m_pageList.at( saveOnlyPage )->saveOasisPage( store, contentTmpWriter, ( saveOnlyPage+1 ), savingContext, indexObj, partIndexObj , manifestWriter, pageNames );
+ }
+ else
+ {
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ )
+ {
+ m_pageList.at( i )->saveOasisPage( store, contentTmpWriter, ( i+1 ), savingContext, indexObj, partIndexObj , manifestWriter, pageNames );
+ }
+ }
+ if ( saveOnlyPage == -1 ) //don't save setting when we save on page
+ {
+ QMap<int, QString> page2name;
+ QMap<QString, int>::ConstIterator it( pageNames.begin() );
+ for ( ; it != pageNames.end(); ++it )
+ {
+ page2name.insert( it.data(), it.key() );
+ }
+ saveOasisPresentationSettings( contentTmpWriter, page2name );
+ }
+
+ contentTmpWriter.endElement(); //office:presentation
+ contentTmpWriter.endElement(); //office:body
+
+ writeAutomaticStyles( *contentWriter, mainStyles, savingContext, false );
+
+ // And now we can copy over the contents from the tempfile to the real one
+ tmpFile->close();
+ contentWriter->addCompleteElement( tmpFile );
+ contentTmpFile.close();
+
+ contentWriter->endElement(); // root element
+ contentWriter->endDocument();
+ delete contentWriter;
+
+ if ( !store->close() ) // done with content.xml
+ return false;
+
+ //add manifest line for content.xml
+ manifestWriter->addManifestEntry( "content.xml", "text/xml" );
+
+ if ( !store->open( "styles.xml" ) )
+ return false;
+
+ manifestWriter->addManifestEntry( "styles.xml", "text/xml" );
+
+ //todo fixme????
+ masterStyles->close();
+ saveOasisDocumentStyles( store, mainStyles, masterStyles, savingContext );
+ stickyTmpFile.close();
+
+ if ( !store->close() ) // done with styles.xml
+ return false;
+
+
+ if ( saveOnlyPage == -1 )
+ emit sigProgress( 90 );
+
+ // Save sound file list.
+//todo ????
+
+
+ makeUsedPixmapList();
+
+ m_pictureCollection.saveOasisToStore( store, usedPictures, manifestWriter);
+
+ if(!store->open("settings.xml"))
+ return false;
+
+ KoXmlWriter& settingsWriter = *createOasisXmlWriter(&contentDev, "office:document-settings");
+ settingsWriter.startElement("office:settings");
+
+ settingsWriter.startElement("config:config-item-set");
+ settingsWriter.addAttribute("config:name", "view-settings");
+
+ KoUnit::saveOasis(&settingsWriter, unit());
+ saveOasisSettings( settingsWriter );
+
+ settingsWriter.endElement(); // config:config-item-set
+
+ settingsWriter.startElement("config:config-item-set");
+ settingsWriter.addAttribute("config:name", "configuration-settings");
+ settingsWriter.addConfigItem("SpellCheckerIgnoreList", m_spellCheckIgnoreList.join( "," ) );
+ settingsWriter.addConfigItem("ShowPresentationDuration", _showPresentationDuration );
+ settingsWriter.endElement(); // config:config-item-set
+
+ m_varColl->variableSetting()->saveOasis( settingsWriter );
+
+ settingsWriter.endElement(); // office:settings
+ settingsWriter.endElement(); // Root:Element
+ settingsWriter.endDocument();
+ delete &settingsWriter;
+
+ if(!store->close())
+ return false;
+
+ manifestWriter->addManifestEntry("settings.xml", "text/xml");
+
+ //reset progressbar
+ emit sigProgress( 100 );
+ emit sigProgress( -1 );
+
+ setModified( false );
+
+ return true;
+}
+
+void KPrDocument::saveOasisCustomFied( KoXmlWriter &writer )const
+{
+ bool customVariableFound = false;
+ QPtrListIterator<KoVariable> it( m_varColl->getVariables() );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->type() == VT_CUSTOM )
+ {
+ if ( !customVariableFound )
+ {
+ writer.startElement( "text:user-field-decls" );
+ customVariableFound = true;
+ }
+ //<text:user-field-decl office:value-type="string" office:string-value="dfddd" text:name="cvbcbcbx"/>
+ writer.startElement( "text:user-field-decl" );
+ writer.addAttribute( "office:value-type", "string" );
+ writer.addAttribute( "office:string-value", static_cast<KoCustomVariable *>( it.current() )->value() );
+ writer.addAttribute( "text:name", static_cast<KoCustomVariable*>( it.current() )->name() );
+ writer.endElement();
+ }
+ }
+ if ( customVariableFound )
+ writer.endElement();
+}
+
+void KPrDocument::loadOasisIgnoreList( const KoOasisSettings& settings )
+{
+ KoOasisSettings::Items configurationSettings = settings.itemSet( "configuration-settings" );
+ if ( !configurationSettings.isNull() )
+ {
+ _showPresentationDuration = configurationSettings.parseConfigItemBool( "ShowPresentationDuration", false );
+ const QString ignorelist = configurationSettings.parseConfigItemString( "SpellCheckerIgnoreList" );
+ m_spellCheckIgnoreList = QStringList::split( ',', ignorelist );
+ }
+}
+
+void KPrDocument::writeAutomaticStyles( KoXmlWriter& contentWriter, KoGenStyles& mainStyles, KoSavingContext& context, bool stylesDotXml )
+{
+ if ( !stylesDotXml )
+ {
+ context.writeFontFaces( contentWriter );
+ contentWriter.startElement( "office:automatic-styles" );
+ }
+ QValueList<KoGenStyles::NamedStyle> styles = mainStyles.styles( KoGenStyle::STYLE_AUTO, stylesDotXml );
+ QValueList<KoGenStyles::NamedStyle>::const_iterator it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( &contentWriter, mainStyles, "style:style", (*it).name, "style:paragraph-properties" );
+ }
+
+ styles = mainStyles.styles( KoGenStyle::STYLE_AUTO_LIST, stylesDotXml );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ ( *it ).style->writeStyle( &contentWriter, mainStyles, "text:list-style", (*it).name, 0 );
+ }
+
+ styles = mainStyles.styles( STYLE_BACKGROUNDPAGEAUTO, stylesDotXml );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( &contentWriter, mainStyles, "style:style", (*it).name, "style:drawing-page-properties" );
+ }
+
+ styles = mainStyles.styles( KoGenStyle::STYLE_GRAPHICAUTO, stylesDotXml );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( &contentWriter, mainStyles, "style:style", (*it).name , "style:graphic-properties" );
+ }
+
+ styles = mainStyles.styles( KoGenStyle::STYLE_NUMERIC_DATE, stylesDotXml );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( &contentWriter, mainStyles, "number:date-style", (*it).name, 0 /*TODO ????*/ );
+ }
+ styles = mainStyles.styles( KoGenStyle::STYLE_NUMERIC_TIME, stylesDotXml );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( &contentWriter, mainStyles, "number:time-style", (*it).name, 0 /*TODO ????*/ );
+ }
+
+ if ( !stylesDotXml )
+ {
+ contentWriter.endElement(); // office:automatic-styles
+ }
+}
+
+void KPrDocument::loadOasisHeaderFooter(QDomNode & drawPage, KoOasisContext & context)
+{
+ QDomNode tmp = KoDom::namedItemNS( drawPage, KoXmlNS::style, "header" );
+ if ( !tmp.isNull() )
+ {
+ //kdDebug()<<" there is a header \n";
+ _header->textObject()->loadOasisContent( tmp.toElement(), context, styleCollection() );
+ }
+ tmp = KoDom::namedItemNS( drawPage, KoXmlNS::style, "footer" );
+ if ( !tmp.isNull() )
+ {
+ //kdDebug()<<" there is a footer \n";
+ _footer->textObject()->loadOasisContent( tmp.toElement(), context, styleCollection() );
+ }
+}
+
+void KPrDocument::saveOasisSettings( KoXmlWriter &settingsWriter )
+{
+ settingsWriter.startElement("config:config-item-map-indexed");
+ settingsWriter.addAttribute("config:name", "Views");
+ settingsWriter.startElement( "config:config-item-map-entry" );
+
+ //ooimpress save it as this line.
+ //<config:config-item config:name="SnapLinesDrawing" config:type="string">H2260V14397H7693H12415H15345H1424</config:config-item>
+ QString guideLinesOasis;
+ //save in mm as in oo
+ for( QValueList<double>::Iterator it = m_vGuideLines.begin(); it != m_vGuideLines.end(); ++it )
+ {
+ int tmpX = ( int ) ( KoUnit::toMM( *it )*100 );
+ guideLinesOasis += "V" + QString::number( tmpX );
+ }
+
+ for( QValueList<double>::Iterator it = m_hGuideLines.begin(); it != m_hGuideLines.end(); ++it )
+ {
+ int tmpY = ( int ) ( KoUnit::toMM( *it )*100 );
+ guideLinesOasis += "H" + QString::number( tmpY );
+ }
+ if ( !guideLinesOasis.isEmpty() )
+ {
+ settingsWriter.addConfigItem( "SnapLinesDrawing", guideLinesOasis );
+ }
+ //<config:config-item config:name="IsSnapToGrid" config:type="boolean">false</config:config-item>
+ settingsWriter.addConfigItem( "IsSnapToGrid", m_bSnapToGrid );
+
+ //<config:config-item config:name="GridFineWidth" config:type="int">500</config:config-item>
+ settingsWriter.addConfigItem( "GridFineWidth", ( ( int ) ( KoUnit::toMM( ( m_gridX ) )*100 ) ) );
+
+
+ //<config:config-item config:name="GridFineHeight" config:type="int">500</config:config-item>
+ settingsWriter.addConfigItem( "GridFineHeight", ( ( int ) ( KoUnit::toMM( ( m_gridY ) )*100 ) ) );
+
+ //<config:config-item config:name="SelectedPage" config:type="short">3</config:config-item>
+ //store first view parameter.
+ int activePage=0;
+ if ( m_initialActivePage )
+ activePage=m_pageList.findRef(m_initialActivePage);
+ activePage = QMAX( activePage, 0);
+ settingsWriter.addConfigItem( "SelectedPage", activePage );
+
+ //not define into oo spec
+ settingsWriter.addConfigItem( "SnapLineIsVisible", showGuideLines() );
+ settingsWriter.endElement();
+ settingsWriter.endElement();
+}
+
+void KPrDocument::loadOasisSettings(const QDomDocument&settingsDoc)
+{
+ kdDebug(33001)<<"void KPrDocument::loadOasisSettings(const QDomDocument&settingsDoc)**********\n";
+ KoOasisSettings settings( settingsDoc );
+ KoOasisSettings::Items viewSettings = settings.itemSet( "view-settings" );
+ setUnit(KoUnit::unit(viewSettings.parseConfigItemString("unit")));
+ KoOasisSettings::IndexedMap viewMap = viewSettings.indexedMap( "Views" );
+ KoOasisSettings::Items firstView = viewMap.entry( 0 );
+ if ( !firstView.isNull() )
+ {
+ parseOasisGuideLines( firstView.parseConfigItemString( "SnapLinesDrawing" ) );
+ setShowGuideLines( firstView.parseConfigItemBool( "SnapLineIsVisible" ) );
+ int valx = firstView.parseConfigItemInt( "GridFineWidth" );
+ m_gridX = MM_TO_POINT( valx / 100.0 );
+ int valy = firstView.parseConfigItemInt( "GridFineHeight" );
+ m_gridY = MM_TO_POINT( valy / 100.0 );
+
+ m_bSnapToGrid = firstView.parseConfigItemBool( "IsSnapToGrid" );
+
+ int activePage = firstView.parseConfigItemInt( "SelectedPage" );
+ kdDebug(33001)<<" activePage :"<<activePage<<endl;
+ if(activePage!=-1)
+ m_initialActivePage=m_pageList.at(activePage);
+ }
+ loadOasisIgnoreList( settings );
+ m_varColl->variableSetting()->loadOasis( settings );
+}
+
+void KPrDocument::parseOasisGuideLines( const QString &text )
+{
+ QString str;
+ int newPos = text.length()-1; //start to element = 1
+ for ( int pos = text.length()-1; pos >=0;--pos )
+ {
+ if ( text[pos]=='V' )
+ {
+ //vertical element
+ str = text.mid( pos+1, ( newPos-pos ) );
+ //kdDebug()<<" vertical :"<< str <<endl;
+ double posX = ( str.toInt() / 100.0 );
+ m_vGuideLines.append( MM_TO_POINT( posX ) );
+ newPos = pos-1;
+ }
+ else if ( text[pos]=='H' )
+ {
+ //horizontal element
+ str = text.mid( pos+1, ( newPos-pos ) );
+ //kdDebug()<<" horizontal :"<< str <<endl;
+ double posY = ( str.toInt() / 100.0 );
+ m_hGuideLines.append( MM_TO_POINT( posY ) );
+ newPos = pos-1;
+ }
+ }
+}
+
+void KPrDocument::loadOasisPresentationSettings( QDomNode &settingsDoc )
+{
+ //kdDebug()<<"presentation:settings ********************************************* \n";
+ QDomElement settings( settingsDoc.toElement() );
+ //kdDebug()<<"settings.attribute(presentation:endless) :"<<settings.attributeNS( KoXmlNS::presentation, "endless", QString::null)<<endl;
+ if (settings.attributeNS( KoXmlNS::presentation, "endless", QString::null)=="true")
+ _spInfiniteLoop = true;
+ if (settings.attributeNS( KoXmlNS::presentation, "show-end-of-presentation-slide", QString::null)=="true")
+ _spShowEndOfPresentationSlide = true;
+ if (settings.attributeNS( KoXmlNS::presentation, "force-manual", QString::null)=="true")
+ _spManualSwitch = true;
+ if ( settings.hasAttributeNS( KoXmlNS::presentation, "start-page" ) )
+ {
+ //TODO allow to start presentation to specific page
+ //???? = settings.attributeNS( KoXmlNS::presentation, "start-page", QString::null );
+ }
+ if ( settings.hasAttributeNS( KoXmlNS::presentation, "show" ) )
+ {
+ m_presentationName = settings.attributeNS( KoXmlNS::presentation, "show", QString::null );
+ kdDebug()<<" default presentation name :"<<m_presentationName<<endl;
+ }
+ loadOasisPresentationCustomSlideShow( settingsDoc );
+}
+
+void KPrDocument::loadOasisPresentationCustomSlideShow( QDomNode &settingsDoc )
+{
+ //kdDebug()<<"void KPrDocument::loadOasisPresentationCustomSlideShow( QDomNode &settingsDoc )**********\n";
+ for ( QDomNode element = settingsDoc.firstChild(); !element.isNull(); element = element.nextSibling() )
+ {
+ QDomElement e = element.toElement();
+ QCString tagName = e.tagName().latin1();
+ //kdDebug()<<" tagName :"<<tagName<<endl;
+ if ( tagName == "show" && e.namespaceURI() == KoXmlNS::presentation )
+ {
+ //kdDebug()<<" e.attribute(presentation:name) :"<<e.attributeNS( KoXmlNS::presentation, "name", QString::null)<< " e.attribute(presentation:pages) :"<<e.attributeNS( KoXmlNS::presentation, "pages", QString::null)<<endl;
+ QString name = e.attributeNS( KoXmlNS::presentation, "name", QString::null );
+ QStringList tmp = QStringList::split( ",", e.attributeNS( KoXmlNS::presentation, "pages", QString::null) );
+ QValueList<KPrPage *> pageList;
+ for ( QStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it )
+ {
+ if ( m_loadingInfo->m_name2page.contains( *it ) )
+ {
+ kdDebug(33001) << "slide show " << name << " page = " << *it << endl;
+ pageList.push_back( m_loadingInfo->m_name2page[*it] );
+ }
+ }
+ if ( ! pageList.empty() )
+ {
+ m_customListSlideShow.insert( name, pageList );
+ }
+ }
+ }
+}
+
+void KPrDocument::saveOasisPresentationSettings( KoXmlWriter &contentTmpWriter, QMap<int, QString> &page2name )
+{
+ //todo don't save when is not value by default (check with oo)
+ //FIXME
+ contentTmpWriter.startElement( "presentation:settings" );
+ contentTmpWriter.addAttribute( "presentation:endless", ( _spInfiniteLoop ? "true" : "false" ) );
+ contentTmpWriter.addAttribute( "presentation:show-end-of-presentation-slide", ( _spShowEndOfPresentationSlide ? "true" : "false" ) );
+ contentTmpWriter.addAttribute( "presentation:force-manual", ( _spManualSwitch ? "true" : "false" ) );
+ //add for default presentation
+ if ( !m_presentationName.isEmpty() )
+ contentTmpWriter.addAttribute( "presentation:show", m_presentationName );
+
+ saveOasisPresentationCustomSlideShow( contentTmpWriter, page2name );
+ contentTmpWriter.endElement();
+}
+
+void KPrDocument::saveOasisPresentationCustomSlideShow( KoXmlWriter &contentTmpWriter, QMap<int, QString> &page2name )
+{
+ if ( m_customListSlideShow.isEmpty() )
+ return;
+
+ CustomSlideShowMap::Iterator it;
+ for ( it = m_customListSlideShow.begin(); it != m_customListSlideShow.end(); ++it )
+ {
+ contentTmpWriter.startElement( "presentation:show" );
+ contentTmpWriter.addAttribute( "presentation:name", it.key() );
+ QString tmp;
+ QValueListIterator<KPrPage*> itPage ;
+ for( itPage = ( *it ).begin(); itPage != ( *it ).end(); ++itPage )
+ {
+ int posPage = m_pageList.find(*itPage );
+ if ( posPage != -1 )
+ {
+ if ( itPage != ( *it ).begin() )
+ tmp += ",";
+ //tmp+=( *itPage )->oasisNamePage(posPage+1)+",";
+ tmp += page2name[posPage + 1];
+ }
+ }
+ contentTmpWriter.addAttribute( "presentation:pages", tmp );
+ contentTmpWriter.endElement();
+ }
+ //<presentation:show presentation:name="New Custom Slide Show" presentation:pages="page1,page1,page1,page1,page1"/>
+}
+
+void KPrDocument::saveOasisDocumentStyles( KoStore* store, KoGenStyles& mainStyles, QFile* masterStyles,
+ KoSavingContext & savingContext, SaveFlag saveFlag ) const
+{
+ KoStoreDevice stylesDev( store );
+ KoXmlWriter* stylesWriter = createOasisXmlWriter( &stylesDev, "office:document-styles" );
+
+ // Yeah we need to save the same font faces in both content.xml and styles.xml...
+ savingContext.writeFontFaces( *stylesWriter );
+
+ stylesWriter->startElement( "office:styles" );
+ QValueList<KoGenStyles::NamedStyle> styles = mainStyles.styles( KoGenStyle::STYLE_USER );
+ QValueList<KoGenStyles::NamedStyle>::const_iterator it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( stylesWriter, mainStyles, "style:style", (*it).name, "style:paragraph-properties" );
+ }
+ styles = mainStyles.styles( KoGenStyle::STYLE_LIST );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( stylesWriter, mainStyles, "text:list-style", (*it).name, 0 );
+ }
+ styles = mainStyles.styles( KoGenStyle::STYLE_HATCH );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( stylesWriter, mainStyles, "draw:hatch", (*it).name, "style:graphic-properties" , true, true /*add draw:name*/);
+ }
+ styles = mainStyles.styles( STYLE_GRADIENT );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( stylesWriter, mainStyles, "draw:gradient", (*it).name, "style:graphic-properties" , true, true /*add draw:name*/);
+ }
+
+ styles = mainStyles.styles( STYLE_STROKE );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( stylesWriter, mainStyles, "draw:stroke-dash", (*it).name, "style:graphic-properties" , true, true /*add draw:name*/);
+ }
+
+ styles = mainStyles.styles( STYLE_MARKER );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( stylesWriter, mainStyles, "draw:marker", (*it).name, "style:graphic-properties" , true, true /*add draw:name*/);
+ }
+ styles = mainStyles.styles( STYLE_PICTURE );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( stylesWriter, mainStyles, "draw:fill-image", (*it).name, "style:image-properties" , true, true /*add draw:name*/);
+ }
+
+ stylesWriter->endElement(); // office:styles
+
+ if ( saveFlag == SaveAll )
+ {
+ stylesWriter->startElement( "office:automatic-styles" );
+ // this has to be the first
+ if ( masterStyles )
+ {
+ writeAutomaticStyles( *stylesWriter, mainStyles, savingContext, true );
+ }
+
+ styles = mainStyles.styles( STYLE_BACKGROUNDPAGE );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( stylesWriter, mainStyles, "style:style", (*it).name , "style:drawing-page-properties" );
+ }
+
+ // if there's more than one pagemaster we need to rethink all this
+ styles = mainStyles.styles( KoGenStyle::STYLE_PAGELAYOUT );
+ Q_ASSERT( styles.count() == 1 );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ (*it).style->writeStyle( stylesWriter, mainStyles, "style:page-layout", (*it).name, "style:page-layout-properties", false /*don't close*/ );
+ stylesWriter->endElement();
+ }
+
+ styles = mainStyles.styles( STYLE_PRESENTATIONSTICKYOBJECT );
+ it = styles.begin();
+ for ( ; it != styles.end() ; ++it ) {
+ //TODO fix me graphic-properties ???
+ (*it).style->writeStyle( stylesWriter, mainStyles, "style:style", (*it).name , "style:graphic-properties" );
+ }
+
+ stylesWriter->endElement(); // office:automatic-styles
+
+
+ if ( masterStyles )
+ {
+ stylesWriter->startElement( "office:master-styles" );
+ stylesWriter->addCompleteElement( masterStyles );
+ stylesWriter->endElement();
+ }
+ }
+
+ stylesWriter->endElement(); // root element (office:document-styles)
+ stylesWriter->endDocument();
+ delete stylesWriter;
+}
+
+bool KPrDocument::loadOasis( const QDomDocument& doc, KoOasisStyles&oasisStyles, const QDomDocument&settingsDoc, KoStore*store )
+{
+ QTime dt;
+ dt.start();
+ m_loadingInfo = new KPrLoadingInfo;
+ ignoreSticky = FALSE;
+ emit sigProgress( 0 );
+
+ lastObj = -1;
+ // clean
+ if ( _clean ) {
+ m_styleColl->clear();
+ // Some simple import filters don't define any style,
+ // so let's have a Standard style at least
+ KoParagStyle * standardStyle = new KoParagStyle( "Standard" ); // This gets translated later on
+ //kdDebug() << "KWDocument::KWDocument creating standardStyle " << standardStyle << endl;
+ standardStyle->format().setFont( m_defaultFont );
+ m_styleColl->addStyle( standardStyle );
+
+ __pgLayout = KoPageLayout::standardLayout();
+ _spInfiniteLoop = false;
+ _spShowEndOfPresentationSlide = true;
+ _spManualSwitch = true;
+ _showPresentationDuration = false;
+ _xRnd = 20;
+ _yRnd = 20;
+ urlIntern = url().path();
+ }
+ else
+ m_spellCheckIgnoreList.clear();
+ emit sigProgress( 5 );
+
+ QDomElement content = doc.documentElement();
+ QDomElement realBody (KoDom::namedItemNS( content, KoXmlNS::office, "body" ) );
+ if ( realBody.isNull() )
+ {
+ kdError(33001) << "No office:body found!" << endl;
+ setErrorMessage( i18n( "Invalid OASIS OpenDocument file. No office:body tag found." ) );
+ return false;
+ }
+ QDomElement body = KoDom::namedItemNS( realBody, KoXmlNS::office, "presentation" );
+ if ( body.isNull() )
+ {
+ kdError(33001) << "No office:presentation found!" << endl;
+ QDomElement childElem;
+ QString localName;
+ forEachElement( childElem, realBody ) {
+ localName = childElem.localName();
+ }
+ if ( localName.isEmpty() )
+ setErrorMessage( i18n( "Invalid OASIS OpenDocument file. No tag found inside office:body." ) );
+ else
+ setErrorMessage( i18n( "This document is not a presentation, but a %1. Please try opening it with the appropriate application." ).arg( KoDocument::tagNameToDocumentType( localName ) ) );
+ return false;
+ }
+
+ // it seems that ooimpress has different paper-settings for every slide.
+ // we take the settings of the first slide for the whole document.
+ QDomNode drawPage = KoDom::namedItemNS( body, KoXmlNS::draw, "page" );
+ if ( drawPage.isNull() ) // no slides? give up.
+ return false;
+ QDomElement dp = drawPage.toElement();
+
+ //code from kword
+ // TODO variable settings
+ // By default display real variable value
+ if ( !isReadWrite())
+ getVariableCollection()->variableSetting()->setDisplayFieldCode(false);
+
+ KoOasisContext context( this, *m_varColl, oasisStyles, store );
+ Q_ASSERT( !oasisStyles.officeStyle().isNull() );
+
+ // Load all styles before the corresponding paragraphs try to use them!
+ m_styleColl->loadOasisStyles( context );
+
+ // if we only copy a page we have no master
+ // also don't copy master when you insert file as long as we don't have multiple masters
+ if ( !m_pageWhereLoadObject && _clean )
+ {
+ QString masterPageName = drawPage.toElement().attributeNS( KoXmlNS::draw, "master-page-name", QString::null );
+ QDomElement *master = oasisStyles.masterPages()[ masterPageName];
+
+ kdDebug()<<" master :"<<master<<endl;
+ kdDebug()<<" masterPageName:"<<masterPageName<<endl;
+ if ( ! master )
+ {
+ masterPageName = "Standard"; // use default layout as fallback (default in kpresenter)
+ master = oasisStyles.masterPages()[ masterPageName];
+ if ( !master ) //last test...
+ master = oasisStyles.masterPages()["Default"];
+ }
+
+ if ( master == 0 )
+ {
+ setErrorMessage( i18n( "Invalid OASIS OpenDocument file. No master-style found inside office:master-styles." ) );
+ return false;
+ }
+
+ kdDebug()<<" load oasis master styles\n";
+ QDomNode node = *master;
+ QDomElement masterElement = node.toElement();
+ kdDebug()<<" node.isNull() :"<<node.isNull()<< ", " << masterElement.attributeNS( KoXmlNS::draw, "style-name", QString::null ) << endl;
+ // add the correct styles
+ const QDomElement* masterPageStyle = context.oasisStyles().findStyleAutoStyle( masterElement.attributeNS( KoXmlNS::draw, "style-name", QString::null ), "drawing-page" );
+ if (masterPageStyle)
+ context.styleStack().push( *masterPageStyle );
+
+ context.setUseStylesAutoStyles( true );
+ m_masterPage->loadOasis( context );
+
+ createPresentationAnimation( KoDom::namedItemNS( node, KoXmlNS::presentation, "animations"));
+
+ loadOasisObject( m_masterPage, node , context);
+
+ m_loadingInfo->clearAnimationShowDict(); // clear all show animations style
+ m_loadingInfo->clearAnimationHideDict(); // clear all hide animations style
+
+ loadOasisHeaderFooter( node,context );
+ context.setUseStylesAutoStyles( false );
+
+ kdDebug()<<" end load oasis master style \n";
+
+ Q_ASSERT( master );
+ const QDomElement *style = master ? oasisStyles.findStyle(master->attributeNS( KoXmlNS::style, "page-layout-name", QString::null )) : 0;
+ const QDomElement *backgroundStyle = oasisStyles.findStyle( "Standard-background", "presentation" );
+ kdDebug()<<"Standard background "<<backgroundStyle<<endl;
+ // parse all pages
+ Q_ASSERT( style );
+ if ( style )
+ {
+ __pgLayout.loadOasis( *style );
+ kdDebug()<<"Page size __pgLayout.ptWidth :"<<__pgLayout.ptWidth<<" __pgLayout.ptHeight :"<<__pgLayout.ptHeight<<endl;
+ kdDebug()<<"Page orientation :"<<(( __pgLayout.orientation== PG_LANDSCAPE )? " landscape " : " portrait ")<<endl;
+
+ kdDebug()<<" margin right:"<< __pgLayout.ptRight <<" __pgLayout.ptBottom :"<<__pgLayout.ptBottom<<" __pgLayout.ptLeft :"<<__pgLayout.ptLeft<<" __pgLayout.ptTop :"<<__pgLayout.ptTop<<endl;
+ }
+ if ( _clean )
+ {
+ /// ### this has already been done, no?
+ setPageLayout( __pgLayout );
+ }
+ }
+
+ int pos = m_insertFilePage;
+ for ( drawPage = body.firstChild(); !drawPage.isNull(); drawPage = drawPage.nextSibling() )
+ {
+ dp = drawPage.toElement();
+ kdDebug()<<"dp.tagName() :"<<dp.tagName()<<endl;
+ if ( dp.tagName()== "page" && dp.namespaceURI() == KoXmlNS::draw ) // don't try to parse "</draw:page>" as page
+ {
+ context.styleStack().clear(); // remove all styles
+ fillStyleStack( dp, context, "drawing-page" );
+ context.styleStack().save();
+ kdDebug ()<<"insert new page "<<pos<<endl;
+ KPrPage *newpage = 0L;
+ if ( m_pageWhereLoadObject )
+ {
+ newpage = m_pageWhereLoadObject;
+ }
+ else
+ {
+ if ( pos != 0 )
+ {
+ newpage = new KPrPage( this, m_masterPage );
+ m_pageList.insert( pos,newpage);
+ }
+ else //we create a first page into KPrDocument()
+ {
+ newpage = m_pageList.at(pos);
+ }
+ }
+ //only set the manual title if it is different to the draw:id. Only in this case it had one.
+ QString str = dp.attributeNS( KoXmlNS::draw, "name", QString::null );
+ m_loadingInfo->m_name2page.insert( str, newpage );
+ QString idPage = dp.attributeNS( KoXmlNS::draw, "id", QString::null );
+
+ if ( dp.hasAttributeNS( KoXmlNS::koffice, "name" ) )
+ {
+ str = dp.attributeNS( KoXmlNS::koffice, "name", QString::null );
+ newpage->insertManualTitle(str);
+ }
+ else
+ {
+ // OO uses /page[0-9]+$/ as default for no name set
+ QRegExp rx( "^page[0-9]+$" );
+ if ( rx.search( str ) == -1 )
+ newpage->insertManualTitle(str);
+ }
+ context.styleStack().setTypeProperties( "drawing-page" );
+
+ newpage->loadOasis( context );
+
+ //All animation object for current page is store into this element
+ createPresentationAnimation(KoDom::namedItemNS( drawPage, KoXmlNS::presentation, "animations"));
+ // parse all objects
+ loadOasisObject( newpage, drawPage, context );
+
+ context.styleStack().restore();
+ m_loadingInfo->clearAnimationShowDict(); // clear all show animations style
+ m_loadingInfo->clearAnimationHideDict(); // clear all hide animations style
+ ++pos;
+ }
+ }
+
+ //load settings at the end as we need to know what the draw:name of a page is
+ QDomNode settings = KoDom::namedItemNS( body, KoXmlNS::presentation, "settings" );
+ kdDebug()<<"settings :"<<settings.isNull()<<endl;
+ if (!settings.isNull() && _clean /*don't load settings when we copy/paste a page*/)
+ loadOasisPresentationSettings( settings );
+
+ ignoreSticky = TRUE;
+ kdDebug()<<" _clean :"<<_clean<<endl;
+ if(_clean)
+ {
+ setModified(false);
+#if 0 //FIXME
+ //it crashed, I don't know why for the moment.
+ startBackgroundSpellCheck();
+#endif
+ }
+ kdDebug(33001) << "Loading took " << (float)(dt.elapsed()) / 1000.0 << " seconds" << endl;
+
+ if ( !settingsDoc.isNull() )
+ {
+ loadOasisSettings( settingsDoc );
+ }
+
+ // set the initial active page
+ if ( m_initialActivePage == 0 )
+ {
+ m_initialActivePage = m_pageList.at( 0 );
+ }
+
+ emit sigProgress( 100 );
+ recalcVariables( VT_ALL );
+ emit sigProgress( -1 );
+
+ setModified( false );
+ return true;
+}
+
+
+void KPrDocument::loadOasisObject( KPrPage * newpage, QDomNode & drawPage, KoOasisContext & context, KPrGroupObject *groupObject )
+{
+ for ( QDomNode object = drawPage.firstChild(); !object.isNull(); object = object.nextSibling() )
+ {
+ QDomElement o = object.toElement();
+ QString name = o.tagName();
+ if ( !name.isEmpty() )
+ {
+ kdDebug()<<" name :"<<name<<endl;
+ if ( o.hasAttributeNS( KoXmlNS::presentation, "placeholder" ) &&
+ o.attributeNS( KoXmlNS::presentation, "placeholder", QString::null ) == "true" )
+ {
+ kdDebug(33001) << "Placeholder" << endl;
+ continue;
+ }
+ context.styleStack().save();
+ const bool isDrawNS = o.namespaceURI() == KoXmlNS::draw;
+ // draw:frame
+ if ( name == "frame" && isDrawNS )
+ {
+ fillStyleStack( o, context, "graphic" );
+ QDomElement elem;
+ forEachElement( elem, o )
+ {
+ if ( elem.namespaceURI() != KoXmlNS::draw )
+ continue;
+ const QString localName = elem.localName();
+ if ( localName == "text-box" )
+ {
+ KPrTextObject *kptextobject = new KPrTextObject( this );
+ kptextobject->loadOasis(o, context, m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kptextobject );
+ else
+ newpage->appendObject(kptextobject);
+ break;
+ }
+ else if ( localName == "image" )
+ {
+ KPrPixmapObject *kppixmapobject = new KPrPixmapObject( pictureCollection() );
+ kppixmapobject->loadOasis( o, context, m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kppixmapobject );
+ else
+ newpage->appendObject(kppixmapobject);
+ break;
+ }
+ else if ( localName == "object" )
+ {
+ KPrChild *ch = new KPrChild( this );
+ QRect r;
+ KPrPartObject *kppartobject = new KPrPartObject( ch );
+ kppartobject->loadOasis( o, context, m_loadingInfo );
+ r = ch->geometry();
+ if ( groupObject )
+ groupObject->addObjects( kppartobject );
+ else
+ newpage->appendObject(kppartobject);
+ insertChild( ch );
+ kppartobject->setOrig( r.x(), r.y() );
+ kppartobject->setSize( r.width(), r.height() );
+ break;
+ }
+ }
+ }
+ else if ( name == "rect" && isDrawNS) // rectangle
+ {
+ fillStyleStack( o, context, "graphic" );
+ KPrRectObject *kprectobject = new KPrRectObject();
+ kprectobject->loadOasis(o, context , m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kprectobject );
+ else
+ newpage->appendObject(kprectobject);
+ }
+ else if ( ( name == "circle" || name == "ellipse" )&& isDrawNS)
+ {
+ fillStyleStack( o, context, "graphic" );
+ if ( o.hasAttributeNS( KoXmlNS::draw, "kind" ) ) // pie, chord or arc
+ {
+ KPrPieObject *kppieobject = new KPrPieObject();
+ kppieobject->loadOasis(o, context, m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kppieobject );
+ else
+ newpage->appendObject(kppieobject);
+ }
+ else // circle or ellipse
+ {
+ KPrEllipseObject *kpellipseobject = new KPrEllipseObject();
+ kpellipseobject->loadOasis(o,context, m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kpellipseobject );
+ else
+ newpage->appendObject(kpellipseobject);
+ }
+ }
+ else if ( name == "line" && isDrawNS) // line
+ {
+ fillStyleStack( o, context, "graphic" );
+ KPrLineObject *kplineobject = new KPrLineObject();
+ kplineobject->loadOasis(o, context, m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kplineobject );
+ else
+ newpage->appendObject( kplineobject );
+ }
+ else if (name=="polyline" && isDrawNS) { // polyline
+ fillStyleStack( o, context, "graphic" );
+ KPrPolylineObject *kppolylineobject = new KPrPolylineObject();
+ kppolylineobject->loadOasis(o, context, m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kppolylineobject );
+ else
+ newpage->appendObject(kppolylineobject);
+ }
+ else if (name=="polygon" && isDrawNS) { // plcloseobject
+ fillStyleStack( o, context, "graphic" );
+ KPrClosedLineObject *kpClosedObject = new KPrClosedLineObject();
+ kpClosedObject->loadOasis( o, context, m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kpClosedObject );
+ else
+ newpage->appendObject(kpClosedObject);
+ }
+ else if (name=="regular-polygon"&& isDrawNS) { // kppolygone object
+ fillStyleStack( o, context, "graphic" );
+ KPrPolygonObject *kpPolygoneObject = new KPrPolygonObject();
+ kpPolygoneObject->loadOasis( o, context, m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kpPolygoneObject );
+ else
+ newpage->appendObject(kpPolygoneObject);
+ }
+ else if ( name == "path" && isDrawNS)
+ {
+ fillStyleStack( o, context, "graphic" );
+ QString d = o.attributeNS( KoXmlNS::svg, "d", QString::null);
+
+ KPrSVGPathParser parser;
+ ObjType objType = parser.getType( d );
+
+ switch ( objType )
+ {
+ case OT_CUBICBEZIERCURVE:
+ {
+ kdDebug(33001) << "Cubicbeziercurve" << endl;
+ KPrCubicBezierCurveObject *kpCurveObject = new KPrCubicBezierCurveObject();
+ kpCurveObject->loadOasis( o, context, m_loadingInfo );
+ if ( groupObject )
+ groupObject->addObjects( kpCurveObject );
+ else
+ newpage->appendObject( kpCurveObject );
+ } break;
+ case OT_QUADRICBEZIERCURVE:
+ {
+ kdDebug(33001) << "Quadricbeziercurve" << endl;
+ KPrQuadricBezierCurveObject *kpQuadricObject = new KPrQuadricBezierCurveObject();
+ kpQuadricObject->loadOasis( o, context, m_loadingInfo );
+ if ( groupObject )
+ groupObject->addObjects( kpQuadricObject );
+ else
+ newpage->appendObject( kpQuadricObject );
+ } break;
+ case OT_FREEHAND:
+ {
+ kdDebug(33001) << "Freehand" << endl;
+ KPrFreehandObject *kpFreeHandObject = new KPrFreehandObject();
+ kpFreeHandObject->loadOasis( o, context, m_loadingInfo );
+ if ( groupObject )
+ groupObject->addObjects( kpFreeHandObject );
+ else
+ newpage->appendObject( kpFreeHandObject );
+ } break;
+ case OT_CLOSED_LINE:
+ {
+ kdDebug(33001) << "Closed Line" << endl;
+ KPrClosedLineObject *kpClosedObject = new KPrClosedLineObject();
+ kpClosedObject->loadOasis( o, context, m_loadingInfo );
+ if ( groupObject )
+ groupObject->addObjects( kpClosedObject );
+ else
+ newpage->appendObject( kpClosedObject );
+ } break;
+ default:
+ kdDebug(33001) << "draw:path found unsupported object type " << objType << " in svg:d " << d << endl;
+ break;
+ }
+ }
+ else if ( name == "custom-shape" && isDrawNS )
+ {
+ fillStyleStack( o, context, "graphic" );
+
+ QDomElement enhancedGeometry = KoDom::namedItemNS( o, KoXmlNS::draw, "enhanced-geometry" );
+
+ if ( !enhancedGeometry.isNull() )
+ {
+ QString d = enhancedGeometry.attributeNS( KoXmlNS::draw, "enhanced-path", QString::null );
+ QRegExp rx( "^([0-9 ML]+Z) N$" );
+ if ( rx.search( d ) != -1 )
+ {
+ d = rx.cap( 1 );
+ KPrSVGPathParser parser;
+ ObjType objType = parser.getType( d );
+
+ switch ( objType )
+ {
+#if 0 // not yet supported
+ case OT_CUBICBEZIERCURVE:
+ {
+ kdDebug(33001) << "Cubicbeziercurve" << endl;
+ KPrCubicBezierCurveObject *kpCurveObject = new KPrCubicBezierCurveObject();
+ kpCurveObject->loadOasis( o, context, m_loadingInfo );
+ if ( groupObject )
+ groupObject->addObjects( kpCurveObject );
+ else
+ newpage->appendObject( kpCurveObject );
+ } break;
+ case OT_QUADRICBEZIERCURVE:
+ {
+ kdDebug(33001) << "Quadricbeziercurve" << endl;
+ KPrQuadricBezierCurveObject *kpQuadricObject = new KPrQuadricBezierCurveObject();
+ kpQuadricObject->loadOasis( o, context, m_loadingInfo );
+ if ( groupObject )
+ groupObject->addObjects( kpQuadricObject );
+ else
+ newpage->appendObject( kpQuadricObject );
+ } break;
+ case OT_FREEHAND:
+ {
+ kdDebug(33001) << "Freehand" << endl;
+ KPrFreehandObject *kpFreeHandObject = new KPrFreehandObject();
+ kpFreeHandObject->loadOasis( o, context, m_loadingInfo );
+ if ( groupObject )
+ groupObject->addObjects( kpFreeHandObject );
+ else
+ newpage->appendObject( kpFreeHandObject );
+ } break;
+#endif
+ case OT_CLOSED_LINE:
+ {
+ kdDebug(33001) << "Closed Line" << endl;
+ KPrClosedLineObject *kpClosedObject = new KPrClosedLineObject();
+ kpClosedObject->loadOasis( o, context, m_loadingInfo );
+ if ( groupObject )
+ groupObject->addObjects( kpClosedObject );
+ else
+ newpage->appendObject( kpClosedObject );
+ } break;
+ default:
+ kdDebug(33001) << "draw:custom-shape found unsupported object type " << objType << " in draw:enhanced-path " << d << endl;
+ break;
+ }
+ }
+ else
+ {
+ kdDebug(33001) << "draw:custom-shape not supported" << endl;
+ }
+ }
+ }
+ else if ( name == "g" && isDrawNS)
+ {
+ fillStyleStack( o, context, "graphic" );
+ KPrGroupObject *kpgroupobject = new KPrGroupObject();
+ QDomNode nodegroup = object.firstChild();
+
+ kpgroupobject->loadOasisGroupObject( this, newpage, object, context, m_loadingInfo);
+ if ( groupObject )
+ groupObject->addObjects( kpgroupobject );
+ else
+ newpage->appendObject(kpgroupobject);
+ }
+ else if ( name == "notes" && o.namespaceURI() == KoXmlNS::presentation ) // notes
+ {
+ //we must extend note attribute
+ //kdDebug()<<"presentation:notes----------------------------------\n";
+ QDomNode frameBox = KoDom::namedItemNS( o, KoXmlNS::draw, "frame" );
+ QString note;
+
+ while ( !frameBox.isNull() )
+ {
+ //add an empty line between the different frames
+ if ( !note.isEmpty() )
+ note += "\n";
+
+ //todo load layout for note.
+ QDomNode textBox = KoDom::namedItemNS( frameBox, KoXmlNS::draw, "text-box" );
+
+ if ( !textBox.isNull() )
+ {
+ for ( QDomNode text = textBox.firstChild(); !text.isNull(); text = text.nextSibling() )
+ {
+ // We don't care about styles as they are not supported in kpresenter.
+ // Only add a linebreak for every child.
+ QDomElement t = text.toElement();
+ if ( t.tagName() == "p" )
+ {
+ note += t.text() + "\n";
+ }
+ }
+ }
+ frameBox = frameBox.nextSibling();
+ }
+ newpage->setNoteText( note );
+ }
+ else if ( ( name == "header" || name == "footer" ) && o.namespaceURI() == KoXmlNS::style ||
+ ( name == "animations" && o.namespaceURI() == KoXmlNS::presentation) )
+ {
+ //nothing
+ }
+ else
+ {
+ kdDebug() << "Unsupported object '" << name << "'" << endl;
+ }
+ context.styleStack().restore();
+ }
+ }
+
+}
+
+int KPrDocument::createPresentationAnimation(const QDomElement& element, int order, bool increaseOrder)
+{
+ kdDebug()<<"void KPrDocument::createPresentationAnimation(const QDomElement& element)\n";
+ int orderAnimation = increaseOrder ? 0 : order;
+ for ( QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling() )
+ {
+ QDomElement e = n.toElement();
+ QCString tagName = e.tagName().latin1();
+ if ( ! tagName.isEmpty() ) // only tags that open
+ {
+ const bool isPresentationNS = e.namespaceURI() == KoXmlNS::presentation;
+ if ( isPresentationNS &&
+ ( tagName == "show-shape" || tagName == "hide-shape" ) )
+ {
+ Q_ASSERT( e.hasAttributeNS( KoXmlNS::draw, "shape-id" ) );
+ QString name = e.attributeNS( KoXmlNS::draw, "shape-id", QString::null );
+ kdDebug()<<" insert animation " << tagName << " name :" << name << endl;
+
+ if ( e.hasAttributeNS( KoXmlNS::koffice, "order-id" ) )
+ {
+ orderAnimation = e.attributeNS( KoXmlNS::koffice, "order-id", QString::null ).toInt();
+ }
+
+ lstAnimation *tmp = new lstAnimation;
+ tmp->element = new QDomElement( e );
+ tmp->order = orderAnimation;
+ if ( tagName == "show-shape" )
+ {
+ m_loadingInfo->storePresentationShowAnimation( tmp, name );
+ }
+ else
+ {
+ m_loadingInfo->storePresentationHideAnimation( tmp, name );
+ }
+ if ( increaseOrder )
+ ++orderAnimation;
+ }
+ else if ( tagName == "animation-group" && isPresentationNS )
+ {
+ orderAnimation = createPresentationAnimation( e, orderAnimation, false );
+ }
+ }
+ }
+ //increase when we finish it necessary for group object
+ ++orderAnimation;
+ return orderAnimation;
+}
+
+void KPrDocument::fillStyleStack( const QDomElement& object, KoOasisContext & context, const char* family )
+{
+ // See OpenDoc 9.2.15 Common Drawing Shape Attributes
+ // presentation:style-name is allways family presentation
+ if ( object.hasAttributeNS( KoXmlNS::presentation, "style-name" ))
+ {
+ context.fillStyleStack( object, KoXmlNS::presentation, "style-name", "presentation" );
+ }
+ if ( object.hasAttributeNS( KoXmlNS::draw, "style-name" ) )
+ {
+ context.fillStyleStack( object, KoXmlNS::draw, "style-name", family );
+ }
+ // draw:tex-style-name is allways family paragraph
+ if ( object.hasAttributeNS( KoXmlNS::draw, "text-style-name" ) )
+ {
+ context.fillStyleStack( object, KoXmlNS::draw, "text-style-name", "paragraph" );
+ }
+ if ( object.hasAttributeNS( KoXmlNS::text, "style-name" ) )
+ {
+ context.fillStyleStack( object, KoXmlNS::text, "style-name", family );
+ }
+}
+
+bool KPrDocument::loadXML( QIODevice * dev, const QDomDocument& doc )
+{
+ QTime dt;
+ dt.start();
+ m_loadingInfo = new KPrLoadingInfo( true );
+
+ ignoreSticky = FALSE;
+ bool b=false;
+ QDomElement docelem = doc.documentElement();
+ const int syntaxVersion = docelem.attribute( "syntaxVersion" ).toInt();
+ if ( syntaxVersion < 2 )
+ {
+ // This is an old style document, before the current TextObject
+ // We have kprconverter.pl for it
+ kdWarning(33001) << "KPresenter document version 1. Launching perl script to convert it." << endl;
+
+ // Read the full XML and write it to a temp file
+ KTempFile tmpFileIn;
+ tmpFileIn.setAutoDelete( true );
+ dev->reset();
+ tmpFileIn.file()->writeBlock( dev->readAll() ); // copy stresm to temp file
+ tmpFileIn.close();
+
+ // Launch the perl script on it
+ KTempFile tmpFileOut;
+ tmpFileOut.setAutoDelete( true );
+ QString cmd = KGlobal::dirs()->findExe("perl");
+ if (cmd.isEmpty())
+ {
+ setErrorMessage( i18n("You don't appear to have PERL installed.\nIt is needed to convert this document.\nPlease install PERL and try again."));
+ return false;
+ }
+ cmd += " ";
+ cmd += locate( "exe", "kprconverter.pl" );
+ cmd += " ";
+ cmd += KProcess::quote( tmpFileIn.name() );
+ cmd += " ";
+ cmd += KProcess::quote( tmpFileOut.name() );
+ system( QFile::encodeName(cmd) );
+
+ // Build a new QDomDocument from the result
+ QString errorMsg;
+ int errorLine;
+ int errorColumn;
+ QDomDocument newdoc;
+ if ( ! newdoc.setContent( tmpFileOut.file(), &errorMsg, &errorLine, &errorColumn ) )
+ {
+ kdError (33001) << "Parsing Error! Aborting! (in KPrDocument::loadXML)" << endl
+ << " Line: " << errorLine << " Column: " << errorColumn << endl
+ << " Message: " << errorMsg << endl;
+ setErrorMessage( i18n( "parsing error in the main document (converted from an old KPresenter format) at line %1, column %2\nError message: %3" )
+ .arg( errorLine ).arg( errorColumn ).arg( i18n ( errorMsg.utf8() ) ) );
+ return false;
+ }
+ b = loadXML( newdoc );
+ }
+ else
+ b = loadXML( doc );
+
+ ignoreSticky = TRUE;
+
+ if(_clean)
+ {
+ startBackgroundSpellCheck();
+ }
+ if ( m_pageWhereLoadObject == 0 && m_insertFilePage == 0 )
+ setModified( false );
+ kdDebug(33001) << "Loading took " << (float)(dt.elapsed()) / 1000.0 << " seconds" << endl;
+ return b;
+}
+
+void KPrDocument::createHeaderFooter()
+{
+ //add header/footer to sticky page
+ KoRect pageRect=m_masterPage->getPageRect();
+ _header->setOrig(pageRect.topLeft());
+ _header->setSize(pageRect.width(),20);
+
+ _footer->setOrig(pageRect.left(),pageRect.bottom()-20);
+ _footer->setSize(pageRect.width(),20);
+
+ m_masterPage->appendObject(_header);
+ m_masterPage->appendObject(_footer);
+}
+
+void KPrDocument::insertEmbedded( KoStore *store, QDomElement topElem, KMacroCommand * macroCmd, KPrPage *page, int pos )
+{
+ QDomElement elem = topElem.firstChild().toElement();
+ for ( ; !elem.isNull() ; elem = elem.nextSibling().toElement() )
+ {
+ kdDebug(33001) << "Element name: " << elem.tagName() << endl;
+ if(elem.tagName()=="EMBEDDED") {
+ KPrChild *ch = new KPrChild( this );
+ KPrPartObject *kppartobject = 0L;
+ QRect r;
+
+ QDomElement object=elem.namedItem("OBJECT").toElement();
+ if(!object.isNull()) {
+ ch->load(object, true); // true == uppercase
+ r = ch->geometry();
+ ch->loadDocument( store );
+ insertChild( ch );
+ kppartobject = new KPrPartObject( ch );
+ }
+ QDomElement settings=elem.namedItem("SETTINGS").toElement();
+ int zIndex = 0;
+ if ( settings.hasAttribute( "z-index" ) )
+ {
+ zIndex = settings.attribute( "z-index" ).toInt();
+ }
+ double offset = 0.0;
+ if(!settings.isNull() && kppartobject!=0)
+ offset=kppartobject->load(settings);
+ else if ( settings.isNull() ) // all embedded obj must have SETTING tags
+ {
+ delete kppartobject;
+ kppartobject = 0L;
+ return;
+ }
+ int index = m_pageList.findRef(page);
+ int pageIndex = (int)(offset/__pgLayout.ptHeight)+index;
+ int newPos=(int)((offset+index*__pgLayout.ptHeight)-pageIndex*__pgLayout.ptHeight);
+ kppartobject->setOrig(kppartobject->getOrig().x(),newPos);
+
+ KPrInsertCmd *insertCmd = new KPrInsertCmd( i18n( "Insert Part Object" ), kppartobject, this,page );
+ insertCmd->execute();
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Insert Part Object"));
+ macroCmd->addCommand( insertCmd );
+ if ( pos != 0 )
+ {
+ const QPtrList<KPrObject>& oldList( page->objectList() );
+ // tz TODO this is not 100% correct
+ if ( static_cast<int>( oldList.count() ) > pos + zIndex )
+ {
+ page->takeObject( kppartobject );
+ page->insertObject( kppartobject, pos + zIndex );
+ KPrLowerRaiseCmd *lrCmd = new KPrLowerRaiseCmd( i18n("Insert Part Object"),
+ oldList, page->objectList(),
+ this, page );
+ macroCmd->addCommand( lrCmd );
+ }
+ }
+ }
+ }
+}
+
+bool KPrDocument::loadXML( const QDomDocument &doc )
+{
+ emit sigProgress( 0 );
+ int activePage=0;
+ lastObj = -1;
+ bool allSlides = false;
+ // clean
+ if ( _clean ) {
+ __pgLayout = KoPageLayout::standardLayout();
+ _spInfiniteLoop = false;
+ _spShowEndOfPresentationSlide = true;
+ _spManualSwitch = true;
+ _showPresentationDuration = false;
+ _xRnd = 20;
+ _yRnd = 20;
+ //_txtBackCol = white;
+ urlIntern = url().path();
+ }
+ else
+ m_spellCheckIgnoreList.clear();
+ emit sigProgress( 5 );
+
+ QDomElement document=doc.documentElement();
+ // DOC
+ if(document.tagName()!="DOC") {
+ kdWarning(33001) << "Missing DOC" << endl;
+ setErrorMessage( i18n("Invalid document, DOC tag missing.") );
+ return false;
+ }
+
+ if(!document.hasAttribute("mime") || (
+ document.attribute("mime")!="application/x-kpresenter" &&
+ document.attribute("mime")!="application/vnd.kde.kpresenter" ) ) {
+ kdError(33001) << "Unknown mime type " << document.attribute("mime") << endl;
+ setErrorMessage( i18n("Invalid document, expected mimetype application/x-kpresenter or application/vnd.kde.kpresenter, got %1").arg(document.attribute("mime")) );
+ return false;
+ }
+ if(document.hasAttribute("url"))
+ urlIntern=KURL(document.attribute("url")).path();
+
+ emit sigProgress( 10 );
+
+ QDomElement elem=document.firstChild().toElement();
+
+ uint childTotalCount=document.childNodes().count();
+ uint childCount = 0;
+
+ loadTextStyle( document );
+
+ while(!elem.isNull()) {
+ kdDebug(33001) << "Element name: " << elem.tagName() << endl;
+ if(elem.tagName()=="EMBEDDED") {
+ KPrChild *ch = new KPrChild( this );
+ KPrPartObject *kppartobject = 0L;
+ QRect r;
+
+ QDomElement object=elem.namedItem("OBJECT").toElement();
+ if(!object.isNull()) {
+ ch->load(object, true); // true == uppercase
+ r = ch->geometry();
+ insertChild( ch );
+ kppartobject = new KPrPartObject( ch );
+ //emit sig_insertObject( ch, kppartobject );
+ }
+ QDomElement settings=elem.namedItem("SETTINGS").toElement();
+ int tmp=0;
+ int pos = -1;
+ if ( settings.hasAttribute( "z-index" ) )
+ {
+ pos = settings.attribute( "z-index" ).toInt();
+ }
+ if(settings.hasAttribute("sticky"))
+ tmp=settings.attribute("sticky").toInt();
+ bool sticky=static_cast<bool>(tmp);
+ double offset = 0.0;
+ if(!settings.isNull() && kppartobject!=0)
+ {
+ offset=kppartobject->load(settings);
+ }
+ else if ( settings.isNull() ) // all embedded obj must have SETTING tags
+ {
+ delete kppartobject;
+ kppartobject = 0L;
+ }
+ //hack for some old file, they don't have ORIG tag !
+ if ( offset == -1.0 )
+ offset = r.y();
+ if ( sticky && !ignoreSticky && kppartobject )
+ {
+ if ( pos == -1 )
+ {
+ m_masterPage->appendObject( kppartobject );
+ }
+ else
+ {
+ m_masterPage->insertObject( kppartobject, pos );
+ }
+ kppartobject->setOrig(kppartobject->getOrig().x(), offset);
+ }
+ else if ( kppartobject ) {
+ if ( m_pageWhereLoadObject )
+ {
+ kppartobject->setOrig(kppartobject->getOrig().x(), offset);
+ m_pageWhereLoadObject->insertObject( kppartobject, pos );
+ }
+ else
+ {
+ insertObjectInPage( offset, kppartobject, pos );
+ }
+ }
+ } else if(elem.tagName()=="PAPER" && _clean) {
+ if(elem.hasAttribute("format"))
+ __pgLayout.format=static_cast<KoFormat>(elem.attribute("format").toInt());
+ if(elem.hasAttribute("orientation"))
+ __pgLayout.orientation=static_cast<KoOrientation>(elem.attribute("orientation").toInt());
+ if(elem.hasAttribute("ptWidth"))
+ __pgLayout.ptWidth = elem.attribute("ptWidth").toDouble();
+ else if(elem.hasAttribute("inchWidth")) //compatibility
+ __pgLayout.ptWidth = INCH_TO_POINT( elem.attribute("inchWidth").toDouble() );
+ else if(elem.hasAttribute("mmWidth")) //compatibility
+ __pgLayout.ptWidth = MM_TO_POINT( elem.attribute("mmWidth").toDouble() );
+ if(elem.hasAttribute("ptHeight"))
+ __pgLayout.ptHeight = elem.attribute("ptHeight").toDouble();
+ else if(elem.hasAttribute("inchHeight")) //compatibility
+ __pgLayout.ptHeight = INCH_TO_POINT( elem.attribute("inchHeight").toDouble() );
+ else if(elem.hasAttribute("mmHeight")) //compatibility
+ __pgLayout.ptHeight = MM_TO_POINT( elem.attribute("mmHeight").toDouble() );
+ if(elem.hasAttribute("unit"))
+ setUnit( static_cast<KoUnit::Unit>(elem.attribute("unit").toInt()) );
+ if ( elem.hasAttribute("tabStopValue"))
+ m_tabStop = elem.attribute("tabStopValue").toDouble();
+
+ if(elem.hasAttribute("width"))
+ __pgLayout.ptWidth = MM_TO_POINT( elem.attribute("width").toDouble() );
+ if(elem.hasAttribute("height"))
+ __pgLayout.ptHeight = MM_TO_POINT( elem.attribute("height").toDouble() );
+
+ QDomElement borders=elem.namedItem("PAPERBORDERS").toElement();
+ if(!borders.isNull()) {
+ if(borders.hasAttribute("left"))
+ __pgLayout.ptLeft = MM_TO_POINT( borders.attribute("left").toDouble() );
+ if(borders.hasAttribute("top"))
+ __pgLayout.ptTop = MM_TO_POINT( borders.attribute("top").toDouble() );
+ if(borders.hasAttribute("right"))
+ __pgLayout.ptRight = MM_TO_POINT( borders.attribute("right").toDouble() );
+ if(borders.hasAttribute("bottom"))
+ __pgLayout.ptBottom = MM_TO_POINT( borders.attribute("bottom").toDouble() );
+ if(borders.hasAttribute("ptLeft"))
+ __pgLayout.ptLeft = borders.attribute("ptLeft").toDouble();
+ else if(borders.hasAttribute("inchLeft")) //compatibility
+ __pgLayout.ptLeft = INCH_TO_POINT( borders.attribute("inchLeft").toDouble() );
+ else if(borders.hasAttribute("mmLeft")) //compatibility
+ __pgLayout.ptLeft = MM_TO_POINT( borders.attribute("mmLeft").toDouble() );
+ if(borders.hasAttribute("ptRight"))
+ __pgLayout.ptRight = borders.attribute("ptRight").toDouble();
+ else if(borders.hasAttribute("inchRight")) //compatibility
+ __pgLayout.ptRight = INCH_TO_POINT( borders.attribute("inchRight").toDouble() );
+ else if(borders.hasAttribute("mmRight")) //compatibility
+ __pgLayout.ptRight = MM_TO_POINT( borders.attribute("mmRight").toDouble() );
+ if(borders.hasAttribute("ptTop"))
+ __pgLayout.ptTop = borders.attribute("ptTop").toDouble();
+ else if(borders.hasAttribute("inchTop")) //compatibility
+ __pgLayout.ptTop = INCH_TO_POINT( borders.attribute("inchTop").toDouble() );
+ else if(borders.hasAttribute("mmTop")) //compatibility
+ __pgLayout.ptTop = MM_TO_POINT( borders.attribute("mmTop").toDouble() );
+ if(borders.hasAttribute("ptBottom"))
+ __pgLayout.ptBottom = borders.attribute("ptBottom").toDouble();
+ else if(borders.hasAttribute("inchBottom")) //compatibility
+ __pgLayout.ptBottom = INCH_TO_POINT( borders.attribute("inchBottom").toDouble() );
+ else if(borders.hasAttribute("mmBottom")) //compatibility
+ __pgLayout.ptBottom = MM_TO_POINT( borders.attribute("inchBottom").toDouble() );
+ }
+ // PAPER found and parsed -> apply page layout
+ // e.g. the text objects need it
+ if ( _clean )
+ setPageLayout( __pgLayout );
+
+ } else if(elem.tagName()=="VARIABLESETTINGS" && _clean){
+ getVariableCollection()->variableSetting()->load(document);
+ //by default display real variable value
+ if ( !isReadWrite())
+ getVariableCollection()->variableSetting()->setDisplayFieldCode(false);
+
+ }
+ else if(elem.tagName()=="BACKGROUND") {
+ int red=0, green=0, blue=0;
+ if(elem.hasAttribute("xRnd"))
+ _xRnd = elem.attribute("xRnd").toInt();
+ if(elem.hasAttribute("yRnd"))
+ _yRnd = elem.attribute("yRnd").toInt();
+ if(elem.hasAttribute("bred"))
+ red = elem.attribute("bred").toInt();
+ if(elem.hasAttribute("bgreen"))
+ green = elem.attribute("bgreen").toInt();
+ if(elem.hasAttribute("bblue"))
+ blue = elem.attribute("bblue").toInt();
+ loadBackground(elem);
+ } else if(elem.tagName()=="HEADER") {
+ if ( _clean /*don't reload header footer, header/footer was created at the beginning || !hasHeader()*/ ) {
+ if(elem.hasAttribute("show")) {
+ setHeader(static_cast<bool>(elem.attribute("show").toInt()));
+ }
+ _header->load(elem);
+ }
+ } else if ( elem.tagName()=="HEADERFOOTERBYPAGE" ) {
+ if ( elem.hasAttribute( "value" ) ) {
+ m_loadingInfo->m_headerFooterByPage = true;
+ }
+ } else if(elem.tagName()=="FOOTER") {
+ if ( _clean /*|| !hasFooter()*/ ) {
+ if(elem.hasAttribute("show")) {
+ setFooter( static_cast<bool>(elem.attribute("show").toInt() ) );
+ }
+ _footer->load(elem);
+ }
+ }else if( elem.tagName()=="HELPLINES"){
+ if ( _clean ) {
+ if(elem.hasAttribute("show")) {
+ setShowGuideLines( static_cast<bool>(elem.attribute("show").toInt() ) );
+ }
+ loadGuideLines( elem );
+ }
+ }else if( elem.tagName()=="SPELLCHECKIGNORELIST"){
+ QDomElement spellWord=elem.toElement();
+ spellWord=spellWord.firstChild().toElement();
+ while ( !spellWord.isNull() )
+ {
+ if ( spellWord.tagName()=="SPELLCHECKIGNOREWORD" )
+ {
+ m_spellCheckIgnoreList.append(spellWord.attribute("word"));
+ }
+ spellWord=spellWord.nextSibling().toElement();
+ }
+ }else if(elem.tagName()=="ATTRIBUTES" && _clean) {
+ if(elem.hasAttribute("activePage"))
+ activePage=elem.attribute("activePage").toInt();
+ if(elem.hasAttribute("gridx"))
+ m_gridX = elem.attribute("gridx").toDouble();
+ if(elem.hasAttribute("gridy"))
+ m_gridY = elem.attribute("gridy").toDouble();
+ if(elem.hasAttribute("snaptogrid"))
+ m_bSnapToGrid = (bool)elem.attribute("snaptogrid").toInt();
+ } else if(elem.tagName()=="PAGETITLES") {
+ loadTitle(elem);
+ } else if(elem.tagName()=="PAGENOTES") {
+ loadNote(elem);
+ } else if(elem.tagName()=="OBJECTS") {
+ //FIXME**********************
+#if 0
+ lastObj = _objectList->count() - 1;
+#endif
+ //don't add command we don't paste object
+ KCommand * cmd =loadObjects(elem);
+ if ( cmd )
+ delete cmd;
+ } else if(elem.tagName()=="INFINITLOOP") {
+ if(_clean) {
+ if(elem.hasAttribute("value"))
+ _spInfiniteLoop = static_cast<bool>(elem.attribute("value").toInt());
+ }
+ } else if(elem.tagName()=="SHOWENDOFPRESENTATIONSLIDE") {
+ if(_clean) {
+ if(elem.hasAttribute("value"))
+ _spShowEndOfPresentationSlide = static_cast<bool>(elem.attribute("value").toInt());
+ }
+ } else if(elem.tagName()=="PRESSPEED") {
+ if(_clean) {
+ if(elem.hasAttribute("value"))
+ m_loadingInfo->presSpeed = elem.attribute("value").toInt();
+ }
+ } else if(elem.tagName()=="MANUALSWITCH") {
+ if(_clean) {
+ if(elem.hasAttribute("value"))
+ _spManualSwitch = static_cast<bool>(elem.attribute("value").toInt());
+ }
+ } else if(elem.tagName()=="SHOWPRESENTATIONDURATION") {
+ if(_clean) {
+ if(elem.hasAttribute("value"))
+ _showPresentationDuration = static_cast<bool>(elem.attribute("value").toInt());
+ }
+ } else if(elem.tagName()=="PRESSLIDES") {
+ if(elem.hasAttribute("value") && elem.attribute("value").toInt()==0)
+ allSlides = TRUE;
+ } else if ( elem.tagName()=="DEFAULTCUSTOMSLIDESHOWNAME" ) {
+ if(elem.hasAttribute("name") )
+ m_presentationName=elem.attribute( "name" );
+ } else if ( elem.tagName()=="CUSTOMSLIDESHOWCONFIG" ) {
+ if ( _clean ) {
+ QMap<QString, KPrPage *> name2page;
+ int pos = 1;
+ for ( QPtrListIterator<KPrPage> it( m_pageList ); it.current(); ++it )
+ {
+ name2page.insert( "page" + QString::number( pos++ ), it.current() ) ;
+ }
+
+ QDomElement slide=elem.firstChild().toElement();
+ while(!slide.isNull()) {
+ if(slide.tagName()=="CUSTOMSLIDESHOW") {
+ QStringList tmp = QStringList::split( ",", slide.attribute( "pages" ) );
+ QValueList<KPrPage *> pageList;
+ for ( QStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it )
+ {
+ if ( name2page.contains( *it ) )
+ {
+ kdDebug(33001) << "slide show " << slide.attribute( "name" ) << " page = " << *it << endl;
+ pageList.push_back( name2page[*it] );
+ }
+ }
+ if ( ! pageList.empty() )
+ {
+ m_customListSlideShow.insert( slide.attribute( "name" ), pageList );
+ }
+ }
+ slide=slide.nextSibling().toElement();
+ }
+ }
+ } else if(elem.tagName()=="SELSLIDES") {
+ if( _clean ) { // Skip this when loading a single page
+ QDomElement slide=elem.firstChild().toElement();
+ while(!slide.isNull()) {
+ if(slide.tagName()=="SLIDE") {
+ int nr = -1;
+ bool show = false;
+ if(slide.hasAttribute("nr"))
+ nr=slide.attribute("nr").toInt();
+ if(slide.hasAttribute("show"))
+ show=static_cast<bool>(slide.attribute("show").toInt());
+ if ( nr >= 0 )
+ {
+ //kdDebug(33001) << "KPrDocument::loadXML m_selectedSlides nr=" << nr << " show=" << show << endl;
+ if ( nr > ( (int)m_pageList.count() - 1 ) )
+ {
+ for (int i=(m_pageList.count()-1); i<nr;i++)
+ m_pageList.append( new KPrPage( this, m_masterPage ) );
+ }
+ m_pageList.at(nr)->slideSelected(show);
+ } else kdWarning(33001) << "Parse error. No nr in <SLIDE> !" << endl;
+ }
+ slide=slide.nextSibling().toElement();
+ }
+ }
+ } else if ( elem.tagName() == "SOUNDS" ) {
+ loadUsedSoundFileFromXML( elem );
+ }
+ elem=elem.nextSibling().toElement();
+
+ emit sigProgress( childCount * ( 70/childTotalCount ) + 15 );
+ childCount += 1;
+ }
+
+ loadPictureMap( document );
+
+ if(activePage!=-1)
+ m_initialActivePage=m_pageList.at(activePage);
+ if ( m_pageWhereLoadObject == 0 && m_insertFilePage == 0 )
+ setModified(false);
+
+ return true;
+}
+
+void KPrDocument::loadTextStyle( const QDomElement& domElement )
+{
+ QDomElement style = domElement.namedItem( "STYLES" ).toElement();
+ if ( _clean && ! style.isNull() )
+ loadStyleTemplates( style );
+}
+
+void KPrDocument::loadPictureMap ( const QDomElement& domElement )
+{
+ m_pictureMap.clear();
+
+ // <PICTURES>
+ QDomElement picturesElem = domElement.namedItem( "PICTURES" ).toElement();
+ if ( !picturesElem.isNull() )
+ m_pictureCollection.readXML( picturesElem, m_pictureMap );
+
+ // <PIXMAPS>
+ QDomElement pixmapsElem = domElement.namedItem( "PIXMAPS" ).toElement();
+ if ( !pixmapsElem.isNull() )
+ m_pictureCollection.readXML( pixmapsElem, m_pictureMap );
+
+ // <CLIPARTS>
+ QDomElement clipartsElem = domElement.namedItem( "CLIPARTS" ).toElement();
+ if ( !clipartsElem.isNull() )
+ m_pictureCollection.readXML( pixmapsElem, m_pictureMap );
+}
+
+void KPrDocument::loadBackground( const QDomElement &element )
+{
+ kdDebug(33001) << "KPrDocument::loadBackground" << endl;
+ QDomElement page=element.firstChild().toElement();
+ int i=m_insertFilePage;
+ while(!page.isNull()) {
+ if(m_pageWhereLoadObject)
+ {
+ kdDebug(33001) << "m_pageWhereLoadObject->load(...)" << m_pageWhereLoadObject << endl;
+ m_pageWhereLoadObject->load(page);
+ break;
+ }
+ else
+ {
+ if ( page.tagName() == "MASTERPAGE" )
+ {
+ m_masterPage->load( page );
+ }
+ else
+ {
+ //test if there is a page at this index
+ //=> don't add new page if there is again a page
+ if ( i > ( (int)m_pageList.count() - 1 ) )
+ m_pageList.append( new KPrPage( this, m_masterPage ) );
+ m_pageList.at(i)->load(page);
+ i++;
+ }
+ }
+ page=page.nextSibling().toElement();
+ }
+}
+
+KCommand *KPrDocument::loadObjects( const QDomElement &element, bool paste )
+{
+ ObjType t = OT_LINE;
+ QDomElement obj=element.firstChild().toElement();
+ QValueList<KPrObject *> pasteObjects;
+ while(!obj.isNull()) {
+ if(obj.tagName()=="OBJECT" ) {
+ bool sticky=false;
+ int tmp=0;
+ if(obj.hasAttribute("type"))
+ tmp=obj.attribute("type").toInt();
+ t=static_cast<ObjType>(tmp);
+ tmp=0;
+ if(obj.hasAttribute("sticky"))
+ tmp=obj.attribute("sticky").toInt();
+ sticky=static_cast<bool>(tmp);
+ double offset=0;
+ switch ( t ) {
+ case OT_LINE: {
+ KPrLineObject *kplineobject = new KPrLineObject();
+ offset=kplineobject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kplineobject);
+ kplineobject->setOrig(kplineobject->getOrig().x(),offset);
+ }
+ else if (m_pageWhereLoadObject && paste) {
+ kplineobject->setOrig(kplineobject->getOrig().x(),offset);
+ pasteObjects.append( kplineobject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kplineobject);
+ kplineobject->setOrig(kplineobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kplineobject);
+ } break;
+ case OT_RECT: {
+ KPrRectObject *kprectobject = new KPrRectObject();
+ offset=kprectobject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kprectobject);
+ kprectobject->setOrig(kprectobject->getOrig().x(),offset);
+ }
+ else if (m_pageWhereLoadObject && paste) {
+ kprectobject->setOrig(kprectobject->getOrig().x(),offset);
+ pasteObjects.append( kprectobject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kprectobject);
+ kprectobject->setOrig(kprectobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kprectobject);
+ } break;
+ case OT_ELLIPSE: {
+ KPrEllipseObject *kpellipseobject = new KPrEllipseObject();
+ offset=kpellipseobject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kpellipseobject);
+ kpellipseobject->setOrig(kpellipseobject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject && paste)
+ {
+ kpellipseobject->setOrig(kpellipseobject->getOrig().x(),offset);
+ pasteObjects.append( kpellipseobject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kpellipseobject);
+ kpellipseobject->setOrig(kpellipseobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kpellipseobject);
+ } break;
+ case OT_PIE: {
+ KPrPieObject *kppieobject = new KPrPieObject();
+ offset=kppieobject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kppieobject);
+ kppieobject->setOrig(kppieobject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject && paste) {
+ kppieobject->setOrig(kppieobject->getOrig().x(),offset);
+ pasteObjects.append( kppieobject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kppieobject);
+ kppieobject->setOrig(kppieobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kppieobject);
+ } break;
+ case OT_AUTOFORM: {
+ KPrAutoformObject *kpautoformobject = new KPrAutoformObject();
+ offset=kpautoformobject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kpautoformobject);
+ kpautoformobject->setOrig(kpautoformobject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject&& paste) {
+ kpautoformobject->setOrig(kpautoformobject->getOrig().x(),offset);
+ pasteObjects.append( kpautoformobject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kpautoformobject);
+ kpautoformobject->setOrig(kpautoformobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kpautoformobject);
+ } break;
+ case OT_TEXT: {
+ KPrTextObject *kptextobject = new KPrTextObject( this );
+ offset=kptextobject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kptextobject);
+ kptextobject->setOrig(kptextobject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject && paste) {
+ kptextobject->setOrig(kptextobject->getOrig().x(),offset);
+ pasteObjects.append( kptextobject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kptextobject);
+ kptextobject->setOrig(kptextobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kptextobject);
+ } break;
+ case OT_CLIPART:
+ case OT_PICTURE: {
+ KPrPixmapObject *kppixmapobject = new KPrPixmapObject( pictureCollection() );
+ offset=kppixmapobject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kppixmapobject);
+ kppixmapobject->setOrig(kppixmapobject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject && paste) {
+ kppixmapobject->setOrig(kppixmapobject->getOrig().x(),offset);
+ pasteObjects.append( kppixmapobject );
+ kppixmapobject->reload();
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kppixmapobject);
+ kppixmapobject->setOrig(kppixmapobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kppixmapobject);
+ } break;
+ case OT_FREEHAND: {
+ KPrFreehandObject *kpfreehandobject = new KPrFreehandObject();
+ offset=kpfreehandobject->load(obj);
+
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kpfreehandobject);
+ kpfreehandobject->setOrig(kpfreehandobject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject && paste) {
+ kpfreehandobject->setOrig(kpfreehandobject->getOrig().x(),offset);
+ pasteObjects.append( kpfreehandobject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kpfreehandobject);
+ kpfreehandobject->setOrig(kpfreehandobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset,kpfreehandobject);
+ } break;
+ case OT_POLYLINE: {
+ KPrPolylineObject *kppolylineobject = new KPrPolylineObject();
+ offset=kppolylineobject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kppolylineobject);
+ kppolylineobject->setOrig(kppolylineobject->getOrig().x(),offset);
+ }
+ else if (m_pageWhereLoadObject && paste) {
+ kppolylineobject->setOrig(kppolylineobject->getOrig().x(),offset);
+ pasteObjects.append( kppolylineobject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kppolylineobject);
+ kppolylineobject->setOrig(kppolylineobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kppolylineobject);
+ } break;
+ case OT_QUADRICBEZIERCURVE: {
+ KPrQuadricBezierCurveObject *kpQuadricBezierCurveObject = new KPrQuadricBezierCurveObject();
+ offset=kpQuadricBezierCurveObject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kpQuadricBezierCurveObject);
+ kpQuadricBezierCurveObject->setOrig(kpQuadricBezierCurveObject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject && paste) {
+ kpQuadricBezierCurveObject->setOrig(kpQuadricBezierCurveObject->getOrig().x(),offset);
+ pasteObjects.append( kpQuadricBezierCurveObject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kpQuadricBezierCurveObject);
+ kpQuadricBezierCurveObject->setOrig(kpQuadricBezierCurveObject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kpQuadricBezierCurveObject);
+ } break;
+ case OT_CUBICBEZIERCURVE: {
+ KPrCubicBezierCurveObject *kpCubicBezierCurveObject = new KPrCubicBezierCurveObject();
+ offset=kpCubicBezierCurveObject->load(obj);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kpCubicBezierCurveObject);
+ kpCubicBezierCurveObject->setOrig(kpCubicBezierCurveObject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject && paste) {
+ kpCubicBezierCurveObject->setOrig(kpCubicBezierCurveObject->getOrig().x(),offset);
+ pasteObjects.append( kpCubicBezierCurveObject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kpCubicBezierCurveObject);
+ kpCubicBezierCurveObject->setOrig(kpCubicBezierCurveObject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kpCubicBezierCurveObject);
+ } break;
+ case OT_POLYGON: {
+ KPrPolygonObject *kpPolygonObject = new KPrPolygonObject();
+ offset=kpPolygonObject->load( obj );
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kpPolygonObject);
+ kpPolygonObject->setOrig(kpPolygonObject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject && paste) {
+ kpPolygonObject->setOrig(kpPolygonObject->getOrig().x(),offset);
+ pasteObjects.append( kpPolygonObject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kpPolygonObject);
+ kpPolygonObject->setOrig(kpPolygonObject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kpPolygonObject);
+ } break;
+ case OT_CLOSED_LINE: {
+ KPrClosedLineObject *kpClosedLinneObject = new KPrClosedLineObject();
+ offset = kpClosedLinneObject->load( obj );
+ if ( sticky && !ignoreSticky) {
+ m_masterPage->appendObject( kpClosedLinneObject );
+ kpClosedLinneObject->setOrig( kpClosedLinneObject->getOrig().x(), offset );
+ }
+ else if ( m_pageWhereLoadObject && paste ) {
+ kpClosedLinneObject->setOrig( kpClosedLinneObject->getOrig().x(), offset );
+ pasteObjects.append( kpClosedLinneObject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject( kpClosedLinneObject );
+ kpClosedLinneObject->setOrig( kpClosedLinneObject->getOrig().x(), offset );
+ }
+ else
+ insertObjectInPage( offset, kpClosedLinneObject );
+ } break;
+ case OT_GROUP: {
+ KPrGroupObject *kpgroupobject = new KPrGroupObject();
+ offset=kpgroupobject->load(obj, this);
+ if ( sticky && !ignoreSticky)
+ {
+ m_masterPage->appendObject(kpgroupobject);
+ kpgroupobject->setOrig(kpgroupobject->getOrig().x(),offset);
+ }
+ else if ( m_pageWhereLoadObject && paste) {
+ kpgroupobject->setOrig(kpgroupobject->getOrig().x(),offset);
+ pasteObjects.append( kpgroupobject );
+ }
+ else if( m_pageWhereLoadObject &&!paste)
+ {
+ m_pageWhereLoadObject->appendObject(kpgroupobject);
+ kpgroupobject->setOrig(kpgroupobject->getOrig().x(),offset);
+ }
+ else
+ insertObjectInPage(offset, kpgroupobject);
+ } break;
+ default: break;
+ }
+ }
+ obj=obj.nextSibling().toElement();
+ }
+
+ KPrInsertCmd *insertCmd = 0;
+ if ( ! pasteObjects.empty() )
+ {
+ insertCmd = new KPrInsertCmd( i18n( "Paste Objects" ), pasteObjects,
+ this , m_pageWhereLoadObject );
+ insertCmd->execute();
+ }
+ return insertCmd;
+}
+
+void KPrDocument::loadTitle( const QDomElement &element )
+{
+ QDomElement title=element.firstChild().toElement();
+ int i=m_insertFilePage;
+ while ( !title.isNull() ) {
+ if ( title.tagName()=="Title" )
+ {
+ //test if there is a page at this index
+ //=> don't add new page if there is again a page
+ if(!m_pageWhereLoadObject)
+ {
+ if ( i > ( (int)m_pageList.count() - 1 ) )
+ m_pageList.append( new KPrPage( this, m_masterPage ) );
+ m_pageList.at(i)->insertManualTitle(title.attribute("title"));
+ i++;
+ }
+ else
+ m_pageWhereLoadObject->insertManualTitle(title.attribute("title"));
+ }
+ title=title.nextSibling().toElement();
+ }
+}
+
+void KPrDocument::loadNote( const QDomElement &element )
+{
+ QDomElement note=element.firstChild().toElement();
+ int i=m_insertFilePage;
+ while ( !note.isNull() ) {
+ if ( note.tagName()=="Note" )
+ {
+ //test if there is a page at this index
+ //=> don't add new page if there is again a page
+ if(!m_pageWhereLoadObject)
+ {
+ if ( i > ( (int)m_pageList.count() - 1 ) )
+ m_pageList.append( new KPrPage( this, m_masterPage ) );
+ m_pageList.at(i)->setNoteText(note.attribute("note"));
+ i++;
+ }
+ else
+ m_pageWhereLoadObject->setNoteText(note.attribute("note"));
+ }
+ note=note.nextSibling().toElement();
+ }
+}
+
+void KPrDocument::loadUsedSoundFileFromXML( const QDomElement &element )
+{
+ usedSoundFile = QStringList();
+ haveNotOwnDiskSoundFile = QStringList();
+ QDomElement fileElement = element.firstChild().toElement();
+ while ( !fileElement.isNull() ) {
+ if ( fileElement.tagName() == "FILE" ) {
+ QString fileName;
+ if ( fileElement.hasAttribute( "name" ) )
+ fileName = fileElement.attribute( "name" );
+
+ if ( fileElement.hasAttribute( "filename" ) ) {
+ QString name = fileElement.attribute( "filename" );
+ QFile _file( name );
+ if ( _file.open( IO_ReadOnly ) ) {
+ fileName = name;
+ _file.close();
+ }
+ else
+ haveNotOwnDiskSoundFile.append( name );
+ }
+
+ usedSoundFile.append( fileName );
+
+ fileElement = fileElement.nextSibling().toElement();
+ }
+ }
+}
+
+void KPrDocument::loadImagesFromStore( KoStore *_store )
+{
+ if ( _store ) {
+ m_pictureCollection.readFromStore( _store, m_pictureMap );
+ m_pictureMap.clear(); // Release memory
+ }
+}
+
+bool KPrDocument::completeLoading( KoStore* _store )
+{
+ kdDebug()<<"bool KPrDocument::completeLoading( KoStore* _store )*************************\n";
+ emit sigProgress( 80 );
+
+ if ( _store ) {
+ loadImagesFromStore( _store );
+ emit sigProgress( 90 );
+
+ if ( !usedSoundFile.isEmpty() )
+ loadUsedSoundFileFromStore( _store, usedSoundFile );
+
+ if ( _clean )
+ createHeaderFooter();
+ //else {
+ //m_pageList.last()->updateBackgroundSize();
+ //}
+
+
+ if ( saveOnlyPage == -1 ) {
+ // ### following call independant of saveOnlyPage's value?
+ m_masterPage->completeLoading( _clean, lastObj );
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it )
+ it.current()->completeLoading( _clean, lastObj );
+ }
+ } else {
+ if ( _clean )
+ {
+ /// ### this has already been done, no?
+ setPageLayout( __pgLayout );
+ }
+ else
+ setPageLayout( m_pageLayout );
+ }
+
+ compatibilityFromOldFileFormat();
+
+ emit sigProgress( 100 );
+ recalcVariables( VT_FIELD );
+ emit sigProgress( -1 );
+
+ connect( documentInfo(), SIGNAL( sigDocumentInfoModifed()),this,SLOT(slotDocumentInfoModifed() ) );
+ //desactivate bgspellchecking
+ //attributes isReadWrite is not placed at the beginning !
+ if ( !isReadWrite())
+ enableBackgroundSpellCheck( false );
+ return true;
+}
+
+void KPrDocument::loadUsedSoundFileFromStore( KoStore *_store, QStringList _list )
+{
+ int i = m_insertFilePage;
+ QStringList::Iterator it = _list.begin();
+ for ( ; it != _list.end(); ++it ) {
+ QString soundFile = *it;
+
+ if ( _store->open( soundFile ) ) {
+ kdDebug( 33001 ) << "Not found file on disk. Use this( " << soundFile << " ) file." << endl;
+ KoStoreDevice dev( _store );
+ int size = _store->size();
+ char *data = new char[size];
+ dev.readBlock( data, size );
+
+ int position = soundFile.findRev( '.' );
+ QString format = soundFile.right( soundFile.length() - position );
+ KTempFile *tmpFile = new KTempFile( QString::null, format );
+ tmpFile->setAutoDelete( true );
+ tmpFile->file()->writeBlock( data, size );
+ tmpFile->close();
+
+ QString tmpFileName = tmpFile->name();
+ tmpSoundFileList.append( tmpFile );
+
+ QString _fileName = *haveNotOwnDiskSoundFile.at( i );
+ ++i;
+
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it ) {
+ QString _file = it.current()->getPageSoundFileName();
+ if ( !_file.isEmpty() && _file == _fileName )
+ it.current()->setPageSoundFileName( tmpFileName );
+
+ QPtrListIterator<KPrObject> oIt( it.current()->objectList() );
+ for ( ; oIt.current(); ++oIt ) {
+ _file = oIt.current()->getAppearSoundEffectFileName();
+ if ( !_file.isEmpty() && _file == _fileName )
+ oIt.current()->setAppearSoundEffectFileName( tmpFileName );
+
+ _file = oIt.current()->getDisappearSoundEffectFileName();
+ if ( !_file.isEmpty() && _file == _fileName )
+ oIt.current()->setDisappearSoundEffectFileName( tmpFileName );
+ }
+ }
+
+ _store->close();
+ delete[] data;
+ }
+ else {
+ kdDebug( 33001 ) << "Found this( " << soundFile << " ) file on disk" << endl;
+ }
+ }
+}
+
+void KPrDocument::setPageLayout( const KoPageLayout &pgLayout )
+{
+ // if ( _pageLayout == pgLayout )
+ // return;
+
+ m_pageLayout = pgLayout;
+
+ //for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ )
+ // m_pageList.at( i )->updateBackgroundSize();
+
+ repaint( false );
+ layout();
+ // don't setModified(true) here, since this is called on startup
+}
+
+//when we change pagelayout we must re-position header/footer
+void KPrDocument::updateHeaderFooterPosition( )
+{
+ KoRect pageRect=m_masterPage->getPageRect();
+ QRect oldBoundingRect = zoomHandler()->zoomRect( _header->getRepaintRect() );
+ _header->setOrig(pageRect.topLeft ());
+ _header->setSize(pageRect.width(),_header->getSize().height());
+ repaint( oldBoundingRect );
+ repaint(_header);
+
+ oldBoundingRect = zoomHandler()->zoomRect( _footer->getRepaintRect() );
+ _footer->setOrig(pageRect.left(),pageRect.bottom()-_footer->getSize().height());
+ _footer->setSize(pageRect.width(),_footer->getSize().height());
+ repaint(oldBoundingRect);
+ repaint(_footer);
+}
+
+bool KPrDocument::initDoc(InitDocFlags flags, QWidget* parentWidget)
+{
+
+ if (flags==KoDocument::InitDocEmpty)
+ {
+ QString fileName( locate("kpresenter_template", "Screenpresentations/.source/Plain.kpt",
+ KPrFactory::global() ) );
+ objStartY = 0;
+ _clean = true;
+ bool ok = loadNativeFormat( fileName );
+ if ( !ok )
+ showLoadingErrorDialog();
+ resetURL();
+ setEmpty();
+ return ok;
+ }
+
+ QString file;
+ KoTemplateChooseDia::ReturnType ret;
+ KoTemplateChooseDia::DialogType dlgtype;
+ if (flags != InitDocFileNew)
+ dlgtype = KoTemplateChooseDia::Everything;
+ else
+ dlgtype = KoTemplateChooseDia::OnlyTemplates;
+
+ ret = KoTemplateChooseDia::choose( KPrFactory::global(), file,
+ dlgtype, "kpresenter_template", parentWidget );
+ if ( ret == KoTemplateChooseDia::Template ) {
+ _clean = true; //was a parameter called "clean", but unused
+ bool ok = loadNativeFormat( file );
+ if ( !ok )
+ showLoadingErrorDialog();
+ objStartY = 0;
+ _clean = true;
+ resetURL();
+ setEmpty();
+ return ok;
+ } else if ( ret == KoTemplateChooseDia::File ) {
+ objStartY = 0;
+ _clean = true;
+ KURL url( file );
+ bool ok = openURL( url );
+ return ok;
+ } else if ( ret == KoTemplateChooseDia::Empty ) {
+ QString fileName( locate("kpresenter_template", "Screenpresentations/.source/Plain.kpt",
+ KPrFactory::global() ) );
+ objStartY = 0;
+ _clean = true;
+ bool ok = loadNativeFormat( fileName );
+ if ( !ok )
+ showLoadingErrorDialog();
+ resetURL();
+ setEmpty();
+ return ok;
+ } else
+ return false;
+}
+
+void KPrDocument::openExistingFile( const QString& file )
+{
+ objStartY = 0;
+ _clean = true;
+ KoDocument::openExistingFile( file );
+}
+
+void KPrDocument::openTemplate( const QString& file )
+{
+ KoDocument::openTemplate( file );
+ objStartY = 0;
+ _clean = true;
+}
+
+void KPrDocument::initEmpty()
+{
+ QString fileName( locate("kpresenter_template", "Screenpresentations/.source/Plain.kpt",
+ KPrFactory::global() ) );
+ objStartY = 0;
+ _clean = true;
+ setModified(true);
+ bool ok = loadNativeFormat( fileName );
+ if ( !ok )
+ showLoadingErrorDialog();
+ resetURL();
+}
+
+void KPrDocument::setEmpty()
+{
+ KoDocument::setEmpty();
+ // Whether loaded from template or from empty doc: this is a new one -> set creation date
+ m_varColl->variableSetting()->setCreationDate(QDateTime::currentDateTime());
+ recalcVariables( VT_DATE ); // , VST_CREATION_DATE ...
+ // If we then load a document, it will override that date.
+}
+
+void KPrDocument::setGridValue( double _x, double _y, bool _replace )
+{
+ oldGridX = m_gridX;
+ oldGridY = m_gridY;
+ m_gridX=_x;
+ m_gridY=_y;
+ if ( _replace )
+ replaceObjs();
+}
+
+void KPrDocument::repaint( bool erase )
+{
+ QPtrListIterator<KoView> it( views() );
+ for( ; it.current(); ++it ) {
+ KPrCanvas* canvas = ((KPrView*)it.current())->getCanvas();
+ canvas->repaint( erase );
+ }
+}
+
+void KPrDocument::repaint( const QRect& rect )
+{
+ QRect r;
+ QPtrListIterator<KoView> it( views() );
+ for( ; it.current(); ++it ) {
+ r = rect;
+ KPrCanvas* canvas = ((KPrView*)it.current())->getCanvas();
+ r.moveTopLeft( QPoint( r.x() - canvas->diffx(),
+ r.y() - canvas->diffy() ) );
+ canvas->update( r );
+ }
+}
+
+void KPrDocument::layout(KPrObject *kpobject)
+{
+ KPrTextObject * obj = dynamic_cast<KPrTextObject *>( kpobject );
+ if (obj)
+ obj->layout();
+}
+
+void KPrDocument::layout()
+{
+ QPtrListIterator<KoView> it( views() );
+ for( ; it.current(); ++it ) {
+ KPrCanvas* canvas = ((KPrView*)it.current())->getCanvas();
+ canvas->layout();
+ }
+}
+
+void KPrDocument::repaint( KPrObject *kpobject )
+{
+ repaint( m_zoomHandler->zoomRect( kpobject->getRepaintRect() ) );
+}
+
+QValueList<int> KPrDocument::getPageEffectSteps( unsigned int num )
+{
+ return m_pageList.at(num)->getEffectSteps();
+}
+
+QRect KPrDocument::getPageRect( bool decBorders ) const
+{
+ int pw, ph, bl = static_cast<int>(m_pageLayout.ptLeft);
+ int br = static_cast<int>(m_pageLayout.ptRight);
+ int bt = static_cast<int>(m_pageLayout.ptTop);
+ int bb = static_cast<int>(m_pageLayout.ptBottom);
+ int wid = static_cast<int>(m_pageLayout.ptWidth);
+ int hei = static_cast<int>(m_pageLayout.ptHeight);
+
+ if ( !decBorders ) {
+ br = 0;
+ bt = 0;
+ bl = 0;
+ bb = 0;
+ }
+
+ pw = wid - ( bl + br );
+ ph = hei - ( bt + bb );
+
+ return QRect( bl, bt, pw, ph );
+}
+
+int KPrDocument::getLeftBorder() const
+{
+ return static_cast<int>(m_pageLayout.ptLeft);
+}
+
+int KPrDocument::getTopBorder() const
+{
+ return static_cast<int>(m_pageLayout.ptTop);
+}
+
+int KPrDocument::getBottomBorder() const
+{
+ return static_cast<int>(m_pageLayout.ptBottom);
+}
+
+int KPrDocument::getRightBorder() const
+{
+ return static_cast<int>(m_pageLayout.ptRight);
+}
+
+void KPrDocument::deletePage( int _page )
+{
+ kdDebug(33001) << "KPrDocument::deletePage " << _page << endl;
+ //m_pageList.at(_page)->deletePage();
+ if ( m_pageList.count()==1 )
+ return;
+ KPrDeletePageCmd *cmd = new KPrDeletePageCmd( i18n("Delete Slide"), _page, this );
+ cmd->execute();
+ addCommand(cmd);
+}
+
+void KPrDocument::insertPage( KPrPage *page, int currentPageNum, int insertPageNum )
+{
+ // check if page was allready deleted
+ int pos = m_deletedPageList.findRef( page );
+ if ( pos != -1 )
+ m_deletedPageList.take( pos );
+
+ m_pageList.insert( insertPageNum, page );
+
+ pageOrderChanged();
+ //activate this page in all views which on slide currentPageNum
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ KPrView *view = static_cast<KPrView*>( it.current() );
+ view->addSideBarItem( insertPageNum );
+
+ // change to the new page if the view was on the current page.
+ if ( (int)view->getCurrPgNum() - 1 == currentPageNum )
+ {
+ view->skipToPage( insertPageNum );
+ }
+ else // recalc the page number as it might have been changed
+ {
+ view->recalcCurrentPageNum();
+ }
+ }
+}
+
+void KPrDocument::takePage( KPrPage *page, int pageNum )
+{
+ int pos = m_pageList.findRef( page );
+ m_pageList.take( pos );
+ m_deletedPageList.append( page );
+
+ pageOrderChanged();
+
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ KPrView *view = static_cast<KPrView*>( it.current() );
+ view->removeSideBarItem( pos );
+
+ // change to the new page if the view was on the current page.
+ if ( (int)view->getCurrPgNum() - 1 == pos )
+ {
+ view->skipToPage( pageNum );
+ }
+ else // recalc the page number as it might have been changed
+ {
+ view->recalcCurrentPageNum();
+ }
+ }
+
+ repaint( false );
+}
+
+void KPrDocument::pageOrderChanged()
+{
+ recalcVariables( VT_PGNUM );
+
+ //update statusbar
+ emit pageNumChanged();
+ emit sig_updateMenuBar();
+}
+
+void KPrDocument::movePageTo( int oldPos, int newPos )
+{
+ kdDebug(33001) << "movePage oldPos = " << oldPos << ", neuPos = " << newPos << endl;
+
+ KPrPage * page = m_pageList.take( oldPos );
+ m_pageList.insert( newPos, page );
+
+ pageOrderChanged();
+
+ // Update the sidebars
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ KPrView *view = static_cast<KPrView*>( it.current() );
+ view->moveSideBarItem( oldPos, newPos );
+
+ // change to the new page if the view was on the old pos.
+ if ( (int)view->getCurrPgNum() - 1 == oldPos )
+ {
+ view->skipToPage( newPos );
+ }
+ else // recalc the page number as it might have been changed
+ {
+ view->recalcCurrentPageNum();
+ }
+ }
+}
+
+QString KPrDocument::templateFileName( bool chooseTemplate, const QString &theFile )
+{
+ QString fileName;
+ if ( !chooseTemplate ) {
+ if ( theFile.isEmpty() )
+ fileName = locateLocal( "appdata", "default.kpr" );
+ else
+ fileName = theFile;
+ } else {
+ // TODO: pass parentWidget as parameter to this method
+ QWidget* parentWidget = 0;
+ QString _template;
+ if ( KoTemplateChooseDia::choose( KPrFactory::global(), _template,
+ KoTemplateChooseDia::OnlyTemplates,
+ "kpresenter_template", parentWidget ) == KoTemplateChooseDia::Cancel )
+ return QString::null;
+ QFileInfo fileInfo( _template );
+ fileName = fileInfo.dirPath( true ) + "/" + fileInfo.baseName() + ".kpt";
+
+ KURL src, dest;
+ src.setPath( fileName );
+ dest.setPath( locateLocal( "appdata", "default.kpr" ) );
+ kdDebug(33001) << "Copying template (in KPrDocument::templateFileName)" << endl
+ << " from: " << src.prettyURL() << endl
+ << " to: " << dest.prettyURL() << endl;
+ KIO::NetAccess::file_copy( src,
+ dest,
+ -1, /* default permissions */
+ true /* overwrite */ );
+ }
+ return fileName;
+}
+
+int KPrDocument::insertNewPage( const QString &cmdName, int _page, InsertPos _insPos,
+ bool chooseTemplate, const QString &theFile )
+{
+ kdDebug(33001) << "KPrDocument::insertNewPage " << _page << endl;
+
+ QString fileName=templateFileName(chooseTemplate, theFile);
+ if(fileName.isEmpty())
+ return -1;
+
+ _clean = false;
+
+ objStartY=-1;
+
+ //insert page.
+ KPrPage *newpage = new KPrPage( this, m_masterPage );
+
+ m_pageWhereLoadObject=newpage;
+ m_childCountBeforeInsert = children().count();
+
+ bool ok = loadNativeFormat( fileName );
+ if ( !ok )
+ showLoadingErrorDialog();
+
+ objStartY = 0;
+
+ KPrInsertPageCmd *cmd = new KPrInsertPageCmd( cmdName, _page, _insPos, newpage, this );
+ cmd->execute();
+ addCommand(cmd);
+
+ _clean = true;
+ m_pageWhereLoadObject=0L;
+ m_childCountBeforeInsert = 0;
+ return _page;
+}
+
+void KPrDocument::savePage( const QString &file, int pgnum, bool ignore )
+{
+ saveOnlyPage = pgnum;
+ _duplicatePage=ignore;
+ saveNativeFormat( file );
+ _duplicatePage=false;
+ saveOnlyPage = -1;
+}
+
+void KPrDocument::replaceObjs( bool createUndoRedo )
+{
+ KMacroCommand * macroCmd = 0L;
+ QPtrListIterator<KPrPage> oIt(m_pageList);
+ for (; oIt.current(); ++oIt )
+ {
+ KCommand *cmd=oIt.current()->replaceObjs( createUndoRedo, oldGridX,oldGridY,_txtBackCol, _otxtBackCol);
+ if(cmd && createUndoRedo)
+ {
+ if ( !macroCmd)
+ macroCmd = new KMacroCommand( i18n("Set New Options") );
+ macroCmd->addCommand(cmd);
+ }
+ else
+ delete cmd;
+ }
+
+ if(macroCmd)
+ {
+ macroCmd->execute();
+ addCommand(macroCmd);
+ }
+}
+
+void KPrDocument::restoreBackground( KPrPage *page )
+{
+ page->background()->reload();
+}
+
+KCommand * KPrDocument::loadPastedObjs( const QString &in, KPrPage* _page )
+{
+ QDomDocument doc;
+ doc.setContent( in );
+
+ QDomElement document=doc.documentElement();
+
+ // DOC
+ if (document.tagName()!="DOC") {
+ kdError(33001) << "Missing DOC" << endl;
+ return 0L;
+ }
+
+ bool ok = false;
+
+ if(document.hasAttribute("mime") && document.attribute("mime")=="application/x-kpresenter")
+ ok=true;
+
+ if ( !ok )
+ return 0L;
+ m_pageWhereLoadObject=_page;
+ KCommand *cmd = loadObjects(document,true);
+ m_pageWhereLoadObject=0L;
+
+ repaint( false );
+ setModified( true );
+ return cmd;
+}
+
+void KPrDocument::deSelectAllObj()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->getCanvas()->deSelectAllObj();
+}
+
+void KPrDocument::deSelectObj(KPrObject *obj)
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->getCanvas()->deSelectObj( obj );
+}
+
+void KPrDocument::setDisplayObjectMasterPage( bool b )
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->updateDisplayObjectMasterPageButton();
+ repaint(b);
+}
+
+void KPrDocument::setDisplayBackground( bool b )
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->updateDisplayBackgroundButton();
+ repaint(b);
+}
+
+void KPrDocument::setHeader( bool b )
+{
+ _header->setDrawEditRect( b );
+ _header->setDrawEmpty( b );
+ if(!b)
+ {
+ terminateEditing(_header);
+ deSelectObj(_header);
+ }
+ m_masterPage->setHeader( b, false );
+ updateHeaderFooterButton();
+ repaint(b);
+}
+
+void KPrDocument::setFooter( bool b )
+{
+ _footer->setDrawEditRect( b );
+ _footer->setDrawEmpty( b );
+ if(!b)
+ {
+ terminateEditing(_footer);
+ deSelectObj(_footer);
+ }
+ m_masterPage->setFooter( b, false );
+ updateHeaderFooterButton();
+ repaint(b);
+}
+
+void KPrDocument::updateHeaderFooterButton()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->updateHeaderFooterButton();
+}
+
+void KPrDocument::makeUsedPixmapList()
+{
+ usedPictures.clear();
+
+ for ( uint i = 0; i < m_pageList.count(); i++ ) {
+ if ( saveOnlyPage != -1 &&
+ static_cast<int>(i) != saveOnlyPage )
+ continue;
+ m_pageList.at(i)->makeUsedPixmapList();
+ }
+ // ### following call independant of saveOnlyPage's value?
+ if ( saveOnlyPage == -1 )
+ m_masterPage->makeUsedPixmapList();
+}
+
+void KPrDocument::makeUsedSoundFileList()
+{
+ if ( saveOnlyPage != -1 )
+ return;
+
+ usedSoundFile.clear();
+
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it ) {
+ QString _file = it.current()->getPageSoundFileName();
+ if ( !_file.isEmpty() && usedSoundFile.findIndex( _file ) == -1 )
+ usedSoundFile.append( _file );
+
+ QPtrListIterator<KPrObject> oIt( it.current()->objectList() );
+ for ( ; oIt.current(); ++oIt ) {
+ _file = oIt.current()->getAppearSoundEffectFileName();
+ if ( !_file.isEmpty() && usedSoundFile.findIndex( _file ) == -1 )
+ usedSoundFile.append( _file );
+
+ _file = oIt.current()->getDisappearSoundEffectFileName();
+ if ( !_file.isEmpty() && usedSoundFile.findIndex( _file ) == -1 )
+ usedSoundFile.append( _file );
+ }
+ }
+}
+
+KoView* KPrDocument::createViewInstance( QWidget* parent, const char* name )
+{
+ //the page numbers have to be recalced for the sticky objects
+ //as it could not be done during the constructor of KPrView
+ recalcPageNum();
+ return new KPrView( this, parent, name );
+}
+
+void KPrDocument::paintContent( QPainter& painter, const QRect& rect,
+ bool /*transparent*/, double zoomX, double zoomY )
+{
+ m_zoomHandler->setZoom( 100 );
+ if ( zoomHandler()->zoomedResolutionX() != zoomX || zoomHandler()->zoomedResolutionY() != zoomY )
+ {
+ int zoomLevel = qRound( 100 * zoomY / zoomHandler()->zoomedResolutionY() ); // ## ignores the case where the x and y scaling differs
+ zoomHandler()->setZoom( zoomLevel );
+ bool forPrint = painter.device() && painter.device()->devType() == QInternal::Printer;
+ newZoomAndResolution( false, forPrint );
+ }
+ //for the moment draw first page.
+ KPrPage *page=m_pageList.first();
+ if( m_initialActivePage )
+ page = m_initialActivePage;
+
+ int pageNum = m_pageList.findRef( page );
+
+ if ( page->displayBackground() )
+ page->background()->drawBackground( &painter, zoomHandler(), rect, false );
+ if ( page->displayObjectFromMasterPage() )
+ {
+ KPrPage *masterPage = page->masterPage();
+ if ( masterPage )
+ {
+ QPtrListIterator<KPrObject> it( masterPage->objectList() );
+ //draw objects on master slide
+ for ( ; it.current() ; ++it )
+ {
+ if( (it.current()==_header && !page->hasHeader())||(it.current()==_footer && !page->hasFooter()))
+ continue;
+ it.current()->draw( &painter, zoomHandler(), pageNum, SM_NONE );
+ }
+ }
+ }
+ QPtrListIterator<KPrObject> it( page->objectList() );
+ for ( ; it.current() ; ++it )
+ it.current()->draw( &painter, zoomHandler(), pageNum, SM_NONE );
+}
+
+QPixmap KPrDocument::generatePreview( const QSize& size )
+{
+ int oldZoom = zoomHandler()->zoom();
+ double oldResolutionX = zoomHandler()->resolutionX();
+ double oldResolutionY = zoomHandler()->resolutionY();
+
+ QPixmap pix = KoDocument::generatePreview(size);
+
+ zoomHandler()->setResolution( oldResolutionX, oldResolutionY );
+ zoomHandler()->setZoom(oldZoom);
+ newZoomAndResolution( false, false );
+
+ return pix;
+}
+
+void KPrDocument::addShell( KoMainWindow *shell )
+{
+ connect( shell, SIGNAL( documentSaved() ), m_commandHistory, SLOT( documentSaved() ) );
+ KoDocument::addShell( shell );
+}
+
+void KPrDocument::movePage( int from, int to )
+{
+ kdDebug(33001) << "KPrDocument::movePage from=" << from << " to=" << to << endl;
+ KPrMovePageCmd *cmd = new KPrMovePageCmd( i18n("Move Slide"), from, to, this );
+ cmd->execute();
+ addCommand(cmd);
+}
+
+void KPrDocument::copyPage( int from )
+{
+ _clean = false;
+ m_childCountBeforeInsert = children().count();
+
+ _duplicatePage=true; // ### now also set via savePage() parameter below
+
+ kdDebug(33001) << "KPrDocument::copyPage from=" << from << " to=" << from + 1 << endl;
+ kdDebug(33001) << "mimeType = " << mimeType() << ", outputMimeType = " << outputMimeType() << endl;
+ bool wasSelected = isSlideSelected( from );
+ KTempFile tempFile( QString::null, mimeType() == nativeOasisMimeType() ? ".oop": ".kpr" );
+ tempFile.setAutoDelete( true );
+ savePage( tempFile.name(), from, true );
+
+ //insert page.
+ KPrPage *newpage = new KPrPage( this, m_masterPage );
+
+ m_pageWhereLoadObject = newpage;
+
+ bool ok = loadNativeFormat( tempFile.name() );
+ if ( !ok )
+ showLoadingErrorDialog();
+
+ KPrInsertPageCmd *cmd = new KPrInsertPageCmd( i18n("Duplicate Slide"), from, IP_AFTER, newpage, this );
+ cmd->execute();
+ addCommand(cmd);
+
+ _duplicatePage=false;
+
+ _clean = true;
+ m_pageWhereLoadObject=0L;
+ m_childCountBeforeInsert = 0;
+
+ selectPage( from + 1, wasSelected );
+}
+
+void KPrDocument::copyPageToClipboard( int pgnum )
+{
+ // We save the page to a temp file and set the URL of the file in the clipboard
+ // Yes it's a hack but at least we don't hit the clipboard size limit :)
+ // (and we don't have to implement copy-tar-structure-to-clipboard)
+ // In fact it even allows copying a [1-page] kpr in konq and pasting it in kpresenter :))
+ kdDebug(33001) << "KPrDocument::copyPageToClipboard pgnum=" << pgnum << endl;
+ kdDebug(33001) << "mimeType = " << mimeType() << ", outputMimeType = " << outputMimeType() << endl;
+ KTempFile tempFile( QString::null, mimeType() == nativeOasisMimeType() ? ".oop": ".kpr" );
+ savePage( tempFile.name(), pgnum, true );
+ KURL url; url.setPath( tempFile.name() );
+ KURL::List lst;
+ lst.append( url );
+ QApplication::clipboard()->setData( new KURLDrag( lst ) );
+ m_tempFileInClipboard = tempFile.name(); // do this last, the above calls clipboardDataChanged
+}
+
+void KPrDocument::pastePage( const QMimeSource * data, int pgnum )
+{
+ KURL::List lst;
+ if ( KURLDrag::decode( data, lst ) && !lst.isEmpty() )
+ {
+ insertNewPage(i18n("Paste Slide"), pgnum, IP_BEFORE, FALSE, lst.first().path() );
+ //selectPage( pgnum, true /* should be part of the file ? */ );
+ }
+}
+
+void KPrDocument::clipboardDataChanged()
+{
+ if ( !m_tempFileInClipboard.isEmpty() )
+ {
+ kdDebug(33001) << "KPrDocument::clipboardDataChanged, deleting temp file " << m_tempFileInClipboard << endl;
+ unlink( QFile::encodeName( m_tempFileInClipboard ) );
+ m_tempFileInClipboard = QString::null;
+ }
+ // TODO enable paste as well, when a txtobject is activated
+ // and there is plain text in the clipboard. Then enable this code.
+ //QMimeSource *data = QApplication::clipboard()->data();
+ //bool canPaste = data->provides( "text/uri-list" ) || data->provides( "application/x-kpresenter-selection" );
+ // emit enablePaste( canPaste );
+}
+
+void KPrDocument::selectPage( int pgNum /* 0-based */, bool select )
+{
+ Q_ASSERT( pgNum >= 0 );
+ KPrPage *page = m_pageList.at( pgNum );
+ page->slideSelected(select);
+ kdDebug(33001) << "KPrDocument::selectPage pgNum=" << pgNum << " select=" << select << endl;
+ setModified(true);
+
+ updateSideBarItem( page );
+ updatePresentationButton();
+ //update statusbar
+ emit pageNumChanged();
+}
+
+KPrPage * KPrDocument::findPage(KPrObject *object)
+{
+ QPtrList<KPrObject> masterObjects( m_masterPage->objectList() );
+ if ( masterObjects.findRef( object ) != -1 )
+ {
+ //kdDebug(33001) << "Object is on the master page" << endl;
+ return m_masterPage;
+ }
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it ) {
+ QPtrList<KPrObject> list( it.current()->objectList() );
+ if ( list.findRef( object ) != -1 ) {
+ //kdDebug(33001) << "Object is on page " << m_pageList.findRef(it.current()) + 1 << endl;
+ return it.current();
+ }
+ }
+ kdDebug(33001) << "Object not found on a page" << endl;
+ return 0L;
+}
+
+KPrPage * KPrDocument::findPage(QPtrList<KPrObject> &objects)
+{
+ KPrObject *object;
+ for ( object = objects.first(); object; object=objects.next() ) {
+ QPtrList<KPrObject> list( m_masterPage->objectList() );
+ if ( list.findRef( object ) != -1 )
+ {
+ //kdDebug(33001) << "Object is on the master page" << endl;
+ return m_masterPage;
+ }
+ }
+ object = objects.first();
+ for ( KPrPage *page=m_pageList.first(); page; page=m_pageList.next() ) {
+ QPtrList<KPrObject> list( page->objectList() );
+ if ( list.findRef( object ) != -1 ) {
+ //kdDebug(33001) << "The Objects are on page " << m_pageList.findRef(page) + 1 << endl;
+ return page;
+ }
+ }
+ kdDebug(33001) << "Objects not found on a page" << endl;
+ return 0L;
+}
+
+void KPrDocument::updateSideBarItem( KPrPage * page )
+{
+ // Update the views
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ static_cast<KPrView*>( it.current() )->updateSideBarItem( page );
+}
+
+bool KPrDocument::isSlideSelected( int pgNum /* 0-based */ )
+{
+ Q_ASSERT( pgNum >= 0 );
+ return m_pageList.at(pgNum)->isSlideSelected();
+}
+
+QValueList<int> KPrDocument::listOfDisplaySelectedSlides( const QValueList<KPrPage*> & lst) /* returned list is 0-based */
+{
+ QValueList<int> result;
+ QValueListConstIterator<KPrPage*> itPage;
+ QValueListConstIterator<KPrPage*> itPageEnd = lst.end();
+ for( itPage = lst.begin() ; itPage != itPageEnd; ++itPage )
+ {
+ int pageNum = m_pageList.find(*itPage );
+ if ( pageNum != -1 )
+ {
+ kdDebug()<<" KPrDocument::displaySelectedSlide : add slide number :"<<pageNum<<endl;
+ result << pageNum;
+ }
+ }
+ return result;
+}
+
+
+QValueList<int> KPrDocument::displaySelectedSlides() /* returned list is 0-based */
+{
+ QValueList<int> result;
+ if ( m_customListTest )
+ return *m_customListTest;
+ if ( m_presentationName.isEmpty() )
+ return selectedSlides();
+ else
+ {
+ kdDebug()<<" KPrDocument::displaySelectedSlide m_presentationName : "<<m_presentationName<<endl;
+ result = listOfDisplaySelectedSlides( m_customListSlideShow[m_presentationName]);
+ }
+ return result;
+}
+
+QValueList<int> KPrDocument::selectedSlides() /* returned list is 0-based */
+{
+ QValueList<int> result;
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ ) {
+ if(m_pageList.at(i)->isSlideSelected())
+ result <<i;
+ }
+ return result;
+}
+
+QString KPrDocument::selectedForPrinting() {
+ QString ret;
+ int start=-1, end=-1;
+ bool continuous=false;
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ ) {
+ if(m_pageList.at(i)->isSlideSelected()) {
+ if(continuous)
+ ++end;
+ else {
+ start=i;
+ end=i;
+ continuous=true;
+ }
+ }
+ else {
+ if(continuous) {
+ if(start==end)
+ ret+=QString::number(start+1)+",";
+ else
+ ret+=QString::number(start+1)+"-"+QString::number(end+1)+",";
+ continuous=false;
+ }
+ }
+ }
+ if(continuous) {
+ if(start==end)
+ ret+=QString::number(start+1);
+ else
+ ret+=QString::number(start+1)+"-"+QString::number(end+1);
+ }
+ if(','==ret[ret.length()-1])
+ ret.truncate(ret.length()-1);
+ return ret;
+}
+
+void KPrDocument::slotRepaintChanged( KPrTextObject *kptextobj )
+{
+ //todo
+ //use this function for the moment
+ repaint( kptextobj );
+}
+
+
+void KPrDocument::recalcVariables( int type )
+{
+ recalcPageNum();
+ QValueList<KoVariable* > modifiedVariables = m_varColl->recalcVariables(type);
+ if ( modifiedVariables.isEmpty() )
+ return;
+
+ // TODO use the return value from recalcVariables to only repaint what has changed.
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it )
+ it.current()->slotRepaintVariable();
+ m_masterPage->slotRepaintVariable();
+}
+
+void KPrDocument::slotGuideLinesChanged( KoView *view )
+{
+ ( (KPrView*)view )->getCanvas()->guideLines().getGuideLines( m_hGuideLines, m_vGuideLines );
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ if ( it.current() != view )
+ {
+ ( (KPrView*)it.current() )->getCanvas()->guideLines().setGuideLines( m_hGuideLines, m_vGuideLines );
+ }
+ }
+}
+
+void KPrDocument::slotDocumentInfoModifed()
+{
+ if (!getVariableCollection()->variableSetting()->displayFieldCode())
+ recalcVariables( VT_FIELD );
+}
+
+void KPrDocument::reorganizeGUI()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->reorganize();
+}
+
+int KPrDocument::undoRedoLimit() const
+{
+ return m_commandHistory->undoLimit();
+}
+
+void KPrDocument::setUndoRedoLimit(int val)
+{
+ m_commandHistory->setUndoLimit(val);
+ m_commandHistory->setRedoLimit(val);
+}
+
+void KPrDocument::updateRuler()
+{
+ emit sig_updateRuler();
+}
+
+void KPrDocument::recalcPageNum()
+{
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it )
+ it.current()->recalcPageNum();
+ m_masterPage->recalcPageNum();
+}
+
+KPrPage * KPrDocument::activePage()const
+{
+ return m_initialActivePage;
+}
+
+void KPrDocument::insertObjectInPage(double offset, KPrObject *_obj, int pos)
+{
+ /// Why does this use __pgLayout instead of m_pageLayout ?
+ int page = (int)(offset/__pgLayout.ptHeight)+m_insertFilePage;
+ if ( page < 0 )
+ {
+ kdDebug(33001) << "insertObjectInPage object cound not be inserted page = " << page << endl;
+ return;
+ }
+ double newPos = offset - ( page - m_insertFilePage ) * __pgLayout.ptHeight;
+ // due to a very small caluculating error which gives us the wrong page
+ // for objects placed on top of the page we have to move them to the right page.
+ if ( __pgLayout.ptHeight - newPos < 1e-6 )
+ {
+ page++;
+ newPos = 0.0;
+ }
+ if ( page > ( (int)m_pageList.count()-1 ) )
+ {
+ for (int i=(m_pageList.count()-1); i<page;i++)
+ m_pageList.append( new KPrPage( this, m_masterPage ) );
+ }
+ _obj->setOrig(_obj->getOrig().x(),newPos);
+
+ if ( pos == -1 )
+ {
+ m_pageList.at(page)->appendObject(_obj);
+ }
+ else
+ {
+ m_pageList.at( page )->insertObject( _obj, pos );
+ }
+}
+
+void KPrDocument::insertPixmapKey( KoPictureKey key )
+{
+ if ( !usedPictures.contains( key ) )
+ usedPictures.append( key );
+}
+
+KPrPage * KPrDocument::initialActivePage() const
+{
+ return m_initialActivePage;
+}
+
+void KPrDocument::displayActivePage(KPrPage * _page)
+{
+ m_initialActivePage = _page;
+}
+
+void KPrDocument::updateZoomRuler()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ ((KPrView*)it.current())->getHRuler()->setZoom( m_zoomHandler->zoomedResolutionX() );
+ ((KPrView*)it.current())->getVRuler()->setZoom( m_zoomHandler->zoomedResolutionY() );
+ ((KPrView*)it.current())->slotUpdateRuler();
+ }
+}
+
+void KPrDocument::newZoomAndResolution( bool updateViews, bool /*forPrint*/ )
+{
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it ) {
+ QPtrListIterator<KPrObject> oit(it.current()->objectList());
+ for ( ; oit.current(); ++oit ) {
+ if ( oit.current()->getType() == OT_TEXT )
+ static_cast<KPrTextObject *>( oit.current() )->textDocument()->formatCollection()->zoomChanged();
+ }
+ }
+ if ( updateViews )
+ {
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ static_cast<KPrView *>( it.current() )->getCanvas()->update();
+ static_cast<KPrView *>( it.current() )->getCanvas()->layout();
+ }
+ }
+}
+
+bool KPrDocument::isHeader(const KPrObject *obj) const
+{
+ return (obj==_header);
+}
+
+bool KPrDocument::isFooter(const KPrObject *obj) const
+{
+ return (obj==_footer);
+}
+
+bool KPrDocument::isHeaderFooter(const KPrObject *obj) const
+{
+ return (obj==_header)||(obj==_footer);
+}
+
+void KPrDocument::updateRulerPageLayout()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ ((KPrView*)it.current())->getHRuler()->setPageLayout(m_pageLayout );
+ ((KPrView*)it.current())->getVRuler()->setPageLayout(m_pageLayout );
+
+ }
+}
+
+void KPrDocument::refreshAllNoteBarMasterPage(const QString &text, KPrView *exceptView)
+{
+ m_masterPage->setNoteText(text );
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ KPrView* view=(KPrView*)it.current();
+ if ( view->getNoteBar() && view != exceptView && view->editMaster() )
+ view->getNoteBar()->setCurrentNoteText(text );
+ }
+}
+
+void KPrDocument::refreshAllNoteBar(int page, const QString &text, KPrView *exceptView)
+{
+ m_pageList.at(page)->setNoteText(text );
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ KPrView* view=(KPrView*)it.current();
+ if ( view->getNoteBar() && view != exceptView && ((int)(view->getCurrPgNum())-1 == page))
+ view->getNoteBar()->setCurrentNoteText(text );
+ }
+}
+
+void KPrDocument::loadStyleTemplates( const QDomElement &stylesElem )
+{
+ QValueList<QString> followingStyles;
+
+ QDomNodeList listStyles = stylesElem.elementsByTagName( "STYLE" );
+ if( listStyles.count() > 0) { // we are going to import at least one style.
+ KoParagStyle *s = m_styleColl->findStyle("Standard");
+ kdDebug(32001) << "KPrDocument::loadStyleTemplates looking for Standard, to delete it. Found " << s << endl;
+ if(s) // delete the standard style.
+ m_styleColl->removeStyle(s);
+ }
+ for (unsigned int item = 0; item < listStyles.count(); item++) {
+ QDomElement styleElem = listStyles.item( item ).toElement();
+
+ KoParagStyle *sty = new KoParagStyle( QString::null );
+ // Load the style from the <STYLE> element
+ sty->loadStyle( styleElem );
+
+ QDomElement formatElem = styleElem.namedItem( "FORMAT" ).toElement();
+ if ( !formatElem.isNull() )
+ sty->format() = KPrTextObject::loadFormat( formatElem, 0L, defaultFont(), globalLanguage(), globalHyphenation() );
+ else
+ kdWarning(33001) << "No FORMAT tag in <STYLE>" << endl; // This leads to problems in applyStyle().
+
+ // Style created, now let's try to add it
+ sty = m_styleColl->addStyle( sty );
+ kdDebug() << k_funcinfo << m_styleColl->styleList().count() << " styles, " << followingStyles.count() << " following styles" << endl;
+ if(m_styleColl->styleList().count() > followingStyles.count() )
+ {
+ QString following = styleElem.namedItem("FOLLOWING").toElement().attribute("name");
+ followingStyles.append( following );
+ }
+ else
+ kdWarning (33001) << "Found duplicate style declaration, overwriting former " << sty->name() << endl;
+ }
+
+ Q_ASSERT( followingStyles.count() == m_styleColl->styleList().count() );
+ unsigned int i=0;
+ for( QValueList<QString>::Iterator it = followingStyles.begin(); it != followingStyles.end(); ++it ) {
+ KoParagStyle * style = m_styleColl->findStyle(*it);
+ m_styleColl->styleAt( i++)->setFollowingStyle( style );
+ }
+}
+
+
+void KPrDocument::updateAllStyleLists()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->updateStyleList();
+}
+
+void KPrDocument::applyStyleChange( KoStyleChangeDefMap changed )
+{
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it )
+ it.current()->applyStyleChange( changed );
+ m_masterPage->applyStyleChange( changed );
+}
+
+void KPrDocument::saveStyle( KoParagStyle *sty, QDomElement parentElem )
+{
+ QDomDocument doc = parentElem.ownerDocument();
+ QDomElement styleElem = doc.createElement( "STYLE" );
+ parentElem.appendChild( styleElem );
+
+ sty->saveStyle( styleElem );
+ QDomElement formatElem = doc.createElement("FORMAT");
+ KPrTextObject::saveFormat( formatElem, &sty->format() );
+ styleElem.appendChild( formatElem );
+}
+
+void KPrDocument::startBackgroundSpellCheck()
+{
+ //don't start spell checking when document is embedded in konqueror
+ if(backgroundSpellCheckEnabled() && isReadWrite())
+ {
+ if(m_initialActivePage->allTextObjects().count()>0)
+ {
+ m_bgSpellCheck->start();
+ }
+ }
+}
+
+void KPrDocument::enableBackgroundSpellCheck( bool b )
+{
+ //m_bgSpellCheck->enableBackgroundSpellCheck(b);
+ m_bgSpellCheck->setEnabled(b);
+ QPtrListIterator<KoView> it( views() );
+ for( ; it.current(); ++it )
+ ((KPrView*)it.current())->updateBgSpellCheckingState();
+}
+
+bool KPrDocument::backgroundSpellCheckEnabled() const
+{
+ return m_bgSpellCheck->enabled();
+}
+
+void KPrDocument::reactivateBgSpellChecking(bool refreshTextObj)
+{
+ QPtrListIterator<KPrPage> it( m_pageList );
+#if 0
+ if(m_kpresenterView && m_kpresenterView->getCanvas())
+ activePage=m_kpresenterView->getCanvas()->activePage();
+#endif
+ KPrPage *activePage=m_initialActivePage;
+ for ( ; it.current(); ++it )
+ {
+ if( it.current()!=activePage)
+ it.current()->reactivateBgSpellChecking(false );
+ else
+ it.current()->reactivateBgSpellChecking( true);
+ }
+ m_masterPage->reactivateBgSpellChecking(refreshTextObj);
+ startBackgroundSpellCheck();
+}
+
+QPtrList<KoTextObject> KPrDocument::allTextObjects() const
+{
+ QPtrList<KoTextObject> lst;
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it )
+ it.current()->addTextObjects( lst );
+ m_masterPage->addTextObjects( lst );
+ return lst;
+}
+
+QValueList<KoTextDocument *> KPrDocument::allTextDocuments() const
+{
+ QValueList<KoTextDocument *> lst;
+ const QPtrList<KoTextObject> textObjects = allTextObjects();
+ QPtrListIterator<KoTextObject> it( textObjects );
+ for ( ; it.current() ; ++it ) {
+ lst.append( it.current()->textDocument() );
+ }
+ return lst;
+}
+
+QValueList<KoTextObject *> KPrDocument::visibleTextObjects( ) const
+{
+ QValueList<KoTextObject *> lst;
+ QPtrList<KoTextObject> textFramesets = allTextObjects( );
+
+ KoTextObject *frm;
+ for ( frm=textFramesets.first(); frm != 0; frm=textFramesets.next() ) {
+ if ( frm && !frm->protectContent() )
+ {
+ lst.append( frm );
+ }
+ }
+ return lst;
+}
+
+void KPrDocument::setShowGuideLines( bool b )
+{
+ m_bShowGuideLines = b;
+ setModified( true );
+}
+
+void KPrDocument::horizontalGuideLines( const QValueList<double> &lines )
+{
+ m_hGuideLines = lines;
+}
+
+void KPrDocument::verticalGuideLines( const QValueList<double> &lines )
+{
+ m_vGuideLines = lines;
+}
+
+
+void KPrDocument::addGuideLine( Qt::Orientation o, double pos )
+{
+ if ( o == Qt::Horizontal )
+ {
+ m_hGuideLines.append( pos );
+ }
+ else
+ {
+ m_vGuideLines.append( pos );
+ }
+
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ {
+ ( (KPrView*)it.current() )->getCanvas()->guideLines().setGuideLines( m_hGuideLines, m_vGuideLines );
+ }
+}
+
+
+void KPrDocument::updateGuideLineButton()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->updateGuideLineButton();
+}
+
+void KPrDocument::loadGuideLines( const QDomElement &element )
+{
+ // In early versions of KPresenter 1.2 (up to Beta 2), there is child also naed <HELPLINES>
+ // Before KPresenter 1.5 the guide lines where named helplines that is why they are still
+ // named like this in the fileformat
+ QDomElement guidelines = element.namedItem( "HELPLINES" ).toElement();
+ if ( guidelines.isNull() )
+ guidelines = element;
+
+ guidelines = guidelines.firstChild().toElement();
+ while ( !guidelines.isNull() )
+ {
+ if ( guidelines.tagName() == "Vertical" )
+ m_vGuideLines.append( guidelines.attribute( "value" ).toDouble() );
+ else if ( guidelines.tagName() == "Horizontal" )
+ m_hGuideLines.append( guidelines.attribute( "value" ).toDouble() );
+ guidelines = guidelines.nextSibling().toElement();
+ }
+}
+
+void KPrDocument::saveGuideLines( QDomDocument &doc, QDomElement& element )
+{
+ for(QValueList<double>::Iterator it = m_vGuideLines.begin(); it != m_vGuideLines.end(); ++it)
+ {
+ QDomElement lines=doc.createElement("Vertical");
+ lines.setAttribute("value", (double)*it);
+ element.appendChild( lines );
+ }
+
+ for(QValueList<double>::Iterator it = m_hGuideLines.begin(); it != m_hGuideLines.end(); ++it)
+ {
+ QDomElement lines=doc.createElement("Horizontal");
+ lines.setAttribute("value", *it);
+ element.appendChild( lines );
+ }
+}
+
+void KPrDocument::updateGridButton()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->updateGridButton();
+
+}
+
+void KPrDocument::setSpellCheckIgnoreList( const QStringList& lst )
+{
+ m_spellCheckIgnoreList = lst;
+ m_bgSpellCheck->settings()->setCurrentIgnoreList( m_spellCheckIgnoreList + m_spellCheckPersonalDict );
+ setModified( true );
+}
+
+void KPrDocument::addSpellCheckIgnoreWord( const QString & word )
+{
+ // ### missing: undo/redo support
+ if( m_spellCheckIgnoreList.findIndex( word ) == -1 )
+ m_spellCheckIgnoreList.append( word );
+ setSpellCheckIgnoreList( m_spellCheckIgnoreList );
+}
+
+void KPrDocument::updateObjectStatusBarItem()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->updateObjectStatusBarItem();
+}
+
+void KPrDocument::updateObjectSelected()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ ((KPrView*)it.current())->objectSelectedChanged();
+}
+
+void KPrDocument::setTabStopValue ( double _tabStop )
+{
+ m_tabStop = _tabStop;
+ QPtrListIterator<KPrPage> it( m_pageList );
+ for ( ; it.current(); ++it )
+ it.current()->changeTabStopValue( m_tabStop );
+ //styckypage
+ m_masterPage->changeTabStopValue( m_tabStop );
+}
+
+void KPrDocument::changeBgSpellCheckingState( bool b )
+{
+ enableBackgroundSpellCheck( b );
+ reactivateBgSpellChecking();
+ KConfig *config = KPrFactory::global()->config();
+ config->setGroup("KSpell kpresenter" );
+ config->writeEntry( "SpellCheck", (int)b );
+}
+
+
+bool KPrDocument::cursorInProtectedArea()const
+{
+ return m_cursorInProtectectedArea;
+}
+
+void KPrDocument::setCursorInProtectedArea( bool b )
+{
+ m_cursorInProtectectedArea=b;
+ testAndCloseAllTextObjectProtectedContent();
+}
+
+void KPrDocument::testAndCloseAllTextObjectProtectedContent()
+{
+ if ( !m_cursorInProtectectedArea )
+ {
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ static_cast<KPrView*>(it.current())->testAndCloseAllTextObjectProtectedContent();
+ }
+}
+
+void KPrDocument::insertFile(const QString & file )
+{
+ m_insertFilePage = m_pageList.count();
+
+ m_childCountBeforeInsert = children().count();
+ objStartY = 0;
+ bool clean = _clean;
+ _clean = false;
+ bool ok = loadNativeFormat(file );
+ if ( !ok )
+ {
+ showLoadingErrorDialog();
+ return;
+ }
+ KMacroCommand *macro = 0L;
+ for ( int i = m_insertFilePage; i<(int)m_pageList.count();i++)
+ {
+ if ( !macro )
+ macro = new KMacroCommand( i18n("Insert File"));
+ KPrInsertPageCmd * cmd = new KPrInsertPageCmd( i18n("Insert File"), i - 1, IP_AFTER, m_pageList.at(i), this ) ;
+ macro->addCommand(cmd );
+ }
+ if ( macro )
+ addCommand( macro );
+
+ m_insertFilePage = 0;
+ m_childCountBeforeInsert = 0;
+ // Update the views
+ int newPos = m_pageList.count()-1;
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ static_cast<KPrView*>(it.current())->updateSideBar();
+ _clean = clean;
+ updatePresentationButton();
+
+ //activate this page in all views (...)
+ QPtrListIterator<KoView>it2( views() );
+ for (; it2.current(); ++it2 )
+ static_cast<KPrView*>(it2.current())->skipToPage(newPos);
+}
+
+void KPrDocument::spellCheckParagraphDeleted( KoTextParag * /* _parag */, KPrTextObject * /* frm */ )
+{
+ //m_bgSpellCheck->spellCheckParagraphDeleted( _parag, frm->textObject());
+}
+
+void KPrDocument::updateRulerInProtectContentMode()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ static_cast<KPrView*>(it.current())->updateRulerInProtectContentMode();
+}
+
+void KPrDocument::updatePresentationButton()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ static_cast<KPrView*>(it.current())->updatePresentationButton((selectedSlides().count()>0));
+}
+
+void KPrDocument::refreshGroupButton()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ static_cast<KPrView*>(it.current())->refreshGroupButton();
+}
+
+void KPrDocument::addView( KoView *_view )
+{
+ KoDocument::addView( _view );
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ static_cast<KPrView*>(it.current())->closeTextObject();
+}
+
+void KPrDocument::removeView( KoView *_view )
+{
+ KoDocument::removeView( _view );
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ static_cast<KPrView*>(it.current())->deSelectAllObjects();
+}
+
+void KPrDocument::updateStyleListOrder( const QStringList &list )
+{
+ styleCollection()->updateStyleListOrder( list );
+}
+
+void KPrDocument::updateDirectCursorButton()
+{
+ QPtrListIterator<KoView> it( views() );
+ for (; it.current(); ++it )
+ static_cast<KPrView*>(it.current())->updateDirectCursorButton();
+}
+
+void KPrDocument::setInsertDirectCursor(bool _b)
+{
+ m_bInsertDirectCursor=_b;
+ KConfig *config = KPrFactory::global()->config();
+ config->setGroup( "Interface" );
+ config->writeEntry( "InsertDirectCursor", _b );
+ updateDirectCursorButton();
+}
+
+KPrView *KPrDocument::firstView() const
+{
+ if ( views().count()>0)
+ return static_cast<KPrView*>(views().getFirst());
+ else
+ return 0L;
+}
+
+void KPrDocument::addWordToDictionary( const QString & word)
+{
+ if ( m_bgSpellCheck )
+ {
+ if( m_spellCheckPersonalDict.findIndex( word ) == -1 )
+ m_spellCheckPersonalDict.append( word );
+ m_bgSpellCheck->settings()->setCurrentIgnoreList( m_spellCheckIgnoreList + m_spellCheckPersonalDict );
+ if ( backgroundSpellCheckEnabled() )
+ // Re-check everything to make this word normal again
+ reactivateBgSpellChecking();
+ }
+}
+
+QValueList <KPrPage *> KPrDocument::customListPage( const QStringList & lst, bool loadOasis )
+{
+ QStringList tmp( lst );
+ QValueList <KPrPage *> tmpValueList;
+ for ( QStringList::Iterator itList = tmp.begin(); itList != tmp.end(); ++itList )
+ {
+ for ( int i = 0; i < static_cast<int>( m_pageList.count() ); i++ )
+ {
+ //kdDebug()<<" insert page name :"<<*itList<<endl;
+ if ( loadOasis )
+ {
+ if ( m_pageList.at( i )->oasisNamePage(i+1)== ( *itList ) )
+ {
+ tmpValueList.append( m_pageList.at( i ) );
+ //kdDebug()<<" really insert\n";
+ break;
+ }
+ }
+ else
+ {
+ if ( m_pageList.at( i )->pageTitle()== ( *itList ) )
+ {
+ tmpValueList.append( m_pageList.at( i ) );
+ //kdDebug()<<" really insert\n";
+ break;
+ }
+ }
+
+ }
+ }
+ return tmpValueList;
+
+}
+
+void KPrDocument::setCustomSlideShows( const CustomSlideShowMap & customSlideShows )
+{
+ m_customListSlideShow = customSlideShows;
+ setModified( true );
+}
+
+QStringList KPrDocument::presentationList()
+{
+ QStringList lst;
+ if ( !m_customListSlideShow.isEmpty() )
+ {
+ CustomSlideShowMap::Iterator it;
+ for ( it = m_customListSlideShow.begin(); it != m_customListSlideShow.end(); ++it )
+ lst << it.key();
+ }
+ return lst;
+}
+
+void KPrDocument::testCustomSlideShow( const QValueList<KPrPage *> &pages, KPrView *view )
+{
+ delete m_customListTest;
+ m_customListTest = new QValueList<int>( listOfDisplaySelectedSlides( pages ) );
+ if ( view )
+ view->screenStartFromFirst();
+
+}
+
+void KPrDocument::clearTestCustomSlideShow()
+{
+ delete m_customListTest;
+ m_customListTest = 0L;
+}
+
+
+#include "KPrDocument.moc"
diff --git a/kpresenter/KPrDocument.h b/kpresenter/KPrDocument.h
new file mode 100644
index 000000000..2522266f1
--- /dev/null
+++ b/kpresenter/KPrDocument.h
@@ -0,0 +1,714 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __kpresenter_doc_h__
+#define __kpresenter_doc_h__
+
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+class KoGenStyles;
+class KPrView;
+class DCOPObject;
+class KCommand;
+class KMacroCommand;
+class KoCommandHistory;
+class KoTextZoomHandler;
+class KoAutoFormat;
+class KoVariable;
+class KoVariableFormatCollection;
+class KPrVariableCollection;
+class KTempFile;
+class KoParagStyle;
+class KPrBgSpellCheck;
+class KoTextParag;
+class KoTextObject;
+class KPrLoadingInfo;
+class KPrGroupObject;
+
+class KoOasisContext;
+class KoOasisSettings;
+class KoXmlWriter;
+class QFile;
+class KoSavingContext;
+
+#include <KoDocument.h>
+#include <KoDocumentChild.h>
+
+#include <qptrlist.h>
+#include <qobject.h>
+#include <qstring.h>
+#include <qvaluelist.h>
+#include <qdatetime.h>
+#include <qdict.h>
+#include <KoPageLayoutDia.h>
+
+#include "global.h"
+#include <KoStyleStack.h>
+#include <KoPictureCollection.h>
+#include "KPrGradientCollection.h"
+#include <KoTextZoomHandler.h>
+#include <KoStyleCollection.h> // for KoStyleChangeDefMap
+#include <KoCommandHistory.h>
+
+class KoDocumentEntry;
+class KPrTextObject;
+class KPrPartObject;
+class KPrPage;
+class KPrObject;
+class KPrDocument;
+
+class KoParagStyle;
+class KoStyleCollection;
+
+class KPrChild : public KoDocumentChild
+{
+public:
+
+ // constructor - destructor
+ KPrChild( KPrDocument *_kpr, KoDocument* _doc, const QRect& _rect );
+ KPrChild( KPrDocument *_kpr );
+ ~KPrChild();
+
+ // get parent
+ KPrDocument* parent()const { return m_parent; }
+
+ virtual KoDocument *hitTest( const QPoint &, const QWMatrix & );
+
+protected:
+ KPrDocument *m_parent;
+};
+
+class KPrDocument : public KoDocument
+{
+ Q_OBJECT
+ Q_PROPERTY( int maxRecentFiles READ maxRecentFiles )
+ Q_PROPERTY( int undoRedoLimit READ undoRedoLimit WRITE setUndoRedoLimit )
+ Q_PROPERTY( double indentValue READ getIndentValue WRITE setIndentValue )
+ Q_PROPERTY( int getLeftBorder READ getLeftBorder )
+ Q_PROPERTY( int getTopBorder READ getTopBorder )
+ Q_PROPERTY( int getBottomBorder READ getBottomBorder )
+ Q_PROPERTY( int getRightBorder READ getRightBorder )
+ Q_PROPERTY( bool cursorInProtectedArea READ cursorInProtectedArea WRITE setCursorInProtectedArea )
+ Q_PROPERTY( bool insertDirectCursor READ insertDirectCursor WRITE setInsertDirectCursor )
+ Q_PROPERTY( QString picturePath READ picturePath WRITE setPicturePath )
+ Q_PROPERTY( QString globalLanguage READ globalLanguage WRITE setGlobalLanguage )
+ Q_PROPERTY( bool globalHyphenation READ globalHyphenation WRITE setGlobalHyphenation )
+ Q_PROPERTY( double tabStopValue READ tabStopValue WRITE setTabStopValue )
+ Q_PROPERTY( bool snapToGrid READ snapToGrid WRITE setSnapToGrid )
+ Q_PROPERTY( bool backgroundSpellCheckEnabled READ backgroundSpellCheckEnabled WRITE enableBackgroundSpellCheck )
+ Q_PROPERTY( bool spInfiniteLoop READ spInfiniteLoop WRITE setInfiniteLoop )
+ Q_PROPERTY( bool spShowEndOfPresentationSlide READ spShowEndOfPresentationSlide WRITE setShowEndOfPresentationSlide )
+ Q_PROPERTY( bool spManualSwitch READ spManualSwitch WRITE setManualSwitch )
+ Q_PROPERTY( bool presentationDuration READ presentationDuration WRITE setPresentationDuration )
+ Q_PROPERTY( QColor gridColor READ gridColor WRITE setGridColor )
+ Q_PROPERTY( QColor txtBackCol READ txtBackCol WRITE setTxtBackCol )
+
+
+ public:
+ // constructor - destructor
+ KPrDocument( QWidget *parentWidget = 0, const char *widgetName = 0, QObject* doc = 0,
+ const char* name = 0, bool singleViewMode = false );
+ ~KPrDocument();
+
+ // Drawing
+ virtual void paintContent( QPainter& painter, const QRect& rect, bool transparent = false,
+ double zoomX = 1.0, double zoomY = 1.0 );
+
+ // save
+ virtual QDomDocument saveXML();
+ virtual bool completeSaving( KoStore* _store );
+ virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter );
+
+ enum SaveFlag { SaveAll, SaveSelected, SavePage };
+ void saveOasisDocumentStyles( KoStore* store, KoGenStyles& mainStyles, QFile* masterStyles,
+ KoSavingContext & savingContext, SaveFlag saveFlag = SaveAll ) const;
+ enum { STYLE_BACKGROUNDPAGE = 20, STYLE_BACKGROUNDPAGEAUTO, STYLE_GRADIENT,STYLE_OBJECTANIMATION, STYLE_STROKE, STYLE_MARKER, STYLE_PICTURE, STYLE_PRESENTATIONSTICKYOBJECT };
+
+ // load
+ virtual bool loadOasis( const QDomDocument& doc, KoOasisStyles& styles, const QDomDocument&, KoStore* store );
+ /*
+ * Load oasis object
+ * @param pos: we use -1 for sticky page.
+ */
+ void loadOasisObject( KPrPage * page, QDomNode & drawPage, KoOasisContext & context, KPrGroupObject *groupObject = 0L);
+
+ virtual bool loadXML( const QDomDocument& doc );
+ virtual bool loadXML( QIODevice *, const QDomDocument & doc );
+ virtual bool loadChildren( KoStore* _store );
+
+ virtual int supportedSpecialFormats() const;
+
+ virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0);
+ virtual void setEmpty();
+
+ virtual void addView( KoView *_view );
+ virtual void removeView( KoView *_view );
+
+ // page layout
+ void setPageLayout( const KoPageLayout &);
+
+ virtual QPixmap generatePreview( const QSize &size );
+
+ virtual void addShell( KoMainWindow *shell );
+
+ //header-footer
+ void createHeaderFooter();
+ void updateHeaderFooterPosition();
+
+ const QPtrList<KPrPage> & getPageList() const {return m_pageList;}
+
+ // @return the master page
+ KPrPage * masterPage() const { return m_masterPage; }
+ KPrPage * activePage()const;
+ // We need one that's not const, due to QPtrList::at() not being const
+ QPtrList<KPrPage>& pageList() { return m_pageList;}
+
+ void insertPixmapKey( KoPictureKey key );
+
+ void insertObjectInPage(double offset, KPrObject *_obj, int pos = -1);
+
+ void setGridValue( double rx, double ry, bool _replace = true );
+
+ // get - set options for editmodi
+ QColor txtBackCol() const { return _txtBackCol; }
+ void setTxtBackCol( const QColor &c ) { _otxtBackCol = _txtBackCol; _txtBackCol = c; }
+
+ // get - set roundedness
+ unsigned int getRndX() const { return _xRnd; }
+ unsigned int getRndY() const { return _yRnd; }
+
+ // get values for screenpresentations
+ bool spInfiniteLoop() const { return _spInfiniteLoop; }
+ bool spShowEndOfPresentationSlide() const { return _spShowEndOfPresentationSlide; }
+ bool spManualSwitch() const { return _spManualSwitch; }
+ bool presentationDuration() const { return _showPresentationDuration; }
+ void setInfiniteLoop( bool il ) { _spInfiniteLoop = il; }
+ void setShowEndOfPresentationSlide( bool shw ) { _spShowEndOfPresentationSlide = shw; }
+ void setManualSwitch( bool ms ) { _spManualSwitch = ms; }
+ void setPresentationDuration( bool pd ) { _showPresentationDuration = pd; }
+
+
+ // size of page
+ QRect getPageRect( bool decBorders = true ) const;
+
+ void insertObject(KPrChild* ch ){ insertChild(ch);}
+
+ void savePage( const QString &file, int pgnum, bool ignore = false );
+
+ void pastePage( const QMimeSource * data, int pgnum );
+
+ QString templateFileName(bool chooseTemplate, const QString &theFile );
+
+ int insertNewPage( const QString &cmdName,int _page, InsertPos _insPos, bool chooseTemplate, const QString &theFile );
+
+ /**
+ * insert page page and go to page insertPageNum on all views
+ * which have currentPageNum as active page
+ */
+ void insertPage( KPrPage *page, int currentPageNum, int insertPageNum );
+ /**
+ * remove page page and go to page pageNum on all view which
+ * had page as active page
+ */
+ void takePage( KPrPage *page, int pageNum );
+ void deletePage( int _page );
+ void copyPageToClipboard( int pgnum );
+
+ // repaint all views
+ void repaint( bool );
+
+ void repaint( const QRect& );
+ void repaint( KPrObject* );
+
+ // stuff for screen-presentations
+ /**
+ * return the list of steps for the selected page
+ * where objects appear/disappear.
+ */
+ QValueList<int> getPageEffectSteps( unsigned int );
+
+ QPen presPen() const { return _presPen; }
+ void setPresPen( QPen p ) {_presPen = p; }
+
+ void restoreBackground( KPrPage * );
+ KCommand * loadPastedObjs( const QString &in, KPrPage* _page );
+
+ void deSelectAllObj();
+ void deSelectObj(KPrObject *obj);
+ void updateHeaderFooterButton();
+
+ KoPictureCollection *pictureCollection(){ return &m_pictureCollection; }
+ KPrGradientCollection *gradientCollection() { return &_gradientCollection; }
+
+ KoAutoFormat * getAutoFormat()const { return m_autoFormat; }
+
+ void replaceObjs( bool createUndoRedo = true );
+
+ int getLeftBorder() const;
+ int getTopBorder() const;
+ int getBottomBorder() const;
+ int getRightBorder() const;
+
+ void enableEmbeddedParts( bool f );
+
+ KPrTextObject *header()const { return _header; }
+ KPrTextObject *footer()const { return _footer; }
+
+ void setHeader( bool b );
+ void setFooter( bool b );
+
+ void setDisplayObjectMasterPage( bool b );
+ void setDisplayBackground( bool b );
+
+ bool isHeader(const KPrObject *obj)const;
+ bool isFooter(const KPrObject *obj)const;
+ bool isHeaderFooter(const KPrObject *obj)const;
+
+ // Returns true if the slide pgNum (0 based)
+ bool isSlideSelected( int pgNum) ;
+ // Returns the list of selected slides. Slide numbers are 0-based.
+ QValueList<int> selectedSlides();
+ QString selectedForPrinting();
+
+ virtual DCOPObject* dcopObject();
+
+ void initConfig();
+ void saveConfig();
+
+ KoStyleCollection * styleCollection()const { return m_styleColl;}
+
+
+ void updateAllStyleLists();
+ void applyStyleChange( KoStyleChangeDefMap changed );
+ void updateStyleListOrder( const QStringList &list );
+
+ void addCommand( KCommand * cmd );
+
+ KoTextZoomHandler* zoomHandler() const { return m_zoomHandler; }
+ QFont defaultFont() const { return m_defaultFont; }
+ void setDefaultFont( const QFont & newFont) {
+ m_defaultFont = newFont;
+ }
+
+ /**
+ * get custom kspell config
+ */
+
+ bool showStatusBar() const { return m_bShowStatusBar;}
+ void setShowStatusBar( bool _status ) { m_bShowStatusBar = _status;}
+
+ bool showGrid() const { return m_bShowGrid; }
+ void setShowGrid ( bool _grid ) { m_bShowGrid = _grid; }
+
+ double tabStopValue() const { return m_tabStop; }
+ void setTabStopValue ( double _tabStop );
+
+ // in pt
+ double getIndentValue()const { return m_indent; }
+ void setIndentValue(double _ind) { m_indent=_ind; }
+
+ int maxRecentFiles() const { return m_maxRecentFiles; }
+
+ KoVariableFormatCollection *variableFormatCollection()const { return m_varFormatCollection; }
+
+ void recalcVariables( int type );
+
+ void recalcPageNum();
+
+ KPrVariableCollection *getVariableCollection()const {return m_varColl;}
+
+ void refreshMenuCustomVariable();
+
+ void setShowRuler(bool _ruler){ m_bShowRuler=_ruler; }
+ bool showRuler() const { return m_bShowRuler; }
+
+ void reorganizeGUI();
+
+ int undoRedoLimit() const;
+ void setUndoRedoLimit(int _val);
+
+
+ void updateRuler();
+ void updateRulerPageLayout();
+
+ unsigned int getPageNums() const { return m_pageList.count(); }
+
+ // Tell all views to stop editing this frameset, if they were doing so
+ void terminateEditing( KPrTextObject * textObj )
+ { emit sig_terminateEditing( textObj ); }
+ KPrPage * initialActivePage() const;
+
+ KPrView *firstView() const;
+
+ void displayActivePage(KPrPage * _page);
+
+ void updateZoomRuler();
+ void newZoomAndResolution( bool updateViews, bool forPrint );
+
+ void movePageTo( int oldPos, int newPos );
+
+ void updateSideBarItem( KPrPage * page );
+ KPrPage * findPage(KPrObject *object);
+ KPrPage * findPage(QPtrList<KPrObject> &objects);
+
+ void refreshAllNoteBar(int page, const QString &text, KPrView *exceptView);
+ void refreshAllNoteBarMasterPage(const QString &text, KPrView *exceptView);
+
+
+ bool backgroundSpellCheckEnabled() const;
+ void enableBackgroundSpellCheck( bool b );
+
+ void startBackgroundSpellCheck();
+
+ //refresh obj when we active or disactive
+ void reactivateBgSpellChecking(bool refreshTextObj=false);
+ QPtrList<KoTextObject> allTextObjects() const;
+ QValueList<KoTextObject *> visibleTextObjects( ) const;
+
+ /// Reimplementation from KoDocument.
+ virtual QValueList<KoTextDocument *> allTextDocuments() const;
+
+ bool allowAutoFormat() const { return m_bAllowAutoFormat; }
+ void setAllowAutoFormat(bool _b){ m_bAllowAutoFormat=_b; }
+
+ // This setting has to be here [instead of the view] because we need to
+ // format paragraphs slightly differently (to add room for the CR char)
+ bool viewFormattingChars() const { return m_bViewFormattingChars; }
+ void setViewFormattingChars(bool _b) { m_bViewFormattingChars=_b; }
+
+
+ bool showGuideLines() const { return m_bShowGuideLines; }
+ void setShowGuideLines( bool b );
+
+ /**
+ * @brief Get the positions of the horizontal guide lines
+ *
+ * @return list of positions of the horizontal guide lines
+ */
+ QValueList<double> &horizontalGuideLines() { return m_hGuideLines; }
+
+ /**
+ * @brief Get the positions of the vertical guide lines
+ *
+ * @return list of positions of the vertical guide lines
+ */
+ QValueList<double> &verticalGuideLines() { return m_vGuideLines; }
+
+ /**
+ * @brief Set the positions of the horizontal guide lines
+ *
+ * @param lines a list of positions of the horizontal guide lines
+ */
+ void horizontalGuideLines( const QValueList<double> &lines );
+
+ /**
+ * @brief Set the positions of the vertical guide lines
+ *
+ * @param lines a list of positions of the vertical guide lines
+ */
+ void verticalGuideLines( const QValueList<double> &lines );
+
+ /**
+ * @brief Add a guide line
+ *
+ * @param p the orientation of the guide line
+ * @param p the position of the guide line
+ */
+ void addGuideLine( Qt::Orientation o, double pos );
+
+ void updateGuideLineButton();
+
+ void updateGridButton();
+
+ double getGridX()const { return m_gridX; }
+ void setGridX(double _x) { m_gridX=_x; }
+
+ double getGridY()const { return m_gridY; }
+ void setGridY(double _y) { m_gridY=_y; }
+
+ bool snapToGrid() const { return m_bSnapToGrid; }
+ void setSnapToGrid( bool _b ) { m_bSnapToGrid = _b; }
+
+ QColor gridColor() const { return m_gridColor; }
+ void setGridColor( const QColor & _col ) { m_gridColor = _col; }
+
+ QStringList spellCheckIgnoreList() const { return m_spellCheckIgnoreList; }
+ void setSpellCheckIgnoreList( const QStringList& lst );
+ void addSpellCheckIgnoreWord( const QString & );
+
+ KoCommandHistory * commandHistory()const { return m_commandHistory; }
+ void updateObjectStatusBarItem();
+ void updateObjectSelected();
+ void layout(KPrObject *kpobject);
+ void layout();
+ void changeBgSpellCheckingState( bool b );
+
+ bool cursorInProtectedArea()const;
+ void setCursorInProtectedArea( bool b );
+
+ void insertFile(const QString & file );
+
+ void spellCheckParagraphDeleted( KoTextParag *_parag, KPrTextObject *frm);
+
+ void loadPictureMap ( const QDomElement& domElement );
+ void updateRulerInProtectContentMode();
+ void updatePresentationButton();
+ void refreshGroupButton();
+
+ QString picturePath()const { return m_picturePath; }
+ void setPicturePath( const QString & _path ) { m_picturePath = _path ; }
+
+ bool insertDirectCursor() const { return m_bInsertDirectCursor; }
+ void setInsertDirectCursor(bool _b);
+ void updateDirectCursorButton();
+
+ QString globalLanguage()const { return m_globalLanguage; }
+ void setGlobalLanguage( const QString & _lang ){m_globalLanguage = _lang;}
+
+ bool globalHyphenation() const { return m_bGlobalHyphenation; }
+ void setGlobalHyphenation ( bool _hyphen ) { m_bGlobalHyphenation = _hyphen; }
+
+ void addWordToDictionary( const QString & word);
+
+ void loadImagesFromStore( KoStore *_store );
+ void saveEmbeddedObject(KPrPage *page, const QPtrList<KoDocumentChild>& childList ,QDomDocument &doc,QDomElement &presenter );
+ void insertEmbedded( KoStore *store, QDomElement elem, KMacroCommand * macroCmd, KPrPage *page, int pos );
+
+ KPrBgSpellCheck* backSpeller() const { return m_bgSpellCheck; }
+
+ void setCustomSlideShows( const CustomSlideShowMap & customSlideShows );
+ QValueList <KPrPage *> customListPage( const QStringList & lst, bool loadOasis=false );
+
+
+ QString presentationName() const { return m_presentationName; }
+ void setPresentationName( const QString &_name ) { m_presentationName = _name; }
+
+ QStringList presentationList();
+ //return list of slide which be displaying:
+ //return selected slide when presentation name is empty
+ //otherwise return list of custom slide show
+ QValueList<int> displaySelectedSlides();
+ QValueList<int> listOfDisplaySelectedSlides( const QValueList<KPrPage*>& lst );
+ void testCustomSlideShow( const QValueList<KPrPage *> &pages, KPrView *view );
+ void clearTestCustomSlideShow();
+
+ const CustomSlideShowMap & customSlideShows() { return m_customListSlideShow; }
+
+public slots:
+ void movePage( int from, int to );
+ void copyPage( int from );
+
+ void selectPage( int pgNum, bool select );
+ void clipboardDataChanged();
+
+ void slotRepaintChanged( KPrTextObject * );
+
+ static void writeAutomaticStyles( KoXmlWriter& contentWriter, KoGenStyles& mainStyles, KoSavingContext& context, bool stylesDotXml );
+
+ void slotGuideLinesChanged( KoView *view );
+
+ virtual void initEmpty();
+
+signals:
+ void enablePaste( bool );
+ void sig_refreshMenuCustomVariable();
+ void pageNumChanged();
+ void sig_updateRuler();
+ void sig_terminateEditing( KPrTextObject * );
+ void sig_updateMenuBar();
+
+protected slots:
+ void slotDocumentRestored();
+ void slotCommandExecuted();
+ void slotDocumentInfoModifed();
+
+ virtual void openExistingFile( const QString& file );
+ virtual void openTemplate( const QString& file );
+
+protected:
+ KoView* createViewInstance( QWidget* parent, const char* name );
+ void testAndCloseAllTextObjectProtectedContent();
+ // ************ functions ************
+ /**
+ * Overloaded function from @ref Document_impl. Saves all children.
+ */
+ virtual bool saveChildren( KoStore* _store );
+
+ void loadStyleTemplates( const QDomElement &styles );
+ void saveStyle( KoParagStyle *sty, QDomElement parentElem );
+
+ QDomDocumentFragment saveBackground( QDomDocument& );
+ QDomElement saveObjects( QDomDocument &doc );
+ QDomElement saveTitle( QDomDocument &doc );
+ QDomElement saveNote( QDomDocument &doc );
+ QDomElement saveAttribute( QDomDocument &doc );
+ QDomElement saveUsedSoundFileToXML( QDomDocument &_doc, QStringList _list );
+ void loadTextStyle( const QDomElement& domElement );
+ void saveEmbeddedObject(KPrPage *page, KoDocumentChild *chl,QDomDocument &doc,QDomElement &presenter, double offset );
+ void saveGuideLines( QDomDocument &doc, QDomElement& element );
+
+ void loadBackground( const QDomElement &element );
+ void loadGuideLines( const QDomElement &element );
+ KCommand * loadObjects( const QDomElement &element,bool paste=false );
+ void loadTitle( const QDomElement &element );
+ void loadNote( const QDomElement &element );
+ void loadUsedSoundFileFromXML( const QDomElement &element );
+
+ virtual bool completeLoading( KoStore* /* _store */ );
+ void makeUsedPixmapList();
+ void makeUsedSoundFileList();
+
+ void saveUsedSoundFileToStore( KoStore *_store, QStringList _list );
+ void loadUsedSoundFileFromStore( KoStore *_store, QStringList _list );
+ void fillStyleStack( const QDomElement& object, KoOasisContext & context, const char* family );
+ /*
+ * increaseOrder = true by default, put to false when we have group of animation
+ */
+ int createPresentationAnimation(const QDomElement& element, int order = 0 ,bool increaseOrder = true);
+
+ void saveOasisPresentationSettings( KoXmlWriter &contentTmpWriter, QMap<int, QString> &page2name );
+ void loadOasisPresentationSettings( QDomNode &settingsDoc );
+ void saveOasisPresentationCustomSlideShow( KoXmlWriter &contentTmpWriter, QMap<int, QString> &page2name );
+ void loadOasisPresentationCustomSlideShow( QDomNode &settingsDoc );
+
+ void loadOasisHeaderFooter( QDomNode & drawPage, KoOasisContext & context);
+
+ void saveOasisSettings( KoXmlWriter &contentTmpWriter );
+ void loadOasisSettings( const QDomDocument&settingsDoc );
+
+ void saveOasisCustomFied( KoXmlWriter &writer )const;
+
+ void loadOasisIgnoreList( const KoOasisSettings& settings );
+
+ //we move presSpeed to each table => compatibility with old file format
+ void compatibilityFromOldFileFormat();
+
+ void parseOasisGuideLines( const QString &str );
+
+ /**
+ * recalc the variables
+ * update statusbar and sidebar menu
+ */
+ void pageOrderChanged();
+ // ************ variables ************
+
+ // screenpresentations
+ bool _spInfiniteLoop, _spShowEndOfPresentationSlide, _spManualSwitch, _showPresentationDuration;
+
+ // options
+ int _xRnd, _yRnd;
+
+ // options for editmode
+ QColor _txtBackCol;
+ QColor _otxtBackCol;
+
+ bool _clean;
+ int objStartY, objStartNum;
+
+ QPen _presPen;
+
+ KoPictureCollection m_pictureCollection;
+ KPrGradientCollection _gradientCollection;
+
+ KPrTextObject *_header, *_footer;
+
+ QMap<KoPictureKey, QString> m_pictureMap;
+
+ CustomSlideShowMap m_customListSlideShow;
+
+
+ KoPageLayout __pgLayout;
+ int lastObj;
+
+ QString urlIntern;
+
+ QValueList<KoPictureKey> usedPictures;
+ QStringList usedSoundFile, haveNotOwnDiskSoundFile;
+ QPtrList<KTempFile> tmpSoundFileList;
+ DCOPObject *dcop;
+
+ int saveOnlyPage;
+ QString m_tempFileInClipboard;
+ bool ignoreSticky;
+
+ KoCommandHistory * m_commandHistory;
+ KoTextZoomHandler* m_zoomHandler;
+ QFont m_defaultFont;
+ KoAutoFormat * m_autoFormat;
+
+ bool m_bShowRuler;
+ bool m_bShowStatusBar;
+ bool m_bAllowAutoFormat;
+ bool m_bShowGuideLines;
+ bool m_bViewFormattingChars;
+
+ bool m_bShowGrid;
+
+ bool m_bSnapToGrid;
+ double m_indent; // in pt
+
+ double m_tabStop;
+ int m_maxRecentFiles;
+ bool m_cursorInProtectectedArea;
+ KoVariableFormatCollection *m_varFormatCollection;
+ KPrVariableCollection *m_varColl;
+ QColor m_gridColor;
+ bool _duplicatePage;
+private:
+ /// list of positions of horizontal guide lines
+ QValueList<double> m_hGuideLines;
+ /// list of positions of vertical guide lines
+ QValueList<double> m_vGuideLines;
+
+ QPtrList<KPrPage> m_pageList;
+ QPtrList<KPrPage> m_deletedPageList;
+
+ QStringList m_spellCheckIgnoreList; // per-document
+ QStringList m_spellCheckPersonalDict; // per-user
+
+ double m_gridX;
+ double m_gridY;
+ double oldGridX;
+ double oldGridY;
+ int m_insertFilePage;
+ KPrPage *m_initialActivePage;
+ KPrPage *m_pageWhereLoadObject;
+ KPrPage *m_masterPage;
+ KPrBgSpellCheck *m_bgSpellCheck;
+ KoStyleCollection *m_styleColl;
+ KPrObject *bgObjSpellChecked;
+ QString m_picturePath;
+ bool m_bInsertDirectCursor;
+ QString m_globalLanguage;
+ QString m_presentationName;
+ bool m_bGlobalHyphenation;
+ KPrLoadingInfo *m_loadingInfo;
+ QValueList<int> *m_customListTest;
+
+ /// here the amount of existing children before inserting a page/file
+ /// is saved, so that we load the correct children
+ int m_childCountBeforeInsert;
+};
+
+#endif
diff --git a/kpresenter/KPrDocumentIface.cpp b/kpresenter/KPrDocumentIface.cpp
new file mode 100644
index 000000000..f7cd4766b
--- /dev/null
+++ b/kpresenter/KPrDocumentIface.cpp
@@ -0,0 +1,571 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrDocumentIface.h"
+#include "KPrTextObject.h"
+#include "KPrDocument.h"
+#include "KPrView.h"
+#include "KPrPage.h"
+
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <KoVariable.h>
+#include "KPrVariableCollection.h"
+#include <KoAutoFormat.h>
+
+KPrDocumentIface::KPrDocumentIface( KPrDocument *doc_ )
+ : KoDocumentIface( doc_ )
+{
+ doc = doc_;
+}
+
+int KPrDocumentIface::numPages() const
+{
+ return doc->getPageNums();
+}
+
+DCOPRef KPrDocumentIface::page( int num )
+{
+ if( num>= (int )doc->getPageNums())
+ return DCOPRef();
+ return DCOPRef( kapp->dcopClient()->appId(),
+ doc->pageList().at( num )->dcopObject()->objId() );
+}
+
+DCOPRef KPrDocumentIface::masterPage()
+{
+ return DCOPRef( kapp->dcopClient()->appId(),
+ doc->masterPage()->dcopObject()->objId() );
+}
+
+void KPrDocumentIface::setShowRuler(bool b)
+{
+ doc->setShowRuler(b );
+ doc->reorganizeGUI();
+}
+
+bool KPrDocumentIface::showRuler() const
+{
+ return doc->showRuler();
+}
+
+void KPrDocumentIface::recalcAllVariables()
+{
+ //recalc all variable
+ doc->recalcVariables(VT_ALL);
+}
+
+void KPrDocumentIface::recalcVariables(int _var)
+{
+ doc->recalcVariables(_var);
+}
+
+void KPrDocumentIface::recalcVariables(const QString &varName)
+{
+ if(varName=="VT_DATE")
+ doc->recalcVariables(0);
+ else if(varName=="VT_TIME")
+ doc->recalcVariables(2);
+ else if(varName=="VT_PGNUM")
+ doc->recalcVariables(4);
+ else if(varName=="VT_CUSTOM")
+ doc->recalcVariables(6);
+ else if(varName=="VT_SERIALLETTER")
+ doc->recalcVariables(7);
+ else if(varName=="VT_FIELD")
+ doc->recalcVariables(8);
+ else if(varName=="VT_LINK")
+ doc->recalcVariables(9);
+ else if(varName=="VT_NOTE")
+ doc->recalcVariables(10);
+ else if(varName=="VT_ALL")
+ doc->recalcVariables(256);
+}
+
+int KPrDocumentIface::startingPage()
+{
+ return doc->getVariableCollection()->variableSetting()->startingPageNumber();
+}
+
+void KPrDocumentIface::setStartingPage(int nb)
+{
+ doc->getVariableCollection()->variableSetting()->setStartingPageNumber(nb);
+ doc->recalcVariables(VT_PGNUM);
+}
+
+bool KPrDocumentIface::displayLink() const
+{
+ return doc->getVariableCollection()->variableSetting()->displayLink();
+}
+
+void KPrDocumentIface::setDisplayLink(bool b)
+{
+ doc->getVariableCollection()->variableSetting()->setDisplayLink(b);
+ doc->recalcVariables(VT_LINK);
+}
+
+bool KPrDocumentIface::setCustomVariableValue(const QString & varname, const QString & value)
+{
+ bool exist=doc->getVariableCollection()->customVariableExist(varname);
+ if(exist)
+ {
+ doc->getVariableCollection()->setVariableValue( varname, value );
+ doc->recalcVariables(VT_CUSTOM);
+ }
+ else
+ return false;
+ return true;
+}
+
+QString KPrDocumentIface::customVariableValue(const QString & varname)const
+{
+ if(doc->getVariableCollection()->customVariableExist(varname))
+ return doc->getVariableCollection()->getVariableValue( varname );
+ return QString::null;
+}
+
+bool KPrDocumentIface::insertNewPage(int pos )
+{
+ if( pos < 0 || pos > (int)(doc->getPageNums())-1 )
+ pos=doc->getPageNums()-1;
+ int ret= doc->insertNewPage( i18n("Insert New Slide"), pos, IP_AFTER, false, QString::null );
+ bool state = (ret !=-1);
+ return state;
+}
+
+//return false if page number doesn't exist
+bool KPrDocumentIface::selectPage( int page,bool select)
+{
+ if(page <0 || page> (int)(doc->getPageNums())-1 )
+ return false;
+ doc->selectPage( page, select );
+ return true;
+}
+
+// return false when we can't remove page
+bool KPrDocumentIface::deletePage( int _page )
+{
+ if( _page < 0 || _page > (int)(doc->getPageNums())-1 )
+ return false;
+ doc->deletePage(_page);
+ return true;
+}
+
+void KPrDocumentIface::deSelectAllObj()
+{
+ doc->deSelectAllObj();
+}
+
+void KPrDocumentIface::recalcPageNum()
+{
+ doc->recalcPageNum();
+}
+
+
+void KPrDocumentIface::initConfig()
+{
+ doc->initConfig();
+}
+
+void KPrDocumentIface::saveConfig()
+{
+ doc->saveConfig();
+}
+
+QString KPrDocumentIface::selectedForPrinting()const
+{
+ return doc->selectedForPrinting();
+}
+
+bool KPrDocumentIface::isSlideSelected( int pgNum)
+{
+ if( pgNum>= (int)doc->getPageNums())
+ return false;
+ return doc->isSlideSelected(pgNum);
+}
+
+//Return a reference to header textobj
+DCOPRef KPrDocumentIface::header()
+{
+ if(doc->header())
+ return DCOPRef( kapp->dcopClient()->appId(),
+ doc->header()->dcopObject()->objId() );
+ else
+ return DCOPRef();
+}
+
+//Return a reference to footer textobj
+DCOPRef KPrDocumentIface::footer()
+{
+ if(doc->footer())
+ return DCOPRef( kapp->dcopClient()->appId(),
+ doc->footer()->dcopObject()->objId() );
+ else
+ return DCOPRef();
+}
+
+void KPrDocumentIface::startBackgroundSpellCheck()
+{
+ doc->startBackgroundSpellCheck();
+}
+
+void KPrDocumentIface::reactivateBgSpellChecking()
+{
+ doc->reactivateBgSpellChecking();
+}
+
+void KPrDocumentIface::setConfigUpperCase( bool _uc )
+{
+ doc->getAutoFormat()->configUpperCase(_uc);
+}
+
+void KPrDocumentIface::setConfigUpperUpper( bool _uu )
+{
+ doc->getAutoFormat()->configUpperUpper(_uu);
+}
+
+void KPrDocumentIface::setConfigAdvancedAutocorrect( bool _aa )
+{
+ doc->getAutoFormat()->configAdvancedAutocorrect( _aa );
+}
+
+void KPrDocumentIface::setConfigAutoDetectUrl(bool _au)
+{
+ doc->getAutoFormat()->configAutoDetectUrl(_au);
+}
+
+void KPrDocumentIface::setConfigIgnoreDoubleSpace( bool _ids)
+{
+ doc->getAutoFormat()->configIgnoreDoubleSpace(_ids);
+}
+
+void KPrDocumentIface::setConfigRemoveSpaceBeginEndLine( bool _space)
+{
+ doc->getAutoFormat()->configRemoveSpaceBeginEndLine(_space);
+}
+
+void KPrDocumentIface::setConfigUseBulletStyle( bool _ubs)
+{
+ doc->getAutoFormat()->configUseBulletStyle(_ubs);
+}
+
+bool KPrDocumentIface::configUpperCase() const
+{
+ return doc->getAutoFormat()->getConfigUpperCase();
+}
+
+bool KPrDocumentIface::configUpperUpper() const
+{
+ return doc->getAutoFormat()->getConfigUpperUpper();
+}
+
+bool KPrDocumentIface::configAdvancedAutoCorrect() const
+{
+ return doc->getAutoFormat()->getConfigAdvancedAutoCorrect();
+}
+
+bool KPrDocumentIface::configAutoDetectUrl() const
+{
+ return doc->getAutoFormat()->getConfigAutoDetectUrl();
+}
+
+bool KPrDocumentIface::configIgnoreDoubleSpace() const
+{
+ return doc->getAutoFormat()->getConfigIgnoreDoubleSpace();
+}
+
+bool KPrDocumentIface::configRemoveSpaceBeginEndLine() const
+{
+ return doc->getAutoFormat()->getConfigIgnoreDoubleSpace();
+}
+
+bool KPrDocumentIface::configUseBulletSyle() const
+{
+ return doc->getAutoFormat()->getConfigUseBulletSyle();
+}
+
+bool KPrDocumentIface::configAutoChangeFormat() const
+{
+ return doc->getAutoFormat()->getConfigAutoChangeFormat();
+}
+
+void KPrDocumentIface::setConfigAutoChangeFormat( bool _auto)
+{
+ doc->getAutoFormat()->configAutoChangeFormat(_auto);
+}
+
+bool KPrDocumentIface::configAutoReplaceNumber() const
+{
+ return doc->getAutoFormat()->getConfigAutoReplaceNumber();
+}
+
+void KPrDocumentIface::setConfigAutoReplaceNumber( bool b )
+{
+ doc->getAutoFormat()->configAutoReplaceNumber(b);
+}
+
+bool KPrDocumentIface::showStatusBar() const
+{
+ return doc->showStatusBar();
+}
+
+void KPrDocumentIface::setShowStatusBar( bool _status )
+{
+ doc->setShowStatusBar(_status);
+ doc->reorganizeGUI();
+}
+
+void KPrDocumentIface::setConfigAutoNumberStyle( bool b )
+{
+ doc->getAutoFormat()->configAutoNumberStyle(b);
+}
+
+bool KPrDocumentIface::configAutoNumberStyle() const
+{
+ return doc->getAutoFormat()->getConfigAutoNumberStyle();
+}
+
+void KPrDocumentIface::setConfigCompletion( bool b )
+{
+ doc->getAutoFormat()->configCompletion( b );
+}
+
+bool KPrDocumentIface::configCompletion() const
+{
+ return doc->getAutoFormat()->getConfigCompletion();
+}
+
+void KPrDocumentIface::setConfigAppendSpace( bool b)
+{
+ doc->getAutoFormat()->configAppendSpace( b );
+}
+
+bool KPrDocumentIface::configAppendSpace() const
+{
+ return doc->getAutoFormat()->getConfigAppendSpace();
+}
+
+void KPrDocumentIface::setConfigMinWordLength( uint val )
+{
+ doc->getAutoFormat()->configMinWordLength( val );
+}
+
+uint KPrDocumentIface::configMinWordLength() const
+{
+ return doc->getAutoFormat()->getConfigMinWordLength();
+}
+
+void KPrDocumentIface::setConfigNbMaxCompletionWord( uint val )
+{
+ doc->getAutoFormat()->configNbMaxCompletionWord( val );
+}
+
+uint KPrDocumentIface::configNbMaxCompletionWord() const
+{
+ return doc->getAutoFormat()->getConfigNbMaxCompletionWord();
+}
+
+void KPrDocumentIface::setConfigAddCompletionWord( bool b )
+{
+ doc->getAutoFormat()->configAddCompletionWord( b );
+}
+
+bool KPrDocumentIface::configAddCompletionWord() const
+{
+ return doc->getAutoFormat()->getConfigAddCompletionWord();
+}
+
+bool KPrDocumentIface::configIncludeTwoUpperUpperLetterException() const
+{
+ return doc->getAutoFormat()->getConfigIncludeTwoUpperUpperLetterException();
+}
+
+void KPrDocumentIface::setConfigIncludeTwoUpperUpperLetterException( bool b)
+{
+ doc->getAutoFormat()->configIncludeTwoUpperUpperLetterException( b );
+}
+
+bool KPrDocumentIface::configIncludeAbbreviation() const
+{
+ return doc->getAutoFormat()->getConfigIncludeAbbreviation();
+}
+
+void KPrDocumentIface::setConfigIncludeAbbreviation( bool b)
+{
+ doc->getAutoFormat()->configIncludeAbbreviation( b );
+}
+
+bool KPrDocumentIface::displayComment() const
+{
+ return doc->getVariableCollection()->variableSetting()->displayComment();
+}
+
+void KPrDocumentIface::setDisplayComment( bool b)
+{
+ doc->getVariableCollection()->variableSetting()->setDisplayComment( b );
+ doc->recalcVariables(VT_NOTE);
+}
+
+bool KPrDocumentIface::showGuideLines() const
+{
+ return doc->showGuideLines();
+}
+
+void KPrDocumentIface::setShowGuideLines( bool b )
+{
+ doc->setShowGuideLines( b );
+ doc->updateGuideLineButton();
+ doc->repaint( false );
+}
+
+void KPrDocumentIface::addGuideLine( bool horizontal, double pos )
+{
+ doc->addGuideLine( horizontal ? Qt::Horizontal: Qt::Vertical, pos );
+ doc->repaint( false );
+}
+
+unsigned int KPrDocumentIface::nbHorizontalHelpLine() const
+{
+ return doc->horizontalGuideLines().count();
+}
+
+unsigned int KPrDocumentIface::nbVerticalHelpLine() const
+{
+ return doc->verticalGuideLines().count();
+}
+
+bool KPrDocumentIface::showGrid() const
+{
+ return doc->showGrid();
+}
+
+void KPrDocumentIface::setShowGrid ( bool _grid )
+{
+ doc->setShowGrid( _grid);
+ doc->updateGridButton();
+ doc->repaint( false );
+}
+
+double KPrDocumentIface::gridX() const
+{
+ return doc->getGridX();
+}
+
+void KPrDocumentIface::setGridX(double _x)
+{
+ doc->setGridX( _x );
+ if( showGrid() )
+ doc->repaint( false );
+}
+
+double KPrDocumentIface::gridY() const
+{
+ return doc->getGridY();
+}
+
+void KPrDocumentIface::setGridY(double _y)
+{
+ doc->setGridY( _y );
+ if( showGrid() )
+ doc->repaint( false );
+}
+
+bool KPrDocumentIface::configAutoSuperScript() const
+{
+ return doc->getAutoFormat()->getConfigAutoSuperScript();
+}
+
+void KPrDocumentIface::setConfigAutoSuperScript( bool b)
+{
+ doc->getAutoFormat()->configAutoSuperScript( b );
+}
+
+void KPrDocumentIface::addIgnoreWordAll( const QString &word)
+{
+ doc->addSpellCheckIgnoreWord( word );
+}
+
+void KPrDocumentIface::clearIgnoreWordAll( )
+{
+ doc->setSpellCheckIgnoreList( QStringList() );
+}
+
+QStringList KPrDocumentIface::spellListIgnoreAll() const
+{
+ return doc->spellCheckIgnoreList();
+}
+
+bool KPrDocumentIface::displayFieldCode()const
+{
+ return doc->getVariableCollection()->variableSetting()->displayFieldCode();
+}
+
+void KPrDocumentIface::setDisplayFieldCode( bool b)
+{
+ doc->getVariableCollection()->variableSetting()->setDisplayFieldCode( b );
+ doc->recalcVariables(VT_ALL);
+}
+
+QString KPrDocumentIface::configAutoFormatLanguage( )const
+{
+ return doc->getAutoFormat()->getConfigAutoFormatLanguage( );
+}
+
+
+bool KPrDocumentIface::configCapitalizeNameOfDays() const
+{
+ return doc->getAutoFormat()->getConfigCapitalizeNameOfDays();
+}
+
+void KPrDocumentIface::setConfigCapitalizeNameOfDays( bool b)
+{
+ doc->getAutoFormat()->configCapitalizeNameOfDays( b );
+}
+
+QString KPrDocumentIface::presentationName() const
+{
+ return doc->presentationName();
+}
+
+void KPrDocumentIface::setPresentationName( const QString &_name )
+{
+ doc->setPresentationName( _name );
+}
+
+
+QStringList KPrDocumentIface::presentationList()
+{
+ return doc->presentationList();
+}
+
+void KPrDocumentIface::repaint()
+{
+ doc->repaint( false );
+}
+
+void KPrDocumentIface::setConfigToolTipCompletion( bool b )
+{
+ doc->getAutoFormat()->configToolTipCompletion( b );
+}
+
+bool KPrDocumentIface::configToolTipCompletion() const
+{
+ return doc->getAutoFormat()->getConfigToolTipCompletion();
+}
diff --git a/kpresenter/KPrDocumentIface.h b/kpresenter/KPrDocumentIface.h
new file mode 100644
index 000000000..f28aa032f
--- /dev/null
+++ b/kpresenter/KPrDocumentIface.h
@@ -0,0 +1,188 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRESENTER_DOC_IFACE_H
+#define KPRESENTER_DOC_IFACE_H
+
+#include <KoDocumentIface.h>
+#include <dcopref.h>
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qcolor.h>
+class KPrDocument;
+
+class KPrDocumentIface : public KoDocumentIface
+{
+ K_DCOP
+public:
+ KPrDocumentIface( KPrDocument *doc_ );
+
+k_dcop:
+ virtual int numPages() const;
+ /// 0-based
+ virtual DCOPRef page( int num );
+
+ virtual DCOPRef masterPage();
+
+ bool selectPage( int page,bool select);
+
+
+ virtual void setShowRuler(bool );
+ virtual bool showRuler() const;
+
+ virtual void recalcVariables( int type );
+ virtual void recalcAllVariables();
+ virtual void recalcVariables(const QString &varName);
+ virtual bool setCustomVariableValue(const QString & varname, const QString & value);
+ virtual QString customVariableValue(const QString & varname) const;
+
+ virtual int startingPage();
+ virtual void setStartingPage(int nb);
+
+ virtual void setDisplayLink(bool b);
+ virtual bool displayLink() const;
+ virtual bool insertNewPage(int pos );
+ virtual bool deletePage( int _page );
+ virtual void deSelectAllObj();
+ virtual void recalcPageNum();
+
+
+ virtual void initConfig();
+ virtual void saveConfig();
+
+ virtual QString selectedForPrinting() const;
+
+ //Be carefull ! when pgNum > num of page we return false
+ virtual bool isSlideSelected( int pgNum);
+
+
+ virtual DCOPRef header();
+ virtual DCOPRef footer();
+
+
+ virtual void startBackgroundSpellCheck();
+ virtual void reactivateBgSpellChecking();
+
+ virtual void setConfigUpperCase( bool _uc );
+ virtual void setConfigUpperUpper( bool _uu );
+ virtual void setConfigAdvancedAutocorrect( bool _aa );
+ virtual void setConfigAutoDetectUrl(bool _au);
+ virtual void setConfigIgnoreDoubleSpace( bool _ids);
+
+ virtual bool configUpperCase() const;
+ virtual bool configUpperUpper() const;
+ virtual bool configAdvancedAutoCorrect() const;
+ virtual bool configAutoDetectUrl() const;
+ virtual bool configIgnoreDoubleSpace() const;
+
+ virtual void setConfigRemoveSpaceBeginEndLine( bool _space);
+ virtual void setConfigUseBulletStyle( bool _ubs);
+
+ virtual bool configRemoveSpaceBeginEndLine() const;
+ virtual bool configUseBulletSyle() const;
+
+ virtual bool configAutoChangeFormat() const;
+ virtual void setConfigAutoChangeFormat( bool _auto);
+
+ virtual bool configAutoReplaceNumber() const;
+ virtual void setConfigAutoReplaceNumber( bool b );
+
+ virtual bool showStatusBar() const;
+ virtual void setShowStatusBar( bool _status );
+
+ void setConfigAutoNumberStyle( bool b );
+ bool configAutoNumberStyle() const;
+
+ void setConfigCompletion( bool b );
+ bool configCompletion() const;
+
+ void setConfigAppendSpace( bool b);
+ bool configAppendSpace() const;
+
+ void setConfigMinWordLength( uint val );
+ uint configMinWordLength() const;
+
+ void setConfigNbMaxCompletionWord( uint val );
+ uint configNbMaxCompletionWord() const;
+
+ void setConfigAddCompletionWord( bool b );
+ bool configAddCompletionWord() const;
+
+ void setConfigToolTipCompletion( bool b );
+ bool configToolTipCompletion() const;
+
+ bool configIncludeTwoUpperUpperLetterException() const;
+ void setConfigIncludeTwoUpperUpperLetterException( bool b);
+
+ bool configIncludeAbbreviation() const;
+ void setConfigIncludeAbbreviation( bool b);
+
+ bool displayComment()const;
+ void setDisplayComment( bool b);
+
+ bool showGuideLines() const;
+ void setShowGuideLines( bool b );
+
+ void addGuideLine( bool horizontal, double pos );
+
+ unsigned int nbHorizontalHelpLine() const;
+ unsigned int nbVerticalHelpLine() const;
+
+ bool showGrid() const;
+ void setShowGrid ( bool _grid );
+
+ double gridX() const;
+ void setGridX(double _x);
+
+ double gridY() const;
+ void setGridY(double _y);
+
+ bool configAutoSuperScript() const;
+ void setConfigAutoSuperScript( bool b);
+
+ void addIgnoreWordAll( const QString &);
+ void clearIgnoreWordAll( );
+
+ QStringList spellListIgnoreAll() const;
+
+
+ bool displayFieldCode()const;
+ void setDisplayFieldCode( bool b);
+ QString configAutoFormatLanguage( )const;
+
+ bool configCapitalizeNameOfDays() const;
+ void setConfigCapitalizeNameOfDays( bool b);
+
+ QString presentationName() const;
+ void setPresentationName( const QString &_name );
+
+ QStringList presentationList();
+
+ /// Repaint document. Call this after moving or resizing an object, for instance.
+ /// @since 1.4
+ void repaint();
+
+private:
+ KPrDocument *doc;
+
+};
+
+#endif
diff --git a/kpresenter/KPrDuplicateObjDia.cpp b/kpresenter/KPrDuplicateObjDia.cpp
new file mode 100644
index 000000000..4b72e1ded
--- /dev/null
+++ b/kpresenter/KPrDuplicateObjDia.cpp
@@ -0,0 +1,125 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Montel Laurent <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <klocale.h>
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qbuttongroup.h>
+
+#include "KPrDuplicateObjDia.h"
+#include "KPrPage.h"
+#include <knuminput.h>
+#include <qlineedit.h>
+#include <KoUnit.h>
+#include <knumvalidator.h>
+#include "KPrDocument.h"
+#include <kseparator.h>
+#include <KoUnitWidgets.h>
+
+KPrDuplicatObjDia::KPrDuplicatObjDia( QWidget *parent, KPrDocument * _doc, const char *name)
+ : KDialogBase( parent, name, true, "", Ok | Cancel, Ok, true )
+{
+ m_doc=_doc;
+ KoUnit::Unit unit = m_doc->unit();
+
+ KoRect pageRect = m_doc->masterPage()->getPageRect();
+
+ setCaption( i18n("Duplicate Object") );
+
+ QVBox *page = makeVBoxMainWidget();
+ QLabel *lab=new QLabel(i18n("Number of copies:"), page);
+
+ m_nbCopy = new KIntNumInput( 1, page );
+ m_nbCopy->setRange( 1 , 10, 1);
+
+ KSeparator *tmp=new KSeparator(page);
+ lab=new QLabel(i18n("Rotation angle:"), page);
+
+ m_rotation = new KDoubleNumInput( page, "customInput" );
+ m_rotation->setRange(0.0, 360, 1, false);
+
+ tmp=new KSeparator(page);
+
+ lab=new QLabel(i18n("Increase width:"), page);
+ m_increaseX= new KoUnitDoubleSpinBox( page );
+ m_increaseX->setMinValue(0.0);
+ m_increaseX->setMaxValue(pageRect.width());
+ m_increaseX->changeValue( 1 );
+ m_increaseX->setUnit(unit);
+
+ lab=new QLabel(i18n("Increase height:"), page);
+ m_increaseY= new KoUnitDoubleSpinBox( page );
+ m_increaseY->setMinValue(0.0);
+ m_increaseY->setMaxValue(pageRect.height());
+ m_increaseY->changeValue( 1 );
+ m_increaseY->setUnit(unit);
+
+ tmp=new KSeparator(page);
+ lab=new QLabel(i18n("Move X:"), page);
+ m_moveX= new KoUnitDoubleSpinBox( page );
+ m_moveX->setMinValue(0.0);
+ m_moveX->setMaxValue(pageRect.width());
+ m_moveX->changeValue( 20.0 );
+ m_moveX->setUnit(unit);
+
+
+ lab=new QLabel(i18n("Move Y:"), page);
+ m_moveY= new KoUnitDoubleSpinBox( page );
+ m_moveY->setMinValue(0.0);
+ m_moveY->setMaxValue(pageRect.height());
+ m_moveY->changeValue( 20.0 );
+ m_moveY->setUnit(unit);
+
+ resize( 200,100 );
+}
+
+int KPrDuplicatObjDia::nbCopy() const
+{
+ return m_nbCopy->value();
+}
+
+double KPrDuplicatObjDia::angle() const
+{
+ return m_rotation->value();
+}
+
+double KPrDuplicatObjDia::increaseX() const
+{
+ return QMAX(0, m_increaseX->value());
+}
+
+double KPrDuplicatObjDia::increaseY() const
+{
+ return QMAX(0, m_increaseY->value());
+}
+
+double KPrDuplicatObjDia::moveX() const
+{
+ return QMAX(0, m_moveX->value());
+}
+
+double KPrDuplicatObjDia::moveY() const
+{
+ return QMAX(0, m_moveY->value());
+}
+
+
+#include "KPrDuplicateObjDia.moc"
diff --git a/kpresenter/KPrDuplicateObjDia.h b/kpresenter/KPrDuplicateObjDia.h
new file mode 100644
index 000000000..cba96b5fc
--- /dev/null
+++ b/kpresenter/KPrDuplicateObjDia.h
@@ -0,0 +1,54 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Montel Laurent <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __kprduplicateobjdia__
+#define __kprduplicateobjdia__
+
+#include <kdialogbase.h>
+#include <KoRect.h>
+
+class KIntNumInput;
+class KDoubleNumInput;
+class KPrDocument;
+class KoUnitDoubleSpinBox;
+
+class KPrDuplicatObjDia : public KDialogBase
+{
+ Q_OBJECT
+public:
+ KPrDuplicatObjDia( QWidget *parent, KPrDocument * _doc, const char *name=0L);
+ int nbCopy() const;
+ double angle() const;
+ double increaseX() const;
+ double increaseY() const;
+ double moveX() const;
+ double moveY() const;
+
+protected:
+ KIntNumInput *m_nbCopy;
+ KDoubleNumInput *m_rotation;
+ KoUnitDoubleSpinBox *m_increaseX, *m_increaseY;
+ KoUnitDoubleSpinBox *m_moveX, *m_moveY;
+ KPrDocument *m_doc;
+
+};
+
+
+#endif
diff --git a/kpresenter/KPrEffectDia.cpp b/kpresenter/KPrEffectDia.cpp
new file mode 100644
index 000000000..711b4cd6b
--- /dev/null
+++ b/kpresenter/KPrEffectDia.cpp
@@ -0,0 +1,528 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrView.h"
+#include "KPrDocument.h"
+#include "KPrEffectDia.h"
+#include "KPrCommand.h"
+#include "KPrObject.h"
+#include "KPrSoundPlayer.h"
+
+#include <qpushbutton.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qgroupbox.h>
+#include <qcheckbox.h>
+#include <qlineedit.h>
+#include <qvaluelist.h>
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qstringlist.h>
+#include <qdir.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+#include <kglobal.h>
+#include <kbuttonbox.h>
+#include <knuminput.h>
+#include <kurlrequester.h>
+#include <kurl.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+
+KPrEffectDia::KPrEffectDia( QWidget* parent, const char* name, const QPtrList<KPrObject>& _objs,
+ KPrView *_view )
+ : KDialogBase( parent, name, true ), objs( _objs )
+{
+ view = _view;
+ KPrObject *obj = objs.at( 0 );
+ soundPlayer1 = 0;
+ soundPlayer2 = 0;
+
+ QWidget *page = new QWidget( this );
+ setMainWidget(page);
+ topLayout = new QVBoxLayout( page, 0, spacingHint() );
+
+ QGroupBox *grp1 = new QGroupBox(0, Qt::Vertical, i18n( "Appear" ), page );
+ grp1->layout()->setSpacing(KDialog::spacingHint());
+ grp1->layout()->setMargin(KDialog::marginHint());
+ topLayout->addWidget(grp1);
+ QGridLayout *upperRow = new QGridLayout(grp1->layout(), 6, 4);
+
+ lAppear = new QLabel( i18n( "Order of appearance:" ), grp1 );
+ lAppear->setAlignment( AlignVCenter );
+ upperRow->addWidget(lAppear, 0, 0);
+
+ eAppearStep = new QSpinBox( 0, 100, 1, grp1 );
+ eAppearStep->setValue( obj->getAppearStep() );
+ upperRow->addWidget(eAppearStep, 0, 1);
+
+ //( void )new QWidget( grp1 );
+ //( void )new QWidget( grp1 );
+
+ lEffect = new QLabel( i18n( "Effect (appearing):" ), grp1 );
+ lEffect->setAlignment( AlignVCenter );
+ upperRow->addWidget(lEffect, 1, 0);
+
+ cEffect = new QComboBox( false, grp1, "cEffect" );
+ cEffect->insertItem( i18n( "No Effect" ) );
+ cEffect->insertItem( i18n( "Come From Right" ) );
+ cEffect->insertItem( i18n( "Come From Left" ) );
+ cEffect->insertItem( i18n( "Come From Top" ) );
+ cEffect->insertItem( i18n( "Come From Bottom" ) );
+ cEffect->insertItem( i18n( "Come From Right/Top" ) );
+ cEffect->insertItem( i18n( "Come From Right/Bottom" ) );
+ cEffect->insertItem( i18n( "Come From Left/Top" ) );
+ cEffect->insertItem( i18n( "Come From Left/Bottom" ) );
+ cEffect->insertItem( i18n( "Wipe From Left" ) );
+ cEffect->insertItem( i18n( "Wipe From Right" ) );
+ cEffect->insertItem( i18n( "Wipe From Top" ) );
+ cEffect->insertItem( i18n( "Wipe From Bottom" ) );
+ cEffect->setCurrentItem( static_cast<int>( obj->getEffect() ) );
+ upperRow->addWidget(cEffect, 1, 1);
+
+ connect( cEffect, SIGNAL( activated( int ) ), this, SLOT( appearEffectChanged( int ) ) );
+
+ lAppearSpeed = new QLabel( i18n( "Speed:" ), grp1 );
+ lAppearSpeed->setAlignment( AlignVCenter );
+ upperRow->addWidget(lAppearSpeed, 2, 0);
+
+ cAppearSpeed = new QComboBox( false, grp1, "cEffect" );
+ cAppearSpeed->insertItem( i18n( "Slow" ) );
+ cAppearSpeed->insertItem( i18n( "Medium" ) );
+ cAppearSpeed->insertItem( i18n( "Fast" ) );
+ cAppearSpeed->setCurrentItem( static_cast<int>( obj->getAppearSpeed() ) );
+ upperRow->addWidget(cAppearSpeed, 2, 1);
+ appearEffectChanged( cEffect->currentItem() );
+
+ lEffect2 = new QLabel( i18n( "Effect (object specific):" ), grp1 );
+ lEffect2->setAlignment( AlignVCenter );
+ upperRow->addWidget(lEffect2, 3, 0);
+
+ cEffect2 = new QComboBox( false, grp1, "cEffect2" );
+ cEffect2->insertItem( i18n( "No Effect" ) );
+ upperRow->addWidget(cEffect2, 3, 1);
+
+ switch ( obj->getType() ) {
+ case OT_TEXT: {
+ cEffect2->insertItem( i18n( "Paragraph After Paragraph" ) );
+ } break;
+ default:
+ lEffect2->setEnabled(false);
+ cEffect2->setEnabled(false);
+ break;
+ }
+
+ if ( obj->getEffect2() == EF2_NONE )
+ cEffect2->setCurrentItem( static_cast<int>( obj->getEffect2() ) );
+ else {
+ switch ( obj->getType() )
+ {
+ case OT_TEXT:
+ cEffect2->setCurrentItem( static_cast<int>( obj->getEffect2() + TxtObjOffset ) );
+ break;
+ default: break;
+ }
+ }
+
+ QLabel *lTimerOfAppear = new QLabel( i18n( "Timer of the object:" ), grp1 );
+ lTimerOfAppear->setAlignment( AlignVCenter );
+ upperRow->addWidget( lTimerOfAppear, 4, 0 );
+
+ timerOfAppear = new KIntNumInput( obj->getAppearTimer(), grp1 );
+ timerOfAppear->setRange( 1, 600, 1 );
+ timerOfAppear->setSuffix( i18n( " seconds" ) );
+ upperRow->addWidget( timerOfAppear, 4, 1 );
+
+ if ( view->kPresenterDoc()->spManualSwitch() )
+ timerOfAppear->setEnabled( false );
+
+
+ // setup the Sound Effect stuff
+ appearSoundEffect = new QCheckBox( i18n( "Sound effect" ), grp1 );
+ appearSoundEffect->setChecked( obj->getAppearSoundEffect() );
+ upperRow->addWidget( appearSoundEffect, 5, 0 );
+
+ connect( appearSoundEffect, SIGNAL( clicked() ), this, SLOT( appearSoundEffectChanged() ) );
+
+ lSoundEffect1 = new QLabel( i18n( "File name:" ), grp1 );
+ lSoundEffect1->setAlignment( AlignVCenter );
+ upperRow->addWidget( lSoundEffect1, 6, 0 );
+
+ requester1 = new KURLRequester( grp1 );
+ requester1->setURL( obj->getAppearSoundEffectFileName() );
+ upperRow->addWidget( requester1, 6, 1 );
+
+ connect( requester1, SIGNAL( openFileDialog( KURLRequester * ) ),
+ this, SLOT( slotRequesterClicked( KURLRequester * ) ) );
+
+ connect( requester1, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( slotAppearFileChanged( const QString& ) ) );
+
+ buttonTestPlaySoundEffect1 = new QPushButton( grp1 );
+ buttonTestPlaySoundEffect1->setIconSet( SmallIconSet("1rightarrow") );
+ QToolTip::add( buttonTestPlaySoundEffect1, i18n("Play") );
+ upperRow->addWidget( buttonTestPlaySoundEffect1, 6, 2 );
+
+ connect( buttonTestPlaySoundEffect1, SIGNAL( clicked() ), this, SLOT( playSound1() ) );
+
+ buttonTestStopSoundEffect1 = new QPushButton( grp1 );
+ buttonTestStopSoundEffect1->setIconSet( SmallIconSet("player_stop") );
+ QToolTip::add( buttonTestStopSoundEffect1, i18n("Stop") );
+ upperRow->addWidget( buttonTestStopSoundEffect1, 6, 3 );
+
+ connect( buttonTestStopSoundEffect1, SIGNAL( clicked() ), this, SLOT( stopSound1() ) );
+
+
+ disappear = new QCheckBox( i18n( "Disappear" ), page );
+ disappear->setChecked( obj->getDisappear() );
+ topLayout->addWidget(disappear);
+
+ QGroupBox *grp2 = new QGroupBox(0, Qt::Vertical, i18n( "Disappear" ), page);
+ grp2->layout()->setSpacing(KDialog::spacingHint());
+ grp2->layout()->setMargin(KDialog::marginHint());
+ topLayout->addWidget(grp2);
+ QGridLayout *lowerRow = new QGridLayout(grp2->layout(), 5, 4);
+
+ lDisappear = new QLabel( i18n( "Order of disappearance:" ), grp2 );
+ lDisappear->setAlignment( AlignVCenter );
+ lowerRow->addWidget(lDisappear, 0, 0);
+
+ eDisappearStep = new QSpinBox( 0, 100, 1, grp2 );
+ eDisappearStep->setValue( obj->getDisappearStep() );
+ lowerRow->addWidget(eDisappearStep, 0, 1);
+
+ lDEffect = new QLabel( i18n( "Effect (disappearing):" ), grp2 );
+ lDEffect->setAlignment( AlignVCenter );
+ lowerRow->addWidget(lDEffect, 1, 0);
+
+ cDisappear = new QComboBox( false, grp2, "cDisappear" );
+ cDisappear->insertItem( i18n( "No Effect" ) );
+ cDisappear->insertItem( i18n( "Disappear to Right" ) );
+ cDisappear->insertItem( i18n( "Disappear to Left" ) );
+ cDisappear->insertItem( i18n( "Disappear to Top" ) );
+ cDisappear->insertItem( i18n( "Disappear to Bottom" ) );
+ cDisappear->insertItem( i18n( "Disappear to Right/Top" ) );
+ cDisappear->insertItem( i18n( "Disappear to Right/Bottom" ) );
+ cDisappear->insertItem( i18n( "Disappear to Left/Top" ) );
+ cDisappear->insertItem( i18n( "Disappear to Left/Bottom" ) );
+ cDisappear->insertItem( i18n( "Wipe to Left" ) );
+ cDisappear->insertItem( i18n( "Wipe to Right" ) );
+ cDisappear->insertItem( i18n( "Wipe to Top" ) );
+ cDisappear->insertItem( i18n( "Wipe to Bottom" ) );
+ cDisappear->setCurrentItem( static_cast<int>( obj->getEffect3() ) );
+ lowerRow->addWidget(cDisappear, 1, 1);
+
+ connect( cDisappear, SIGNAL( activated( int ) ), this, SLOT( disappearEffectChanged( int ) ) );
+
+ lDisappearSpeed = new QLabel( i18n( "Speed:" ), grp2 );
+ lDisappearSpeed->setAlignment( AlignVCenter );
+ lowerRow->addWidget(lDisappearSpeed, 2, 0);
+
+ cDisappearSpeed = new QComboBox( false, grp2, "cEffect" );
+ cDisappearSpeed->insertItem( i18n( "Slow" ) );
+ cDisappearSpeed->insertItem( i18n( "Medium" ) );
+ cDisappearSpeed->insertItem( i18n( "Fast" ) );
+ cDisappearSpeed->setCurrentItem( static_cast<int>( obj->getDisappearSpeed() ) );
+ lowerRow->addWidget(cDisappearSpeed, 2, 1);
+
+ //appearEffectChanged( cEffect->currentItem() );
+
+ QLabel *lTimerOfDisappear = new QLabel( i18n( "Timer of the object:" ), grp2 );
+ lTimerOfDisappear->setAlignment( AlignVCenter );
+ lowerRow->addWidget( lTimerOfDisappear, 3, 0 );
+
+ timerOfDisappear = new KIntNumInput( obj->getDisappearTimer(), grp2 );
+ timerOfDisappear->setRange( 1, 600, 1 );
+ timerOfDisappear->setSuffix( i18n( " seconds" ) );
+ lowerRow->addWidget( timerOfDisappear, 3, 1 );
+
+ if ( view->kPresenterDoc()->spManualSwitch() )
+ timerOfDisappear->setEnabled( false );
+
+
+ // setup the Sound Effect stuff
+ disappearSoundEffect = new QCheckBox( i18n( "Sound effect" ), grp2 );
+ disappearSoundEffect->setChecked( obj->getDisappearSoundEffect() );
+ lowerRow->addWidget( disappearSoundEffect, 4, 0 );
+ disappearSoundEffect->setEnabled( disappear->isChecked() );
+
+ connect( disappearSoundEffect, SIGNAL( clicked() ), this, SLOT( disappearSoundEffectChanged() ) );
+
+ lSoundEffect2 = new QLabel( i18n( "File name:" ), grp2 );
+ lSoundEffect2->setAlignment( AlignVCenter );
+ lowerRow->addWidget( lSoundEffect2, 5, 0 );
+
+ requester2 = new KURLRequester( grp2 );
+ requester2->setURL( obj->getDisappearSoundEffectFileName() );
+ lowerRow->addWidget( requester2, 5, 1 );
+
+ connect( requester2, SIGNAL( openFileDialog( KURLRequester * ) ),
+ this, SLOT( slotRequesterClicked( KURLRequester * ) ) );
+
+ connect( requester2, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( slotDisappearFileChanged( const QString& ) ) );
+
+ buttonTestPlaySoundEffect2 = new QPushButton( grp2 );
+ buttonTestPlaySoundEffect2->setIconSet( SmallIconSet("1rightarrow") );
+ QToolTip::add( buttonTestPlaySoundEffect2, i18n("Play") );
+ lowerRow->addWidget( buttonTestPlaySoundEffect2, 5, 2 );
+
+ connect( buttonTestPlaySoundEffect2, SIGNAL( clicked() ), this, SLOT( playSound2() ) );
+
+ buttonTestStopSoundEffect2 = new QPushButton( grp2 );
+ buttonTestStopSoundEffect2->setIconSet( SmallIconSet("player_stop") );
+ QToolTip::add( buttonTestStopSoundEffect2, i18n("Stop") );
+ lowerRow->addWidget( buttonTestStopSoundEffect2, 5, 3 );
+
+ connect( buttonTestStopSoundEffect2, SIGNAL( clicked() ), this, SLOT( stopSound2() ) );
+
+
+ topLayout->activate();
+
+ connect( this, SIGNAL( okClicked() ), this, SLOT( slotEffectDiaOk() ) );
+ connect( this, SIGNAL( okClicked() ), this, SLOT( accept() ) );
+ connect( disappear, SIGNAL( clicked() ), this, SLOT( disappearChanged() ) );
+ disappearChanged();
+ appearSoundEffectChanged();
+}
+
+KPrEffectDia::~KPrEffectDia()
+{
+ stopSound1();
+ stopSound2();
+
+ delete soundPlayer1;
+ delete soundPlayer2;
+}
+
+void KPrEffectDia::slotEffectDiaOk()
+{
+ QValueList<KPrEffectCmd::EffectStruct> oldEffects;
+ for ( unsigned int i = 0; i < objs.count(); ++i ) {
+ KPrObject *o = objs.at( i );
+ KPrEffectCmd::EffectStruct e;
+ e.appearStep = o->getAppearStep();
+ e.disappearStep = o->getDisappearStep();
+ e.effect = o->getEffect();
+ e.effect2 = o->getEffect2();
+ e.effect3 = o->getEffect3();
+ e.m_appearSpeed = o->getAppearSpeed();
+ e.m_disappearSpeed = o->getDisappearSpeed();
+ e.disappear = o->getDisappear();
+ e.appearTimer = o->getAppearTimer();
+ e.disappearTimer = o->getDisappearTimer();
+ e.appearSoundEffect = o->getAppearSoundEffect();
+ e.disappearSoundEffect = o->getDisappearSoundEffect();
+ e.a_fileName = o->getAppearSoundEffectFileName();
+ e.d_fileName = o->getDisappearSoundEffectFileName();
+ oldEffects << e;
+ }
+
+ KPrEffectCmd::EffectStruct eff;
+ eff.appearStep = eAppearStep->value();
+ eff.disappearStep = eDisappearStep->value();
+ eff.effect = ( Effect )cEffect->currentItem();
+ eff.effect2 = ( Effect2 )cEffect2->currentItem();
+ eff.effect3 = ( Effect3 )cDisappear->currentItem();
+ eff.m_appearSpeed = ( EffectSpeed )cAppearSpeed->currentItem();
+ eff.m_disappearSpeed = ( EffectSpeed )cDisappearSpeed->currentItem();
+ eff.disappear = disappear->isChecked();
+ eff.appearTimer = timerOfAppear->value();
+ eff.disappearTimer = timerOfDisappear->value();
+ eff.appearSoundEffect = (requester1->url().isEmpty() ? false : appearSoundEffect->isChecked());
+ eff.disappearSoundEffect = (requester2->url().isEmpty() ? false : disappearSoundEffect->isChecked());
+ eff.a_fileName = requester1->url();
+ eff.d_fileName = requester2->url();
+
+ KPrEffectCmd *effectCmd = new KPrEffectCmd( i18n( "Assign Object Effects" ), objs, oldEffects, eff );
+ effectCmd->execute();
+ view->kPresenterDoc()->addCommand( effectCmd );
+ accept();
+}
+
+void KPrEffectDia::resizeEvent( QResizeEvent *e )
+{
+ QDialog::resizeEvent( e );
+ //topLayout->resize( size() );
+}
+
+void KPrEffectDia::disappearChanged()
+{
+ cDisappear->setEnabled( disappear->isChecked() );
+ eDisappearStep->setEnabled( disappear->isChecked() );
+ disappearSoundEffect->setEnabled( disappear->isChecked() );
+ disappearSoundEffectChanged();
+ disappearEffectChanged( cDisappear->currentItem() );
+
+ if ( !view->kPresenterDoc()->spManualSwitch() )
+ timerOfDisappear->setEnabled( disappear->isChecked() );
+}
+
+void KPrEffectDia::appearEffectChanged( int /*num*/ )
+{
+ bool b = ( cEffect->currentItem() != 0 );
+ lAppearSpeed->setEnabled( b );
+ cAppearSpeed->setEnabled( b );
+}
+
+void KPrEffectDia::disappearEffectChanged( int /*num*/ )
+{
+ bool b = ( cDisappear->currentItem() !=0 && disappear->isChecked() );
+ lDisappearSpeed->setEnabled( b );
+ cDisappearSpeed->setEnabled( b );
+}
+
+void KPrEffectDia::appearSoundEffectChanged()
+{
+ lSoundEffect1->setEnabled( appearSoundEffect->isChecked() );
+ requester1->setEnabled( appearSoundEffect->isChecked() );
+
+ if ( !requester1->url().isEmpty() ) {
+ buttonTestPlaySoundEffect1->setEnabled( appearSoundEffect->isChecked() );
+ buttonTestStopSoundEffect1->setEnabled( appearSoundEffect->isChecked() );
+ }
+ else {
+ buttonTestPlaySoundEffect1->setEnabled( false );
+ buttonTestStopSoundEffect1->setEnabled( false );
+ }
+}
+
+void KPrEffectDia::disappearSoundEffectChanged()
+{
+ lSoundEffect2->setEnabled( disappear->isChecked() && disappearSoundEffect->isChecked() );
+ requester2->setEnabled( disappear->isChecked() && disappearSoundEffect->isChecked() );
+
+ if ( !requester2->url().isEmpty() ) {
+ buttonTestPlaySoundEffect2->setEnabled( disappear->isChecked() && disappearSoundEffect->isChecked() );
+ buttonTestStopSoundEffect2->setEnabled( disappear->isChecked() && disappearSoundEffect->isChecked() );
+ }
+ else {
+ buttonTestPlaySoundEffect2->setEnabled( false );
+ buttonTestStopSoundEffect2->setEnabled( false );
+ }
+}
+
+void KPrEffectDia::slotRequesterClicked( KURLRequester *requester )
+{
+ QString filter = getSoundFileFilter();
+ requester->fileDialog()->setFilter( filter );
+
+ // find the first "sound"-resource that contains files
+ QStringList soundDirs = KGlobal::dirs()->resourceDirs( "sound" );
+ if ( !soundDirs.isEmpty() ) {
+ KURL soundURL;
+ QDir dir;
+ dir.setFilter( QDir::Files | QDir::Readable );
+ QStringList::ConstIterator it = soundDirs.begin();
+ while ( it != soundDirs.end() ) {
+ dir = *it;
+ if ( dir.isReadable() && dir.count() > 2 ) {
+ soundURL.setPath( *it );
+ requester->fileDialog()->setURL( soundURL );
+ break;
+ }
+ ++it;
+ }
+ }
+}
+
+void KPrEffectDia::slotAppearFileChanged( const QString &text )
+{
+ buttonTestPlaySoundEffect1->setEnabled( !text.isEmpty() );
+ buttonTestStopSoundEffect1->setEnabled( !text.isEmpty() );
+}
+
+void KPrEffectDia::slotDisappearFileChanged( const QString &text )
+{
+ buttonTestPlaySoundEffect2->setEnabled( !text.isEmpty() );
+ buttonTestStopSoundEffect2->setEnabled( !text.isEmpty() );
+}
+
+void KPrEffectDia::playSound1()
+{
+ delete soundPlayer1;
+ soundPlayer1 = new KPrSoundPlayer( requester1->url() );
+ soundPlayer1->play();
+
+ buttonTestPlaySoundEffect1->setEnabled( false );
+ buttonTestStopSoundEffect1->setEnabled( true );
+}
+
+void KPrEffectDia::playSound2()
+{
+ delete soundPlayer2;
+ soundPlayer2 = new KPrSoundPlayer( requester2->url() );
+ soundPlayer2->play();
+
+ buttonTestPlaySoundEffect2->setEnabled( false );
+ buttonTestStopSoundEffect2->setEnabled( true );
+}
+
+void KPrEffectDia::stopSound1()
+{
+ if ( soundPlayer1 ) {
+ soundPlayer1->stop();
+ delete soundPlayer1;
+ soundPlayer1 = 0;
+
+ buttonTestPlaySoundEffect1->setEnabled( true );
+ buttonTestStopSoundEffect1->setEnabled( false );
+ }
+}
+
+void KPrEffectDia::stopSound2()
+{
+ if ( soundPlayer2 ) {
+ soundPlayer2->stop();
+ delete soundPlayer2;
+ soundPlayer2 = 0;
+
+ buttonTestPlaySoundEffect2->setEnabled( true );
+ buttonTestStopSoundEffect2->setEnabled( false );
+ }
+}
+
+QString KPrEffectDia::getSoundFileFilter() const
+{
+ QStringList fileList;
+ fileList << "wav" << "au" << "mp3" << "mp1" << "mp2" << "mpg" << "dat"
+ << "mpeg" << "ogg" << "cdda" << "cda " << "vcd" << "null";
+ fileList.sort();
+
+ bool comma = false;
+ QString full, str;
+ for ( QStringList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it ) {
+ if ( comma )
+ str += '\n';
+ comma = true;
+ str += QString( i18n( "*.%1|%2 Files" ) ).arg( *it ).arg( (*it).upper() );
+
+ full += QString( "*.") + (*it) + ' ';
+ }
+
+ str = full + '|' + i18n( "All Supported Files" ) + '\n' + str;
+ str += "\n*|" + i18n( "All Files" );
+
+ return str;
+}
+
+#include "KPrEffectDia.moc"
diff --git a/kpresenter/KPrEffectDia.h b/kpresenter/KPrEffectDia.h
new file mode 100644
index 000000000..7f59af0c2
--- /dev/null
+++ b/kpresenter/KPrEffectDia.h
@@ -0,0 +1,94 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef EFFECTDIA_H
+#define EFFECTDIA_H
+
+#include <kdialogbase.h>
+#include <qptrlist.h>
+
+class KPrView;
+class QWidget;
+class QComboBox;
+class QLabel;
+class QPushButton;
+class QCheckBox;
+class QBoxLayout;
+class QResizeEvent;
+class QLineEdit;
+class KPrObject;
+class KIntNumInput;
+class KURLRequester;
+class KPrSoundPlayer;
+class QSpinBox;
+
+class KPrEffectDia : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KPrEffectDia( QWidget* parent, const char*, const QPtrList<KPrObject> &_objs,
+ KPrView* );
+
+ ~KPrEffectDia();
+
+protected:
+ void resizeEvent( QResizeEvent *e );
+
+ QString getSoundFileFilter() const;
+
+ QComboBox *cEffect, *cEffect2, *cDisappear, *cAppearSpeed, *cDisappearSpeed;
+ QLabel *lEffect, *lEffect2, *lAppear, *lDisappear, *lDEffect, * lAppearSpeed, *lDisappearSpeed;
+ QSpinBox *eAppearStep,*eDisappearStep;
+ QCheckBox *disappear;
+ QBoxLayout *topLayout;
+ KIntNumInput *timerOfAppear, *timerOfDisappear;
+
+ QCheckBox *appearSoundEffect, *disappearSoundEffect;
+ QLabel *lSoundEffect1, *lSoundEffect2;
+ KURLRequester *requester1, *requester2;
+ QPushButton *buttonTestPlaySoundEffect1, *buttonTestStopSoundEffect1;
+ QPushButton *buttonTestPlaySoundEffect2, *buttonTestStopSoundEffect2;
+
+ KPrSoundPlayer *soundPlayer1, *soundPlayer2;
+
+ KPrView *view;
+ QPtrList<KPrObject> objs;
+
+public slots:
+ void slotEffectDiaOk();
+
+protected slots:
+ void disappearChanged();
+ void appearEffectChanged( int num );
+ void disappearEffectChanged( int num );
+ void appearSoundEffectChanged();
+ void disappearSoundEffectChanged();
+ void slotRequesterClicked( KURLRequester * );
+ void slotAppearFileChanged( const QString& );
+ void slotDisappearFileChanged( const QString& );
+ void playSound1();
+ void playSound2();
+ void stopSound1();
+ void stopSound2();
+
+};
+
+#endif //EFFECTDIA_H
diff --git a/kpresenter/KPrEffectHandler.cpp b/kpresenter/KPrEffectHandler.cpp
new file mode 100644
index 000000000..79853dd7b
--- /dev/null
+++ b/kpresenter/KPrEffectHandler.cpp
@@ -0,0 +1,1055 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrEffectHandler.h"
+
+#include "KPrObject.h"
+#include "KPrDocument.h"
+#include "KPrView.h"
+#include "KPrCanvas.h"
+
+#include <KoZoomHandler.h>
+#include <kapplication.h>
+
+#include <qpainter.h>
+#include <qpaintdevice.h>
+
+#include <unistd.h>
+
+
+KPrEffectHandler::KPrEffectHandler( PresStep step, bool back, QPaintDevice *dst, QPixmap *src,
+ const QPtrList<KPrObject> &objects, KPrView *view, int _presSpeed )
+: m_effectStep(0), m_step(step), m_back(back), m_dst(dst),
+ m_paint(*src), m_objects(objects), m_view(view), m_soundEffect(QString::null),
+ m_objectTimer(1)
+{
+ m_src = new QPixmap( *src );
+
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current(); ++it )
+ {
+ KPrObject *object = it.current();
+ if ( object->getAppearStep() == m_step.m_step
+ && ( m_step.m_subStep == 0
+ || ( object->getType() == OT_TEXT
+ && object->getEffect2() == EF2T_PARA ) ) )
+ {
+ m_appearEffectObjects.append( object );
+ if ( object->getAppearSoundEffect() )
+ {
+ m_soundEffect = object->getAppearSoundEffectFileName();
+ }
+
+ if ( object->getAppearTimer() > m_objectTimer )
+ {
+ m_objectTimer = object->getAppearTimer();
+ }
+ }
+ else if ( object->getDisappear() && object->getDisappearStep() == m_step.m_step )
+ {
+ m_disappearEffectObjects.append( object );
+ if ( object->getDisappearSoundEffect() )
+ {
+ m_soundEffect = object->getDisappearSoundEffectFileName();
+ }
+
+ if ( object->getDisappearTimer() > m_objectTimer )
+ {
+ m_objectTimer = object->getDisappearTimer();
+ }
+ }
+ }
+
+ float speedFactor = 150.0 / static_cast<float>( _presSpeed + 2 );
+ m_stepWidth = static_cast<int>( m_src->width() / speedFactor );
+ m_stepHeight = static_cast<int>( m_src->height() / speedFactor );
+ m_lastRepaintRects.setAutoDelete( true );
+}
+
+
+KPrEffectHandler::~KPrEffectHandler()
+{
+ delete m_src;
+}
+
+
+bool KPrEffectHandler::doEffect()
+{
+ if ( m_effectStep == 0 )
+ {
+ if ( !m_view->kPresenterDoc()->spManualSwitch() )
+ {
+ m_view->stopAutoPresTimer();
+ }
+
+ if ( !m_soundEffect.isNull() )
+ {
+ m_view->getCanvas()->stopSound();
+ m_view->getCanvas()->playSound( m_soundEffect );
+ }
+ }
+ if ( !m_appearEffectObjects.isEmpty() || !m_disappearEffectObjects.isEmpty() )
+ {
+ QPtrList<QRect> m_removeRects;
+ KPrObject *appearObject = m_appearEffectObjects.first();
+ KPrObject *disappearObject = m_disappearEffectObjects.first();
+ QPtrListIterator<KPrObject> it( m_objects );
+ KPrObject *object;
+
+ while ( ( object = it.current() ) != 0 )
+ {
+ int speed[] = { 50, 35, 20 };
+
+ ++it;
+ if ( object == appearObject )
+ {
+ bool next = true;
+
+ double speedFactor = speed[object->getAppearSpeed()];
+
+ m_stepWidth = static_cast<int>( m_src->width() / speedFactor );
+ m_stepHeight = static_cast<int>( m_src->height() / speedFactor );
+
+ if ( doAppearEffectStep( object ) )
+ {
+ m_removeRects.append( m_repaintRects.getLast() );
+ if ( appearObject != m_appearEffectObjects.getLast() )
+ {
+ next = false;
+ }
+ m_appearEffectObjects.remove();
+
+ // add object to src
+ drawObject( object, 0, 0, m_src );
+ }
+ if ( next )
+ appearObject = m_appearEffectObjects.next();
+ else
+ appearObject = m_appearEffectObjects.current();
+ }
+ else if ( object == disappearObject )
+ {
+ bool next = true;
+
+ double speedFactor = speed[object->getDisappearSpeed()];
+
+ m_stepWidth = static_cast<int>( m_src->width() / speedFactor );
+ m_stepHeight = static_cast<int>( m_src->height() / speedFactor );
+
+ if ( doDisappearEffectStep( object ) )
+ {
+ if ( disappearObject != m_disappearEffectObjects.getLast() )
+ {
+ next = false;
+ }
+ m_disappearEffectObjects.remove();
+ }
+
+ if ( next )
+ disappearObject = m_disappearEffectObjects.next();
+ else
+ disappearObject = m_disappearEffectObjects.current();
+ }
+ }
+
+ ++m_effectStep;
+ QRect *r;
+#if 0 // used for debugging effects
+ QPtrListIterator<QRect> it_debug(m_repaintRects);
+ while( ( r = it_debug.current() ) != 0 )
+ {
+ ++it_debug;
+ QPainter p( &m_paint );
+ QPen pen = QPen( Qt::red, 1, Qt::DashLine );
+ p.setPen( pen );
+ p.drawRect( *r );
+ }
+
+ QPtrListIterator<QRect> it_debug2(m_lastRepaintRects);
+ while( ( r = it_debug2.current() ) != 0 )
+ {
+ ++it_debug2;
+ QPainter p( &m_paint );
+ QPen pen = QPen( Qt::green, 1, Qt::DashLine );
+ p.setPen( pen );
+ p.drawRect( *r );
+ }
+ sleep( 1 );
+#endif
+
+ QPtrListIterator<QRect> it_r(m_repaintRects);
+#if 1
+ while( ( r = it_r.current() ) != 0 )
+ {
+ ++it_r;
+ //bitBlt( m_dst, r->x(), r->y(), &m_paint, r->x(), r->y(), r->width(), r->height() );
+ bitBlt( m_dst, r->x() - 5, r->y() - 5, &m_paint, r->x() - 5, r->y() - 5, r->width() + 10, r->height() + 10 );
+ }
+ QPtrListIterator<QRect> it2(m_lastRepaintRects);
+ while( ( r = it2.current() ) != 0 )
+ {
+ ++it2;
+ //bitBlt( m_dst, r->x(), r->y(), &m_paint, r->x(), r->y(), r->width(), r->height() );
+ bitBlt( m_dst, r->x() - 5, r->y() - 5, &m_paint, r->x() - 5, r->y() - 5, r->width() + 10, r->height() + 10 );
+ }
+#else
+ bitBlt( m_dst, 0, 0, &m_paint);
+#endif
+
+ m_lastRepaintRects = m_repaintRects;
+ QPtrListIterator<QRect> it3(m_removeRects);
+ while( ( r = it3.current() ) != 0 )
+ {
+ ++it3;
+ m_lastRepaintRects.remove( r );
+ }
+
+ m_repaintRects.clear();
+
+ m_paint = *m_src;
+
+ }
+ bool retval = ( m_appearEffectObjects.isEmpty() && m_disappearEffectObjects.isEmpty() );
+
+ if ( retval && !m_view->kPresenterDoc()->spManualSwitch() )
+ {
+ m_view->setAutoPresTimer( m_objectTimer );
+ }
+ return retval;
+}
+
+
+void KPrEffectHandler::finish()
+{
+ KPrObject *appearObject = m_appearEffectObjects.first();
+ KPrObject *disappearObject = m_disappearEffectObjects.first();
+ QPtrListIterator<KPrObject> it( m_objects );
+ KPrObject *object;
+
+ while ( ( object = it.current() ) != 0 )
+ {
+ ++it;
+ if ( object == appearObject )
+ {
+ bool next = true;
+
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ m_repaintRects.append( new QRect( objectRect ) );
+
+ if ( appearObject != m_appearEffectObjects.getLast() )
+ {
+ next = false;
+ }
+ m_appearEffectObjects.remove();
+
+ // add object to src
+ drawObject( object, 0, 0, m_src );
+
+ if ( next )
+ appearObject = m_appearEffectObjects.next();
+ else
+ appearObject = m_appearEffectObjects.current();
+ }
+ else if ( object == disappearObject )
+ {
+ bool next = true;
+
+ if ( disappearObject != m_disappearEffectObjects.getLast() )
+ {
+ next = false;
+ }
+ m_disappearEffectObjects.remove();
+
+ if ( next )
+ disappearObject = m_disappearEffectObjects.next();
+ else
+ disappearObject = m_disappearEffectObjects.current();
+ }
+ }
+ bitBlt( m_dst, 0, 0, m_src );
+
+ if ( !m_view->kPresenterDoc()->spManualSwitch() && m_objectTimer > 0 )
+ {
+ m_view->setAutoPresTimer( m_objectTimer );
+ }
+}
+
+
+bool KPrEffectHandler::doAppearEffectStep( KPrObject *object )
+{
+ bool positionReached = true;
+
+ switch( object->getEffect() )
+ {
+ case EF_NONE:
+ positionReached = appearNone( object );
+ break;
+ case EF_COME_LEFT:
+ positionReached = appearComeLeft( object );
+ break;
+ case EF_COME_TOP:
+ positionReached = appearComeTop( object );
+ break;
+ case EF_COME_RIGHT:
+ positionReached = appearComeRight( object );
+ break;
+ case EF_COME_BOTTOM:
+ positionReached = appearComeBottom( object );
+ break;
+ case EF_COME_LEFT_TOP:
+ positionReached = appearComeLeftTop( object );
+ break;
+ case EF_COME_LEFT_BOTTOM:
+ positionReached = appearComeLeftBottom( object );
+ break;
+ case EF_COME_RIGHT_TOP:
+ positionReached = appearComeRightTop( object );
+ break;
+ case EF_COME_RIGHT_BOTTOM:
+ positionReached = appearComeRightBottom( object );
+ break;
+ case EF_WIPE_LEFT:
+ positionReached = appearWipeLeft( object );
+ break;
+ case EF_WIPE_RIGHT:
+ positionReached = appearWipeRight( object );
+ break;
+ case EF_WIPE_TOP:
+ positionReached = appearWipeTop( object );
+ break;
+ case EF_WIPE_BOTTOM:
+ positionReached = appearWipeBottom( object );
+ break;
+ default:
+ break;
+ }
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::doDisappearEffectStep( KPrObject *object )
+{
+ bool positionReached = true;
+
+ switch( object->getEffect3() )
+ {
+ case EF3_NONE:
+ break;
+ case EF3_GO_LEFT:
+ positionReached = disappearGoLeft( object );
+ break;
+ case EF3_GO_TOP:
+ positionReached = disappearGoTop( object );
+ break;
+ case EF3_GO_RIGHT:
+ positionReached = disappearGoRight( object );
+ break;
+ case EF3_GO_BOTTOM:
+ positionReached = disappearGoBottom( object );
+ break;
+ case EF3_GO_LEFT_TOP:
+ positionReached = disappearGoLeftTop( object );
+ break;
+ case EF3_GO_LEFT_BOTTOM:
+ positionReached = disappearGoLeftBottom( object );
+ break;
+ case EF3_GO_RIGHT_TOP:
+ positionReached = disappearGoRightTop( object );
+ break;
+ case EF3_GO_RIGHT_BOTTOM:
+ positionReached = disappearGoRightBottom( object );
+ break;
+ case EF3_WIPE_LEFT:
+ positionReached = disappearWipeLeft( object );
+ break;
+ case EF3_WIPE_RIGHT:
+ positionReached = disappearWipeRight( object );
+ break;
+ case EF3_WIPE_TOP:
+ positionReached = disappearWipeTop( object );
+ break;
+ case EF3_WIPE_BOTTOM:
+ positionReached = disappearWipeBottom( object );
+ break;
+ default:
+ break;
+ }
+ return positionReached;
+}
+
+bool KPrEffectHandler::appearNone( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ m_repaintRects.append( new QRect( objectRect ) );
+ drawObject( object, 0, 0, &m_paint );
+ return true;
+}
+
+
+bool KPrEffectHandler::appearComeLeft( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int xdiff = repaintRect.x() - ox;
+
+ bool positionReached = false;
+ int x = m_effectStep * m_stepWidth - objectRect.width();
+ if ( x >= ox )
+ {
+ x = ox;
+ positionReached = true;
+ }
+ repaintRect.moveLeft( x + xdiff );
+ m_repaintRects.append( new QRect( repaintRect ) );
+
+ //kdDebug(33001) << "KPrEffectHandler appearComeLeft x = " << x << " " << positionReached << endl;
+ drawObject( object, x - ox, 0, &m_paint );
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearComeTop( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int oy = objectRect.y();
+ int ydiff = repaintRect.y() - oy;
+
+ bool positionReached = false;
+ int y = m_effectStep * m_stepHeight - objectRect.height();
+ if ( y >= oy )
+ {
+ y = oy;
+ positionReached = true;
+ }
+ repaintRect.moveTop( y + ydiff );
+ m_repaintRects.append( new QRect( repaintRect ) );
+
+ //kdDebug(33001) << "KPrEffectHandler appearComeTop y = " << y << " " << positionReached << endl;
+ drawObject( object, 0, y - oy, &m_paint );
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearComeRight( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int xdiff = repaintRect.x() - ox;
+
+ bool positionReached = false;
+ int x = m_src->width() - m_effectStep * m_stepWidth;
+ if ( x <= ox )
+ {
+ x = ox;
+ positionReached = true;
+ }
+ repaintRect.moveLeft( x + xdiff );
+ m_repaintRects.append( new QRect( repaintRect ) );
+
+ //kdDebug(33001) << "KPrEffectHandler appearComeRight x = " << x << " " << positionReached << endl;
+ drawObject( object, x - ox, 0, &m_paint );
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearComeBottom( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int oy = objectRect.y();
+ int ydiff = repaintRect.y() - oy;
+
+ bool positionReached = false;
+ int y = m_src->height() - m_effectStep * m_stepHeight;
+ if ( y <= oy )
+ {
+ y = oy;
+ positionReached = true;
+ }
+ repaintRect.moveTop( y + ydiff );
+ m_repaintRects.append( new QRect( repaintRect ) );
+
+ //kdDebug(33001) << "KPrEffectHandler appearComeBottom y = " << y << " " << positionReached << endl;
+ drawObject( object, 0, y - oy, &m_paint );
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearComeLeftTop( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int oy = objectRect.y();
+ int xdiff = repaintRect.x() - ox;
+ int ydiff = repaintRect.y() - oy;
+
+ bool positionReached = false;
+ int x = m_effectStep * m_stepWidth - objectRect.width();
+ int y = m_effectStep * m_stepHeight - objectRect.height();
+
+ if ( x >= ox )
+ x = ox;
+
+ if ( y >= oy )
+ y = oy;
+
+ if ( x == ox && y == oy )
+ positionReached = true;
+
+ repaintRect.moveLeft( x + xdiff );
+ repaintRect.moveTop( y + ydiff );
+ m_repaintRects.append( new QRect( repaintRect ) );
+
+ //kdDebug(33001) << "KPrEffectHandler appearComeLeftTop x = " << x << ",y = " << y << " " << positionReached << endl;
+ drawObject( object, x - ox, y - oy, &m_paint );
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearComeLeftBottom( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int oy = objectRect.y();
+ int xdiff = repaintRect.x() - ox;
+ int ydiff = repaintRect.y() - oy;
+
+ bool positionReached = false;
+ int x = m_effectStep * m_stepWidth - objectRect.width();
+ int y = m_src->height() - m_effectStep * m_stepHeight;
+
+ if ( x >= ox )
+ x = ox;
+
+ if ( y <= oy )
+ y = oy;
+
+ if ( x == ox && y == oy )
+ positionReached = true;
+
+ repaintRect.moveLeft( x + xdiff );
+ repaintRect.moveTop( y + ydiff );
+ m_repaintRects.append( new QRect( repaintRect ) );
+
+ //kdDebug(33001) << "KPrEffectHandler appearComeLeftBottom x = " << x << ",y = " << y << " " << positionReached << endl;
+ drawObject( object, x - ox, y - oy, &m_paint );
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearComeRightTop( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int oy = objectRect.y();
+ int xdiff = repaintRect.x() - ox;
+ int ydiff = repaintRect.y() - oy;
+
+ bool positionReached = false;
+ int x = m_src->width() - m_effectStep * m_stepWidth;
+ int y = m_effectStep * m_stepHeight - objectRect.height();
+
+ if ( x <= ox )
+ x = ox;
+
+ if ( y >= oy )
+ y = oy;
+
+ if ( x == ox && y == oy )
+ positionReached = true;
+
+ repaintRect.moveLeft( x + xdiff );
+ repaintRect.moveTop( y + ydiff );
+ m_repaintRects.append( new QRect( repaintRect ) );
+
+ //kdDebug(33001) << "KPrEffectHandler appearComeRightTop x = " << x << ",y = " << y << " " << positionReached << endl;
+ drawObject( object, x - ox, y - oy, &m_paint );
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearComeRightBottom( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int oy = objectRect.y();
+ int xdiff = repaintRect.x() - ox;
+ int ydiff = repaintRect.y() - oy;
+
+ bool positionReached = false;
+ int x = m_src->width() - m_effectStep * m_stepWidth;
+ int y = m_src->height() - m_effectStep * m_stepHeight;
+
+ if ( x <= ox )
+ x = ox;
+
+ if ( y <= oy )
+ y = oy;
+
+ if ( x == ox && y == oy )
+ positionReached = true;
+
+ repaintRect.moveLeft( x + xdiff );
+ repaintRect.moveTop( y + ydiff );
+ m_repaintRects.append( new QRect( repaintRect ) );
+
+ //kdDebug(33001) << "KPrEffectHandler appearComeRightBottom x = " << x << ",y = " << y << " " << positionReached << endl;
+ drawObject( object, x - ox, y - oy, &m_paint );
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearWipeLeft( KPrObject *object )
+{
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ow = repaintRect.width();
+
+ bool positionReached = false;
+ int w = m_effectStep * m_stepWidth;
+ if ( w >= ow )
+ {
+ w = ow;
+ positionReached = true;
+ }
+
+ repaintRect.setWidth( w );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ drawObject( object, 0, 0, &m_paint, &repaintRect );
+ //kdDebug(33001) << "KPrEffectHandler appearWipeLeft w = " << w << positionReached << endl;
+ return positionReached;
+}
+
+bool KPrEffectHandler::appearWipeRight( KPrObject *object )
+{
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ow = repaintRect.width();
+
+ bool positionReached = false;
+ int w = m_effectStep * m_stepWidth;
+ if ( w >= ow )
+ {
+ w = ow;
+ positionReached = true;
+ }
+
+ repaintRect.setLeft( repaintRect.right() - w );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ drawObject( object, 0, 0, &m_paint, &repaintRect );
+ //kdDebug(33001) << "KPrEffectHandler appearWipeLeft w = " << w << positionReached << endl;
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearWipeTop( KPrObject *object )
+{
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int oh = repaintRect.height();
+
+ bool positionReached = false;
+ int h = m_effectStep * m_stepHeight;
+ if ( h >= oh )
+ {
+ h = oh;
+ positionReached = true;
+ }
+
+ repaintRect.setHeight( h );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ drawObject( object, 0, 0, &m_paint, &repaintRect );
+ //kdDebug(33001) << "KPrEffectHandler appearWipeLeft h = " << h << positionReached << endl;
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::appearWipeBottom( KPrObject *object )
+{
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int oh = repaintRect.height();
+
+ bool positionReached = false;
+ int h = m_effectStep * m_stepHeight;
+ if ( h >= oh )
+ {
+ h = oh;
+ positionReached = true;
+ }
+
+ repaintRect.setTop( repaintRect.bottom() - h );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ drawObject( object, 0, 0, &m_paint, &repaintRect );
+ //kdDebug(33001) << "KPrEffectHandler appearWipeLeft h = " << h << positionReached << endl;
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearGoLeft( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+
+ bool positionReached = false;
+ int x = m_effectStep * m_stepWidth;
+ if ( ox - x <= -objectRect.width() )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.moveBy( -x, 0 );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ //kdDebug(33001) << "KPrEffectHandler disappearGoLeft x = " << -x + ox << " " << positionReached << endl;
+ drawObject( object, -x, 0, &m_paint );
+ }
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearGoTop( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int oy = objectRect.y();
+
+ bool positionReached = false;
+ int y = m_effectStep * m_stepHeight;
+ if ( oy - y <= -objectRect.height() )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.moveBy( 0, -y );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ //kdDebug(33001) << "KPrEffectHandler disappearGoTop y = " << -y + oy << " " << positionReached << endl;
+ drawObject( object, 0, -y, &m_paint );
+ }
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearGoRight( KPrObject *object )
+{
+ int ox = m_view->zoomHandler()->zoomItX( object->getRealRect().x() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+
+ bool positionReached = false;
+ int x = m_effectStep * m_stepWidth;
+ if ( x + ox >= m_src->width() )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.moveBy( x, 0 );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ //kdDebug(33001) << "KPrEffectHandler disappearGoRight x = " << x + ox << " " << positionReached << endl;
+ drawObject( object, x, 0, &m_paint );
+ }
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearGoBottom( KPrObject *object )
+{
+ int oy = m_view->zoomHandler()->zoomItY( object->getRealRect().y() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+
+ bool positionReached = false;
+ int y = m_effectStep * m_stepHeight;
+ if ( oy + y >= m_src->height() )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.moveBy( 0, y );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ //kdDebug(33001) << "KPrEffectHandler disappearGoBottom y = " << y + oy << " " << positionReached << endl;
+ drawObject( object, 0, y, &m_paint );
+ }
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearGoLeftTop( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int oy = objectRect.y();
+
+ bool positionReached = false;
+ int x = m_effectStep * m_stepWidth;
+ int y = m_effectStep * m_stepHeight;
+ if ( ox - x <= -objectRect.width() || oy - y <= -objectRect.height() )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.moveBy( -x, -y );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ //kdDebug(33001) << "KPrEffectHandler disappearGoLeftTop x = " << -x + ox << ", y = " << -y + oy << positionReached << endl;
+ drawObject( object, -x, -y, &m_paint );
+ }
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearGoLeftBottom( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int oy = objectRect.y();
+
+ bool positionReached = false;
+ int x = m_effectStep * m_stepWidth;
+ int y = m_effectStep * m_stepHeight;
+ if ( ox - x <= -objectRect.width() || oy + y >= m_src->height() )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.moveBy( -x, y );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ //kdDebug(33001) << "KPrEffectHandler disappearGoLeftTop x = " << -x + ox << ", y = " << y + oy << positionReached << endl;
+ drawObject( object, -x, y, &m_paint );
+ }
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearGoRightTop( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int oy = objectRect.y();
+
+ bool positionReached = false;
+ int x = m_effectStep * m_stepWidth;
+ int y = m_effectStep * m_stepHeight;
+ if ( ox + x >= m_src->width() || oy - y <= -objectRect.height() )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.moveBy( x, -y );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ //kdDebug(33001) << "KPrEffectHandler disappearGoLeftTop x = " << x + ox << ", y = " << -y + oy << positionReached << endl;
+ drawObject( object, x, -y, &m_paint );
+ }
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearGoRightBottom( KPrObject *object )
+{
+ QRect objectRect = m_view->zoomHandler()->zoomRect( object->getRealRect() );
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ox = objectRect.x();
+ int oy = objectRect.y();
+
+ bool positionReached = false;
+ int x = m_effectStep * m_stepWidth;
+ int y = m_effectStep * m_stepHeight;
+ if ( ox + x >= m_src->width() || oy + y >= m_src->height() )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.moveBy( x, y );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ //kdDebug(33001) << "KPrEffectHandler disappearGoLeftTop x = " << x + ox << ", y = " << y + oy << positionReached << endl;
+ drawObject( object, x, y, &m_paint );
+ }
+
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearWipeLeft( KPrObject *object )
+{
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ow = repaintRect.width();
+
+ bool positionReached = false;
+ int w = ow - m_effectStep * m_stepWidth;
+ if ( w <= 0 )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.setWidth( w );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ drawObject( object, 0, 0, &m_paint, &repaintRect );
+ //kdDebug(33001) << "KPrEffectHandler appearWipeLeft w = " << w << positionReached << endl;
+ }
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearWipeRight( KPrObject *object )
+{
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int ow = repaintRect.width();
+
+ bool positionReached = false;
+ int w = ow - m_effectStep * m_stepWidth;
+ if ( w <= 0 )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.setLeft( repaintRect.right() - w );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ drawObject( object, 0, 0, &m_paint, &repaintRect );
+ //kdDebug(33001) << "KPrEffectHandler appearWipeLeft w = " << w << positionReached << endl;
+ }
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearWipeTop( KPrObject *object )
+{
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int oh = repaintRect.height();
+
+ bool positionReached = false;
+ int h = oh - m_effectStep * m_stepHeight;
+ if ( h <= 0 )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.setHeight( h );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ drawObject( object, 0, 0, &m_paint, &repaintRect );
+ //kdDebug(33001) << "KPrEffectHandler appearWipeLeft h = " << h << positionReached << endl;
+ }
+ return positionReached;
+}
+
+
+bool KPrEffectHandler::disappearWipeBottom( KPrObject *object )
+{
+ QRect repaintRect = m_view->zoomHandler()->zoomRect( object->getRepaintRect() );
+ int oh = repaintRect.height();
+
+ bool positionReached = false;
+ int h = oh - m_effectStep * m_stepHeight;
+ if ( h <= 0 )
+ {
+ positionReached = true;
+ }
+ else
+ {
+ repaintRect.setTop( repaintRect.bottom() - h );
+ m_repaintRects.append( new QRect( repaintRect ) );
+ drawObject( object, 0, 0, &m_paint, &repaintRect );
+ //kdDebug(33001) << "KPrEffectHandler appearWipeLeft h = " << h << positionReached << endl;
+ }
+ return positionReached;
+}
+
+
+void KPrEffectHandler::drawObject( KPrObject *object, int x, int y, QPixmap *screen, QRect *clipRect )
+{
+ QPainter p;
+ p.begin( screen );
+ if ( clipRect )
+ {
+ p.setClipRect( *clipRect, QPainter::CoordPainter );
+ }
+
+ p.translate( x, y );
+
+ if ( object->getAppearStep() == m_step.m_step && ! m_back )
+ {
+ object->setSubPresStep( m_step.m_subStep );
+ object->doSpecificEffects( true );
+ }
+
+ object->draw( &p, m_view->zoomHandler(), m_step.m_pageNumber, SM_NONE, false );
+
+ if ( object->getAppearStep() == m_step.m_step && ! m_back )
+ {
+ object->setSubPresStep( 0 );
+ object->doSpecificEffects( false );
+ }
+
+ p.translate( -x, -y );
+
+ // redraw objects which lie above the currenty drawn
+ m_objects.findRef( object );
+ KPrObject *obj;
+ while ( ( obj = m_objects.next() ) != 0 )
+ {
+ if ( ( obj->getAppearStep() < m_step.m_step
+ || obj->getAppearStep() == m_step.m_step && !m_appearEffectObjects.containsRef( obj ) )
+ && ( ( obj->getDisappear() && obj->getDisappearStep() > m_step.m_step ) || ! obj->getDisappear() )
+ && m_view->zoomHandler()->zoomRect( obj->getRealRect()).intersects(*m_repaintRects.getLast()) )
+ {
+ if ( obj->getAppearStep() == m_step.m_step && ! m_back )
+ {
+ obj->setSubPresStep( m_step.m_subStep );
+ obj->doSpecificEffects( true );
+ }
+ obj->draw( &p, m_view->zoomHandler(), m_step.m_pageNumber, SM_NONE, false );
+ if ( obj->getAppearStep() == m_step.m_step && ! m_back )
+ {
+ obj->setSubPresStep( 0 );
+ obj->doSpecificEffects( false );
+ }
+ }
+ }
+
+ p.end();
+}
diff --git a/kpresenter/KPrEffectHandler.h b/kpresenter/KPrEffectHandler.h
new file mode 100644
index 000000000..8128b2640
--- /dev/null
+++ b/kpresenter/KPrEffectHandler.h
@@ -0,0 +1,345 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef EFFECTHANDLER_H
+#define EFFECTHANDLER_H
+
+#include <qpixmap.h>
+#include <qptrlist.h>
+#include <qstring.h>
+
+#include "global.h"
+#include "presstep.h"
+
+class QPaintDevice;
+class KPrObject;
+class KPrView;
+
+class KPrEffectHandler
+{
+public:
+ /**
+ * Creates an EffectsHandler for the effect step step and the effect sub step subStep.
+ * step the effect step for which the effect should be displayed
+ * subStep the sub effect step for which the effect should be displayed
+ * back set to true if the effect step was reached by going backwards
+ * dst the paint device on which the Effects will be shown
+ * src this pixmap holds the pixmap before any effects are started
+ * objects all objects of the page
+ * view pointer to the active KPrView
+ */
+ KPrEffectHandler( PresStep step, bool back, QPaintDevice *dst, QPixmap *src, const QPtrList<KPrObject> &objects, KPrView *view, int _presSpeed );
+
+ /**
+ * Delete the KPrEffectHandler.
+ */
+ ~KPrEffectHandler();
+
+ /**
+ * doEffect handle the next step of the object effect.
+ * Returns true if all effects in the current step are finished.
+ * In automatic presentation mode:
+ * On the first step it stops the automatic presentation timer.
+ * The automatic presentation timer will be restared when all
+ * effects are done.
+ */
+ bool doEffect();
+
+ /**
+ * Ends the effect for the current step by displaying all objects
+ * on their final position.
+ * In automatic presentation mode:
+ * Restarts the automatic presentation timer.
+ */
+ void finish();
+protected:
+ /**
+ * Calls the right appear effect method for the object object.
+ * Returns true if the effect for the object is finished.
+ */
+ bool doAppearEffectStep( KPrObject *object );
+
+ /**
+ * Calls the right disappear effect method for the object object.
+ * Returns true if the effect for the object is finished.
+ */
+ bool doDisappearEffectStep( KPrObject *object );
+
+ /**
+ * Effect None
+ * The object just appears on its position
+ * Returns allways true as the object is in is final position.
+ */
+ bool appearNone( KPrObject *object );
+
+ /**
+ * Effect Come From Left
+ * The object comes in from the left to its position
+ * Returns true if the object is on its final position.
+ */
+ bool appearComeLeft( KPrObject *object );
+
+ /**
+ * Effect Come From Top
+ * The object comes in from the top to its position
+ * Returns true if the object is on its final position.
+ */
+ bool appearComeTop( KPrObject *object );
+
+ /**
+ * Effect Come From Right
+ * The object comes in from the right to its position
+ * Returns true if the object is on its final position.
+ */
+ bool appearComeRight( KPrObject *object );
+
+ /**
+ * Effect Come From Bottom
+ * The object comes in from the bottom to its position
+ * Returns true if the object is on its final position.
+ */
+ bool appearComeBottom( KPrObject *object );
+
+ /**
+ * Effect Come From Left/Top
+ * The object comes in from the top left corner to its position
+ * Returns true if the object is on its final position.
+ */
+ bool appearComeLeftTop( KPrObject *object );
+
+ /**
+ * Effect Come From Left/Buttom
+ * The object comes in from the bottom left corner to its position
+ * Returns true if the object is on its final position.
+ */
+ bool appearComeLeftBottom( KPrObject *object );
+
+ /**
+ * Effect Come From Right/Top
+ * The object comes in from the top right corner to its position
+ * Returns true if the object is on its final position.
+ */
+ bool appearComeRightTop( KPrObject *object );
+
+ /**
+ * Effect Come From Right/Buttom
+ * The object comes in from the bottom right corner to its position
+ * Returns true if the object is on its final position.
+ */
+ bool appearComeRightBottom( KPrObject *object );
+
+ /**
+ * Effect Wipe From Left
+ * Returns true if the object is fully shown.
+ */
+ bool appearWipeLeft( KPrObject *object );
+
+ /**
+ * Effect Wipe From Right
+ * Returns true if the object is fully shown.
+ */
+ bool appearWipeRight( KPrObject *object );
+
+ /**
+ * Effect Wipe From Top
+ * Returns true if the object is fully shown.
+ */
+ bool appearWipeTop( KPrObject *object );
+
+ /**
+ * Effect Wipe From Bottom
+ * Returns true if the object is fully shown.
+ */
+ bool appearWipeBottom( KPrObject *object );
+
+ /**
+ * Effect Disappear To Left
+ * The object moves from it's position to the left out of the screen
+ * Returns true if the object is out of the screen.
+ */
+ bool disappearGoLeft( KPrObject *object );
+
+ /**
+ * Effect Disappear To Right
+ * The object moves from it's position to the right out of the screen
+ * Returns true if the object is out of the screen.
+ */
+ bool disappearGoRight( KPrObject *object );
+
+ /**
+ * Effect Disappear To Top
+ * The object moves from it's position to the top out of the screen
+ * Returns true if the object is out of the screen.
+ */
+ bool disappearGoTop( KPrObject *object );
+
+ /**
+ * Effect Disappear To Bottom
+ * The object moves from it's position to the bottom out of the screen
+ * Returns true if the object is out of the screen.
+ */
+ bool disappearGoBottom( KPrObject *object );
+
+ /**
+ * Effect Disappear To Left/Top
+ * The object moves from it's position to the top left out of the screen
+ * Returns true if the object is out of the screen.
+ */
+ bool disappearGoLeftTop( KPrObject *object );
+
+ /**
+ * Effect Disappear To Left/Bottom
+ * The object moves from it's position to the bottom left out of the screen
+ * Returns true if the object is out of the screen.
+ */
+ bool disappearGoLeftBottom( KPrObject *object );
+
+ /**
+ * Effect Disappear To Right/Top
+ * The object moves from it's position to the top right out of the screen
+ * Returns true if the object is out of the screen.
+ */
+ bool disappearGoRightTop( KPrObject *object );
+
+ /**
+ * Effect Disappear To Right/Bottom
+ * The object moves from it's position to the bottom right out of the screen
+ * Returns true if the object is out of the screen.
+ */
+ bool disappearGoRightBottom( KPrObject *object );
+
+ /**
+ * Effect Wipe From Left
+ * Returns true if the object is fully shown.
+ */
+ bool disappearWipeLeft( KPrObject *object );
+
+ /**
+ * Effect Wipe From Right
+ * Returns true if the object is fully shown.
+ */
+ bool disappearWipeRight( KPrObject *object );
+
+ /**
+ * Effect Wipe From Top
+ * Returns true if the object is fully shown.
+ */
+ bool disappearWipeTop( KPrObject *object );
+
+ /**
+ * Effect Wipe From Bottom
+ * Returns true if the object is fully shown.
+ */
+ bool disappearWipeBottom( KPrObject *object );
+
+ /**
+ * Draws the object object to the pixmap screen with the offset defined
+ * in x and y. If clipRect is set the only the clipRect will be painted.
+ */
+ void drawObject( KPrObject *object, int x, int y, QPixmap *screen, QRect *clipRect = 0 );
+
+ /**
+ * The internal step of the effect. This is used to calculate the position
+ * of the object.
+ */
+ int m_effectStep;
+
+ /**
+ * The effect step which should be animated.
+ */
+ PresStep m_step;
+
+ /**
+ * True when the effect step was reached by going backwards
+ */
+ bool m_back;
+
+ /**
+ * Paint device on which the effects will be displayed
+ */
+ QPaintDevice *m_dst;
+
+ /**
+ * Pixmap used as source for displaying on.
+ * m_src contains all objects which are allready on the
+ * final position.
+ */
+ QPixmap *m_src;
+
+ /**
+ * Is used for printing all objects before bitblt to m_dst
+ */
+ QPixmap m_paint;
+
+ /**
+ * List of all objects of the current page
+ */
+ QPtrList<KPrObject> m_objects;
+
+ /**
+ * List of all objects which appear in the current step.
+ * If a object has reached its final position it is removed from
+ * this list
+ */
+ QPtrList<KPrObject> m_appearEffectObjects;
+
+ /**
+ * List of all objects which disappear in the current step.
+ * If a object has disappeared it is removed from this list
+ */
+ QPtrList<KPrObject> m_disappearEffectObjects;
+
+ /// the active KPrView
+ KPrView *m_view;
+
+ /**
+ * The width of a step.
+ */
+ int m_stepWidth;
+
+ /**
+ * The height of a step.
+ */
+ int m_stepHeight;
+
+ /**
+ * The rects which have to be bitblt
+ */
+ QPtrList<QRect> m_repaintRects;
+
+ /**
+ * The rects which have to be bitblt as the objects
+ * are no longer there.
+ */
+ QPtrList<QRect> m_lastRepaintRects;
+
+ /**
+ * The filename of the sound file which should be played during the effect.
+ */
+ QString m_soundEffect;
+
+ /**
+ * Used the set the autopresentation timer.
+ */
+ int m_objectTimer;
+};
+
+
+#endif /* EFFECTHANDLER_H */
diff --git a/kpresenter/KPrEllipseObject.cpp b/kpresenter/KPrEllipseObject.cpp
new file mode 100644
index 000000000..d20f540fe
--- /dev/null
+++ b/kpresenter/KPrEllipseObject.cpp
@@ -0,0 +1,128 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#include "KPrObject2DIface.h"
+#include "KPrEllipseObject.h"
+#include "KPrGradient.h"
+
+#include <kdebug.h>
+#include <qbitmap.h>
+#include <qregion.h>
+#include <qdom.h>
+#include <qpicture.h>
+#include <qpainter.h>
+#include <KoTextZoomHandler.h>
+#include <KoOasisContext.h>
+
+using namespace std;
+
+KPrEllipseObject::KPrEllipseObject()
+ : KPr2DObject()
+{
+}
+
+KPrEllipseObject::KPrEllipseObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType,
+ const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor)
+ : KPr2DObject( _pen, _brush, _fillType, _gColor1, _gColor2, _gType, _unbalanced, _xfactor, _yfactor )
+{
+}
+
+KPrEllipseObject &KPrEllipseObject::operator=( const KPrEllipseObject & )
+{
+ return *this;
+}
+
+DCOPObject* KPrEllipseObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrObject2DIface( this );
+ return dcop;
+}
+
+void KPrEllipseObject::paint( QPainter* _painter, KoTextZoomHandler *_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour )
+{
+ int ow = _zoomHandler->zoomItX( ext.width() );
+ int oh = _zoomHandler->zoomItY( ext.height() );
+ QSize size( _zoomHandler->zoomSize( ext ) );
+
+ if ( drawContour ) {
+ QPen pen3( Qt::black, 1, Qt::DotLine );
+ _painter->setPen( pen3 );
+ _painter->setRasterOp( Qt::NotXorROP );
+ _painter->drawEllipse( 0, 0, ow, oh );
+ return;
+ }
+
+ QPen pen2 = pen.zoomedPen( _zoomHandler );
+ int pw = ( pen2.style() == Qt::NoPen ) ? 1 : pen2.width();
+ _painter->setPen( pen2 );
+
+ if ( drawingShadow || getFillType() == FT_BRUSH || !gradient )
+ _painter->setBrush( getBrush() );
+ else {
+ if ( m_redrawGradientPix || gradient->size() != size ) {
+ m_redrawGradientPix = false;
+ gradient->setSize( size );
+ QRegion clipregion( 0, 0, ow - pw + 1, oh - pw + 1, QRegion::Ellipse );
+ m_gradientPix.resize ( ow, oh );
+ m_gradientPix.fill( Qt::white );
+ QPainter p;
+ p.begin( &m_gradientPix );
+ p.setClipRegion( clipregion );
+ p.drawPixmap( 0, 0, gradient->pixmap() );
+ p.end();
+
+ m_gradientPix.setMask( m_gradientPix.createHeuristicMask() );
+ }
+
+ _painter->drawPixmap( pw / 2, pw / 2, m_gradientPix, 0, 0, ow - pw + 1, oh - pw + 1 );
+
+ _painter->setBrush( Qt::NoBrush );
+ }
+ _painter->drawEllipse( pw / 2, pw / 2, ow - pw + 1, oh - pw + 1 );
+}
+
+KoSize KPrEllipseObject::getRealSize() const {
+ KoSize size = ext;
+
+ if ( angle != 0.0 ) {
+ float angInRad = angle * M_PI / 180;
+ size.setWidth( sqrt( pow ( ext.width() * cos( angInRad ), 2) +
+ pow ( ext.height() * sin( angInRad ) ,2 ) ) );
+ size.setHeight( sqrt( pow ( ext.width() * sin( angInRad ), 2) +
+ pow ( ext.height() * cos( angInRad ) ,2 ) ) );
+ }
+
+ return size;
+}
+
+bool KPrEllipseObject::saveOasisObjectAttributes( KPOasisSaveContext &/*sc*/ ) const
+{
+ // nothing to do
+ return true;
+}
+
+const char * KPrEllipseObject::getOasisElementName() const
+{
+ return ext.width() == ext.height() ? "draw:circle" : "draw:ellipse";
+}
+
diff --git a/kpresenter/KPrEllipseObject.h b/kpresenter/KPrEllipseObject.h
new file mode 100644
index 000000000..36349b8c4
--- /dev/null
+++ b/kpresenter/KPrEllipseObject.h
@@ -0,0 +1,64 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpellipseobject_h
+#define kpellipseobject_h
+
+#include <KoBrush.h>
+
+#include "KPrObject.h"
+#include "global.h"
+
+class KPrGradient;
+class QPainter;
+class DCOPObject;
+
+class KPrEllipseObject : public KPr2DObject
+{
+public:
+ KPrEllipseObject();
+ KPrEllipseObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType,
+ const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor );
+ virtual ~KPrEllipseObject() {}
+
+ virtual DCOPObject* dcopObject();
+
+
+ KPrEllipseObject &operator=( const KPrEllipseObject & );
+
+ virtual ObjType getType() const
+ { return OT_ELLIPSE; }
+ virtual QString getTypeString() const
+ { return i18n("Ellipse"); }
+
+ virtual KoSize getRealSize() const;
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+
+ virtual void paint( QPainter *_painter,KoTextZoomHandler *_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour = FALSE );
+
+};
+
+#endif
diff --git a/kpresenter/KPrFactory.cpp b/kpresenter/KPrFactory.cpp
new file mode 100644
index 000000000..7fb6ebcda
--- /dev/null
+++ b/kpresenter/KPrFactory.cpp
@@ -0,0 +1,84 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrFactory.h"
+#include "KPrDocument.h"
+#include "KPrAboutData.h"
+
+#include <kstandarddirs.h>
+#include <kinstance.h>
+
+
+KInstance* KPrFactory::s_global = 0;
+KAboutData* KPrFactory::s_aboutData = 0;
+
+KPrFactory::KPrFactory( QObject* parent, const char* name )
+ : KoFactory( parent, name )
+{
+ (void)global();
+}
+
+KPrFactory::~KPrFactory()
+{
+ delete s_aboutData;
+ s_aboutData=0;
+ delete s_global;
+ s_global=0;
+}
+
+KParts::Part* KPrFactory::createPartObject( QWidget *parentWidget, const char *widgetName, QObject* parent,
+ const char* name, const char* classname, const QStringList & )
+{
+ bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 );
+
+ KPrDocument *doc = new KPrDocument( parentWidget, widgetName, parent, name, !bWantKoDocument );
+
+ if ( !bWantKoDocument )
+ doc->setReadWrite( false );
+
+ return doc;
+}
+
+KAboutData* KPrFactory::aboutData()
+{
+ if( !s_aboutData )
+ s_aboutData=newKPresenterAboutData();
+ return s_aboutData;
+}
+
+KInstance* KPrFactory::global()
+{
+ if ( !s_global )
+ {
+ s_global = new KInstance(aboutData());
+
+ s_global->dirs()->addResourceType("kpresenter_template",
+ KStandardDirs::kde_default("data") + "kpresenter/templates/");
+ s_global->dirs()->addResourceType("autoforms",
+ KStandardDirs::kde_default("data") + "kpresenter/autoforms/");
+ s_global->dirs()->addResourceType("slideshow",
+ KStandardDirs::kde_default("data") + "kpresenter/slideshow/");
+ // Tell the iconloader about share/apps/koffice/icons
+ s_global->iconLoader()->addAppDir("koffice");
+ }
+ return s_global;
+}
+
+#include "KPrFactory.moc"
diff --git a/kpresenter/KPrFactory.h b/kpresenter/KPrFactory.h
new file mode 100644
index 000000000..35f1a6014
--- /dev/null
+++ b/kpresenter/KPrFactory.h
@@ -0,0 +1,48 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRESENTER_FACTORY_H
+#define KPRESENTER_FACTORY_H
+
+#include <KoFactory.h>
+class KAboutData;
+
+class KPrFactory : public KoFactory
+{
+ Q_OBJECT
+public:
+ KPrFactory( QObject* parent = 0, const char* name = 0 );
+ ~KPrFactory();
+
+ virtual KParts::Part *createPartObject( QWidget *parentWidget = 0, const char *widgetName = 0, QObject *parent = 0,
+ const char *name = 0, const char *classname = "KoDocument",
+ const QStringList &args = QStringList() );
+
+ static KInstance* global();
+
+ // _Creates_ a KAboutData but doesn't keep ownership
+ static KAboutData* aboutData();
+
+private:
+ static KInstance* s_global;
+ static KAboutData* s_aboutData;
+};
+
+#endif
diff --git a/kpresenter/KPrFactoryInit.cpp b/kpresenter/KPrFactoryInit.cpp
new file mode 100644
index 000000000..9b745c819
--- /dev/null
+++ b/kpresenter/KPrFactoryInit.cpp
@@ -0,0 +1,24 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 David Faure <faure@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrFactory.h"
+
+K_EXPORT_COMPONENT_FACTORY( libkpresenterpart, KPrFactory )
+
diff --git a/kpresenter/KPrFindReplace.cpp b/kpresenter/KPrFindReplace.cpp
new file mode 100644
index 000000000..ba268f000
--- /dev/null
+++ b/kpresenter/KPrFindReplace.cpp
@@ -0,0 +1,64 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001, Laurent Montel <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <kdebug.h>
+#include "KPrFindReplace.h"
+#include "KPrCanvas.h"
+#include "KPrView.h"
+#include "KPrDocument.h"
+#include "KPrTextObject.h"
+#include <KoTextObject.h>
+#include <kcommand.h>
+#include <KoSearchDia.h>
+#include "KPrTextDocument.h"
+
+KPrFindReplace::KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoSearchDia * dialog,
+ const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView)
+ : KoFindReplace( parent, dialog, lstObjects, textView )
+{
+ m_canvas = canvas;
+}
+
+KPrFindReplace::KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoReplaceDia * dialog,
+ const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView )
+ : KoFindReplace( parent, dialog, lstObjects, textView )
+{
+ m_canvas = canvas;
+}
+
+KPrFindReplace::~KPrFindReplace()
+{
+ //kdDebug(33001)() << "KPrFindReplace::~KPrFindReplace m_destroying=" << m_destroying << endl;
+}
+
+void KPrFindReplace::emitNewCommand(KCommand *cmd)
+{
+ m_canvas->getView()->kPresenterDoc()->addCommand(cmd);
+}
+
+void KPrFindReplace::highlightPortion(KoTextParag * parag, int index, int length, KoTextDocument *_textdoc, KDialogBase* dialog)
+{
+ bool repaint = isReplace() ? options() & KReplaceDialog::PromptOnReplace : true;
+ KPrTextDocument *textdoc = static_cast<KPrTextDocument *>(_textdoc);
+ KPrTextObject* textobj = textdoc->textObject();
+ textobj->highlightPortion( parag, index, length, m_canvas, repaint, dialog );
+}
+
+#include "KPrFindReplace.moc"
diff --git a/kpresenter/KPrFindReplace.h b/kpresenter/KPrFindReplace.h
new file mode 100644
index 000000000..87f2799b0
--- /dev/null
+++ b/kpresenter/KPrFindReplace.h
@@ -0,0 +1,63 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001, Laurent Montel <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef searchdia_h
+#define searchdia_h
+
+#include "KPrTextObject.h"
+#include <KoSearchDia.h>
+
+class KPrCanvas;
+class KMacroCommand;
+class KPrTextView;
+class KoTextObject;
+class KoFindReplace;
+class KoReplaceDia;
+class KoSearchDia;
+class KPrTextView;
+class KPrFindReplace;
+class KCommand;
+/**
+ * This class implements the 'find' functionality ( the "search next, prompt" loop )
+ * and the 'replace' functionality. Same class, to allow centralizing the code that
+ * finds the framesets and paragraphs to look into.
+ */
+class KPrFindReplace : public KoFindReplace
+{
+ Q_OBJECT
+public:
+ /**
+ * The parent widget can't be the canvas, otherwise the 'find next' dialog
+ * scrolls up/down when using the scrollbars (hehe, cool effect).
+ */
+ KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoSearchDia * dialog,
+ const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView );
+ KPrFindReplace( QWidget* parent, KPrCanvas * canvas, KoReplaceDia * dialog,
+ const QValueList<KoTextObject *> & lstObjects, KPrTextView *textView );
+ ~KPrFindReplace();
+
+ virtual void emitNewCommand(KCommand *);
+ virtual void highlightPortion(KoTextParag * parag, int index, int length, KoTextDocument *textdoc, KDialogBase* dialog);
+
+private:
+ KPrCanvas *m_canvas;
+};
+
+#endif
diff --git a/kpresenter/KPrFreehandObject.cpp b/kpresenter/KPrFreehandObject.cpp
new file mode 100644
index 000000000..662c9a3c0
--- /dev/null
+++ b/kpresenter/KPrFreehandObject.cpp
@@ -0,0 +1,106 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#include "KPrFreehandObjectIface.h"
+#include "KPrFreehandObject.h"
+#include "KPrUtils.h"
+#include <KoTextZoomHandler.h>
+#include <qpainter.h>
+#include <qwmatrix.h>
+#include <qdom.h>
+
+#include <kdebug.h>
+#include <math.h>
+using namespace std;
+
+KPrFreehandObject::KPrFreehandObject()
+ : KPrPointObject()
+{
+}
+
+KPrFreehandObject::KPrFreehandObject( const KoPointArray &_points, const KoSize &_size,
+ const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd )
+ : KPrPointObject( _pen, _lineBegin, _lineEnd )
+{
+ points = KoPointArray( _points );
+ ext = _size;
+}
+
+KPrFreehandObject &KPrFreehandObject::operator=( const KPrFreehandObject & )
+{
+ return *this;
+}
+
+DCOPObject* KPrFreehandObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrFreehandObjectIface( this );
+ return dcop;
+}
+
+bool KPrFreehandObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ // the rect for the view box have to be the rect and not the real rect
+ KoRect rect( getRect() );
+ sc.xmlWriter.addAttribute("svg:viewBox", QString( "0 0 %1 %2" ).arg( int( rect.width() * 100 ) )
+ .arg( int( rect.height() * 100 ) ) );
+ unsigned int pointCount = points.count();
+ unsigned int pos = 0;
+
+ QString d;
+ d += QString( "M%1 %2" ).arg( int( points.at(pos).x() * 100 ) )
+ .arg( int( points.at(pos).y() * 100 ) );
+ ++pos;
+
+ while ( pos < pointCount )
+ {
+ d += QString( "L%1 %2" ).arg( int( points.at( pos ).x() * 100 ) )
+ .arg( int( points.at( pos ).y() * 100 ) );
+ ++pos;
+ }
+
+ sc.xmlWriter.addAttribute( "svg:d", d );
+
+ return true;
+}
+
+const char * KPrFreehandObject::getOasisElementName() const
+{
+ return "draw:path";
+}
+
+void KPrFreehandObject::loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo* info )
+{
+ kdDebug(33001) << "KPrFreehandObject::loadOasis" << endl;
+ KPrPointObject::loadOasis( element, context, info );
+
+ //load marker
+ loadOasisMarker( context );
+}
+
+QDomDocumentFragment KPrFreehandObject::save( QDomDocument& doc,double offset )
+{
+ return KPrPointObject::save( doc, offset );
+}
+
+double KPrFreehandObject::load( const QDomElement &element )
+{
+ return KPrPointObject::load( element );
+}
diff --git a/kpresenter/KPrFreehandObject.h b/kpresenter/KPrFreehandObject.h
new file mode 100644
index 000000000..17bab0b7f
--- /dev/null
+++ b/kpresenter/KPrFreehandObject.h
@@ -0,0 +1,54 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpfreehandobject_h
+#define kpfreehandobject_h
+
+#include "KPrPointObject.h"
+
+class QPainter;
+class DCOPObject;
+class KoXmlWriter;
+
+class KPrFreehandObject : public KPrPointObject
+{
+public:
+ KPrFreehandObject();
+ KPrFreehandObject( const KoPointArray &_points, const KoSize &_size, const KoPen &_pen,
+ LineEnd _lineBegin, LineEnd _lineEnd );
+ virtual ~KPrFreehandObject() {}
+ virtual DCOPObject* dcopObject();
+
+ KPrFreehandObject &operator=( const KPrFreehandObject & );
+
+ virtual ObjType getType() const { return OT_FREEHAND; }
+ virtual QString getTypeString() const { return i18n("Freehand"); }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc,double offset );
+ virtual double load( const QDomElement &element );
+ virtual void loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo* info );
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+};
+
+#endif
diff --git a/kpresenter/KPrFreehandObjectIface.cpp b/kpresenter/KPrFreehandObjectIface.cpp
new file mode 100644
index 000000000..8aab6f98a
--- /dev/null
+++ b/kpresenter/KPrFreehandObjectIface.cpp
@@ -0,0 +1,67 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrFreehandObjectIface.h"
+#include "KPrFreehandObject.h"
+#include "KPrUtils.h"
+#include <kdebug.h>
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrFreehandObjectIface::KPrFreehandObjectIface( KPrFreehandObject *_obj )
+ : KPrObjectIface(_obj)
+{
+ obj = _obj;
+}
+
+void KPrFreehandObjectIface::setLineBegin( const QString & type)
+{
+ obj->setLineBegin(lineEndBeginFromString( type ));
+}
+
+void KPrFreehandObjectIface::setLineEnd( const QString & type)
+{
+ obj->setLineEnd(lineEndBeginFromString( type ));
+}
+
+QString KPrFreehandObjectIface::lineBegin()const
+{
+ LineEnd type=obj->getLineBegin();
+ return lineEndBeginName( type );
+}
+
+QString KPrFreehandObjectIface::lineEnd() const
+{
+ LineEnd type=obj->getLineEnd();
+ return lineEndBeginName( type );
+}
+
+void KPrFreehandObjectIface::horizontalFlip()
+{
+ //todo repaint it
+ obj->flip(true );
+}
+
+void KPrFreehandObjectIface::verticalFlip()
+{
+ //todo repaint it
+ obj->flip( false );
+}
diff --git a/kpresenter/KPrFreehandObjectIface.h b/kpresenter/KPrFreehandObjectIface.h
new file mode 100644
index 000000000..2ead4e5aa
--- /dev/null
+++ b/kpresenter/KPrFreehandObjectIface.h
@@ -0,0 +1,50 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPFREEHAND_OBJECT_IFACE_H
+#define KPFREEHAND_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObjectIface.h"
+#include <qstring.h>
+
+class KPrFreehandObject;
+
+class KPrFreehandObjectIface : public KPrObjectIface
+{
+ K_DCOP
+public:
+ KPrFreehandObjectIface( KPrFreehandObject *obj_ );
+
+k_dcop:
+
+ void setLineBegin( const QString & );
+ void setLineEnd( const QString & );
+ QString lineBegin()const;
+ QString lineEnd() const;
+ void horizontalFlip();
+ void verticalFlip();
+
+private:
+ KPrFreehandObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrGeneralProperty.cpp b/kpresenter/KPrGeneralProperty.cpp
new file mode 100644
index 000000000..e07bf84c1
--- /dev/null
+++ b/kpresenter/KPrGeneralProperty.cpp
@@ -0,0 +1,254 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#include "KPrGeneralProperty.h"
+
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+
+#include <knuminput.h>
+#include <klocale.h>
+#include <KoUnitWidgets.h>
+
+#include <KoGeneralPropertyUi.h>
+
+KPrGeneralProperty::KPrGeneralProperty( QWidget *parent, const char *name, GeneralValue &generalValue, KoUnit::Unit unit )
+: QWidget( parent, name )
+, m_ratio( 1.0 )
+, m_generalValue( generalValue )
+, m_unit( unit )
+{
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->addWidget( m_ui = new KoGeneralPropertyUI( this ) );
+
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ layout->addItem( spacer );
+
+ if ( m_generalValue.m_name.isNull() )
+ {
+ m_ui->nameLabel->setEnabled( false );
+ m_ui->nameInput->setEnabled( false );
+ }
+ else
+ {
+ m_ui->nameInput->setText( m_generalValue.m_name );
+ }
+
+ m_ui->positionGroup->setTitle( i18n( "Position" ) );
+
+ connect( m_ui->protect, SIGNAL( toggled( bool ) ), this, SLOT( slotProtectToggled( bool ) ) );
+ connect( m_ui->keepRatio, SIGNAL( toggled( bool ) ), this, SLOT( slotKeepRatioToggled( bool ) ) );
+
+ double dStep = KoUnit::fromUserValue( 0.5, m_unit );
+ double dMax = KoUnit::fromUserValue( 9999, m_unit );
+ m_ui->xInput->setUnit( m_unit );
+ m_ui->xInput->setMinMaxStep( 0, dMax, dStep );
+
+ m_ui->yInput->setUnit( m_unit );
+ m_ui->yInput->setMinMaxStep( 0, dMax, dStep );
+
+ m_ui->widthInput->setUnit( m_unit );
+ m_ui->widthInput->setMinMaxStep( 0, dMax, dStep );
+ connect( m_ui->widthInput, SIGNAL( valueChanged( double ) ), this, SLOT( slotWidthChanged( double ) ) );
+
+ m_ui->heightInput->setUnit( m_unit );
+ m_ui->heightInput->setMinMaxStep( 0, dMax, dStep );
+ connect( m_ui->heightInput, SIGNAL( valueChanged( double ) ), this, SLOT( slotHeightChanged( double ) ) );
+ slotReset();
+}
+
+
+KPrGeneralProperty::~KPrGeneralProperty()
+{
+}
+
+
+int KPrGeneralProperty::getGeneralPropertyChange() const
+{
+ int flags = 0;
+
+ if ( !m_generalValue.m_name.isNull() && m_generalValue.m_name != m_ui->nameInput->text() )
+ flags |= Name;
+
+ if ( m_ui->protect->state() != QButton::NoChange )
+ {
+ if ( ( m_ui->protect->isOn() ? STATE_ON : STATE_OFF ) != m_generalValue.m_protect )
+ flags |= Protect;
+
+ if ( !m_ui->protect->isOn() )
+ {
+ KoRect rect = getRect();
+ if ( m_generalValue.m_rect.left() != rect.left() )
+ flags |= Left;
+ if ( m_generalValue.m_rect.top() != rect.top() )
+ flags |= Top;
+ // this has to be done as the rect cahnges width/hight if left or top is changed
+ if ( QABS( m_generalValue.m_rect.width() - rect.width() ) > 1e-6 )
+ flags |= Width;
+ if ( QABS( m_generalValue.m_rect.height() - rect.height() ) > 1e-6 )
+ flags |= Height;
+ }
+ }
+
+ if ( m_ui->keepRatio->state() != QButton::NoChange
+ && ( m_ui->keepRatio->isOn() ? STATE_ON : STATE_OFF ) != m_generalValue.m_keepRatio )
+ {
+ flags |= KeepRatio;
+ }
+
+ return flags;
+}
+
+
+KPrGeneralProperty::GeneralValue KPrGeneralProperty::getGeneralValue() const
+{
+ GeneralValue generalValue;
+ generalValue.m_name = m_ui->nameInput->isEnabled() ? m_ui->nameInput->text() : QString();
+ generalValue.m_protect = m_ui->protect->isOn() ? STATE_ON : STATE_OFF;
+ generalValue.m_keepRatio = m_ui->keepRatio->isOn() ? STATE_ON : STATE_OFF;
+ generalValue.m_rect = getRect();
+ return generalValue;
+}
+
+
+void KPrGeneralProperty::apply()
+{
+ int flags = getGeneralPropertyChange();
+
+ if ( flags & Name )
+ m_generalValue.m_name = m_ui->nameInput->text();
+
+ if ( flags & Protect )
+ m_generalValue.m_protect = m_ui->protect->isOn() ? STATE_ON : STATE_OFF;
+
+ if ( flags & KeepRatio )
+ m_generalValue.m_keepRatio = m_ui->keepRatio->isOn() ? STATE_ON : STATE_OFF;
+
+ // get the values to the actual rect
+ m_generalValue.m_rect = getRect();
+}
+
+
+KoRect KPrGeneralProperty::getRect() const
+{
+ double x = QMAX( 0, m_ui->xInput->value() );
+ double y = QMAX( 0, m_ui->yInput->value() );
+ double w = QMAX( 0, m_ui->widthInput->value() );
+ double h = QMAX( 0, m_ui->heightInput->value() );
+
+ KoRect rect( x, y, w, h );
+ return rect;
+}
+
+
+void KPrGeneralProperty::setRect( KoRect &rect )
+{
+ m_ui->xInput->changeValue( QMAX( 0.00, rect.left() ) );
+ m_ui->yInput->changeValue( QMAX( 0.00, rect.top() ) );
+ m_ui->widthInput->changeValue( QMAX( 0.00, rect.width() ) );
+ m_ui->heightInput->changeValue( QMAX( 0.00, rect.height() ) );
+}
+
+
+void KPrGeneralProperty::slotReset()
+{
+ switch ( m_generalValue.m_protect )
+ {
+ case STATE_ON:
+ m_ui->protect->setChecked( true );
+ break;
+ case STATE_OFF:
+ m_ui->protect->setChecked( false );
+ break;
+ case STATE_UNDEF:
+ m_ui->protect->setTristate( true );
+ m_ui->protect->setNoChange();
+ break;
+ default:
+ m_ui->protect->setChecked( false );
+ break;
+ }
+
+ switch ( m_generalValue.m_keepRatio )
+ {
+ case STATE_ON:
+ m_ui->keepRatio->setChecked( true );
+ break;
+ case STATE_OFF:
+ m_ui->keepRatio->setChecked( false );
+ break;
+ case STATE_UNDEF:
+ m_ui->keepRatio->setTristate( true );
+ m_ui->keepRatio->setNoChange();
+ break;
+ default:
+ m_ui->keepRatio->setChecked( false );
+ break;
+ }
+
+ setRect( m_generalValue.m_rect );
+ // this is done due to the rounding so we can detect a change
+ m_generalValue.m_rect = getRect();
+}
+
+
+void KPrGeneralProperty::slotProtectToggled( bool state )
+{
+ m_ui->positionGroup->setEnabled( !state );
+}
+
+
+void KPrGeneralProperty::slotKeepRatioToggled( bool state )
+{
+ if ( state )
+ {
+ if ( m_ui->widthInput->value() == 0 )
+ {
+ m_ratio = 1.0;
+ }
+ else
+ {
+ m_ratio = m_ui->heightInput->value() / m_ui->widthInput->value();
+ }
+ }
+}
+
+
+void KPrGeneralProperty::slotWidthChanged( double value )
+{
+ if ( m_ui->keepRatio->isChecked() )
+ {
+ m_ui->heightInput->setValue( value * m_ratio );
+ }
+}
+
+
+void KPrGeneralProperty::slotHeightChanged( double value )
+{
+ if ( m_ui->keepRatio->isChecked() && m_ratio != 0 )
+ {
+ m_ui->widthInput->setValue( value / m_ratio );
+ }
+}
+
+
+#include "KPrGeneralProperty.moc"
diff --git a/kpresenter/KPrGeneralProperty.h b/kpresenter/KPrGeneralProperty.h
new file mode 100644
index 000000000..bc6f16657
--- /dev/null
+++ b/kpresenter/KPrGeneralProperty.h
@@ -0,0 +1,82 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#ifndef GENERALPROPERTY_H
+#define GENERALPROPERTY_H
+
+#include <qwidget.h>
+#include <global.h>
+
+#include <KoRect.h>
+#include <KoUnit.h>
+
+class KoGeneralPropertyUI;
+
+class KPrGeneralProperty : public QWidget
+{
+ Q_OBJECT
+public:
+ struct GeneralValue
+ {
+ GeneralValue()
+ {}
+ QString m_name;
+ PropValue m_keepRatio;
+ PropValue m_protect;
+ KoRect m_rect;
+ };
+
+ enum GeneralConfigChange
+ {
+ Name = 1,
+ Protect = 2,
+ KeepRatio = 4,
+ Left = 8,
+ Top = 16,
+ Width = 32,
+ Height = 64
+ };
+
+ KPrGeneralProperty( QWidget *parent, const char *name, GeneralValue &generalValue, KoUnit::Unit unit );
+ ~KPrGeneralProperty();
+
+ int getGeneralPropertyChange() const;
+ GeneralValue getGeneralValue() const;
+
+ void apply();
+
+protected:
+ KoRect getRect() const;
+ void setRect( KoRect &rect );
+
+ KoGeneralPropertyUI *m_ui;
+ double m_ratio;
+
+ GeneralValue m_generalValue;
+ KoUnit::Unit m_unit;
+
+protected slots:
+ void slotReset();
+ void slotProtectToggled( bool state );
+ void slotKeepRatioToggled( bool state );
+ void slotWidthChanged( double value );
+ void slotHeightChanged( double value );
+};
+
+#endif /* GENERALPROPERTY_H */
diff --git a/kpresenter/KPrGotoPage.cpp b/kpresenter/KPrGotoPage.cpp
new file mode 100644
index 000000000..44f372d1a
--- /dev/null
+++ b/kpresenter/KPrGotoPage.cpp
@@ -0,0 +1,91 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrGotoPage.h"
+
+#include <qlabel.h>
+#include <qlistbox.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+
+#include <klocale.h>
+#include <kdialog.h>
+
+#include "KPrDocument.h"
+#include "KPrPage.h"
+
+KPrGotoPage::KPrGotoPage( const KPrDocument *doc,
+ const QValueList<int> &slides, int start,
+ QWidget *parent, const char *name )
+ : KDialogBase( parent, name, true, i18n("Goto Slide..."), Ok|Cancel),
+ oldPage(start)
+{
+
+ QWidget *page = new QWidget( this );
+ setMainWidget(page);
+ QVBoxLayout *ml = new QVBoxLayout( page, KDialog::marginHint(),
+ KDialog::spacingHint());
+ QLabel *label = new QLabel( i18n( "Go to slide:" ), page );
+ ml->addWidget( label );
+ spinbox = new QListBox( page );
+ connect( spinbox, SIGNAL(doubleClicked( QListBoxItem* )),
+ this, SLOT(accept()) );
+ connect( spinbox, SIGNAL(returnPressed( QListBoxItem* )),
+ this, SLOT(accept()) );
+ ml->addWidget( spinbox );
+
+ QPtrList<KPrPage> pageList = doc->getPageList(); // because of const doc, we can't do doc->pageList()->at()
+ QValueList<int>::ConstIterator it = slides.begin();
+ for ( ; it != slides.end(); ++it ) {
+ QString t( pageList.at( (*it) - 1 )->pageTitle() );
+ // cut ultra long titles...
+ if(t.length() > 30) {
+ t.truncate(30);
+ t+="...";
+ }
+ spinbox->insertItem( QString( "%1 - %2" ).arg( *it ).arg( t ), -1 );
+ if ( *it == start )
+ spinbox->setCurrentItem( spinbox->count()-1 );
+ }
+
+ if ( parent )
+ parent->setCursor( Qt::forbiddenCursor );
+}
+
+int KPrGotoPage::gotoPage( const KPrDocument *doc,
+ const QValueList<int> &slides, int start,
+ QWidget *parent)
+{
+ KPrGotoPage dia( doc, slides, start,parent, 0L );
+ dia.exec();
+ dia.resetCursor();
+ return dia.page();
+}
+
+int KPrGotoPage::page() const {
+ if(result()==QDialog::Accepted)
+ return spinbox->currentText().left( spinbox->currentText().find( "-" ) - 1 ).toInt();
+ return oldPage;
+}
+
+void KPrGotoPage::resetCursor() {
+ if ( parentWidget() )
+ parentWidget()->setCursor( Qt::blankCursor );
+}
diff --git a/kpresenter/KPrGotoPage.h b/kpresenter/KPrGotoPage.h
new file mode 100644
index 000000000..2b96d4d62
--- /dev/null
+++ b/kpresenter/KPrGotoPage.h
@@ -0,0 +1,53 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef gotopage_h
+#define gotopage_h
+
+#include <kdialogbase.h>
+#include <qvaluelist.h>
+
+class QWidget;
+class QObject;
+class QResizeEvent;
+class QListBox;
+class KPrDocument;
+
+class KPrGotoPage : public KDialogBase
+{
+public:
+ KPrGotoPage( const KPrDocument *doc,
+ const QValueList<int> &slides, int start,
+ QWidget *parent = 0L, const char *name = 0L );
+
+ static int gotoPage( const KPrDocument *doc,
+ const QValueList<int> &slides, int start,
+ QWidget *parent = 0L );
+
+ int page() const;
+
+private:
+ void resetCursor();
+
+ QListBox *spinbox;
+ int oldPage;
+};
+
+#endif
diff --git a/kpresenter/KPrGradient.cpp b/kpresenter/KPrGradient.cpp
new file mode 100644
index 000000000..89728ece7
--- /dev/null
+++ b/kpresenter/KPrGradient.cpp
@@ -0,0 +1,136 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrGradient.h"
+#include <qpainter.h>
+#include <kpixmapeffect.h>
+#include <kdebug.h>
+#include <KoTextZoomHandler.h>
+
+KPrGradient::KPrGradient( const QColor &_color1, const QColor &_color2, BCType _bcType,
+ bool _unbalanced, int _xfactor, int _yfactor )
+ : color1( _color1 ), color2( _color2 ), bcType( _bcType ),
+ m_pixmap(), refCount( 0 ),
+ xFactor( _xfactor ), yFactor( _yfactor ),
+ unbalanced( _unbalanced ), m_bDirty( true )
+{
+ //m_pixmap.resize( _size );
+}
+
+void KPrGradient::setParameters(const QColor &c1, const QColor &c2, BCType _type,
+ bool _unbalanced, int xf, int yf) {
+ color1=c1;
+ color2=c2;
+ bcType=_type;
+ unbalanced=_unbalanced;
+ xFactor=xf;
+ yFactor=yf;
+ m_bDirty = true;
+}
+
+void KPrGradient::addRef()
+{
+ ++refCount;
+}
+
+bool KPrGradient::removeRef()
+{
+ return ( --refCount == 0 );
+}
+
+void KPrGradient::paint()
+{
+ QPainter painter;
+ switch ( bcType ) {
+ case BCT_PLAIN:
+ painter.begin( &m_pixmap );
+
+ painter.setPen( Qt::NoPen );
+ painter.setBrush( color1 );
+ painter.drawRect( m_pixmap.rect() );
+
+ painter.end();
+ break;
+ case BCT_GHORZ: {
+ if ( !unbalanced )
+ KPixmapEffect::gradient( m_pixmap, color1, color2, KPixmapEffect::VerticalGradient );
+ else
+ KPixmapEffect::unbalancedGradient( m_pixmap, color1, color2, KPixmapEffect::VerticalGradient,
+ xFactor, yFactor );
+ } break;
+ case BCT_GVERT: {
+ if ( !unbalanced )
+ KPixmapEffect::gradient( m_pixmap, color1, color2, KPixmapEffect::HorizontalGradient );
+ else
+ KPixmapEffect::unbalancedGradient( m_pixmap, color1, color2, KPixmapEffect::HorizontalGradient,
+ xFactor, yFactor );
+ } break;
+ case BCT_GDIAGONAL1: {
+ if ( !unbalanced )
+ KPixmapEffect::gradient( m_pixmap, color1, color2, KPixmapEffect::DiagonalGradient );
+ else
+ KPixmapEffect::unbalancedGradient( m_pixmap, color1, color2, KPixmapEffect::DiagonalGradient,
+ xFactor, yFactor );
+ } break;
+ case BCT_GDIAGONAL2: {
+ if ( !unbalanced )
+ KPixmapEffect::gradient( m_pixmap, color1, color2, KPixmapEffect::CrossDiagonalGradient );
+ else
+ KPixmapEffect::unbalancedGradient( m_pixmap, color1, color2,
+ KPixmapEffect::CrossDiagonalGradient, xFactor, yFactor );
+ } break;
+ case BCT_GCIRCLE: {
+ if ( !unbalanced )
+ KPixmapEffect::gradient( m_pixmap, color1, color2, KPixmapEffect::EllipticGradient );
+ else
+ KPixmapEffect::unbalancedGradient( m_pixmap, color1, color2,
+ KPixmapEffect::EllipticGradient, xFactor, yFactor );
+ } break;
+ case BCT_GRECT: {
+ if ( !unbalanced )
+ KPixmapEffect::gradient( m_pixmap, color1, color2, KPixmapEffect::RectangleGradient );
+ else
+ KPixmapEffect::unbalancedGradient( m_pixmap, color1, color2,
+ KPixmapEffect::RectangleGradient, xFactor, yFactor );
+ } break;
+ case BCT_GPIPECROSS: {
+ if ( !unbalanced )
+ KPixmapEffect::gradient( m_pixmap, color1, color2, KPixmapEffect::PipeCrossGradient );
+ else
+ KPixmapEffect::unbalancedGradient( m_pixmap, color1, color2,
+ KPixmapEffect::PipeCrossGradient, xFactor, yFactor );
+ } break;
+ case BCT_GPYRAMID: {
+ if ( !unbalanced )
+ KPixmapEffect::gradient( m_pixmap, color1, color2, KPixmapEffect::PyramidGradient );
+ else
+ KPixmapEffect::unbalancedGradient( m_pixmap, color1, color2,
+ KPixmapEffect::PyramidGradient, xFactor, yFactor );
+ } break;
+ }
+ m_bDirty = false;
+}
+
+const QPixmap& KPrGradient::pixmap() const
+{
+ if ( m_bDirty )
+ const_cast<KPrGradient *>(this)->paint();
+ return m_pixmap;
+}
diff --git a/kpresenter/KPrGradient.h b/kpresenter/KPrGradient.h
new file mode 100644
index 000000000..bbf8dc54f
--- /dev/null
+++ b/kpresenter/KPrGradient.h
@@ -0,0 +1,97 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpgradient_h
+#define kpgradient_h
+
+#include <qcolor.h>
+#include <KoBrush.h>
+#include <kpixmap.h>
+#include "global.h"
+
+class QPainter;
+class KoTextZoomHandler;
+
+/**
+ * Class: KPrGradient
+ *
+ * Encapsulates all gradient related functionality, to share it between
+ * KPr2DObject and KPrBackGround.
+ * KPrGradient stores the gradient parameters, and generate the gradient
+ * on demand, in @ref pixmap().
+ */
+class KPrGradient
+{
+public:
+ KPrGradient( const QColor &_color1, const QColor &_color2, BCType _bcType,
+ bool _unbalanced, int _xfactor, int _yfactor );
+ ~KPrGradient() {}
+
+ QColor getColor1() const { return color1; }
+ QColor getColor2() const { return color2; }
+ BCType getBackColorType() const { return bcType; }
+ bool getUnbalanced() const { return unbalanced; }
+ int getXFactor() const { return xFactor; }
+ int getYFactor() const { return yFactor; }
+
+ void setColor1( const QColor &_color ) { color1 = _color; m_bDirty = true; }
+ void setColor2( const QColor &_color ) { color2 = _color; m_bDirty = true; }
+ void setBackColorType( BCType _type ) { bcType = _type; m_bDirty = true; }
+ void setUnbalanced( bool b ) { unbalanced = b; m_bDirty = true; }
+ void setXFactor( int i ) { xFactor = i; m_bDirty = true; }
+ void setYFactor( int i ) { yFactor = i; m_bDirty = true; }
+ void setSize( const QSize& _size )
+ {
+ if ( size() != _size ) {
+ m_pixmap.resize( _size );
+ m_bDirty = true;
+ }
+ }
+
+ // Sets all of the above at once. Used when loading.
+ void setParameters(const QColor &c1, const QColor &c2, BCType _type,
+ bool _unbalanced, int xf, int yf);
+
+ /** Return the pixmap containing the gradient.
+ * Calculated on demand if necessary (if m_bDirty is true).
+ */
+ const QPixmap& pixmap() const;
+ QSize size() const { return m_pixmap.size(); }
+
+ void addRef();
+ bool removeRef();
+
+protected:
+ /** Create the pixmap containing the gradient */
+ void paint();
+
+ KPrGradient() {}
+
+ QColor color1, color2;
+ BCType bcType;
+
+ KPixmap m_pixmap;
+ int refCount;
+ int xFactor, yFactor;
+ bool unbalanced;
+ bool m_bDirty;
+};
+
+#endif
diff --git a/kpresenter/KPrGradientCollection.cpp b/kpresenter/KPrGradientCollection.cpp
new file mode 100644
index 000000000..59dbde2d4
--- /dev/null
+++ b/kpresenter/KPrGradientCollection.cpp
@@ -0,0 +1,73 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrGradientCollection.h"
+#include "KPrGradient.h"
+#include <qstring.h>
+
+const QPixmap& KPrGradientCollection::getGradient( const QColor &_color1, const QColor &_color2,
+ BCType _bcType, const QSize &_size,
+ bool _unbalanced, int _xfactor, int _yfactor, bool addref )
+{
+ KPrGradient *cachedGradient = inGradientList( _color1, _color2, _bcType, _size, _unbalanced, _xfactor, _yfactor );
+
+ if ( !cachedGradient ) {
+ KPrGradient *kpgradient = new KPrGradient( _color1, _color2, _bcType, _unbalanced, _xfactor, _yfactor );
+ kpgradient->setSize( _size );
+ gradientList.append( kpgradient );
+
+ if ( addref )
+ kpgradient->addRef();
+
+ return kpgradient->pixmap();
+ } else {
+ if ( addref )
+ cachedGradient->addRef();
+
+ return cachedGradient->pixmap();
+ }
+}
+
+void KPrGradientCollection::removeRef( const QColor &_color1, const QColor &_color2,
+ BCType _bcType, const QSize &_size,
+ bool _unbalanced, int _xfactor, int _yfactor)
+{
+ KPrGradient* cachedGradient = inGradientList( _color1, _color2, _bcType, _size, _unbalanced, _xfactor, _yfactor );
+ if ( cachedGradient ) {
+ if ( cachedGradient->removeRef() ) // does deref say it was the last use?
+ gradientList.removeRef( cachedGradient ); // yes -> remove from list
+ }
+}
+
+KPrGradient* KPrGradientCollection::inGradientList( const QColor &_color1, const QColor &_color2,
+ BCType _bcType, const QSize &_size,
+ bool _unbalanced, int _xfactor, int _yfactor ) const
+{
+ QPtrListIterator<KPrGradient> it( gradientList );
+ for ( ; it.current() ; ++it ) {
+ KPrGradient *kpgradient = it.current();
+ if ( kpgradient->getColor1() == _color1 && kpgradient->getColor2() == _color2 &&
+ kpgradient->getBackColorType() == _bcType && kpgradient->size() == _size &&
+ kpgradient->getUnbalanced() == _unbalanced && kpgradient->getXFactor() == _xfactor &&
+ kpgradient->getYFactor() == _yfactor )
+ return kpgradient;
+ }
+ return 0L;
+}
diff --git a/kpresenter/KPrGradientCollection.h b/kpresenter/KPrGradientCollection.h
new file mode 100644
index 000000000..49993fe69
--- /dev/null
+++ b/kpresenter/KPrGradientCollection.h
@@ -0,0 +1,63 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpgradientcollection_h
+#define kpgradientcollection_h
+
+#include <qptrlist.h>
+#include "global.h"
+#include "KPrGradient.h"
+
+class QPixmap;
+
+/**
+ * Class: KPrGradientCollection
+ * Holds a collection of gradients, and is able to provide a gradient
+ * for a given set of gradient parameters.
+ * The idea is to be able to share gradients among pages which need the same one.
+ * This class is currently only used for KPBackground, not for objects with gradients
+ * (those having much less chances of sharing).
+ */
+class KPrGradientCollection
+{
+public:
+ KPrGradientCollection()
+ { gradientList.setAutoDelete( true ); }
+
+ ~KPrGradientCollection()
+ { gradientList.clear(); }
+
+ /** Retrieve or create gradient for the given parameters */
+ const QPixmap& getGradient( const QColor &_color1, const QColor &_color2, BCType _bcType, const QSize &_size,
+ bool _unbalanced, int _xfactor, int _yfactor, bool addref = true );
+
+ /** Remove reference to gradient with the given parameters */
+ void removeRef( const QColor &_color1, const QColor &_color2, BCType _bcType, const QSize &_size,
+ bool _unbalanced, int _xfactor, int _yfactor );
+
+protected:
+ KPrGradient* inGradientList( const QColor &_color1, const QColor &_color2, BCType _bcType, const QSize &_size,
+ bool _unbalanced, int _xfactor, int _yfactor ) const;
+
+private:
+ QPtrList<KPrGradient> gradientList;
+};
+
+#endif
diff --git a/kpresenter/KPrGroupObject.cpp b/kpresenter/KPrGroupObject.cpp
new file mode 100644
index 000000000..5a21aaed1
--- /dev/null
+++ b/kpresenter/KPrGroupObject.cpp
@@ -0,0 +1,642 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrGroupObject.h"
+
+#include "KPrDocument.h"
+#include "KPrLineObject.h"
+#include "KPrRectObject.h"
+#include "KPrEllipseObject.h"
+#include "KPrAutoformObject.h"
+#include "KPrTextObject.h"
+#include "KPrPixmapObject.h"
+#include "KPrPieObject.h"
+#include "KPrFreehandObject.h"
+#include "KPrPolylineObject.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrPolygonObject.h"
+#include "KPrClosedLineObject.h"
+#include <kdebug.h>
+#include <KoOasisContext.h>
+
+#include <qpainter.h>
+using namespace std;
+
+KPrGroupObject::KPrGroupObject()
+ : KPrObject(), objects( QPtrList<KPrObject>() ), updateObjs( false )
+{
+ objects.setAutoDelete( false );
+}
+
+KPrGroupObject::KPrGroupObject( const QPtrList<KPrObject> &objs )
+ : KPrObject(), objects( objs ), updateObjs( false )
+{
+ objects.setAutoDelete( false );
+}
+
+KPrGroupObject &KPrGroupObject::operator=( const KPrGroupObject & )
+{
+ return *this;
+}
+
+void KPrGroupObject::selectAllObj()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setSelected(true);
+}
+
+void KPrGroupObject::deSelectAllObj()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setSelected(false);
+}
+
+void KPrGroupObject::setSize( double _width, double _height )
+{
+ KoSize origSize( ext );
+ KPrObject::setSize( _width, _height );
+
+ double fx = ext.width() / origSize.width();
+ double fy = ext.height() / origSize.height();
+
+ updateSizes( fx, fy );
+}
+
+void KPrGroupObject::setOrig( const KoPoint &_point )
+{
+ setOrig( _point.x(), _point.y() );
+}
+
+void KPrGroupObject::setOrig( double _x, double _y )
+{
+ double dx = 0;
+ double dy = 0;
+ if ( !orig.isNull() ) {
+ dx = _x - orig.x();
+ dy = _y - orig.y();
+ }
+
+ KPrObject::setOrig( _x, _y );
+
+ if ( dx != 0 || dy != 0 )
+ updateCoords( dx, dy );
+}
+
+void KPrGroupObject::moveBy( const KoPoint &_point )
+{
+ moveBy( _point.x(), _point.y() );
+}
+
+void KPrGroupObject::moveBy( double _dx, double _dy )
+{
+ KPrObject::moveBy( _dx, _dy );
+ updateCoords( _dx, _dy );
+}
+
+QDomDocumentFragment KPrGroupObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment=KPrObject::save(doc, offset);
+ QDomElement objs=doc.createElement("OBJECTS");
+ fragment.appendChild(objs);
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->getType() == OT_PART )
+ continue;
+ QDomElement object=doc.createElement("OBJECT");
+ object.setAttribute("type", static_cast<int>( it.current()->getType() ));
+ object.appendChild(it.current()->save( doc,offset ));
+ objs.appendChild(object);
+ }
+ return fragment;
+}
+
+
+bool KPrGroupObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ {
+ //TODO what to do with parts?
+ it.current()->saveOasisObject( sc );
+ }
+ return true;
+}
+
+void KPrGroupObject::saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const
+{
+ xmlWriter.addAttribute( "draw:id", "object" + QString::number( indexObj ) );
+}
+
+
+const char * KPrGroupObject::getOasisElementName() const
+{
+ return "draw:g";
+}
+
+
+void KPrGroupObject::loadOasisGroupObject( KPrDocument *_doc, KPrPage * newpage, QDomNode &element, KoOasisContext & context, KPrLoadingInfo */*info*/ )
+{
+ //KPrObject::loadOasis( element, context, info );
+ updateObjs = false;
+ _doc->loadOasisObject( newpage,element, context, this);
+ QPtrListIterator<KPrObject> it( objects );
+ KoRect r=KoRect();
+ for ( ; it.current() ; ++it )
+ {
+ r |= it.current()->getRealRect();
+ }
+ setOrig( r.x(), r.y() );
+ setSize( r.width(), r.height() );
+ updateObjs = true;
+}
+
+void KPrGroupObject::addObjects( KPrObject * obj )
+{
+ kdDebug()<<"add object to group object:"<<obj<<endl;
+ objects.append( obj );
+}
+
+double KPrGroupObject::load( const QDomElement &element, KPrDocument *doc)
+{
+ //FIXME
+ double offset=KPrObject::load(element);
+ updateObjs = false;
+ QDomElement group=element.namedItem("OBJECTS").toElement();
+ if(!group.isNull()) {
+ QDomElement current=group.firstChild().toElement();
+ while(!current.isNull()) {
+ ObjType t = OT_LINE;
+ if(current.tagName()=="OBJECT") {
+ if(current.hasAttribute("type"))
+ t=static_cast<ObjType>(current.attribute("type").toInt());
+ double objOffset;
+ switch ( t ) {
+ case OT_LINE: {
+ KPrLineObject *kplineobject = new KPrLineObject();
+ objOffset = kplineobject->load(current);
+ kplineobject->setOrig(kplineobject->getOrig().x(),objOffset - offset);
+ objects.append( kplineobject );
+ } break;
+ case OT_RECT: {
+ KPrRectObject *kprectobject = new KPrRectObject();
+ objOffset = kprectobject->load(current);
+ kprectobject->setOrig(kprectobject->getOrig().x(),objOffset - offset);
+ objects.append( kprectobject );
+ } break;
+ case OT_ELLIPSE: {
+ KPrEllipseObject *kpellipseobject = new KPrEllipseObject();
+ objOffset = kpellipseobject->load(current);
+ kpellipseobject->setOrig(kpellipseobject->getOrig().x(),objOffset - offset);
+ objects.append( kpellipseobject );
+ } break;
+ case OT_PIE: {
+ KPrPieObject *kppieobject = new KPrPieObject();
+ objOffset = kppieobject->load(current);
+ kppieobject->setOrig(kppieobject->getOrig().x(),objOffset - offset);
+ objects.append( kppieobject );
+ } break;
+ case OT_AUTOFORM: {
+ KPrAutoformObject *kpautoformobject = new KPrAutoformObject();
+ objOffset = kpautoformobject->load(current);
+ kpautoformobject->setOrig(kpautoformobject->getOrig().x(),objOffset - offset);
+ objects.append( kpautoformobject );
+ } break;
+ case OT_TEXT: {
+ KPrTextObject *kptextobject = new KPrTextObject( doc );
+ objOffset = kptextobject->load(current);
+ kptextobject->setOrig(kptextobject->getOrig().x(),objOffset - offset);
+ objects.append( kptextobject );
+ } break;
+ case OT_CLIPART:
+ case OT_PICTURE: {
+ KPrPixmapObject *kppixmapobject = new KPrPixmapObject( doc->pictureCollection() );
+ objOffset = kppixmapobject->load(current);
+ kppixmapobject->setOrig(kppixmapobject->getOrig().x(),objOffset - offset);
+ kppixmapobject->reload();
+ objects.append( kppixmapobject );
+ } break;
+ case OT_FREEHAND: {
+ KPrFreehandObject *kpfreehandobject = new KPrFreehandObject();
+ objOffset = kpfreehandobject->load( current );
+ kpfreehandobject->setOrig(kpfreehandobject->getOrig().x(),objOffset - offset);
+ objects.append( kpfreehandobject );
+ } break;
+ case OT_POLYLINE: {
+ KPrPolylineObject *kppolylineobject = new KPrPolylineObject();
+ objOffset = kppolylineobject->load( current );
+ kppolylineobject->setOrig(kppolylineobject->getOrig().x(),objOffset - offset);
+ objects.append( kppolylineobject );
+ } break;
+ case OT_QUADRICBEZIERCURVE: {
+ KPrQuadricBezierCurveObject *kpQuadricBezierCurveObject = new KPrQuadricBezierCurveObject();
+ objOffset = kpQuadricBezierCurveObject->load( current );
+ kpQuadricBezierCurveObject->setOrig(kpQuadricBezierCurveObject->getOrig().x(),objOffset - offset);
+ objects.append( kpQuadricBezierCurveObject );
+ } break;
+ case OT_CUBICBEZIERCURVE: {
+ KPrCubicBezierCurveObject *kpCubicBezierCurveObject = new KPrCubicBezierCurveObject();
+ objOffset = kpCubicBezierCurveObject->load( current );
+ kpCubicBezierCurveObject->setOrig(kpCubicBezierCurveObject->getOrig().x(),objOffset - offset);
+ objects.append( kpCubicBezierCurveObject );
+ } break;
+ case OT_POLYGON: {
+ KPrPolygonObject *kpPolygonObject = new KPrPolygonObject();
+ objOffset = kpPolygonObject->load( current );
+ kpPolygonObject->setOrig(kpPolygonObject->getOrig().x(),objOffset - offset);
+ objects.append( kpPolygonObject );
+ } break;
+ case OT_GROUP: {
+ KPrGroupObject *kpgroupobject = new KPrGroupObject();
+ objOffset = kpgroupobject->load(current, doc);
+ kpgroupobject->setOrig(kpgroupobject->getOrig().x(),objOffset - offset);
+ objects.append( kpgroupobject );
+ } break;
+ case OT_CLOSED_LINE: {
+ KPrClosedLineObject *kpClosedLinneObject = new KPrClosedLineObject();
+ objOffset = kpClosedLinneObject->load( current );
+ kpClosedLinneObject->setOrig(kpClosedLinneObject->getOrig().x(),objOffset - offset);
+ objects.append( kpClosedLinneObject );
+ } break;
+ default: break;
+ }
+ }
+ current=current.nextSibling().toElement();
+ }
+ }
+ updateObjs = true;
+ return offset;
+}
+
+void KPrGroupObject::draw( QPainter *_painter,KoTextZoomHandler *_zoomhandler,
+ int pageNum, SelectionMode selectionMode, bool drawContour )
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->draw( _painter, _zoomhandler, pageNum, selectionMode, drawContour );
+
+ KPrObject::draw( _painter, _zoomhandler, pageNum, selectionMode, drawContour );
+}
+
+void KPrGroupObject::updateSizes( double fx, double fy )
+{
+ if ( !updateObjs )
+ return;
+ KoRect r = KoRect();
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ {
+ double _x = ( it.current()->getOrig().x() - orig.x() ) * fx + orig.x();
+ double _y = ( it.current()->getOrig().y() - orig.y() ) * fy + orig.y();
+ it.current()->setOrig( _x, _y );
+
+ double _w = it.current()->getSize().width() * fx;
+ double _h = it.current()->getSize().height() * fy;
+ it.current()->setSize( _w, _h );
+ }
+}
+
+void KPrGroupObject::updateCoords( double dx, double dy )
+{
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->moveBy( dx, dy );
+}
+
+void KPrGroupObject::rotate( float _angle )
+{
+ float oldAngle = angle;
+ float diffAngle = _angle - angle;
+ float angInRad = diffAngle * M_PI / 180;
+
+ KPrObject::rotate( _angle );
+
+ // find center of the group
+ double centerx = orig.x() + ext.width() / 2.0;
+ double centery = orig.y() + ext.height() / 2.0;
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it ) {
+ // find distance of object center to group center
+ double px = it.current()->getOrig().x() + it.current()->getSize().width() / 2.0 - centerx;
+ double py = it.current()->getOrig().y() + it.current()->getSize().height() / 2.0 - centery;
+ // find distance for move
+ double mx = px * cos( angInRad ) - py * sin( angInRad ) - px;
+ double my = px * sin( angInRad ) + py * cos( angInRad ) - py;
+ double objAngle = it.current()->getAngle();
+ // If part of group was already rotated the difference has to be added
+ // to the angle
+ if ( objAngle != oldAngle )
+ it.current()->rotate( objAngle + diffAngle );
+ else
+ it.current()->rotate( _angle );
+ it.current()->moveBy( mx, my );
+ }
+}
+
+void KPrGroupObject::setShadowParameter( int _distance, ShadowDirection _direction, const QColor &_color )
+{
+ KPrObject::setShadowParameter( _distance, _direction, _color );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setShadowParameter( _distance, _direction, _color );
+}
+
+void KPrGroupObject::setShadowDistance( int _distance )
+{
+ KPrObject::setShadowDistance( _distance );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setShadowDistance( _distance );
+}
+
+void KPrGroupObject::setShadowDirection( ShadowDirection _direction )
+{
+ KPrObject::setShadowDirection( _direction );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setShadowDirection( _direction );
+}
+
+void KPrGroupObject::setShadowColor( const QColor &_color )
+{
+ KPrObject::setShadowColor( _color );
+ kdDebug(33001) << "KPrGroupObject::setShadowColor"<<updateObjs << endl;
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setShadowColor( _color );
+}
+
+void KPrGroupObject::setEffect( Effect _effect )
+{
+ KPrObject::setEffect( _effect );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setEffect( _effect );
+}
+
+void KPrGroupObject::setEffect2( Effect2 _effect2 )
+{
+ KPrObject::setEffect2( _effect2 );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setEffect2( _effect2 );
+}
+
+void KPrGroupObject::setAppearStep( int _appearStep )
+{
+ KPrObject::setAppearStep( _appearStep );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setAppearStep( _appearStep );
+}
+
+void KPrGroupObject::setDisappear( bool b )
+{
+ KPrObject::setDisappear( b );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setDisappear( b );
+}
+
+void KPrGroupObject::setDisappearStep( int _disappearStep )
+{
+ KPrObject::setDisappearStep( _disappearStep );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setDisappearStep( _disappearStep );
+}
+
+void KPrGroupObject::setEffect3( Effect3 _effect3)
+{
+ KPrObject::setEffect3( _effect3 );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setEffect3( _effect3 );
+}
+
+void KPrGroupObject::setAppearTimer( int _appearTimer )
+{
+ KPrObject::setAppearTimer( _appearTimer );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setAppearTimer( _appearTimer );
+}
+
+void KPrGroupObject::setDisappearTimer( int _disappearTimer )
+{
+ KPrObject::setDisappearTimer( _disappearTimer );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setDisappearTimer( _disappearTimer );
+}
+
+void KPrGroupObject::setOwnClipping( bool _ownClipping )
+{
+ KPrObject::setOwnClipping( _ownClipping );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setOwnClipping( _ownClipping );
+}
+
+void KPrGroupObject::setSubPresStep( int _subPresStep )
+{
+ KPrObject::setSubPresStep( _subPresStep );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setSubPresStep( _subPresStep );
+}
+
+void KPrGroupObject::doSpecificEffects( bool _specEffects, bool _onlyCurrStep )
+{
+ KPrObject::doSpecificEffects( _specEffects, _onlyCurrStep );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->doSpecificEffects( _specEffects, _onlyCurrStep );
+}
+
+void KPrGroupObject::setAppearSoundEffect( bool b )
+{
+ KPrObject::setAppearSoundEffect( b );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->setAppearSoundEffect( b );
+}
+
+void KPrGroupObject::setDisappearSoundEffect( bool b )
+{
+ KPrObject::setDisappearSoundEffect( b );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects);
+ for ( ; it.current() ; ++it )
+ it.current()->setDisappearSoundEffect( b );
+}
+
+void KPrGroupObject::setAppearSoundEffectFileName( const QString &_a_fileName )
+{
+ KPrObject::setAppearSoundEffectFileName( _a_fileName );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects);
+ for ( ; it.current() ; ++it )
+ it.current()->setAppearSoundEffectFileName( _a_fileName );
+}
+
+void KPrGroupObject::setDisappearSoundEffectFileName( const QString &_d_fileName )
+{
+ KPrObject::setDisappearSoundEffectFileName( _d_fileName );
+
+ if ( !updateObjs )
+ return;
+ QPtrListIterator<KPrObject> it( objects);
+ for ( ; it.current() ; ++it )
+ it.current()->setDisappearSoundEffectFileName( _d_fileName );
+}
+
+void KPrGroupObject::getAllObjectSelectedList(QPtrList<KPrObject> &lst,bool force )
+{
+ if ( selected || force)
+ {
+ QPtrListIterator<KPrObject> it( objects);
+ for ( ; it.current() ; ++it )
+ it.current()->getAllObjectSelectedList( lst, true );
+ }
+}
+
+void KPrGroupObject::addTextObjects( QPtrList<KoTextObject> &lst ) const
+{
+ QPtrListIterator<KPrObject> it( objects);
+ for ( ; it.current() ; ++it )
+ it.current()->addTextObjects( lst );
+}
+
+void KPrGroupObject::flip( bool horizontal ) {
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it ) {
+ it.current()->flip( horizontal );
+ double mx = 0;
+ double my = 0;
+ if ( ! horizontal )
+ {
+ double disttop = it.current()->getOrig().y() - orig.y();
+ double distbottom = ext.height() - disttop - it.current()->getSize().height();
+ my = distbottom - disttop;
+ }
+ else
+ {
+ double distleft = it.current()->getOrig().x() - orig.x();
+ double distright = ext.width() - distleft - it.current()->getSize().width();
+ mx = distright - distleft;
+ }
+ it.current()->moveBy( mx, my );
+ }
+}
+
+void KPrGroupObject::removeFromObjList()
+{
+ inObjList = false;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->removeFromObjList();
+}
+
+void KPrGroupObject::addToObjList()
+{
+ inObjList = true;
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->addToObjList();
+}
+
+void KPrGroupObject::incCmdRef()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->incCmdRef();
+
+ cmds++;
+}
+
+void KPrGroupObject::decCmdRef()
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ it.current()->decCmdRef();
+
+ cmds--;
+ doDelete();
+}
diff --git a/kpresenter/KPrGroupObject.h b/kpresenter/KPrGroupObject.h
new file mode 100644
index 000000000..0dfd28d25
--- /dev/null
+++ b/kpresenter/KPrGroupObject.h
@@ -0,0 +1,116 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpgroupobject_h
+#define kpgroupobject_h
+
+class KPrDocument;
+class KoOasisContext;
+class KPrPage;
+class KoXmlWriter;
+
+#include "KPrObject.h"
+
+class KPrGroupObject : public KPrObject
+{
+public:
+ KPrGroupObject();
+ KPrGroupObject( const QPtrList<KPrObject> &objs );
+ virtual ~KPrGroupObject() {}
+
+ KPrGroupObject &operator=( const KPrGroupObject & );
+
+ virtual void setSize( double _width, double _height );
+ virtual void setOrig( const KoPoint &_point );
+ virtual void setOrig( double _x, double _y );
+ virtual void moveBy( const KoPoint &_point );
+ virtual void moveBy( double _dx, double _dy );
+
+ virtual void rotate( float _angle );
+ virtual void setShadowDistance( int _distance );
+ virtual void setShadowDirection( ShadowDirection _direction );
+ virtual void setShadowColor( const QColor &_color );
+ virtual void setEffect( Effect _effect );
+ virtual void setEffect2( Effect2 _effect2 );
+ virtual void setAppearStep( int _appearStep );
+ virtual void setDisappear( bool b );
+ virtual void setDisappearStep( int _disappearStep );
+ virtual void setEffect3( Effect3 _effect3);
+ virtual void setAppearTimer( int _appearTimer );
+ virtual void setDisappearTimer( int _disappearTimer );
+ virtual void setAppearSoundEffect( bool b );
+ virtual void setDisappearSoundEffect( bool b );
+ virtual void setAppearSoundEffectFileName( const QString &_a_fileName );
+ virtual void setDisappearSoundEffectFileName( const QString &_d_fileName );
+
+ virtual void setShadowParameter(int _distance,ShadowDirection _direction,const QColor &_color);
+
+ virtual ObjType getType() const
+ { return OT_GROUP; }
+ virtual QString getTypeString() const
+ { return i18n("Group"); }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+ virtual double load(const QDomElement &element, KPrDocument *doc);
+ virtual void loadOasisGroupObject( KPrDocument *doc, KPrPage * newpage, QDomNode &element, KoOasisContext & context, KPrLoadingInfo *info);
+
+ virtual void draw( QPainter *_painter, KoTextZoomHandler *_zoomhandler,
+ int pageNum, SelectionMode selectionMode, bool drawContour = FALSE );
+
+ void addObjects( KPrObject * obj );
+
+ void setUpdateObjects( bool b )
+ { updateObjs = b; }
+
+ QPtrList<KPrObject> getObjects()
+ { return objects; }
+ const QPtrList<KPrObject> &objectList() const
+ { return objects; }
+ virtual void addTextObjects( QPtrList<KoTextObject> & ) const;
+
+ void selectAllObj();
+ void deSelectAllObj();
+
+ virtual void setOwnClipping( bool _ownClipping );
+ virtual void setSubPresStep( int _subPresStep );
+ virtual void doSpecificEffects( bool _specEffects, bool _onlyCurrStep = true );
+ virtual void getAllObjectSelectedList(QPtrList<KPrObject> &lst,bool force=false );
+
+ virtual void flip( bool horizontal );
+ virtual void removeFromObjList();
+ virtual void addToObjList();
+ virtual void incCmdRef();
+ virtual void decCmdRef();
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+ virtual void saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const;
+
+ void updateSizes( double fx, double fy );
+ void updateCoords( double dx, double dy );
+
+ QPtrList<KPrObject> objects;
+ bool updateObjs;
+
+};
+
+#endif
diff --git a/kpresenter/KPrImageEffectDia.cpp b/kpresenter/KPrImageEffectDia.cpp
new file mode 100644
index 000000000..0e62e7eac
--- /dev/null
+++ b/kpresenter/KPrImageEffectDia.cpp
@@ -0,0 +1,412 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Lukas Tinkl <lukas@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qspinbox.h>
+#include <qwidgetstack.h>
+#include <qcheckbox.h>
+#include <qimage.h>
+
+#include <kimageeffect.h>
+#include <klocale.h>
+#include <knuminput.h>
+#include <kcolorbutton.h>
+
+#include "KPrImageEffectDia.h"
+
+KPrImageEffectDia::KPrImageEffectDia(QWidget * parent, const char * name):
+ KDialogBase(parent, name, true, i18n("Image Effect"), Ok|Cancel, Ok)
+{
+ m_pix = QPixmap();
+
+ m_effect = IE_NONE;
+ m_param1 = QVariant();
+ m_param2 = QVariant();
+ m_param3 = QVariant();
+
+ base = new EffectBrowserBase(this, "effect_base");
+
+ setMainWidget(base);
+
+ setupSignals();
+
+ connect((QWidget *)base->m_effectCombo, SIGNAL(activated(int)),
+ this, SLOT(effectChanged(int)));
+
+ connect(this, SIGNAL(okClicked()),
+ this, SLOT(okClicked()));
+}
+
+KPrImageEffectDia::~KPrImageEffectDia()
+{
+ delete base;
+}
+
+void KPrImageEffectDia::effectChanged(int eff)
+{
+ QImage _tmpImage = m_origpix.convertToImage();
+
+ //clear the (unused) params
+ m_param1 = QVariant();
+ m_param2 = QVariant();
+ m_param3 = QVariant();
+
+ m_effect = static_cast<ImageEffect>(eff);
+
+ switch (m_effect) {
+ case IE_CHANNEL_INTENSITY: {
+ m_param1 = QVariant(base->chanInt_value->value());
+ m_param2 = QVariant(base->chanInt_component->currentItem());
+ _tmpImage = KImageEffect::channelIntensity(_tmpImage, m_param1.toDouble()/100.0,
+ static_cast<KImageEffect::RGBComponent>(m_param2.toInt()));
+ break;
+ }
+ case IE_FADE: {
+ m_param1 = QVariant(base->fade_value->value());
+ m_param2 = QVariant(base->fade_color->color());
+ _tmpImage = KImageEffect::fade(_tmpImage, m_param1.toDouble(), m_param2.toColor());
+ break;
+ }
+ case IE_FLATTEN: {
+ m_param1 = QVariant(base->flatten_color1->color());
+ m_param2 = QVariant(base->flatten_color2->color());
+ _tmpImage = KImageEffect::flatten(_tmpImage, m_param1.toColor(), m_param2.toColor());
+ break;
+ }
+ case IE_INTENSITY: {
+ m_param1 = QVariant(base->intensity_value->value());
+ _tmpImage = KImageEffect::intensity(_tmpImage, m_param1.toDouble()/100.0);
+ break;
+ }
+ case IE_DESATURATE: {
+ m_param1 = QVariant(base->desaturate_value->value());
+ _tmpImage = KImageEffect::desaturate(_tmpImage, m_param1.toDouble());
+ break;
+ }
+ case IE_CONTRAST: {
+ m_param1 = QVariant(base->contrast_value->value());
+ _tmpImage = KImageEffect::contrast(_tmpImage, m_param1.toInt());
+ break;
+ }
+ case IE_NORMALIZE: {
+ KImageEffect::normalize(_tmpImage);
+ break;
+ }
+ case IE_EQUALIZE: {
+ KImageEffect::equalize(_tmpImage);
+ break;
+ }
+ case IE_THRESHOLD: {
+ m_param1 = QVariant(base->threshold_value->value());
+ KImageEffect::threshold(_tmpImage, m_param1.toInt());
+ break;
+ }
+ case IE_SOLARIZE: {
+ m_param1 = QVariant(base->solarize_value->value());
+ KImageEffect::solarize(_tmpImage, m_param1.toDouble());
+ break;
+ }
+ case IE_EMBOSS: {
+ _tmpImage = KImageEffect::emboss(_tmpImage);
+ break;
+ }
+ case IE_DESPECKLE: {
+ _tmpImage = KImageEffect::despeckle(_tmpImage);
+ break;
+ }
+ case IE_CHARCOAL: {
+ m_param1 = QVariant(base->charcoal_value->value());
+ _tmpImage = KImageEffect::charcoal(_tmpImage, m_param1.toDouble());
+ break;
+ }
+ case IE_NOISE: {
+ m_param1 = QVariant(base->noise_type->currentItem());
+ _tmpImage = KImageEffect::addNoise(_tmpImage, static_cast<KImageEffect::NoiseType>(m_param1.toInt()));
+ break;
+ }
+ case IE_BLUR: {
+ m_param1 = QVariant(base->blur_value->value());
+ _tmpImage = KImageEffect::blur(_tmpImage, m_param1.toDouble());
+ break;
+ }
+ case IE_EDGE: {
+ m_param1 = QVariant(base->edge_value->value());
+ _tmpImage = KImageEffect::edge(_tmpImage, m_param1.toDouble());
+ break;
+ }
+ case IE_IMPLODE: {
+ m_param1 = QVariant(base->implode_value->value());
+ _tmpImage = KImageEffect::implode(_tmpImage, m_param1.toDouble());
+ break;
+ }
+ case IE_OIL_PAINT: {
+ m_param1 = QVariant(base->oilPaint_radius->value());
+ _tmpImage = KImageEffect::oilPaint(_tmpImage, m_param1.toInt());
+ break;
+ }
+ case IE_SHARPEN: {
+ m_param1 = QVariant(base->sharpen_value->value());
+ _tmpImage = KImageEffect::sharpen(_tmpImage, m_param1.toDouble());
+ break;
+ }
+ case IE_SPREAD: {
+ m_param1 = QVariant(base->spread_value->value());
+ _tmpImage = KImageEffect::spread(_tmpImage, m_param1.toInt());
+ break;
+ }
+ case IE_SHADE: {
+ m_param1 = QVariant(base->shade_color->isChecked());
+ m_param2 = QVariant(base->shade_azimuth->value());
+ m_param3 = QVariant(base->shade_elevation->value());
+ _tmpImage = KImageEffect::shade(_tmpImage, m_param1.toBool(), m_param2.toDouble(), m_param3.toDouble());
+ break;
+ }
+ case IE_SWIRL: {
+ m_param1 = QVariant(base->swirl_value->value());
+ _tmpImage = KImageEffect::swirl(_tmpImage, m_param1.toDouble());
+ break;
+ }
+ case IE_WAVE: {
+ m_param1 = QVariant(base->wave_amplitude->value());
+ m_param2 = QVariant(base->wave_length->value());
+ _tmpImage = KImageEffect::wave(_tmpImage, m_param1.toDouble(), m_param2.toDouble());
+ break;
+ }
+ case IE_NONE:
+ default:
+ break;
+ }
+
+ m_pix.convertFromImage(_tmpImage);
+
+ updatePreview();
+}
+
+void KPrImageEffectDia::okClicked()
+{
+ accept();
+}
+
+
+void KPrImageEffectDia::setPixmap(QPixmap pix)
+{
+ m_pix = pix;
+ m_origpix = pix;
+ m_pix.detach();
+ m_origpix.detach();
+}
+
+void KPrImageEffectDia::updatePreview()
+{
+ base->m_previewLabel->setPixmap(m_pix);
+ base->m_previewLabel->repaint(false);
+}
+
+void KPrImageEffectDia::setEffect(ImageEffect eff, QVariant p1, QVariant p2, QVariant p3)
+{
+ m_effect = eff;
+ m_param1 = p1;
+ m_param2 = p2;
+ m_param3 = p3;
+
+ switch (m_effect) {
+ case IE_CHANNEL_INTENSITY: {
+ base->chanInt_value->setValue(m_param1.toInt());
+ base->chanInt_component->setCurrentItem(m_param2.toInt());
+ break;
+ }
+ case IE_FADE: {
+ base->fade_value->setValue(m_param1.toDouble());
+ base->fade_color->setColor(m_param2.toColor());
+ break;
+ }
+ case IE_FLATTEN: {
+ base->flatten_color1->setColor(m_param1.toColor());
+ base->flatten_color2->setColor(m_param2.toColor());
+ break;
+ }
+ case IE_INTENSITY: {
+ base->intensity_value->setValue(m_param1.toInt());
+ break;
+ }
+ case IE_DESATURATE: {
+ base->desaturate_value->setValue(m_param1.toDouble());
+ break;
+ }
+ case IE_CONTRAST: {
+ base->contrast_value->setValue(m_param1.toInt());
+ break;
+ }
+ case IE_THRESHOLD: {
+ base->threshold_value->setValue(m_param1.toInt());
+ break;
+ }
+ case IE_SOLARIZE: {
+ base->solarize_value->setValue(m_param1.toDouble());
+ break;
+ }
+ case IE_CHARCOAL: {
+ base->charcoal_value->setValue(m_param1.toDouble());
+ break;
+ }
+ case IE_NOISE: {
+ base->noise_type->setCurrentItem(m_param1.toInt());
+ break;
+ }
+ case IE_BLUR: {
+ base->blur_value->setValue(m_param1.toDouble());
+ break;
+ }
+ case IE_EDGE: {
+ base->edge_value->setValue(m_param1.toDouble());
+ break;
+ }
+ case IE_IMPLODE: {
+ base->implode_value->setValue(m_param1.toDouble());
+ break;
+ }
+ case IE_OIL_PAINT: {
+ base->oilPaint_radius->setValue(m_param1.toInt());
+ break;
+ }
+ case IE_SHARPEN: {
+ base->sharpen_value->setValue(m_param1.toDouble());
+ break;
+ }
+ case IE_SPREAD: {
+ base->spread_value->setValue(m_param1.toInt());
+ break;
+ }
+ case IE_SHADE: {
+ base->shade_color->setChecked(m_param1.toBool());
+ base->shade_azimuth->setValue(m_param2.toDouble());
+ base->shade_elevation->setValue(m_param3.toDouble());
+ break;
+ }
+ case IE_SWIRL: {
+ base->swirl_value->setValue(m_param1.toDouble());
+ break;
+ }
+ case IE_WAVE: {
+ base->wave_amplitude->setValue(m_param1.toDouble());
+ base->wave_length->setValue(m_param2.toDouble());
+ break;
+ }
+
+ //no params
+ case IE_NORMALIZE:
+ case IE_EQUALIZE:
+ case IE_EMBOSS:
+ case IE_DESPECKLE:
+
+ case IE_NONE:
+ default:
+ break;
+ }
+
+ base->m_effectCombo->setCurrentItem(static_cast<int>(m_effect));
+ base->m_widgetStack->raiseWidget(static_cast<int>(m_effect)); //bug in Qt? the above doesn't emit this :(
+}
+
+void KPrImageEffectDia::showEvent(QShowEvent * e)
+{
+ KDialogBase::showEvent(e);
+ effectChanged((int)m_effect);
+}
+
+void KPrImageEffectDia::setupSignals()
+{
+ connect((QWidget *)base->chanInt_value, SIGNAL(valueChanged(int)),
+ this, SLOT(effectParamChanged()));
+ connect((QWidget *)base->chanInt_component, SIGNAL(activated(int)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->fade_value, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+ connect((QWidget *)base->fade_color, SIGNAL(changed(const QColor&)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->flatten_color1, SIGNAL(changed(const QColor&)),
+ this, SLOT(effectParamChanged()));
+ connect((QWidget *)base->flatten_color2, SIGNAL(changed(const QColor&)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->intensity_value, SIGNAL(valueChanged(int)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->desaturate_value, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->contrast_value, SIGNAL(valueChanged(int)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->threshold_value, SIGNAL(valueChanged(int)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->solarize_value, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->charcoal_value, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->noise_type, SIGNAL(activated(int)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->blur_value, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->edge_value, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->implode_value, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->oilPaint_radius, SIGNAL(valueChanged(int)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->sharpen_value, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->spread_value, SIGNAL(valueChanged(int)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->shade_color, SIGNAL(toggled(bool)),
+ this, SLOT(effectParamChanged()));
+ connect((QWidget *)base->shade_elevation, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+ connect((QWidget *)base->shade_azimuth, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->swirl_value, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+
+ connect((QWidget *)base->wave_amplitude, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+ connect((QWidget *)base->wave_length, SIGNAL(valueChanged(double)),
+ this, SLOT(effectParamChanged()));
+}
+
+void KPrImageEffectDia::effectParamChanged()
+{
+ effectChanged(base->m_effectCombo->currentItem());
+}
+
+#include "KPrImageEffectDia.moc"
diff --git a/kpresenter/KPrImageEffectDia.h b/kpresenter/KPrImageEffectDia.h
new file mode 100644
index 000000000..7e26b50fb
--- /dev/null
+++ b/kpresenter/KPrImageEffectDia.h
@@ -0,0 +1,83 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Lukas Tinkl <lukas@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef IMAGEEFFECTDIA_H
+#define IMAGEEFFECTDIA_H
+
+#include <qpixmap.h>
+
+#include <kdialogbase.h>
+
+#include "imageEffectBase.h"
+#include "global.h"
+
+class KPrImageEffectDia: public KDialogBase {
+ Q_OBJECT
+
+public:
+ KPrImageEffectDia(QWidget * parent = 0, const char * name = 0);
+ ~KPrImageEffectDia();
+
+ /**
+ * Set the initial preview pixmap
+ */
+ void setPixmap(QPixmap pix);
+
+ /**
+ * Returns the selected effect
+ */
+ ImageEffect getEffect() const {return m_effect;}
+ /**
+ * Returns the first param of the selected effect
+ */
+ QVariant getParam1() const {return m_param1;}
+ /**
+ * Returns the second param of the the selected effect
+ */
+ QVariant getParam2() const {return m_param2;}
+ /**
+ * Returns the third param of the the selected effect
+ */
+ QVariant getParam3() const {return m_param3;}
+
+ /**
+ * Set the initial effect and its params before showing the dialog
+ */
+ void setEffect(ImageEffect eff, QVariant p1, QVariant p2, QVariant p3);
+
+protected:
+ virtual void showEvent(QShowEvent * e);
+
+private slots:
+ void effectChanged(int);
+ void okClicked();
+ void effectParamChanged();
+
+private:
+ void updatePreview();
+ void setupSignals();
+ QPixmap m_pix;
+ QPixmap m_origpix;
+ ImageEffect m_effect;
+ QVariant m_param1, m_param2, m_param3;
+ EffectBrowserBase * base;
+};
+
+#endif //IMAGEEFFECTDIA_H
diff --git a/kpresenter/KPrImportStyleDia.cpp b/kpresenter/KPrImportStyleDia.cpp
new file mode 100644
index 000000000..d271445ec
--- /dev/null
+++ b/kpresenter/KPrImportStyleDia.cpp
@@ -0,0 +1,157 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Montel Laurent <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <klocale.h>
+#include "KPrDocument.h"
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlistbox.h>
+#include <kmessagebox.h>
+#include "KPrImportStyleDia.h"
+#include <KoStore.h>
+#include <qfile.h>
+#include <kfiledialog.h>
+#include <kdebug.h>
+#include <qlabel.h>
+#include "KPrTextObject.h"
+
+KPrImportStyleDia::KPrImportStyleDia( KPrDocument *_doc, KoStyleCollection* currentCollection,
+ QWidget *parent, const char *name )
+ :KoImportStyleDia( currentCollection, parent, name ),
+ m_doc(_doc)
+{
+}
+
+KPrImportStyleDia::~KPrImportStyleDia()
+{
+}
+
+void KPrImportStyleDia::loadFile()
+{
+ KFileDialog fd( QString::null, QString::null, 0, 0, TRUE );
+ QStringList lst = "application/x-kpresenter";
+#if 0 //For the future
+ lst << "application/vnd.oasis.opendocument.presentation";
+#endif
+ fd.setMimeFilter( lst );
+ fd.setCaption(i18n("Import Style"));
+ KURL url;
+ if ( fd.exec() != QDialog::Accepted )
+ return;
+ url = fd.selectedURL();
+ if( url.isEmpty() )
+ {
+ KMessageBox::sorry( this,
+ i18n("File name is empty."),
+ i18n("Import Style"));
+ return;
+ }
+ QMap<QString, QString>insertStyle;
+ KoStore* store=KoStore::createStore( this, url.path(), KoStore::Read );
+ if (store )
+ {
+ if (store->open("maindoc.xml") )
+ {
+ clear();
+ m_listStyleName->clear();
+
+ QDomDocument doc;
+ doc.setContent( store->device() );
+ QDomElement word = doc.documentElement();
+
+ QDomElement stylesElem = word.namedItem( "STYLES" ).toElement();
+ if ( !stylesElem.isNull() )
+ {
+ //todo
+ //duplicate code try to remove it !
+ QValueList<QString> followingStyles;
+ QDomNodeList listStyles = stylesElem.elementsByTagName( "STYLE" );
+ for (unsigned int item = 0; item < listStyles.count(); item++)
+ {
+ QDomElement styleElem = listStyles.item( item ).toElement();
+
+ KoParagStyle *sty = new KoParagStyle( QString::null );
+ // Load the style from the <STYLE> element
+ sty->loadStyle( styleElem );
+
+ if ( currentCollection()->findStyle( sty->name() ) )
+ sty->setName(generateStyleName(sty->name() + "-%1"));
+ QString name = sty->displayName();
+ // ### TODO: we should offer the option of updating the
+ // existing style instead of creating a foo-1 style. Any ideas for a GUI?
+ if ( currentCollection()->findStyleByDisplayName( name ) )
+ sty->setDisplayName(generateStyleDisplayName(sty->displayName() + "-%1"));
+ insertStyle.insert( name, sty->name() );
+
+ QDomElement formatElem = styleElem.namedItem( "FORMAT" ).toElement();
+ if ( !formatElem.isNull() )
+ sty->format() = KPrTextObject::loadFormat( formatElem, 0L, m_doc->defaultFont(),
+ m_doc->globalLanguage(), m_doc->globalHyphenation() );
+ else
+ kdWarning(33001) << "No FORMAT tag in <STYLE>" << endl; // This leads to problems in applyStyle().
+
+
+ // Style created, now let's try to add it
+ sty = m_styleList.addStyle(sty);
+
+ if( m_styleList.count() >= 0 && uint( m_styleList.count() ) > followingStyles.count() )
+ {
+ QString following = styleElem.namedItem("FOLLOWING").toElement().attribute("name");
+ followingStyles.append( following );
+ }
+ else
+ kdWarning(33001) << "Found duplicate style declaration, overwriting former " << sty->name() << endl;
+ }
+
+ Q_ASSERT( m_styleList.count() >= 0 && followingStyles.count() == uint( m_styleList.count() ) );
+
+ unsigned int i=0;
+ for( QValueList<QString>::Iterator it = followingStyles.begin(); it != followingStyles.end(); ++it ) {
+ QString newName =*it;
+ if ( insertStyle.contains( *it ) )
+ newName = (insertStyle)[ *it ];
+
+ KoParagStyle * style = m_styleList.findStyle(newName);
+ if ( style )
+ m_styleList.styleAt(i++)->setFollowingStyle( style );
+ }
+
+ }
+ initList();
+ }
+ else if ( store->hasFile( "content.xml" ) )
+ {
+ //oasis file format (for koffice-1.5)
+ }
+ else
+ {
+ KMessageBox::error( this,
+ i18n("File is not a KPresenter file!"),
+ i18n("Import Style"));
+ }
+ store->close();
+ }
+ delete store;
+}
+
+
+#include "KPrImportStyleDia.moc"
diff --git a/kpresenter/KPrImportStyleDia.h b/kpresenter/KPrImportStyleDia.h
new file mode 100644
index 000000000..b800d3dc8
--- /dev/null
+++ b/kpresenter/KPrImportStyleDia.h
@@ -0,0 +1,47 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Montel Laurent <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __KPRImportStyleDia__
+#define __KPRImportStyleDia__
+
+#include <kdialogbase.h>
+#include <KoImportStyleDia.h>
+#include <qstringlist.h>
+class QLineEdit;
+class QListBox;
+class KPrDocument;
+class QPushButton;
+class KoParagStyle;
+
+class KPrImportStyleDia : public KoImportStyleDia
+{
+ Q_OBJECT
+public:
+ KPrImportStyleDia( KPrDocument *_doc, KoStyleCollection* currentCollection, QWidget *parent, const char *name = 0 );
+ ~KPrImportStyleDia();
+
+protected:
+ virtual void loadFile();
+
+private:
+ KPrDocument *m_doc;
+};
+
+#endif
diff --git a/kpresenter/KPrLineObject.cpp b/kpresenter/KPrLineObject.cpp
new file mode 100644
index 000000000..f0ac86bce
--- /dev/null
+++ b/kpresenter/KPrLineObject.cpp
@@ -0,0 +1,499 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrLineObject.h"
+#include "KPrUtils.h"
+#include "KPrDocument.h"
+#include "KPrLineObjectIface.h"
+#include "KoPointArray.h"
+#include <KoStyleStack.h>
+#include <KoOasisContext.h>
+
+#include <qpainter.h>
+#include <qwmatrix.h>
+#include <qdom.h>
+#include <kdebug.h>
+#include <KoUnit.h>
+#include <KoTextZoomHandler.h>
+#include <math.h>
+#include <KoDom.h>
+#include <KoXmlNS.h>
+
+using namespace std;
+
+KPrLineObject::KPrLineObject()
+ : KPrShadowObject(), KPrStartEndLine( L_NORMAL, L_NORMAL )
+{
+ lineType = LT_HORZ;
+}
+
+KPrLineObject::KPrLineObject( const KoPen &_pen, LineEnd _lineBegin,
+ LineEnd _lineEnd, LineType _lineType )
+ : KPrShadowObject( _pen ), KPrStartEndLine( _lineBegin, _lineEnd )
+{
+ lineType = _lineType;
+}
+
+KPrLineObject &KPrLineObject::operator=( const KPrLineObject & )
+{
+ return *this;
+}
+
+DCOPObject* KPrLineObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrLineObjectIface( this );
+ return dcop;
+}
+
+
+void KPrLineObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const
+{
+ KPrShadowObject::fillStyle( styleObjectAuto, mainStyles );
+ saveOasisMarkerElement( mainStyles, styleObjectAuto );
+}
+
+
+bool KPrLineObject::saveOasisObjectAttributes( KPOasisSaveContext &/*sc*/ ) const
+{
+ // nothing to do
+ return true;
+}
+
+void KPrLineObject::saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const
+{
+ xmlWriter.addAttribute( "draw:id", "object" + QString::number( indexObj ) );
+
+ double x1 = 0.0;
+ double y1 = 0.0;
+ double x2 = 0.0;
+ double y2 = 0.0;
+ KoPoint center( ext.width() / 2, ext.height() / 2 );
+
+ switch ( lineType )
+ {
+ case LT_LD_RU:
+ x1 = -center.x();
+ y1 = center.y();
+ x2 = -x1;
+ y2 = -y1;
+ break;
+ case LT_HORZ:
+ x1 = -center.x();
+ x2 = -x1;
+ break;
+ case LT_VERT:
+ y1 = -center.y();
+ y2 = -y1;
+ break;
+ case LT_LU_RD:
+ x1 = -center.x();
+ y1 = -center.y();
+ x2 = -x1;
+ y2 = -y1;
+ break;
+ }
+ if ( kAbs( angle ) > 1E-6 )
+ {
+ double angInRad = -angle * M_PI / 180.0;
+ QWMatrix m( cos( angInRad ), -sin( angInRad ), sin( angInRad ), cos( angInRad ), 0, 0 );
+ double transX1 = 0.0;
+ double transY1 = 0.0;
+ double transX2 = 0.0;
+ double transY2 = 0.0;
+ m.map( x1, y1, &transX1, &transY1 );
+ m.map( x2, y2, &transX2, &transY2 );
+ x1 = transX1;
+ y1 = transY1;
+ x2 = transX2;
+ y2 = transY2;
+ }
+
+ x1 += orig.x() + center.x();
+ y1 += orig.y() + center.y();
+ x2 += orig.x() + center.x();
+ y2 += orig.y() + center.y();
+
+ //save all into pt
+ xmlWriter.addAttributePt( "svg:x1", x1 );
+ xmlWriter.addAttributePt( "svg:y1", y1 );
+ xmlWriter.addAttributePt( "svg:x2", x2 );
+ xmlWriter.addAttributePt( "svg:y2", y2 );
+}
+
+const char * KPrLineObject::getOasisElementName() const
+{
+ return "draw:line";
+}
+
+QDomDocumentFragment KPrLineObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment=KPrShadowObject::save(doc, offset);
+ if (lineType!=LT_HORZ)
+ fragment.appendChild(KPrObject::createValueElement("LINETYPE", static_cast<int>(lineType), doc));
+ KPrStartEndLine::save( fragment, doc );
+ return fragment;
+}
+
+void KPrLineObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
+{
+ KPrShadowObject::loadOasis(element, context, info);
+
+ double x1 = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "x1", QString::null ) );
+ double y1 = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y1", QString::null ) );
+ double x2 = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "x2", QString::null ) );
+ double y2 = KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y2", QString::null ) );
+
+ kdDebug()<<" KPrLineObject::loadOasis(const QDomElement &element) : x1 "<< x1 <<" y1 : "<<y1<<" x2 :"<<x2 <<" y2 "<<y2<<endl;
+ double x = QMIN( x1, x2 );
+ double y = QMIN( y1, y2 );
+
+ orig.setX( x );
+ orig.setY( y );
+
+ ext.setWidth( fabs( x1 - x2 ) );
+ ext.setHeight( fabs( y1 - y2 ) );
+
+ if ( y1 == y2 )
+ {
+ lineType=LT_HORZ;
+ //define default height
+ ext.setHeight( 10 );
+ orig.setY( y - 5.0 );
+ }
+ else if ( x1 == x2 )
+ {
+ lineType=LT_VERT;
+ //define default width
+ ext.setWidth( 10 );
+ orig.setX( x - 5.0 );
+ }
+ else if ( ( x1 < x2 && y1 < y2 ) || ( x1 > x2 && y1 > y2 ) )
+ lineType=LT_LU_RD;
+ else
+ lineType=LT_LD_RU;
+
+ kdDebug()<<"KPrLineObject::loadOasis(const QDomElement &element) : real position x :"<<orig.x()<<" y "<<orig.y()<< " width :"<<ext.width()<<" height :"<<ext.height()<<endl;
+
+ QString attr = (x1 <= x2) ? "marker-start" : "marker-end";
+ loadOasisMarkerElement( context, attr, lineBegin );
+
+ attr = (x1 <= x2) ? "marker-end" : "marker-start";
+ loadOasisMarkerElement( context, attr, lineEnd );
+}
+
+double KPrLineObject::load(const QDomElement &element)
+{
+ double offset=KPrShadowObject::load(element);
+ QDomElement e=element.namedItem("LINETYPE").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ lineType=static_cast<LineType>(tmp);
+ }
+ KPrStartEndLine::load( element );
+ return offset;
+}
+
+void KPrLineObject::paint( QPainter* _painter, KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool /*drawingShadow*/, bool drawContour )
+{
+ double ow = ext.width();
+ double oh = ext.height();
+ int _w = int( pen.pointWidth() );
+
+ QPen pen2;
+ if ( drawContour ) {
+ pen2 = QPen( Qt::black, 1, Qt::DotLine );
+ _painter->setRasterOp( Qt::NotXorROP );
+ }
+ else {
+ pen2 = pen.zoomedPen( _zoomHandler );
+ }
+ _painter->setPen( pen2 );
+
+
+ KoSize diff1( 0, 0 ), diff2( 0, 0 );
+
+ float _angle = 0;
+ switch ( lineType )
+ {
+ case LT_HORZ: {
+ _angle = 0;
+ } break;
+ case LT_VERT: {
+ _angle = 90 ;
+ } break;
+ case LT_LU_RD: {
+ KoRect _rect = KoRect( orig, ext );
+ KoPoint pnt1 = _rect.topLeft();
+ KoPoint pnt2 = _rect.bottomRight();
+
+ _angle = KoPoint::getAngle( pnt1, pnt2 ) - 180.0;
+ } break;
+ case LT_LD_RU: {
+ KoRect _rect = KoRect( orig, ext );
+ KoPoint pnt1 = _rect.bottomLeft();
+ KoPoint pnt2 = _rect.topRight();
+
+ _angle = KoPoint::getAngle( pnt1, pnt2 ) - 180.0;
+ } break;
+ }
+
+ if ( lineBegin != L_NORMAL )
+ diff1 = getOffset( lineBegin, _w, _angle + 180.0);
+
+ if ( lineEnd != L_NORMAL )
+ diff2 = getOffset( lineEnd, _w, _angle );
+
+ switch ( lineType )
+ {
+ case LT_HORZ: {
+ if ( lineBegin != L_NORMAL && !drawContour )
+ drawFigure( lineBegin, _painter,
+ KoPoint( 0, oh / 2.0 ),
+ pen2.color(), _w, 180.0, _zoomHandler );
+
+ if ( lineEnd != L_NORMAL && !drawContour )
+ drawFigure( lineEnd, _painter,
+ KoPoint( ow , oh / 2.0),
+ pen2.color(), _w, 0.0, _zoomHandler );
+
+ _painter->drawLine( _zoomHandler->zoomItX( - diff1.width() ),
+ _zoomHandler->zoomItY( oh / 2 ),
+ _zoomHandler->zoomItX( ow - diff2.width() ),
+ _zoomHandler->zoomItY( oh / 2 ) );
+ } break;
+ case LT_VERT: {
+ if ( lineBegin != L_NORMAL && !drawContour )
+ drawFigure( lineBegin, _painter,
+ KoPoint( ow / 2.0, 0 ),
+ pen2.color(), _w, 270.0, _zoomHandler );
+
+ if ( lineEnd != L_NORMAL && !drawContour )
+ drawFigure( lineEnd, _painter,
+ KoPoint( ow / 2.0, oh ),
+ pen2.color(), _w, 90.0, _zoomHandler );
+
+ _painter->drawLine( _zoomHandler->zoomItX( ow / 2 ),
+ _zoomHandler->zoomItX( - diff1.height() ),
+ _zoomHandler->zoomItX( ow / 2 ),
+ _zoomHandler->zoomItY( oh - diff2.height() ) );
+ } break;
+ case LT_LU_RD: {
+ if ( lineBegin != L_NORMAL && !drawContour ) {
+ _painter->save();
+ drawFigure( lineBegin, _painter,
+ KoPoint( 0, 0 ), pen2.color(),
+ _w, _angle + 180, _zoomHandler );
+ _painter->restore();
+ }
+ if ( lineEnd != L_NORMAL && !drawContour ) {
+ _painter->save();
+ _painter->translate( _zoomHandler->zoomItX( ow ),
+ _zoomHandler->zoomItY( oh ) );
+ drawFigure( lineEnd, _painter,
+ KoPoint( 0, 0 ), pen2.color(),
+ _w, _angle, _zoomHandler );
+ _painter->restore();
+
+ }
+ _painter->drawLine( _zoomHandler->zoomItX( - diff1.width() ),
+ _zoomHandler->zoomItY( - diff1.height() ),
+ _zoomHandler->zoomItX( ow - diff2.width() ),
+ _zoomHandler->zoomItY( oh - diff2.height() ) );
+ } break;
+ case LT_LD_RU: {
+ if ( lineBegin != L_NORMAL && !drawContour ) {
+ _painter->save();
+ _painter->translate( _zoomHandler->zoomItX( 0 ),
+ _zoomHandler->zoomItY( oh ) );
+ drawFigure( lineBegin, _painter,
+ KoPoint( 0, 0 ), pen2.color(),
+ _w, _angle + 180,_zoomHandler );
+ _painter->restore();
+ }
+ if ( lineEnd != L_NORMAL && !drawContour ) {
+ _painter->save();
+ _painter->translate( _zoomHandler->zoomItX( ow ),
+ _zoomHandler->zoomItY( 0 ) );
+ drawFigure( lineEnd, _painter,
+ KoPoint( 0, 0 ), pen2.color(),
+ _w, _angle,_zoomHandler );
+ _painter->restore();
+ }
+ _painter->drawLine( _zoomHandler->zoomItX( - diff1.width() ),
+ _zoomHandler->zoomItY( oh - diff1.height() ),
+ _zoomHandler->zoomItX( ow - diff2.width() ),
+ _zoomHandler->zoomItY( - diff2.height() ));
+ } break;
+ }
+}
+
+void KPrLineObject::flip( bool horizontal )
+{
+ KPrObject::flip( horizontal );
+ if ( ! horizontal )
+ {
+ if ( lineType == LT_LU_RD )
+ lineType = LT_LD_RU;
+ else if ( lineType == LT_LD_RU )
+ lineType = LT_LU_RD;
+ }
+ else
+ {
+ if ( lineType == LT_LU_RD )
+ lineType = LT_LD_RU;
+ else if ( lineType == LT_LD_RU )
+ lineType = LT_LU_RD;
+
+ LineEnd tmp = lineBegin;
+ lineBegin = lineEnd;
+ lineEnd = tmp;
+ }
+}
+
+KoSize KPrLineObject::getRealSize() const {
+ KoPoint realOrig( orig );
+ KoSize size( ext );
+
+ KoPointArray points(4);
+
+ if ( lineType == LT_LU_RD || lineType == LT_LD_RU )
+ {
+ double objAngle = atan( ext.width() / ext.height() );
+ double x = cos( objAngle ) * pen.pointWidth();
+ double y = sin( objAngle ) * pen.pointWidth();
+
+ if ( lineType == LT_LU_RD )
+ {
+ points.setPoint( 0, x, 0 );
+ points.setPoint( 1, 0, y );
+ points.setPoint( 2, ext.width() + x, ext.height() );
+ points.setPoint( 3, ext.width(), ext.height() + y );
+ }
+ else
+ {
+ points.setPoint( 0, 0, ext.height() );
+ points.setPoint( 1, x, ext.height() + y );
+ points.setPoint( 2, ext.width(), 0 );
+ points.setPoint( 3, ext.width() + x, y );
+ }
+ realOrig.setX( realOrig.x() - x / 2.0 );
+ realOrig.setY( realOrig.y() - y / 2.0 );
+ size.setWidth( size.width() + x );
+ size.setHeight( size.height() + y );
+ }
+
+ if ( angle == 0.0 && lineType == LT_HORZ )
+ {
+ size.setHeight( pen.pointWidth() );
+ }
+ else if ( angle == 0.0 && lineType == LT_VERT )
+ {
+ size.setWidth( pen.pointWidth() );
+ }
+ else
+ {
+ if ( lineType == LT_HORZ )
+ {
+ points.setPoint( 0, 0, ( ext.height() - pen.pointWidth() ) / 2.0 );
+ points.setPoint( 1, 0, ( ext.height() + pen.pointWidth() ) / 2.0 );
+ points.setPoint( 2, ext.width(), ( ext.height() - pen.pointWidth() ) / 2.0 );
+ points.setPoint( 3, ext.width(), ( ext.height() + pen.pointWidth() ) / 2.0 );
+ }
+ else if ( lineType == LT_VERT )
+ {
+ points.setPoint( 0, ( ext.width() - pen.pointWidth() ) / 2.0, 0 );
+ points.setPoint( 1, ( ext.width() + pen.pointWidth() ) / 2.0, 0 );
+ points.setPoint( 2, ( ext.width() - pen.pointWidth() ) / 2.0, ext.height() );
+ points.setPoint( 3, ( ext.width() + pen.pointWidth() ) / 2.0, ext.height() );
+ }
+
+ getRealSizeAndOrigFromPoints( points, angle, size, realOrig );
+ }
+
+ return size;
+}
+
+KoPoint KPrLineObject::getRealOrig() const {
+ KoPoint realOrig( orig );
+ KoSize size( ext );
+
+ KoPointArray points(4);
+
+ if ( lineType == LT_LU_RD || lineType == LT_LD_RU )
+ {
+ double objAngle = atan( ext.width() / ext.height() );
+ double x = cos( objAngle ) * pen.pointWidth();
+ double y = sin( objAngle ) * pen.pointWidth();
+
+ if ( lineType == LT_LU_RD )
+ {
+ points.setPoint( 0, x, 0 );
+ points.setPoint( 1, 0, y );
+ points.setPoint( 2, ext.width() + x, ext.height() );
+ points.setPoint( 3, ext.width(), ext.height() + y );
+ }
+ else
+ {
+ points.setPoint( 0, 0, ext.height() );
+ points.setPoint( 1, x, ext.height() + y );
+ points.setPoint( 2, ext.width(), 0 );
+ points.setPoint( 3, ext.width() + x, y );
+ }
+ realOrig.setX( realOrig.x() - x / 2.0 );
+ realOrig.setY( realOrig.y() - y / 2.0 );
+ size.setWidth( size.width() + x );
+ size.setHeight( size.height() + y );
+ }
+
+ if ( angle == 0.0 && lineType == LT_HORZ )
+ {
+ realOrig.setY( realOrig.y() + ( ext.height() - pen.pointWidth() ) / 2.0 );
+ }
+ else if ( angle == 0.0 && lineType == LT_VERT )
+ {
+ realOrig.setX( realOrig.x() + ( ext.width() - pen.pointWidth() ) / 2.0 );
+ }
+ else
+ {
+ if ( lineType == LT_HORZ )
+ {
+ points.setPoint( 0, 0, ( ext.height() - pen.pointWidth() ) / 2.0 );
+ points.setPoint( 1, 0, ( ext.height() + pen.pointWidth() ) / 2.0 );
+ points.setPoint( 2, ext.width(), ( ext.height() - pen.pointWidth() ) / 2.0 );
+ points.setPoint( 3, ext.width(), ( ext.height() + pen.pointWidth() ) / 2.0 );
+ }
+ else if ( lineType == LT_VERT )
+ {
+ points.setPoint( 0, ( ext.width() - pen.pointWidth() ) / 2.0, 0 );
+ points.setPoint( 1, ( ext.width() + pen.pointWidth() ) / 2.0, 0 );
+ points.setPoint( 2, ( ext.width() - pen.pointWidth() ) / 2.0, ext.height() );
+ points.setPoint( 3, ( ext.width() + pen.pointWidth() ) / 2.0, ext.height() );
+ }
+
+ getRealSizeAndOrigFromPoints( points, angle, size, realOrig );
+ }
+
+ return realOrig;
+}
diff --git a/kpresenter/KPrLineObject.h b/kpresenter/KPrLineObject.h
new file mode 100644
index 000000000..3785d4438
--- /dev/null
+++ b/kpresenter/KPrLineObject.h
@@ -0,0 +1,84 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kplineobject_h
+#define kplineobject_h
+
+#include "KPrObject.h"
+#include <KoStyleStack.h>
+
+class QPainter;
+class DCOPObject;
+class KoXmlWriter;
+
+class KPrLineObject : public KPrShadowObject, public KPrStartEndLine
+{
+public:
+ KPrLineObject();
+ KPrLineObject( const KoPen &_pen, LineEnd _lineBegin,
+ LineEnd _lineEnd, LineType _lineType );
+ virtual ~KPrLineObject()
+ {}
+
+ virtual DCOPObject* dcopObject();
+
+ KPrLineObject &operator=( const KPrLineObject & );
+
+ virtual void setLineBegin( LineEnd _lineBegin )
+ { lineBegin = _lineBegin; }
+ virtual void setLineEnd( LineEnd _lineEnd )
+ { lineEnd = _lineEnd; }
+ virtual void setLineType( LineType _lineType )
+ { lineType = _lineType; }
+
+ virtual ObjType getType() const
+ { return OT_LINE; }
+ virtual QString getTypeString() const
+ { return i18n("Line"); }
+ virtual LineEnd getLineBegin() const
+ { return lineBegin; }
+ virtual LineEnd getLineEnd() const
+ { return lineEnd; }
+ virtual LineType getLineType() const
+ { return lineType; }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+ virtual double load(const QDomElement &element);
+ virtual void loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info);
+
+ virtual void flip(bool horizontal );
+
+ virtual KoSize getRealSize() const;
+ virtual KoPoint getRealOrig() const;
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+ virtual void saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const;
+
+ virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
+
+ virtual void paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour = FALSE );
+ LineType lineType;
+};
+
+#endif
diff --git a/kpresenter/KPrLineObjectIface.cpp b/kpresenter/KPrLineObjectIface.cpp
new file mode 100644
index 000000000..e9e8664f8
--- /dev/null
+++ b/kpresenter/KPrLineObjectIface.cpp
@@ -0,0 +1,66 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrLineObjectIface.h"
+#include "KPrLineObject.h"
+#include "KPrUtils.h"
+#include "KPrObject.h"
+#include <kdebug.h>
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrLineObjectIface::KPrLineObjectIface( KPrLineObject *_obj )
+ : KPrObjectIface(_obj)
+{
+ obj = _obj;
+}
+
+void KPrLineObjectIface::setLineBegin( const QString & type)
+{
+ obj->setLineBegin(lineEndBeginFromString( type ));
+}
+
+void KPrLineObjectIface::setLineEnd( const QString & type)
+{
+ obj->setLineEnd(lineEndBeginFromString( type ));
+}
+
+QString KPrLineObjectIface::lineBegin()const
+{
+ LineEnd type=obj->getLineBegin();
+ return lineEndBeginName( type );
+}
+
+QString KPrLineObjectIface::lineEnd() const
+{
+ LineEnd type=obj->getLineEnd();
+ return lineEndBeginName( type );
+}
+
+void KPrLineObjectIface::horizontalFlip()
+{
+ obj->flip( true);
+}
+
+void KPrLineObjectIface::verticalFlip()
+{
+ obj->flip( false );
+}
diff --git a/kpresenter/KPrLineObjectIface.h b/kpresenter/KPrLineObjectIface.h
new file mode 100644
index 000000000..b00b4654b
--- /dev/null
+++ b/kpresenter/KPrLineObjectIface.h
@@ -0,0 +1,49 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPLINE_OBJECT_IFACE_H
+#define KPLINE_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObjectIface.h"
+#include <qstring.h>
+
+class KPrLineObject;
+
+class KPrLineObjectIface : public KPrObjectIface
+{
+ K_DCOP
+public:
+ KPrLineObjectIface( KPrLineObject *obj_ );
+
+k_dcop:
+
+ void setLineBegin( const QString & );
+ void setLineEnd( const QString & );
+ QString lineBegin()const;
+ QString lineEnd() const;
+ void horizontalFlip();
+ void verticalFlip();
+private:
+ KPrLineObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrLoadingInfo.h b/kpresenter/KPrLoadingInfo.h
new file mode 100644
index 000000000..3bfea0b91
--- /dev/null
+++ b/kpresenter/KPrLoadingInfo.h
@@ -0,0 +1,87 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRLOADINGINFO_H
+#define KPRLOADINGINFO_H
+
+struct lstAnimation
+{
+ QDomElement *element;
+ int order;
+};
+
+/// Temporary information used only during loading
+class KPrLoadingInfo
+{
+public:
+ KPrLoadingInfo( bool oldFormat = false)
+ : presSpeed( -1 )
+ , m_header( false )
+ , m_footer( false )
+ , m_headerFooterByPage( false )
+ , m_oldFormat( oldFormat )
+ {
+ m_animationsShowDict.setAutoDelete( true );
+ m_animationsHideDict.setAutoDelete( true );
+ }
+ ~KPrLoadingInfo() {}
+
+ lstAnimation* animationShowById( const QString& id ) const {
+ return m_animationsShowDict[id]; // returns 0 if not found
+ }
+ void storePresentationShowAnimation( lstAnimation * element, const QString& id ) {
+ m_animationsShowDict.insert( id , element );
+ }
+ void clearAnimationShowDict() {
+ QDictIterator<lstAnimation> it( m_animationsShowDict ); // See QDictIterator
+ for( ; it.current(); ++it )
+ {
+ delete it.current()->element;
+ }
+ m_animationsShowDict.clear();
+ }
+
+ lstAnimation* animationHideById( const QString& id ) const {
+ return m_animationsHideDict[id]; // returns 0 if not found
+ }
+ void storePresentationHideAnimation( lstAnimation * element, const QString& id ) {
+ m_animationsHideDict.insert( id , element );
+ }
+ void clearAnimationHideDict() {
+ QDictIterator<lstAnimation> it( m_animationsHideDict ); // See QDictIterator
+ for( ; it.current(); ++it )
+ {
+ delete it.current()->element;
+ }
+ m_animationsHideDict.clear();
+ }
+ bool oldFormat() const { return m_oldFormat; }
+ int presSpeed;
+ QMap<QString, KPrPage *> m_name2page;
+ bool m_header;
+ bool m_footer;
+ bool m_headerFooterByPage;
+private:
+ QDict<lstAnimation> m_animationsShowDict;
+ QDict<lstAnimation> m_animationsHideDict;
+ bool m_oldFormat;
+};
+
+#endif /* KPRLOADINGINFO_H */
+
diff --git a/kpresenter/KPrMSPresentationSetup.cpp b/kpresenter/KPrMSPresentationSetup.cpp
new file mode 100644
index 000000000..eb6396047
--- /dev/null
+++ b/kpresenter/KPrMSPresentationSetup.cpp
@@ -0,0 +1,619 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright 2004 Brad Hards <bradh@frogmouth.net>
+ Loosely based on webpresention.cc, which is:
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright 2001, 2002 Nicolas GOUTTE <goutte@kde.org>
+ Copyright 2002 Ariya Hidayat <ariya@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrMSPresentationSetup.h"
+
+#include "KPrView.h"
+#include "KPrDocument.h"
+
+#include "KPrCanvas.h"
+#include "KPrPage.h"
+
+#include <kio/netaccess.h>
+#include <ktempfile.h>
+
+#include <qdir.h>
+#include <qframe.h>
+#include <qfileinfo.h>
+#include <qhbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpixmap.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+
+#include <kapplication.h>
+#include <kbuttonbox.h>
+#include <kcolorbutton.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <klineedit.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprogress.h>
+#include <kstandarddirs.h>
+#include <kurlrequester.h>
+#include <kstdguiitem.h>
+#include <kpushbutton.h>
+
+KPrMSPresentation::KPrMSPresentation( KPrDocument *_doc, KPrView *_view )
+{
+ doc = _doc;
+ view = _view;
+ init();
+}
+
+KPrMSPresentation::KPrMSPresentation( const KPrMSPresentation &msPres )
+ : title( msPres.title ),
+ slideInfos( msPres.slideInfos ), backColour( msPres.backColour ),
+ textColour( msPres.textColour ), path( msPres.path )
+{
+ doc = msPres.doc;
+ view = msPres.view;
+}
+
+void KPrMSPresentation::initCreation( KProgress *progressBar )
+{
+ int p;
+
+ // the title images, and the subsequent real images need to
+ // be in a file under DCIM/, and they start at 101MSPJP, so
+ // we create the DCIM file, and then iterate through looking
+ // for the next "available" directory slot
+ KURL str( path + "/DCIM" );
+ KIO::NetAccess::mkdir( str,( QWidget* )0L );
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ for (int dirNum = 101; dirNum < 999; dirNum++) {
+ slidePath = QString("/DCIM/%1MSPJP").arg(dirNum);
+ if (! KIO::NetAccess::exists(( path + slidePath), true, ( QWidget* )0L) )
+ break;
+ }
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ str = ( path + slidePath );
+ KIO::NetAccess::mkdir( str,( QWidget* )0L );
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ // now do the SPP file directory
+ str = ( path + "/MSSONY" );
+ KIO::NetAccess::mkdir( str,( QWidget* )0L );
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+ str = ( path + "/MSSONY/PJ" );
+ KIO::NetAccess::mkdir( str,( QWidget* )0L );
+
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ // create the title slides
+ QPixmap titleSlide( 1024, 768 );
+ titleSlide.fill( backColour );
+ QPainter painter( &titleSlide );
+
+ //the second title is just blank, so create that now
+ KTempFile tmp;
+ QString filename = path + slidePath + "/SPJT0002.JPG";
+ titleSlide.save( tmp.name(), "JPEG" );
+ KIO::NetAccess::file_move( tmp.name(), filename, -1, true /*overwrite*/);
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ // and put the specified title string on the first slide
+ QFont textFont( "SansSerif", 96 );
+ painter.setFont( textFont );
+ painter.setPen( textColour );
+ painter.drawText( titleSlide.rect(), Qt::AlignCenter | Qt::WordBreak, title );
+ filename = path + slidePath + "/SPJT0001.JPG";
+
+ KTempFile tmp2;
+ titleSlide.save( tmp2.name(), "JPEG" );
+ KIO::NetAccess::file_move( tmp2.name(), filename, -1, true /*overwrite*/);
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+}
+
+void KPrMSPresentation::createSlidesPictures( KProgress *progressBar )
+{
+ if ( slideInfos.isEmpty() )
+ return;
+ QString filename;
+ int p;
+ for ( unsigned int i = 0; i < slideInfos.count(); i++ ) {
+ int pgNum = slideInfos[i].pageNumber;
+ filename.sprintf("/SPJP%04i.JPG", i+3);
+
+ KTempFile tmp;
+
+ view->getCanvas()->exportPage( pgNum, 1023, 767,
+ tmp.name(), "JPEG" );
+
+ KIO::NetAccess::file_move( tmp.name(), ( path + slidePath + filename ), -1, true /*overwrite*/);
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+ }
+}
+
+void KPrMSPresentation::createIndexFile( KProgress *progressBar )
+{
+ int p;
+ KTempFile sppFile;
+
+ QString filenameStore = (path + "/MSSONY/PJ/" + title + ".SPP");
+
+ QDataStream sppStream( sppFile.file() );
+ sppStream.setByteOrder(QDataStream::LittleEndian);
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ // We are doing little endian
+ sppStream << (Q_UINT32)0x00505053; // SPP magic header
+ sppStream << (Q_UINT32)0x00000000; // four null bytes
+ sppStream << (Q_UINT32)0x30303130; // version(?) 0100
+ sppStream << (Q_UINT32)0x00000000; // more nulls
+ sppStream << (Q_UINT32)(slideInfos.count());
+
+ // DCIM path 1, 68 bytes null padded
+ char buff[68];
+ strncpy( buff, QString("%1").arg(slidePath).ascii(), 67 );
+ buff[67] = 0x00;
+ sppStream.writeRawBytes( buff, 68 );
+ sppStream << (Q_UINT32)0x00000001; // fixed value
+ sppStream << (Q_UINT32)0x00000005; // fixed value
+ sppStream << (Q_UINT32)0x00000000; // more nulls
+ sppStream << (Q_UINT32)0x00000000; // more nulls
+ sppStream << (Q_UINT32)0x00000000; // more nulls
+ sppStream << (Q_UINT32)0x00000000; // more nulls
+ sppStream << (Q_UINT32)0x00000000; // more nulls
+ sppStream << (Q_UINT32)0x00000000; // more nulls
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ // title 1, 16 bytes null padded
+ strncpy( buff, "SPJT0001.JPG", 15 );
+ buff[15] = 0x00;
+ sppStream.writeRawBytes( buff, 16 );
+
+ // title 2, 16 bytes null padded
+ strncpy( buff, "SPJT0002.JPG", 15 );
+ buff[15] = 0x00;
+ sppStream.writeRawBytes( buff, 16 );
+
+
+ // type face (?), 44 bytes null padded
+ strncpy( buff, "MS Sans Serif", 43 );
+ buff[44] = 0x00;
+ sppStream.writeRawBytes( buff, 44 );
+
+ //not really sure what this is about
+ sppStream << (Q_UINT32)0xffff0000;
+ sppStream << (Q_UINT32)0xffff00ff;
+ sppStream << (Q_UINT32)0xffff00ff;
+ sppStream << (Q_UINT32)0x000000ff;
+ sppStream << (Q_UINT32)0x00000002;
+ for (int i = 0; i < (296/4); i++) {
+ sppStream << (Q_UINT32)0x00000000;
+ }
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ // Add in the slide filenames
+ QString filename;
+ for ( unsigned int i = 0; i < slideInfos.count(); i++ ) {
+ filename.sprintf("SPJP%04i.JPG", i+3);
+ strncpy( buff, filename.ascii(), 63 );
+ buff[64] = 0x00;
+ sppStream.writeRawBytes( buff, 64 );
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+ }
+
+ // OK, now we need to fill to 16384 bytes
+ // the logic is 16384 bytes total, lead in is 512 bytes, and there
+ // is 64 bytes for each real slide
+ for(unsigned int i = 0; i < (16384-512-64*(slideInfos.count()))/4; i++) {
+ sppStream << (Q_UINT32)0x00000000;
+ }
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ sppFile.close();
+ KIO::NetAccess::file_move( sppFile.name(), filenameStore, -1, true /*overwrite*/);
+}
+
+void KPrMSPresentation::init()
+{
+ title = i18n("Slideshow");
+
+ for ( unsigned int i = 0; i < doc->getPageNums(); i++ )
+ {
+ if ( doc->isSlideSelected( i ) )
+ {
+ SlideInfo info;
+ info.pageNumber = i;
+ slideInfos.append( info );
+ }
+ }
+ if ( slideInfos.isEmpty() )
+ kdWarning() << "No slides selected!" << endl;
+ backColour = Qt::black;
+ textColour = Qt::white;
+
+ path = KGlobalSettings::documentPath();
+}
+
+KPrMSPresentationSetup::KPrMSPresentationSetup( KPrDocument *_doc, KPrView *_view )
+ : QDialog( 0, "", false ), msPres( _doc, _view )
+{
+ doc = _doc;
+ view = _view;
+
+
+ QLabel *helptext = new QLabel( this );
+ helptext->setAlignment( Qt::WordBreak | Qt::AlignTop| Qt::AlignLeft );
+ helptext->setText( i18n( "Please enter the directory where the memory stick "
+ "presentation should be saved. Please also enter a "
+ "title for the slideshow presentation. " ) );
+
+ QLabel *lable2 = new QLabel( i18n("Path:"), this );
+ lable2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ path=new KURLRequester( this );
+ path->setMode( KFile::Directory);
+ path->lineEdit()->setText(msPres.getPath());
+ lable2->setBuddy(path);
+ QHBoxLayout *pathLayout = new QHBoxLayout;
+ pathLayout->addWidget(lable2);
+ pathLayout->addWidget(path);
+
+ connect( path, SIGNAL( textChanged(const QString&) ),
+ this, SLOT( slotChoosePath(const QString&) ) );
+ connect( path, SIGNAL( urlSelected( const QString&) ),
+ this, SLOT( slotChoosePath(const QString&) ) );
+
+
+ QLabel *lable1 = new QLabel( i18n("Title:"), this, "lable1" );
+ lable1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ // TODO - check if there is already a presentation with this title, and
+ // add a number after it until there isn't.
+ title = new KLineEdit( msPres.getTitle(), this );
+ lable1->setBuddy( title );
+ QHBoxLayout *titleLayout = new QHBoxLayout;
+ titleLayout->addWidget( lable1 );
+ titleLayout->addWidget( title );
+
+ QHBox *moreBox = new QHBox( this );
+ QPushButton *showColourButton = new QPushButton( i18n("&Set Colors"), moreBox );
+ showColourButton->setToggleButton( true );
+ connect( showColourButton, SIGNAL( toggled(bool) ), this, SLOT( showColourGroup(bool) ) );
+
+ QVBoxLayout *topLayout = new QVBoxLayout;
+ topLayout->addWidget( helptext );
+ topLayout->addSpacing( 10 );
+ topLayout->addLayout( pathLayout );
+ topLayout->addLayout( titleLayout );
+ topLayout->addWidget( moreBox );
+
+ colourGroup = new QGroupBox( 2, Qt::Vertical,
+ i18n("Preliminary Slides"),
+ this , "colourBox" );
+ QWhatsThis::add( colourGroup,
+ i18n( "This section allows you to set the colors for "
+ "the preliminary slides; it does not affect the "
+ "presentation in any way, and it is normal to "
+ "leave these set to the default.") );
+ QHBox *textColourLayout = new QHBox( colourGroup );
+ QLabel *lable3 = new QLabel( i18n("Text color:"), textColourLayout );
+ lable3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ textColour = new KColorButton( msPres.getTextColour(), textColourLayout );
+ lable3->setBuddy( textColour );
+
+ QHBox *backgroundColourLayout = new QHBox( colourGroup );
+ QLabel *lable4 = new QLabel( i18n("Background color:"), backgroundColourLayout );
+ lable4->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ backColour = new KColorButton( msPres.getBackColour(), backgroundColourLayout );
+ lable4->setBuddy( backColour );
+ colourGroup->setHidden( true );
+
+ QHBox *buttonLayout = new QHBox( this );
+ KPushButton *helpButton = new KPushButton( KStdGuiItem::help(), buttonLayout );
+ QWhatsThis::add( helpButton,
+ i18n( "Selecting this button will take you to the KPresenter "
+ "documentation that provides more information on how "
+ "to use the Memory Stick export function. ") );
+ KPushButton *createButton = new KPushButton( KStdGuiItem::ok(), buttonLayout );
+ QWhatsThis::add( createButton,
+ i18n( "Selecting this button will proceed to generating "
+ "the presentation in the special Sony format." ) );
+ KPushButton *cancelButton = new KPushButton( KStdGuiItem::cancel(), buttonLayout );
+ QWhatsThis::add( cancelButton,
+ i18n( "Selecting this button will cancel out of the "
+ "generation of the presentation, and return "
+ "to the normal KPresenter view. No files will "
+ "be affected." ) );
+
+ mainLayout = new QVBoxLayout( this );
+ mainLayout->setMargin(11);
+ mainLayout->setSpacing(6);
+ mainLayout->addLayout(topLayout);
+ mainLayout->addSpacing( 10 );
+ mainLayout->addWidget(colourGroup);
+ mainLayout->addWidget(buttonLayout);
+ mainLayout->setResizeMode( QLayout::Fixed );
+ mainLayout->setGeometry( QRect( 0, 0, 300, 220 ) );
+
+ connect( helpButton, SIGNAL( clicked() ), this, SLOT ( helpMe() ) );
+ connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( createButton, SIGNAL( clicked() ), this, SLOT( finish() ) );
+}
+
+KPrMSPresentationSetup::~KPrMSPresentationSetup()
+{
+ view->enableMSPres();
+}
+
+void KPrMSPresentationSetup::createMSPresentation( KPrDocument *_doc, KPrView *_view )
+{
+ KPrMSPresentationSetup *dlg = new KPrMSPresentationSetup( _doc, _view );
+
+ dlg->setCaption( i18n( "Create Memory Stick Slideshow" ) );
+ dlg->exec();
+ delete dlg;
+}
+
+void KPrMSPresentationSetup::showColourGroup(bool on)
+{
+ if (on) {
+ colourGroup->setHidden( false );
+ mainLayout->setGeometry( QRect(0, 0, 300, 220 ) );
+ } else {
+ colourGroup->setHidden( true );
+ mainLayout->setGeometry( QRect(0, 0, 300, 320 ) );
+ }
+}
+
+void KPrMSPresentationSetup::helpMe()
+{
+ kapp->invokeHelp("ms-export");
+}
+
+void KPrMSPresentationSetup::finish()
+{
+ msPres.setTitle( title->text() );
+
+ msPres.setBackColour( backColour->color() );
+ msPres.setTextColour( textColour->color() );
+ msPres.setPath( path->lineEdit()->text() );
+
+ // Things to sanity check:
+ // 1. that the directory exists. If not, offer to create it.
+ // 2. that the directory is writable.
+ // 3. that the .spp file doesn't already exist. If it does, offer to overwrite it.
+ // If we fail to create a directory, or the user tells us not to bother creating it,
+ // or the user doesn't want to overwrite it, go back.
+ QString pathname = path->lineEdit()->text();
+
+ // path doesn't exist. ask user if it should be created.
+ if ( !KIO::NetAccess::exists(pathname, false, this) ) {
+ QString msg = i18n( "<qt>The directory <b>%1</b> does not exist.<br>"
+ "Do you want create it?</qt>" );
+ if( KMessageBox::questionYesNo( this, msg.arg( pathname ),
+ i18n( "Directory Not Found" ) )
+ == KMessageBox::Yes)
+ {
+ // we are trying to create the directory
+ QDir dir;
+ bool ok = KIO::NetAccess::mkdir( pathname,this );
+ if( !ok ) {
+ // then directory couldn't be created
+ KMessageBox::sorry( this,
+ i18n( "Cannot create directory." ) );
+ path->setFocus();
+ return;
+ }
+ }
+ else {
+ // user preferred not to create directory
+ path->setFocus();
+ return;
+ }
+ }
+
+ QString sppFile( pathname + "/MSSONY/PJ/" + title->text() + ".SPP" );
+ if (KIO::NetAccess::exists(sppFile, false, this ) ) {
+ if ( KMessageBox::warningYesNo( 0,
+ i18n( "You are about to overwrite an existing index "
+ "file : %1.\n "
+ "Do you want to proceed?" ).arg( sppFile ),
+ i18n( "Overwrite Presentation" ) )
+ == KMessageBox::No) {
+ path->setFocus();
+ return;
+ }
+ }
+
+ close();
+
+ KPrMSPresentationCreateDialog::createMSPresentation( doc, view, msPres );
+
+}
+
+void KPrMSPresentationSetup::slotChoosePath(const QString &text)
+{
+ msPres.setPath(text);
+}
+
+
+
+
+KPrMSPresentationCreateDialog::KPrMSPresentationCreateDialog( KPrDocument *_doc, KPrView *_view,
+ const KPrMSPresentation &_msPres )
+ : QDialog( 0, "", false ), msPres( _msPres )
+{
+ doc = _doc;
+ view = _view;
+
+ setupGUI();
+}
+
+KPrMSPresentationCreateDialog::~KPrMSPresentationCreateDialog()
+{
+ view->enableMSPres();
+}
+
+void KPrMSPresentationCreateDialog::createMSPresentation( KPrDocument *_doc, KPrView *_view,
+ const KPrMSPresentation &_msPres )
+{
+ KPrMSPresentationCreateDialog *dlg = new KPrMSPresentationCreateDialog( _doc, _view, _msPres );
+
+ dlg->setCaption( i18n( "Create Memory Stick Slideshow" ) );
+ dlg->resize( 400, 250 );
+ dlg->show();
+ dlg->start();
+}
+
+void KPrMSPresentationCreateDialog::start()
+{
+ setCursor( waitCursor );
+ initCreation();
+ createSlidesPictures();
+ createIndexFile();
+ setCursor( arrowCursor );
+
+ bDone->setEnabled( true );
+}
+
+void KPrMSPresentationCreateDialog::initCreation()
+{
+ QFont f = step1->font(), f2 = step1->font();
+ f.setBold( true );
+ step1->setFont( f );
+
+ progressBar->setProgress( 0 );
+ progressBar->setTotalSteps( msPres.initSteps() );
+
+ msPres.initCreation( progressBar );
+
+ step1->setFont( f2 );
+ progressBar->setProgress( progressBar->totalSteps() );
+}
+
+void KPrMSPresentationCreateDialog::createSlidesPictures()
+{
+ QFont f = step2->font(), f2 = f;
+ f.setBold( true );
+ step2->setFont( f );
+
+ progressBar->setProgress( 0 );
+ if ( msPres.slidesSteps() > 0 )
+ {
+ progressBar->setTotalSteps( msPres.slidesSteps() );
+ msPres.createSlidesPictures( progressBar );
+ }
+
+ step2->setFont( f2 );
+ progressBar->setProgress( progressBar->totalSteps() );
+}
+
+void KPrMSPresentationCreateDialog::createIndexFile()
+{
+ QFont f = step3->font(), f2 = f;
+ f.setBold( true );
+ step3->setFont( f );
+
+ progressBar->setProgress( 0 );
+ if ( msPres.indexFileSteps() > 0 )
+ {
+ progressBar->setTotalSteps( msPres.indexFileSteps() );
+ msPres.createIndexFile( progressBar );
+ }
+
+ step3->setFont( f2 );
+ progressBar->setProgress( progressBar->totalSteps() );
+}
+
+void KPrMSPresentationCreateDialog::setupGUI()
+{
+ back = new QVBox( this );
+ back->setMargin( KDialog::marginHint() );
+
+ QFrame *line;
+
+ step1 = new QLabel( i18n( "Create directory structure" ), back );
+ step2 = new QLabel( i18n( "Create pictures of the slides" ), back );
+ step3 = new QLabel( i18n( "Create index file" ), back );
+
+ line = new QFrame( back );
+ line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ line->setMaximumHeight( 20 );
+
+ progressBar = new KProgress( back );
+
+ line = new QFrame( back );
+ line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ line->setMaximumHeight( 20 );
+
+ KButtonBox *bb = new KButtonBox( back );
+ bb->addStretch();
+ bDone = bb->addButton( i18n( "Done" ) );
+
+ bDone->setEnabled( false );
+
+ connect( bDone, SIGNAL( clicked() ), this, SLOT( accept() ) );
+}
+
+void KPrMSPresentationCreateDialog::resizeEvent( QResizeEvent *e )
+{
+ QDialog::resizeEvent( e );
+ back->resize( size() );
+}
+
+#include "KPrGradient.h"
+#include "KPrMSPresentationSetup.moc"
diff --git a/kpresenter/KPrMSPresentationSetup.h b/kpresenter/KPrMSPresentationSetup.h
new file mode 100644
index 000000000..7bceb4120
--- /dev/null
+++ b/kpresenter/KPrMSPresentationSetup.h
@@ -0,0 +1,159 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004 Brad Hards <bradh@frogmouth.net>
+ Based heavily on webpresentation.h, which is:
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef mspresentation_h
+#define mspresentation_h
+
+#include <kwizard.h>
+
+#include <qdialog.h>
+#include <qvaluelist.h>
+
+
+class KPrDocument;
+class KPrView;
+
+class KURLRequester;
+class KColorButton;
+class KListView;
+class KIntNumInput;
+class KLineEdit;
+class KComboBox;
+
+class QVBox;
+class QHBox;
+
+class QListViewItem;
+class QCloseEvent;
+class KProgress;
+class QLabel;
+class QGroupBox;
+class QVBoxLayout;
+
+class KPrMSPresentation
+{
+public:
+
+ KPrMSPresentation( KPrDocument *_doc, KPrView *_view );
+ KPrMSPresentation( const KPrMSPresentation &msPres );
+
+ void setTitle( const QString &_title )
+ { title = _title; }
+ void setBackColour( const QColor &_backColour )
+ { backColour = _backColour; }
+ void setTextColour( const QColor &_textColour )
+ { textColour = _textColour; }
+ void setPath( const QString &_path )
+ { path = _path; }
+
+ QString getTitle() const { return title; }
+ QColor getBackColour() const { return backColour; }
+ QColor getTextColour() const { return textColour; }
+ QString getPath() const { return path; }
+
+ struct SlideInfo {
+ int pageNumber; /* 0-based */
+ };
+ QValueList<SlideInfo> getSlideInfos() const { return slideInfos; }
+
+ int initSteps() const { return 7; }
+ int slidesSteps() { return slideInfos.count(); }
+ int indexFileSteps() const { return 4 + slideInfos.count(); }
+
+ void initCreation( KProgress *progressBar );
+ void createSlidesPictures( KProgress *progressBar );
+ void createIndexFile( KProgress *progressBar );
+
+protected:
+ void init();
+
+ KPrDocument *doc;
+ KPrView *view;
+
+ QString title;
+ QValueList<SlideInfo> slideInfos;
+ QColor backColour, textColour;
+ QString path;
+ QString slidePath; // directory relative to path, containing slides
+
+};
+
+class KPrMSPresentationSetup : public QDialog
+{
+ Q_OBJECT
+
+public:
+ KPrMSPresentationSetup( KPrDocument *_doc, KPrView *_view );
+ ~KPrMSPresentationSetup();
+
+ static void createMSPresentation( KPrDocument *_doc, KPrView *_view );
+
+protected:
+ KPrDocument *doc;
+ KPrView *view;
+ KPrMSPresentation msPres;
+
+ KLineEdit *title;
+ KColorButton *textColour, *backColour;
+ QGroupBox *colourGroup;
+ QVBoxLayout *mainLayout;
+ KURLRequester *path;
+
+protected slots:
+ void slotChoosePath(const QString &);
+ virtual void finish();
+ virtual void helpMe();
+ void showColourGroup(bool on);
+};
+
+class KPrMSPresentationCreateDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ KPrMSPresentationCreateDialog( KPrDocument *_doc, KPrView *_view, const KPrMSPresentation &_msPres );
+ ~KPrMSPresentationCreateDialog();
+
+ static void createMSPresentation( KPrDocument *_doc, KPrView *_view, const KPrMSPresentation &_msPres );
+
+ void start();
+
+ void initCreation();
+ void createSlidesPictures();
+ void createIndexFile();
+
+protected:
+ void setupGUI();
+ void resizeEvent( QResizeEvent *e );
+
+ KPrView *view;
+ KPrDocument *doc;
+ KPrMSPresentation msPres;
+
+ KProgress *progressBar;
+ QLabel *step1, *step2, *step3;
+ QPushButton *bDone;
+ QVBox *back;
+
+};
+#endif
+
diff --git a/kpresenter/KPrMarginWidget.cpp b/kpresenter/KPrMarginWidget.cpp
new file mode 100644
index 000000000..3a5874d4d
--- /dev/null
+++ b/kpresenter/KPrMarginWidget.cpp
@@ -0,0 +1,129 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ The code is mostly a copy from kword/framedia.cc
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrMarginWidget.h"
+
+#include <qgroupbox.h>
+#include <qcheckbox.h>
+#include <qlayout.h>
+
+#include <klocale.h>
+#include <knuminput.h>
+
+#include "marginui.h"
+#include <KoUnitWidgets.h>//for KoUnitDoubleSpinBox
+
+KPrMarginWidget::KPrMarginWidget( QWidget *parent, const char *name, const KoUnit::Unit unit )
+: QWidget( parent, name )
+, m_unit( unit )
+, m_changed( false )
+, m_noSignal( false )
+{
+ QVBoxLayout *layout = new QVBoxLayout( this );
+
+ m_ui = new MarginUI( this );
+ layout->addWidget( m_ui );
+
+ QSpacerItem *spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
+ layout->addItem( spacer );
+
+ m_ui->margins->setTitle( i18n( "Margins" ) );
+
+ double dStep = KoUnit::fromUserValue( 0.5, unit );
+ double dMax = KoUnit::fromUserValue( 9999, unit );
+ m_ui->leftInput->setUnit( unit );
+ m_ui->leftInput->setMinMaxStep( 0, dMax, dStep );
+
+ m_ui->rightInput->setUnit( unit );
+ m_ui->rightInput->setMinMaxStep( 0, dMax, dStep );
+
+ m_ui->topInput->setUnit( unit );
+ m_ui->topInput->setMinMaxStep( 0, dMax, dStep );
+
+ m_ui->bottomInput->setUnit( unit );
+ m_ui->bottomInput->setMinMaxStep( 0, dMax, dStep );
+
+ connect( m_ui->leftInput, SIGNAL( valueChanged( double ) ),
+ this, SLOT( slotValueChanged( double ) ) );
+ connect( m_ui->rightInput, SIGNAL( valueChanged( double ) ),
+ this, SLOT( slotValueChanged( double ) ) );
+ connect( m_ui->topInput, SIGNAL( valueChanged( double ) ),
+ this, SLOT( slotValueChanged( double ) ) );
+ connect( m_ui->bottomInput, SIGNAL( valueChanged( double ) ),
+ this, SLOT( slotValueChanged( double ) ) );
+}
+
+
+KPrMarginWidget::~KPrMarginWidget()
+{
+}
+
+
+void KPrMarginWidget::setValues( double left, double right, double top, double bottom )
+{
+ m_ui->leftInput->changeValue( left );
+ m_ui->rightInput->changeValue( right );
+ m_ui->topInput->changeValue( top );
+ m_ui->bottomInput->changeValue( bottom );
+}
+
+
+double KPrMarginWidget::leftValue() const
+{
+ return m_ui->leftInput->value();
+}
+
+
+double KPrMarginWidget::rightValue() const
+{
+ return m_ui->rightInput->value();
+}
+
+
+double KPrMarginWidget::topValue() const
+{
+ return m_ui->topInput->value();
+}
+
+
+double KPrMarginWidget::bottomValue() const
+{
+ return m_ui->bottomInput->value();
+}
+
+
+void KPrMarginWidget::slotValueChanged( double val )
+{
+ m_changed = true;
+ if ( m_ui->synchronize->isChecked() && !m_noSignal )
+ {
+ m_noSignal = true;
+ m_ui->leftInput->setValue( val );
+ m_ui->bottomInput->setValue( val );
+ m_ui->rightInput->setValue( val );
+ m_ui->topInput->setValue( val );
+ m_noSignal = false;
+ }
+}
+
+
+#include "KPrMarginWidget.moc"
diff --git a/kpresenter/KPrMarginWidget.h b/kpresenter/KPrMarginWidget.h
new file mode 100644
index 000000000..3352aee0f
--- /dev/null
+++ b/kpresenter/KPrMarginWidget.h
@@ -0,0 +1,57 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ The code is mostly a copy from kword/framedia.h
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#ifndef KPMARGINWIDGET_H
+#define KPMARGINWIDGET_H
+
+#include <qwidget.h>
+
+#include <KoUnit.h>
+
+class MarginUI;
+
+class KPrMarginWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrMarginWidget( QWidget *parent, const char *name, const KoUnit::Unit unit );
+ ~KPrMarginWidget();
+
+ bool changed() const { return m_changed; }
+ void resetChanged() { m_changed = false; }
+
+ void setValues( double left, double right, double top, double bottom ); // in pt
+ double leftValue() const; // in pt
+ double rightValue() const; // in pt
+ double topValue() const; // in pt
+ double bottomValue() const; // in pt
+
+private:
+ MarginUI *m_ui;
+ KoUnit::Unit m_unit;
+ bool m_changed;
+ bool m_noSignal;
+
+protected slots:
+ void slotValueChanged( double );
+};
+
+#endif /* KPMARGINWIDGET_H */
diff --git a/kpresenter/KPrMoveHelpLineDia.cpp b/kpresenter/KPrMoveHelpLineDia.cpp
new file mode 100644
index 000000000..f01dd1e7f
--- /dev/null
+++ b/kpresenter/KPrMoveHelpLineDia.cpp
@@ -0,0 +1,154 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Montel Laurent <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <klocale.h>
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <knuminput.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+#include <KoUnit.h>
+#include <klineedit.h>
+#include <knumvalidator.h>
+#include <KoUnitWidgets.h>
+
+#include "KPrMoveHelpLineDia.h"
+#include "KPrDocument.h"
+
+
+KPrMoveHelpLineDia::KPrMoveHelpLineDia( QWidget *parent, double value, double limitTop, double limitBottom,
+ KPrDocument *_doc, const char *name)
+ : KDialogBase( parent, name , true, "", Ok | Cancel | User1, Ok, true )
+{
+ m_doc=_doc;
+ m_bRemoveLine = false;
+
+ setButtonText( KDialogBase::User1, i18n("Remove") );
+ setCaption( i18n("Change Help Line Position") );
+ QVBox *page = makeVBoxMainWidget();
+ new QLabel(i18n("Position:"), page);
+ position= new KoUnitDoubleSpinBox( page, QMAX(0.00, limitTop), QMAX(0.00, limitBottom), 1, QMAX(0.00, value));
+ position->setUnit(m_doc->unit() );
+
+ connect( this, SIGNAL( user1Clicked() ), this ,SLOT( slotRemoveHelpLine() ));
+ resize( 300,100 );
+}
+
+void KPrMoveHelpLineDia::slotRemoveHelpLine()
+{
+ m_bRemoveLine = true;
+ KDialogBase::slotOk();
+}
+
+double KPrMoveHelpLineDia::newPosition() const
+{
+ return position->value();
+}
+
+
+KPrInsertHelpLineDia::KPrInsertHelpLineDia( QWidget *parent, const KoRect & _pageRect,
+ KPrDocument *_doc, const char *name)
+ : KDialogBase( parent, name , true, "", Ok|Cancel, Ok, true )
+{
+ limitOfPage=_pageRect;
+ m_doc=_doc;
+ setCaption( i18n("Add New Help Line") );
+ QVBox *page = makeVBoxMainWidget();
+ QButtonGroup *group = new QButtonGroup( 1, QGroupBox::Horizontal,i18n("Orientation"), page );
+ group->setRadioButtonExclusive( TRUE );
+ group->layout();
+ m_rbHoriz = new QRadioButton( i18n("Horizontal"), group );
+ m_rbVert = new QRadioButton( i18n("Vertical"), group );
+
+ connect( group , SIGNAL( clicked( int) ), this, SLOT( slotRadioButtonClicked() ));
+
+ new QLabel(i18n("Position:"), page);
+
+ position= new KoUnitDoubleSpinBox( page,QMAX(0.00, limitOfPage.top() ), QMAX(0.00, limitOfPage.bottom()),1,0.00 );
+
+ position->setUnit( m_doc->unit() );
+ m_rbHoriz->setChecked( true );
+ resize( 300,100 );
+}
+
+double KPrInsertHelpLineDia::newPosition() const
+{
+ return position->value();
+}
+
+bool KPrInsertHelpLineDia::addHorizontalHelpLine()
+{
+ return m_rbHoriz->isChecked();
+}
+
+void KPrInsertHelpLineDia::slotRadioButtonClicked()
+{
+ if ( m_rbHoriz->isChecked() )
+ {
+ position->setMinValue( QMAX(0.00, limitOfPage.top() ) );
+ position->setMaxValue( QMAX(0.00, limitOfPage.bottom() ) );
+ }
+ else if ( m_rbVert->isChecked() )
+ {
+ position->setMinValue( QMAX(0.00, limitOfPage.left()) );
+ position->setMaxValue( QMAX(0.00, limitOfPage.right()) );
+ }
+}
+
+KPrInsertHelpPointDia::KPrInsertHelpPointDia( QWidget *parent, const KoRect & _pageRect,
+ KPrDocument *_doc, double posX, double posY, const char *name)
+ : KDialogBase( parent, name , true, "", Ok|Cancel| User1, Ok, true ),
+ m_bRemovePoint( false )
+{
+ limitOfPage=_pageRect;
+ m_doc=_doc;
+ setButtonText( KDialogBase::User1, i18n("Remove") );
+ setCaption( i18n("Add New Help Point") );
+ QVBox *page = makeVBoxMainWidget();
+ QLabel *lab=new QLabel(i18n("X position:"), page);
+ positionX= new KoUnitDoubleSpinBox( page, QMAX(0.00, limitOfPage.left()),QMAX(0.00, limitOfPage.right()),1,QMAX(0.00, posX) ) ;
+ positionX->setUnit( m_doc->unit() );
+
+
+ lab=new QLabel(i18n("Y position:"), page);
+ positionY= new KoUnitDoubleSpinBox( page, QMAX(0.00, limitOfPage.top()),QMAX(0.00, limitOfPage.bottom()),1, QMAX(0.00, posY) );
+ positionY->setUnit( m_doc->unit() );
+
+ showButton( KDialogBase::User1, (posX!=0.0 || posY!=0.0) );
+
+ connect( this, SIGNAL( user1Clicked() ), this ,SLOT( slotRemoveHelpPoint() ));
+
+ resize( 300,100 );
+}
+
+KoPoint KPrInsertHelpPointDia::newPosition() const
+{
+ return KoPoint( positionX->value(),
+ positionY->value() );
+}
+
+void KPrInsertHelpPointDia::slotRemoveHelpPoint()
+{
+ m_bRemovePoint = true;
+ KDialogBase::slotOk();
+}
+
+#include "KPrMoveHelpLineDia.moc"
diff --git a/kpresenter/KPrMoveHelpLineDia.h b/kpresenter/KPrMoveHelpLineDia.h
new file mode 100644
index 000000000..5990bb801
--- /dev/null
+++ b/kpresenter/KPrMoveHelpLineDia.h
@@ -0,0 +1,95 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Montel Laurent <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __kprhelplinedia__
+#define __kprhelplinedia__
+
+#include <kdialogbase.h>
+#include <KoRect.h>
+
+class QRadioButton;
+class KPrDocument;
+class KLineEdit;
+class KFloatValidator;
+class KoUnitDoubleSpinBox;
+
+class KPrMoveHelpLineDia : public KDialogBase
+{
+ Q_OBJECT
+public:
+ KPrMoveHelpLineDia( QWidget *parent, double value, double limitTop, double limitBottom,
+ KPrDocument *_doc, const char *name=0L);
+
+ double newPosition() const;
+ bool removeLine() const { return m_bRemoveLine;}
+
+private slots:
+ void slotRemoveHelpLine();
+
+protected:
+ KoUnitDoubleSpinBox* position;
+ KPrDocument *m_doc;
+ bool m_bRemoveLine;
+};
+
+class KPrInsertHelpLineDia : public KDialogBase
+{
+ Q_OBJECT
+public:
+ KPrInsertHelpLineDia( QWidget *parent, const KoRect &r, KPrDocument *_doc, const char *name=0L);
+
+ double newPosition() const;
+ //return true if we add a new horizontal line help
+ bool addHorizontalHelpLine();
+
+private slots:
+ void slotRadioButtonClicked();
+
+protected:
+ KoRect limitOfPage;
+ KoUnitDoubleSpinBox* position;
+ QRadioButton *m_rbHoriz;
+ QRadioButton *m_rbVert;
+ KPrDocument *m_doc;
+};
+
+
+class KPrInsertHelpPointDia : public KDialogBase
+{
+ Q_OBJECT
+public:
+ KPrInsertHelpPointDia( QWidget *parent, const KoRect &r, KPrDocument *_doc, double poxX=0.0,
+ double posY=0.0, const char *name=0L);
+
+ KoPoint newPosition() const;
+ bool removePoint() const { return m_bRemovePoint;}
+private slots:
+ void slotRemoveHelpPoint();
+
+protected:
+ KoRect limitOfPage;
+ bool m_bRemovePoint;
+ KoUnitDoubleSpinBox* positionX;
+ KoUnitDoubleSpinBox* positionY;
+ KPrDocument *m_doc;
+};
+
+
+#endif
diff --git a/kpresenter/KPrNoteBar.cpp b/kpresenter/KPrNoteBar.cpp
new file mode 100644
index 000000000..f44865f1f
--- /dev/null
+++ b/kpresenter/KPrNoteBar.cpp
@@ -0,0 +1,197 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+#include <qsimplerichtext.h>
+#include <qlabel.h>
+
+#include <kglobalsettings.h>
+#include <kprinter.h>
+#include <kdebug.h>
+#include <ktextedit.h>
+#include <klocale.h>
+
+#include "KPrNoteBar.h"
+#include "KPrView.h"
+#include "KPrDocument.h"
+#include "KPrPage.h"
+
+
+KPrNoteBar::KPrNoteBar( QWidget *_parent, KPrView *_view )
+ : QWidget( _parent ),
+ view( _view ),
+ initialize( true )
+{
+ QBoxLayout *topLayout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
+
+ label = new QLabel(i18n("Note"), this);
+
+ textEdit = new KTextEdit( this );
+
+ QFont font = KoGlobal::defaultFont();
+ textEdit->setCurrentFont( font );
+
+ int currentPageNum = view->getCurrentPresPage(); // 1 base.
+ QString text=QString::null;
+ if (currentPageNum!=-1)
+ text = view->kPresenterDoc()->pageList().at(currentPageNum - 1)->noteText( );
+ textEdit->setText( text );
+
+ connect( textEdit, SIGNAL( textChanged() ),
+ this, SLOT( slotTextChanged() ) );
+
+ connect( textEdit, SIGNAL( selectionChanged() ),
+ this, SLOT( slotSelectionChanged() ) );
+
+ connect( textEdit, SIGNAL( copyAvailable( bool ) ),
+ this, SLOT( slotSelectionChanged() ) );
+
+ connect( textEdit, SIGNAL( undoAvailable( bool ) ),
+ this, SLOT( slotUndoAvailable( bool ) ) );
+
+ connect( textEdit, SIGNAL( redoAvailable( bool ) ),
+ this, SLOT( slotRedoAvailable( bool ) ) );
+
+ topLayout->addWidget( label );
+ topLayout->addWidget( textEdit );
+}
+
+KPrNoteBar::~KPrNoteBar()
+{
+ delete textEdit;
+}
+
+void KPrNoteBar::setCurrentNoteText( const QString &_text )
+{
+ initialize = true;
+ textEdit->setText( _text );
+ initialize = false;
+}
+
+void KPrNoteBar::slotTextChanged()
+{
+ int currentPageNum = view->getCurrPgNum(); // 1 base.
+ if ( currentPageNum > 0 && !initialize ) {
+ if ( view->editMaster() )
+ view->kPresenterDoc()->refreshAllNoteBarMasterPage(textEdit->text() , view);
+ else
+ view->kPresenterDoc()->refreshAllNoteBar(currentPageNum -1,textEdit->text() , view);
+ textEdit->setModified( true );
+ }
+}
+
+void KPrNoteBar::slotSelectionChanged()
+{
+ kdDebug(33001) << "slotSelectionChanged(): " << textEdit->hasSelectedText() << endl;
+}
+
+void KPrNoteBar::slotCopyAvailable( bool yes )
+{
+ kdDebug(33001) << "slotCopyAvailable( " << yes << " )" << endl;
+}
+
+void KPrNoteBar::slotUndoAvailable( bool /*yes*/ )
+{
+ //kdDebug(33001) << "slotUndoAvailable( " << yes << " )" << endl;
+}
+
+void KPrNoteBar::slotRedoAvailable( bool /*yes*/ )
+{
+ //kdDebug(33001) << "slotRedoAvailable( " << yes << " )" << endl;
+}
+
+void KPrNoteBar::printNotes( QPainter *_painter, KPrinter *_printer, QValueList<int> _list )
+{
+ // base code from $QTDIR/example/textedit/textedit.cpp
+ _painter->save();
+
+ QPaintDeviceMetrics metrics( _painter->device() );
+ int dpix = metrics.logicalDpiX();
+ int dpiy = metrics.logicalDpiY();
+
+ const int margin = 72; // pt
+ QRect body( margin * dpix / 72, margin * dpiy / 72,
+ metrics.width() - margin * dpix / 72 * 2,
+ metrics.height() - margin * dpiy / 72 * 2 );
+
+ QFont font = KoGlobal::defaultFont();
+ QString allText = getNotesTextForPrinting(_list);
+ QString str = QStyleSheet::convertFromPlainText( allText );
+
+ QSimpleRichText richText( str, font, QString::null, QStyleSheet::defaultSheet(),
+ QMimeSourceFactory::defaultFactory(), body.height() );
+
+ richText.setWidth( _painter, body.width() );
+
+ QRect viewRect( body );
+ do {
+ richText.draw( _painter, body.left(), body.top(), viewRect, colorGroup() );
+ viewRect.moveBy( 0, body.height() );
+ _painter->translate( 0, -body.height() );
+ _painter->setFont( font );
+
+ if ( viewRect.top() >= richText.height() )
+ break;
+
+ _printer->newPage();
+ } while ( true );
+
+ _painter->restore();
+}
+
+QString KPrNoteBar::getNotesTextForPrinting(QValueList<int> _list) const
+{
+ QString allText = QString::null;
+ bool firstText = true;
+ bool noteIsEmpty = true;
+ int pageCount = 1;
+ KPrDocument *doc=view->kPresenterDoc();
+ for ( int i = 0; i < static_cast<int>( doc->pageList().count() ); i++, ++pageCount )
+ {
+ if (_list.contains(i+1)==0) // that slide isn't printed, don't print its note either
+ continue;
+
+ if ( !firstText )
+ allText += QString("\n\n");
+
+ allText += i18n( "Slide Note %1:\n" ).arg( pageCount );
+ if(noteIsEmpty && !doc->pageList().at(i)->noteText().isEmpty())
+ noteIsEmpty = false;
+ allText += doc->pageList().at(i)->noteText();
+
+ firstText = false;
+ }
+ //code for master page
+ if ( !firstText )
+ allText += QString("\n\n");
+ allText += i18n( "Master Page Note:\n" );
+ if ( !doc->masterPage()->noteText().isEmpty() )
+ noteIsEmpty = false;
+ allText += doc->masterPage()->noteText();
+
+ if( noteIsEmpty )
+ return QString::null;
+ return allText;
+}
+
+#include "KPrNoteBar.moc"
diff --git a/kpresenter/KPrNoteBar.h b/kpresenter/KPrNoteBar.h
new file mode 100644
index 000000000..94659f03f
--- /dev/null
+++ b/kpresenter/KPrNoteBar.h
@@ -0,0 +1,65 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef NOTEBAR_H
+#define NOTEBAR_H
+
+#include <qwidget.h>
+
+class QPainter;
+class QLabel;
+
+class KPrDocument;
+class KPrView;
+class KPrinter;
+class KTextEdit;
+
+class KPrNoteBar : public QWidget
+{
+ Q_OBJECT
+
+public:
+ KPrNoteBar( QWidget *_parent, KPrView *_view );
+ ~KPrNoteBar();
+
+ void setCurrentNoteText( const QString &_text );
+
+ // print
+ void printNotes( QPainter *_painter, KPrinter *_printer, QValueList<int> );
+
+ QString getNotesTextForPrinting(QValueList<int>) const;
+
+private slots:
+ void slotTextChanged();
+ void slotSelectionChanged();
+ void slotCopyAvailable( bool );
+ void slotUndoAvailable( bool );
+ void slotRedoAvailable( bool );
+
+private:
+ ::KTextEdit *textEdit;
+ QLabel *label;
+
+ KPrView *view;
+
+ bool initialize;
+};
+
+#endif
diff --git a/kpresenter/KPrObject.cpp b/kpresenter/KPrObject.cpp
new file mode 100644
index 000000000..ad246527f
--- /dev/null
+++ b/kpresenter/KPrObject.cpp
@@ -0,0 +1,2172 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrObjectIface.h"
+
+#include "KPrObject.h"
+#include "KPrDocument.h"
+#include "KPrUtils.h"
+
+#include <qpainter.h>
+#include <qwmatrix.h>
+#include <qpointarray.h>
+#include <qregion.h>
+#include <qdom.h>
+#include <qbuffer.h>
+#include <qregexp.h>
+
+#include <kapplication.h>
+#include <KoOasisContext.h>
+#include "KoOasisStyles.h"
+
+#include <stdlib.h>
+#include <fstream>
+#include <math.h>
+#include <float.h>
+
+#include <KoTextZoomHandler.h>
+#include <KoRect.h>
+#include <KoSize.h>
+#include <KoPoint.h>
+#include <KoXmlNS.h>
+#include <KoDom.h>
+#include <kdebug.h>
+
+const QString &KPrObject::tagORIG=KGlobal::staticQString("ORIG");
+const QString &KPrObject::attrX=KGlobal::staticQString("x");
+const QString &KPrObject::attrY=KGlobal::staticQString("y");
+const QString &KPrObject::tagSIZE=KGlobal::staticQString("SIZE");
+const QString &KPrObject::attrWidth=KGlobal::staticQString("width");
+const QString &KPrObject::attrHeight=KGlobal::staticQString("height");
+const QString &KPrObject::tagSHADOW=KGlobal::staticQString("SHADOW");
+const QString &KPrObject::attrDistance=KGlobal::staticQString("distance");
+const QString &KPrObject::attrDirection=KGlobal::staticQString("direction");
+const QString &KPrObject::attrColor=KGlobal::staticQString("color");
+const QString &KPrObject::tagEFFECTS=KGlobal::staticQString("EFFECTS");
+const QString &KPrObject::attrEffect=KGlobal::staticQString("effect");
+const QString &KPrObject::attrEffect2=KGlobal::staticQString("effect2");
+const QString &KPrObject::tagPRESNUM=KGlobal::staticQString("PRESNUM");
+const QString &KPrObject::tagANGLE=KGlobal::staticQString("ANGLE");
+const QString &KPrObject::tagDISAPPEAR=KGlobal::staticQString("DISAPPEAR");
+const QString &KPrObject::attrDoit=KGlobal::staticQString("doit");
+const QString &KPrObject::attrNum=KGlobal::staticQString("num");
+const QString &KPrObject::tagFILLTYPE=KGlobal::staticQString("FILLTYPE");
+const QString &KPrObject::tagGRADIENT=KGlobal::staticQString("GRADIENT");
+const QString &KPrObject::tagPEN=KGlobal::staticQString("PEN");
+const QString &KPrObject::tagBRUSH=KGlobal::staticQString("BRUSH");
+const QString &KPrObject::attrValue=KGlobal::staticQString("value");
+const QString &KPrObject::attrC1=KGlobal::staticQString("color1");
+const QString &KPrObject::attrC2=KGlobal::staticQString("color2");
+const QString &KPrObject::attrType=KGlobal::staticQString("type");
+const QString &KPrObject::attrUnbalanced=KGlobal::staticQString("unbalanced");
+const QString &KPrObject::attrXFactor=KGlobal::staticQString("xfactor");
+const QString &KPrObject::attrYFactor=KGlobal::staticQString("yfactor");
+const QString &KPrObject::attrStyle=KGlobal::staticQString("style");
+
+KPrStartEndLine::KPrStartEndLine( LineEnd _start, LineEnd _end )
+ : lineBegin( _start ), lineEnd( _end )
+{
+}
+
+void KPrStartEndLine::save( QDomDocumentFragment &fragment, QDomDocument& doc )
+{
+ if (lineBegin!=L_NORMAL)
+ fragment.appendChild(KPrStartEndLine::createValueElement("LINEBEGIN", static_cast<int>(lineBegin), doc));
+ if (lineEnd!=L_NORMAL)
+ fragment.appendChild(KPrStartEndLine::createValueElement("LINEEND", static_cast<int>(lineEnd), doc));
+}
+
+QDomElement KPrStartEndLine::createValueElement(const QString &tag, int value, QDomDocument &doc)
+{
+ QDomElement elem=doc.createElement(tag);
+ elem.setAttribute("value", value);
+ return elem;
+}
+
+
+void KPrStartEndLine::load( const QDomElement &element )
+{
+ QDomElement e=element.namedItem("LINEBEGIN").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ lineBegin=static_cast<LineEnd>(tmp);
+ }
+ e=element.namedItem("LINEEND").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ lineEnd=static_cast<LineEnd>(tmp);
+ }
+}
+
+void KPrStartEndLine::loadOasisMarkerElement( KoOasisContext & context, const QString & attr, LineEnd &_element )
+{
+ //kdDebug()<<"void KPrStartEndLine::loadOasisMarkerElement( KoOasisContext & context, const QString & attr, LineEnd &_element ) :"<<attr<<endl;
+
+ KoStyleStack &styleStack = context.styleStack();
+ styleStack.setTypeProperties( "graphic" );
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw,attr.latin1() ) )
+ {
+ QString style = styleStack.attributeNS( KoXmlNS::draw, attr.latin1() );
+ //kdDebug()<<" marker style is : "<<style<<endl;
+
+ //type not defined by default
+ //try to use style.
+ QDomElement* draw = context.oasisStyles().drawStyles()[style];
+ //kdDebug()<<" marker have oasis style defined :"<<draw<<endl;
+ if ( draw )
+ {
+ if( draw->hasAttributeNS( KoXmlNS::svg, "d" ))
+ {
+ QString str = draw->attributeNS( KoXmlNS::svg, "d", QString::null );
+ kdDebug()<<" svg type = "<<str<<endl;
+ if ( str == lineEndBeginSvg( L_ARROW ) )
+ _element = L_ARROW;
+ else if ( str == lineEndBeginSvg( L_CIRCLE ) )
+ _element = L_CIRCLE;
+ else if ( str == lineEndBeginSvg( L_SQUARE ) )
+ _element = L_SQUARE;
+ else if ( str == lineEndBeginSvg( L_LINE_ARROW ) )
+ _element = L_LINE_ARROW;
+ else if ( str == lineEndBeginSvg( L_DIMENSION_LINE ) )
+ _element = L_DIMENSION_LINE;
+ else if ( str == lineEndBeginSvg( L_DOUBLE_ARROW ) )
+ _element = L_DOUBLE_ARROW;
+ else if ( str == lineEndBeginSvg( L_DOUBLE_LINE_ARROW ) )
+ _element = L_DOUBLE_LINE_ARROW;
+ else
+ {
+ kdDebug()<<" element not defined :"<<str<<endl;
+ _element = L_NORMAL;
+ }
+ }
+ }
+ }
+}
+
+void KPrStartEndLine::saveOasisMarkerElement( KoGenStyles& mainStyles, KoGenStyle &styleobjectauto ) const
+{
+ if ( lineBegin != L_NORMAL )
+ {
+ styleobjectauto.addProperty( "draw:marker-start", saveOasisMarkerStyle( mainStyles, lineBegin ) );
+ styleobjectauto.addProperty( "draw:marker-start-width", "0.25cm" );//value from ooimpress
+ }
+ if ( lineEnd != L_NORMAL )
+ {
+ styleobjectauto.addProperty( "draw:marker-end", saveOasisMarkerStyle( mainStyles, lineEnd ) );
+ styleobjectauto.addProperty( "draw:marker-end-width", "0.25cm" );
+ }
+}
+
+QString KPrStartEndLine::saveOasisMarkerStyle( KoGenStyles &mainStyles, const LineEnd &_element ) const
+{
+ KoGenStyle marker( KPrDocument::STYLE_MARKER /*, "graphic"*/ /*no name*/ );
+ // value used from ooimpress filter I don't know if it's good
+ switch( _element )
+ {
+ case L_NORMAL:
+ //nothing
+ break;
+ case L_ARROW:
+ marker.addAttribute( "svg:viewBox", "0 0 20 30" );
+ break;
+ case L_SQUARE:
+ marker.addAttribute( "svg:viewBox", "0 0 10 10" );
+ break;
+ case L_CIRCLE:
+ marker.addAttribute( "svg:viewBox", "0 0 1131 1131" );
+ break;
+ case L_LINE_ARROW:
+ marker.addAttribute( "svg:viewBox", "0 0 1122 2243" );
+ break;
+ case L_DIMENSION_LINE:
+ marker.addAttribute( "svg:viewBox", "0 0 836 110" );
+ break;
+ case L_DOUBLE_ARROW:
+ marker.addAttribute( "svg:viewBox", "0 0 1131 1918" );
+ break;
+ case L_DOUBLE_LINE_ARROW:
+ //FIXME !!!!!!!!!!!!
+ // not defined into ooimpress filter.
+ //marker.addAttribute( "svg:viewBox", "...." );
+ //marker.addAttribute( "svg:d", "...." );
+ break;
+ }
+ marker.addAttribute( "svg:d", lineEndBeginSvg( _element ));
+
+ return mainStyles.lookup( marker, "marker" );
+}
+
+KPrObject::KPrObject()
+ : orig(), ext(), shadowColor( Qt::gray )
+{
+ appearStep = 0;
+ disappearStep = 1;
+ effect = EF_NONE;
+ effect2 = EF2_NONE;
+ effect3 = EF3_NONE;
+ m_appearSpeed = ES_MEDIUM;
+ m_disappearSpeed = ES_MEDIUM;
+ disappear = false;
+ appearTimer = 1;
+ disappearTimer = 1;
+ appearSoundEffect = false;
+ disappearSoundEffect = false;
+ a_fileName = QString::null;
+ d_fileName = QString::null;
+ objectName = QString::null;
+ angle = 0.0;
+ shadowDirection = SD_RIGHT_BOTTOM;
+ shadowDistance = 0;
+ selected = false;
+ ownClipping = true;
+ subPresStep = 0;
+ specEffects = false;
+ onlyCurrStep = true;
+ inObjList = true;
+ cmds = 0;
+ resize = false;
+ protect = false;
+ keepRatio = false;
+ dcop = 0;
+}
+
+KPrObject::~KPrObject()
+{
+ delete dcop;
+}
+
+QDomDocumentFragment KPrObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment=doc.createDocumentFragment();
+ QDomElement elem=doc.createElement(tagORIG);
+ elem.setAttribute(attrX, orig.x());
+ elem.setAttribute(attrY, QString::number( orig.y() + offset, 'g', DBL_DIG ) );
+ fragment.appendChild(elem);
+ elem=doc.createElement(tagSIZE);
+ elem.setAttribute(attrWidth, ext.width());
+ elem.setAttribute(attrHeight, ext.height());
+ fragment.appendChild(elem);
+ if(shadowDistance!=0 || shadowDirection!=SD_RIGHT_BOTTOM || shadowColor!=Qt::gray) {
+ elem=doc.createElement(tagSHADOW);
+ elem.setAttribute(attrDistance, shadowDistance);
+ elem.setAttribute(attrDirection, static_cast<int>( shadowDirection ));
+ elem.setAttribute(attrColor, shadowColor.name());
+ fragment.appendChild(elem);
+ }
+ if(effect!=EF_NONE || effect2!=EF2_NONE) {
+ elem=doc.createElement(tagEFFECTS);
+ elem.setAttribute(attrEffect, static_cast<int>( effect ));
+ elem.setAttribute(attrEffect2, static_cast<int>( effect2 ));
+ elem.setAttribute( "speed", static_cast<int>(m_appearSpeed) );
+ fragment.appendChild(elem);
+ }
+ if(appearStep!=0)
+ fragment.appendChild(KPrObject::createValueElement(tagPRESNUM, appearStep, doc));
+ if(angle!=0.0) {
+ elem=doc.createElement(tagANGLE);
+ elem.setAttribute(attrValue, angle);
+ fragment.appendChild(elem);
+ }
+ if(effect3!=EF3_NONE || disappear) {
+ elem=doc.createElement(tagDISAPPEAR);
+ elem.setAttribute(attrEffect, static_cast<int>( effect3 ));
+ elem.setAttribute(attrDoit, static_cast<int>( disappear ));
+ elem.setAttribute( "speed", static_cast<int>(m_disappearSpeed) );
+ elem.setAttribute(attrNum, disappearStep);
+ fragment.appendChild(elem);
+ }
+ if(appearTimer!=1 || disappearTimer!=1) {
+ elem=doc.createElement("TIMER");
+ elem.setAttribute("appearTimer", appearTimer);
+ elem.setAttribute("disappearTimer", disappearTimer);
+ fragment.appendChild(elem);
+ }
+ if(appearSoundEffect || !a_fileName.isEmpty()) {
+ elem=doc.createElement("APPEARSOUNDEFFECT");
+ elem.setAttribute("appearSoundEffect", static_cast<int>(appearSoundEffect));
+ elem.setAttribute("appearSoundFileName", a_fileName);
+ fragment.appendChild(elem);
+ }
+ if(disappearSoundEffect || !d_fileName.isEmpty()) {
+ elem=doc.createElement("DISAPPEARSOUNDEFFECT");
+ elem.setAttribute("disappearSoundEffect", static_cast<int>(disappearSoundEffect));
+ elem.setAttribute("disappearSoundFileName", d_fileName);
+ fragment.appendChild(elem);
+ }
+ if( !objectName.isEmpty() ) {
+ elem=doc.createElement("OBJECTNAME");
+ elem.setAttribute("objectName", objectName);
+ fragment.appendChild(elem);
+ }
+ if(protect) {
+ elem=doc.createElement("PROTECT");
+ elem.setAttribute("state" , protect);
+ fragment.appendChild(elem);
+ }
+ if(keepRatio) {
+ elem=doc.createElement("RATIO");
+ elem.setAttribute("ratio" , keepRatio);
+ fragment.appendChild(elem);
+ }
+
+ return fragment;
+}
+
+
+void KPrObject::saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const
+{
+ xmlWriter.addAttribute( "draw:id", "object" + QString::number( indexObj ) );
+ //save all into pt
+ xmlWriter.addAttributePt( "svg:width", ext.width() );
+ xmlWriter.addAttributePt( "svg:height", ext.height() );
+
+ if ( kAbs( angle ) > 1E-6 )
+ {
+ double angInRad = -angle * M_PI / 180.0;
+ QWMatrix m( cos( angInRad ), -sin( angInRad ), sin( angInRad ), cos( angInRad ), 0, 0 );
+ KoPoint center( ext.width() / 2, ext.height() / 2 );
+ double rotX = 0.0;
+ double rotY = 0.0;
+ m.map( center.x(), center.y(), &rotX, &rotY );
+ KoPoint rot( rotX, rotY );
+ KoPoint trans( center - rot + orig );
+
+ QCString transX;
+ transX.setNum( trans.x(), 'g', DBL_DIG );
+ QCString transY;
+ transY.setNum( trans.y(), 'g', DBL_DIG );
+ QString str = QString( "rotate(%1) translate(%2pt %3pt)" ).arg( angInRad ).arg( transX ).arg( transY );
+ xmlWriter.addAttribute( "draw:transform", str );
+ }
+ else
+ {
+ xmlWriter.addAttributePt( "svg:x", orig.x() );
+ xmlWriter.addAttributePt( "svg:y", orig.y() );
+ }
+}
+
+void KPrObject::saveOasisObjectProtectStyle( KoGenStyle &styleobjectauto ) const
+{
+ if ( protect )
+ {
+ styleobjectauto.addProperty( "draw:move-protect", "true" );
+ styleobjectauto.addProperty( "draw:size-protect", "true" );
+ }
+}
+
+QString KPrObject::getStyle( KPOasisSaveContext &sc ) const
+{
+ kdDebug(33001) << "KPrObject::getStyle" << endl;
+ KoGenStyle styleObjectAuto;
+ KoGenStyles &mainStyles( sc.context.mainStyles() );
+ if ( sc.onMaster )
+ {
+ styleObjectAuto = KoGenStyle( KPrDocument::STYLE_PRESENTATIONSTICKYOBJECT, "presentation" );
+ }
+ else
+ {
+ styleObjectAuto = KoGenStyle( KoGenStyle::STYLE_GRAPHICAUTO, "graphic" );
+ }
+ fillStyle( styleObjectAuto, mainStyles );
+ if ( sc.onMaster )
+ {
+ return mainStyles.lookup( styleObjectAuto, "pr" );
+ }
+ return mainStyles.lookup( styleObjectAuto, "gr" );
+}
+
+void KPrObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& /* mainStyles */ ) const
+{
+ kdDebug(33001) << "KPrObject::fillStyle" << endl;
+ saveOasisObjectProtectStyle( styleObjectAuto );
+ saveOasisShadowElement( styleObjectAuto );
+}
+
+bool KPrObject::saveOasisObjectAttributes( KPOasisSaveContext &/* sc */ ) const
+{
+ kdDebug()<<"bool saveOasisObjectAttributes not implemented";
+ return true;
+}
+
+bool KPrObject::hasAnimation() const
+{
+ return effect != EF_NONE || appearTimer != 0 ||
+ effect3 != EF3_NONE || disappear ||
+ !a_fileName.isEmpty() || ! d_fileName.isEmpty() ||
+ appearTimer != 1;
+}
+
+bool KPrObject::saveOasisObjectStyleShowAnimation( KoXmlWriter &animation, int objectId )
+{
+ if ( effect != EF_NONE || appearStep != 0 || !a_fileName.isEmpty() )
+ {
+ animation.startElement( "presentation:show-shape" );
+ animation.addAttribute( "draw:shape-id", "object" + QString::number( objectId ) );
+ animation.addAttribute( "koffice:order-id", appearStep );
+
+ switch( effect )
+ {
+ case EF_NONE:
+ // use appear instead none as oo understands this
+ animation.addAttribute( "presentation:effect", "appear" );
+ break;
+ case EF_COME_RIGHT:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-right" );
+ break;
+ case EF_COME_LEFT:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-left" );
+ break;
+ case EF_COME_TOP:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-top" );
+ break;
+ case EF_COME_BOTTOM:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-bottom" );
+ break;
+ case EF_COME_RIGHT_TOP:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-upper-right" );
+ break;
+ case EF_COME_RIGHT_BOTTOM:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-lower-right" );
+ break;
+ case EF_COME_LEFT_TOP:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-upper-left" );
+ break;
+ case EF_COME_LEFT_BOTTOM:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-lower-left" );
+ break;
+ case EF_WIPE_LEFT:
+ animation.addAttribute( "presentation:effect", "fade" );
+ animation.addAttribute( "presentation:direction", "from-left" );
+ break;
+ case EF_WIPE_RIGHT:
+ animation.addAttribute( "presentation:effect", "fade" );
+ animation.addAttribute( "presentation:direction", "from-right" );
+ break;
+ case EF_WIPE_TOP:
+ animation.addAttribute( "presentation:effect", "fade" );
+ animation.addAttribute( "presentation:direction", "from-top" );
+ break;
+ case EF_WIPE_BOTTOM:
+ animation.addAttribute( "presentation:effect", "fade" );
+ animation.addAttribute( "presentation:direction", "from-bottom" );
+ break;
+ }
+
+ if ( effect2 != EF2_NONE )
+ {
+ animation.addAttribute( "koffice:by-paragraph", "true" );
+ }
+
+ if ( m_appearSpeed == ES_SLOW )
+ {
+ animation.addAttribute( "presentation:speed", "slow" );
+ }
+ else if ( m_appearSpeed == ES_FAST )
+ {
+ animation.addAttribute( "presentation:speed", "fast" );
+ }
+
+ if ( appearTimer!=1 )
+ {
+ animation.addAttribute( "presentation:animation-delay", saveOasisTimer( appearTimer ) );
+ }
+ if( !a_fileName.isEmpty() )
+ {
+ //store sound into file ?
+ //<presentation:sound xlink:href="../../usr/lib/openoffice/share/gallery/sounds/pluck.wav" xlink:type="simple" xlink:show="new" xlink:actuate="onRequest"/>
+ animation.startElement( "presentation:sound" );
+ animation.addAttribute( "xlink:href", a_fileName );
+ animation.addAttribute( "xlink:type", "simple" );
+ animation.addAttribute( "xlink:show", "new" );
+ animation.addAttribute( "xlink:actuate", "onRequest" );
+ animation.endElement();
+ }
+ animation.endElement();
+ }
+ return true;
+}
+
+bool KPrObject::saveOasisObjectStyleHideAnimation( KoXmlWriter &animation, int objectId )
+{
+
+ //FIXME oo doesn't support hide animation object
+ if ( effect3 != EF3_NONE || disappearStep != 0 || !d_fileName.isEmpty())
+ {
+ animation.startElement( "presentation:hide-shape" );
+ animation.addAttribute( "draw:shape-id", "object" + QString::number( objectId ) );
+ animation.addAttribute( "koffice:order-id", disappearStep );
+ switch( effect3 )
+ {
+ case EF3_NONE:
+ // use hide instead none as oo understands this
+ animation.addAttribute( "presentation:effect", "hide" );
+ break;
+ case EF3_GO_RIGHT:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-right" );
+ break;
+ case EF3_GO_LEFT:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-left" );
+ break;
+ case EF3_GO_TOP:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-top" );
+ break;
+ case EF3_GO_BOTTOM:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-bottom" );
+ break;
+ case EF3_GO_RIGHT_TOP:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-upper-right" );
+ break;
+ case EF3_GO_RIGHT_BOTTOM:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-lower-right" );
+ break;
+ case EF3_GO_LEFT_TOP:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-upper-left" );
+ break;
+ case EF3_GO_LEFT_BOTTOM:
+ animation.addAttribute( "presentation:effect", "move" );
+ animation.addAttribute( "presentation:direction", "from-lower-left" );
+ break;
+ case EF3_WIPE_LEFT:
+ animation.addAttribute( "presentation:effect", "fade" );
+ animation.addAttribute( "presentation:direction", "from-left" );
+ break;
+ case EF3_WIPE_RIGHT:
+ animation.addAttribute( "presentation:effect", "fade" );
+ animation.addAttribute( "presentation:direction", "from-right" );
+ break;
+ case EF3_WIPE_TOP:
+ animation.addAttribute( "presentation:effect", "fade" );
+ animation.addAttribute( "presentation:direction", "from-top" );
+ break;
+ case EF3_WIPE_BOTTOM:
+ animation.addAttribute( "presentation:effect", "fade" );
+ animation.addAttribute( "presentation:direction", "from-bottom" );
+ break;
+ }
+
+ if ( m_disappearSpeed == ES_SLOW )
+ {
+ animation.addAttribute( "presentation:speed", "slow" );
+ }
+ else if ( m_disappearSpeed == ES_FAST )
+ {
+ animation.addAttribute( "presentation:speed", "fast" );
+ }
+
+ if ( disappearTimer!=1 )
+ {
+ animation.addAttribute( "presentation:animation-delay", saveOasisTimer( disappearTimer ) );
+ }
+ if( !d_fileName.isEmpty() )
+ {
+ //store sound into file ?
+ //<presentation:sound xlink:href="../../usr/lib/openoffice/share/gallery/sounds/pluck.wav" xlink:type="simple" xlink:show="new" xlink:actuate="onRequest"/>
+ animation.startElement( "presentation:sound" );
+ animation.addAttribute( "xlink:href", a_fileName );
+ animation.addAttribute( "xlink:type", "simple" );
+ animation.addAttribute( "xlink:show", "new" );
+ animation.addAttribute( "xlink:actuate", "onRequest" );
+
+ animation.endElement();
+ }
+ animation.endElement();
+ }
+ return true;
+}
+
+void KPrObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
+{
+ if(element.hasAttributeNS( KoXmlNS::draw, "name" ))
+ objectName = element.attributeNS( KoXmlNS::draw, "name", QString::null);
+ orig.setX( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "x", QString::null ) ) );
+ orig.setY( KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y", QString::null ) ) );
+ ext.setWidth(KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "width", QString::null )) );
+ ext.setHeight(KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "height", QString::null ) ) );
+ //kdDebug()<<" orig.x() :"<<orig.x() <<" orig.y() :"<<orig.y() <<"ext.width() :"<<ext.width()<<" ext.height(): "<<ext.height()<<endl;
+ KoStyleStack &styleStack = context.styleStack();
+ styleStack.setTypeProperties( "" ); //no type default type
+ if ( element.hasAttributeNS( KoXmlNS::draw, "transform" ) )
+ {
+ // there is some more stuff in the spezification
+ // TODO make it work for all cases
+ QString transform = element.attributeNS( KoXmlNS::draw, "transform", QString::null );
+ kdDebug()<<" transform action :"<<transform<<endl;
+ QRegExp rx( "rotate ?\\(([^)]+)\\) translate ?\\(([^ ]+) ([^)]+)\\)" );
+ if ( rx.search( transform ) != - 1 && rx.numCaptures() == 3 )
+ {
+ bool ok = false;
+ double angInRad = rx.cap( 1 ).toDouble( &ok );
+ if( ok )
+ {
+ angle = -angInRad * 180.0 / M_PI;
+ }
+ else
+ {
+ angle = 0.0;
+ angInRad = 0.0;
+ }
+ QWMatrix m( cos( angInRad ), -sin( angInRad ), sin( angInRad ), cos( angInRad ), 0, 0 );
+ KoPoint center( ext.width() / 2, ext.height() / 2 );
+ double transX = 0.0;
+ double transY = 0.0;
+ m.map( center.x(), center.y(), &transX, &transY );
+ KoPoint diff( transX, transY );
+ KoPoint trans( KoUnit::parseValue( rx.cap( 2 ) ), KoUnit::parseValue( rx.cap( 3 ) ) );
+ orig = trans - center + diff;
+ kdDebug(33001) << "trans = " << trans << ", center = " << center << ", diff = " << diff << ", orig = " << orig << endl;
+ }
+ }
+ QDomElement *animation = 0L;
+ lstAnimation *tmp = 0L;
+ if( element.hasAttributeNS( KoXmlNS::draw, "id"))
+ {
+ tmp = info->animationShowById(element.attributeNS( KoXmlNS::draw, "id", QString::null) );
+ if ( tmp )
+ animation = tmp->element;
+ }
+
+ if( animation)
+ {
+ QString effectStr = animation->attributeNS( KoXmlNS::presentation, "effect", QString::null);
+ QString dir = animation->attributeNS( KoXmlNS::presentation, "direction", QString::null);
+ QString speed = animation->attributeNS( KoXmlNS::presentation, "speed", QString::null );
+ appearStep = tmp->order;
+ kdDebug()<<" appear direction : "<<dir<<" effect :"<< effectStr <<" speed :"<<speed<<endl;
+
+ if ( speed =="medium" )
+ {
+ m_appearSpeed = ES_MEDIUM;
+ }
+ else if ( speed=="slow" )
+ {
+ m_appearSpeed = ES_SLOW;
+ }
+ else if ( speed=="fast" )
+ {
+ m_appearSpeed = ES_FAST;
+ }
+ else
+ kdDebug()<<" speed argument is not defined :"<<speed<<endl;
+
+ if ( animation->hasAttributeNS( KoXmlNS::presentation, "animation-delay" ) )
+ {
+ appearTimer = loadOasisTimer(animation->attributeNS( KoXmlNS::presentation, "animation-delay", QString::null ) );
+ }
+ if (effectStr=="fade")
+ {
+ if (dir=="from-right")
+ effect = EF_WIPE_RIGHT;
+ else if (dir=="from-left")
+ effect = EF_WIPE_LEFT;
+ else if (dir=="from-top")
+ effect= EF_WIPE_TOP;
+ else if (dir=="from-bottom")
+ effect = EF_WIPE_BOTTOM;
+ else
+ kdDebug(33001)<<" dir not supported: " << dir << endl;
+ }
+ else if (effectStr=="move")
+ {
+ if (dir=="from-right")
+ effect = EF_COME_RIGHT;
+ else if (dir=="from-left")
+ effect = EF_COME_LEFT;
+ else if (dir=="from-top")
+ effect = EF_COME_TOP;
+ else if (dir=="from-bottom")
+ effect = EF_COME_BOTTOM;
+ else if (dir=="from-upper-right")
+ effect = EF_COME_RIGHT_TOP;
+ else if (dir=="from-lower-right")
+ effect = EF_COME_RIGHT_BOTTOM;
+ else if (dir=="from-upper-left")
+ effect = EF_COME_LEFT_TOP;
+ else if (dir=="from-lower-left")
+ effect = EF_COME_LEFT_BOTTOM;
+ else
+ kdDebug(33001) << " dir not supported:" << dir << endl;
+ }
+ else if ( effectStr == "appear" )
+ {
+ effect = EF_NONE;
+ }
+ else
+ {
+ kdDebug(33001) << " appear effect not supported: " << effectStr << endl;
+ effect = EF_NONE;
+ }
+
+ QString byParagaph = animation->attributeNS( KoXmlNS::koffice, "by-paragraph", QString::null );
+ if ( byParagaph == "true" )
+ {
+ effect2 = EF2T_PARA;
+ }
+
+ QDomElement sound = KoDom::namedItemNS( *animation, KoXmlNS::presentation, "sound" );
+ if ( !sound.isNull() )
+ {
+ kdDebug()<<" object has sound effect \n";
+ if ( sound.hasAttributeNS( KoXmlNS::xlink, "href" ) )
+ {
+ a_fileName =sound.attributeNS( KoXmlNS::xlink, "href", QString::null );
+ appearSoundEffect = true;
+ }
+ }
+ }
+
+ animation = 0L;
+ tmp = 0L;
+ if( element.hasAttributeNS( KoXmlNS::draw, "id"))
+ {
+ tmp = info->animationHideById(element.attributeNS( KoXmlNS::draw, "id", QString::null) );
+ if ( tmp )
+ animation = tmp->element;
+ }
+
+ if( animation)
+ {
+ QString effectStr = animation->attributeNS( KoXmlNS::presentation, "effect", QString::null);
+ QString dir = animation->attributeNS( KoXmlNS::presentation, "direction", QString::null);
+ QString speed = animation->attributeNS( KoXmlNS::presentation, "speed", QString::null );
+ kdDebug()<<" disappear direction : "<<dir<<" effect :"<< effectStr <<" speed :"<<speed<<endl;
+ disappearStep = tmp->order;
+
+ if ( speed =="medium" )
+ {
+ m_disappearSpeed = ES_MEDIUM;
+ }
+ else if ( speed=="slow" )
+ {
+ m_disappearSpeed = ES_SLOW;
+ }
+ else if ( speed=="fast" )
+ {
+ m_disappearSpeed = ES_FAST;
+ }
+ else
+ kdDebug()<<" speed argument is not defined :"<<speed<<endl;
+
+ if ( animation->hasAttributeNS( KoXmlNS::presentation, "animation-delay" ) )
+ {
+ disappearTimer = loadOasisTimer(animation->attributeNS( KoXmlNS::presentation, "animation-delay", QString::null ) );
+ }
+ if (effectStr=="fade")
+ {
+ if (dir=="from-right")
+ effect3 = EF3_WIPE_RIGHT;
+ else if (dir=="from-left")
+ effect3 = EF3_WIPE_LEFT;
+ else if (dir=="from-top")
+ effect3 = EF3_WIPE_TOP;
+ else if (dir=="from-bottom")
+ effect3 = EF3_WIPE_BOTTOM;
+ else
+ kdDebug(33001) << " dir not supported: " << dir << endl;
+ }
+ else if (effectStr=="move")
+ {
+ if (dir=="from-right")
+ effect3 = EF3_GO_RIGHT;
+ else if (dir=="from-left")
+ effect3 = EF3_GO_LEFT;
+ else if (dir=="from-top")
+ effect3 = EF3_GO_TOP;
+ else if (dir=="from-bottom")
+ effect3 = EF3_GO_BOTTOM;
+ else if (dir=="from-upper-right")
+ effect3 = EF3_GO_RIGHT_TOP;
+ else if (dir=="from-lower-right")
+ effect3 = EF3_GO_RIGHT_BOTTOM;
+ else if (dir=="from-upper-left")
+ effect3 = EF3_GO_LEFT_TOP;
+ else if (dir=="from-lower-left")
+ effect3 = EF3_GO_LEFT_BOTTOM;
+ else
+ kdDebug(33001) << " dir not supported: " << dir << endl;
+ }
+ else if ( effectStr == "hide" )
+ {
+ effect3 = EF3_NONE;
+ }
+ else
+ {
+ kdDebug(33001) << " hide effect not supported: " << effectStr << endl;
+ effect3 = EF3_NONE;
+ }
+
+ disappear = true;
+
+ QDomElement sound = KoDom::namedItemNS( *animation, KoXmlNS::presentation, "sound" );
+ if ( !sound.isNull() )
+ {
+ kdDebug()<<" object has sound effect \n";
+ if ( sound.hasAttributeNS( KoXmlNS::xlink, "href" ) )
+ {
+ d_fileName =sound.attributeNS( KoXmlNS::xlink, "href", QString::null );
+ disappearSoundEffect = true;
+ }
+ }
+ }
+ //shadow
+#if 0 //move it to kptextobject
+ if ( !element.hasAttribute( "type" ) ||
+ ( element.hasAttribute( "type" ) && element.attribute( "type" ) == "4" ) )
+ {
+ kdDebug()<<" text document !!!!!\n";
+ if ( styleStack.hasAttributeNS( KoXmlNS::fo, "text-shadow" ) &&
+ styleStack.attributeNS( KoXmlNS::fo, "text-shadow" ) != "none" )
+ {
+ QString distance = styleStack.attributeNS( KoXmlNS::fo, "text-shadow" );
+ distance.truncate( distance.find( ' ' ) );
+ shadowDistance = (int)KoUnit::parseValue( distance );
+ shadowDirection = SD_RIGHT_BOTTOM;
+ shadowColor= QColor("#a0a0a0" );
+ }
+ }
+#endif
+
+// draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle" draw:shadow="visible" draw:move-protect="true" draw:size-protect="true"
+ //kpresenter doesn't have two attribute for protect move and protect size perhaps create two argument for 1.4
+ styleStack.setTypeProperties( "graphic" );
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "move-protect" ) )
+ {
+ kdDebug()<<" styleStack.attribute(draw:move-protect ) :"<<styleStack.attributeNS( KoXmlNS::draw, "move-protect" )<<endl;
+ protect = ( styleStack.attributeNS( KoXmlNS::draw, "move-protect" ) == "true" );
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "size-protect" ) )
+ {
+ kdDebug()<<" styleStack.attribute(draw:size-protect ) :"<<styleStack.attributeNS( KoXmlNS::draw, "size-protect" )<<endl;
+ protect = ( styleStack.attributeNS( KoXmlNS::draw, "size-protect" ) == "true" );
+ }
+
+ //not supported into kpresenter
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "textarea-vertical-align" ) )
+ {
+ kdDebug()<<" styleStack.attribute(draw:textarea-vertical-align ) :"<<styleStack.attributeNS( KoXmlNS::draw, "textarea-vertical-align" )<<endl;
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "textarea-horizontal-align") )
+ {
+ kdDebug()<<" styleStack.attribute(draw:textarea-horizontal-align ) :"<<styleStack.attributeNS( KoXmlNS::draw, "textarea-horizontal-align" )<<endl;
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "shadow" ) &&
+ styleStack.attributeNS( KoXmlNS::draw, "shadow") == "visible" )
+ {
+ // use the shadow attribute to indicate an object-shadow
+ double x = KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::draw, "shadow-offset-x" ) );
+ double y = KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::draw, "shadow-offset-y" ) );
+ kdDebug()<<" shadow x : "<<x<<" shadow y :"<<y<<endl;
+ if ( x < 0 && y < 0 )
+ {
+ shadowDirection = SD_LEFT_UP;
+ shadowDistance = (int) fabs ( x );
+ }
+ else if ( x == 0 && y < 0 )
+ {
+ shadowDirection = SD_UP;
+ shadowDistance = (int) fabs ( y );
+ }
+ else if ( x > 0 && y < 0 )
+ {
+ shadowDirection = SD_RIGHT_UP;
+ shadowDistance = (int) fabs ( x );
+ }
+ else if ( x > 0 && y == 0 )
+ {
+ shadowDirection = SD_RIGHT;
+ shadowDistance = (int) fabs ( x );
+ }
+ else if ( x > 0 && y > 0 )
+ {
+ shadowDirection = SD_RIGHT_BOTTOM;
+ shadowDistance = (int) fabs ( x );
+ }
+ else if ( x == 0 && y > 0 )
+ {
+ shadowDirection = SD_BOTTOM;
+ shadowDistance = (int) fabs ( y );
+ }
+ else if ( x < 0 && y > 0 )
+ {
+ shadowDirection = SD_LEFT_BOTTOM;
+ shadowDistance = (int) fabs ( x );
+ }
+ else if ( x < 0 && y == 0 )
+ {
+ shadowDirection = SD_LEFT;
+ shadowDistance = (int) fabs ( x );
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "shadow-color" ) )
+ shadowColor= QColor(styleStack.attributeNS( KoXmlNS::draw, "shadow-color" ) );
+ kdDebug()<<" shadow color : "<<shadowColor.name()<<endl;
+ }
+}
+
+bool KPrObject::saveOasisObject( KPOasisSaveContext &sc ) const
+{
+ sc.xmlWriter.startElement( getOasisElementName() );
+ sc.xmlWriter.addAttribute( sc.onMaster ? "presentation:style-name": "draw:style-name", getStyle( sc ) );
+ saveOasisPosObject( sc.xmlWriter, sc.indexObj );
+ if( !objectName.isEmpty())
+ sc.xmlWriter.addAttribute( "draw:name", objectName );
+
+ saveOasisObjectAttributes( sc );
+
+ sc.xmlWriter.endElement();
+ return true;
+}
+
+void KPrObject::saveOasisShadowElement( KoGenStyle &styleobjectauto ) const
+{
+ //FIXME default value
+ if(shadowDistance!=0 || shadowDirection!=SD_RIGHT_BOTTOM || shadowColor!=Qt::gray) {
+ styleobjectauto.addProperty( "draw:shadow", "visible" );
+ switch( shadowDirection )
+ {
+ case SD_LEFT_UP:
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-x", ( -1.0 * shadowDistance ) );
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-y", ( -1.0 * shadowDistance ) );
+ break;
+ case SD_UP:
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-x", 0.0 );
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-y", ( -1.0 * shadowDistance ) );
+ break;
+ case SD_RIGHT_UP:
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-x", shadowDistance );
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-y", ( -1.0 * shadowDistance ) );
+ break;
+ case SD_RIGHT:
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-x", shadowDistance );
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-y", 0.0 );
+ break;
+ case SD_RIGHT_BOTTOM:
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-x",shadowDistance );
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-y", shadowDistance );
+ break;
+ case SD_BOTTOM:
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-x", 0.0 );
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-y",shadowDistance );
+ break;
+ case SD_LEFT_BOTTOM:
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-x", ( -1.0*shadowDistance ) );
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-y", shadowDistance );
+ break;
+ case SD_LEFT:
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-x", ( -1.0 * shadowDistance ) );
+ styleobjectauto.addPropertyPt( "draw:shadow-offset-y", 0.0 );
+ break;
+ }
+ styleobjectauto.addProperty( "draw:shadow-color", shadowColor.name() );
+ }
+}
+
+double KPrObject::load(const QDomElement &element) {
+
+ double offset=-1.0;
+ QDomElement e=element.namedItem(tagORIG).toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute(attrX))
+ orig.setX(e.attribute(attrX).toDouble());
+ if(e.hasAttribute(attrY))
+ {
+ offset=e.attribute(attrY).toDouble();
+ orig.setY(0);
+ }
+ }
+ e=element.namedItem(tagSIZE).toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute(attrWidth))
+ ext.setWidth(e.attribute(attrWidth).toDouble());
+ if(e.hasAttribute(attrHeight))
+ ext.setHeight(e.attribute(attrHeight).toDouble());
+ }
+ e=element.namedItem(tagSHADOW).toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute(attrDistance))
+ shadowDistance=e.attribute(attrDistance).toInt();
+ if(e.hasAttribute(attrDirection))
+ shadowDirection=static_cast<ShadowDirection>(e.attribute(attrDirection).toInt());
+ shadowColor=retrieveColor(e);
+ }
+ else {
+ shadowDistance=0;
+ shadowDirection=SD_RIGHT_BOTTOM;
+ shadowColor=Qt::gray;
+ }
+ e=element.namedItem(tagEFFECTS).toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute(attrEffect))
+ effect=static_cast<Effect>(e.attribute(attrEffect).toInt());
+ if(e.hasAttribute(attrEffect2))
+ effect2=static_cast<Effect2>(e.attribute(attrEffect2).toInt());
+ if(e.hasAttribute("speed"))
+ {
+ m_appearSpeed=static_cast<EffectSpeed>(e.attribute("speed").toInt());
+ // this is a safty net as we had once speeds up to ten
+ m_appearSpeed = m_appearSpeed > ES_FAST ? ES_FAST : m_appearSpeed;
+ }
+ }
+ else {
+ effect=EF_NONE;
+ effect2=EF2_NONE;
+ }
+ e=element.namedItem(tagANGLE).toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute(attrValue))
+ angle=e.attribute(attrValue).toFloat();
+ }
+ else
+ angle=0.0;
+ e=element.namedItem(tagPRESNUM).toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute(attrValue))
+ appearStep=e.attribute(attrValue).toInt();
+ }
+ else
+ appearStep=0;
+ e=element.namedItem(tagDISAPPEAR).toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute(attrEffect))
+ effect3=static_cast<Effect3>(e.attribute(attrEffect).toInt());
+ if(e.hasAttribute(attrDoit))
+ disappear=static_cast<bool>(e.attribute(attrDoit).toInt());
+ if(e.hasAttribute(attrNum))
+ disappearStep=e.attribute(attrNum).toInt();
+ if(e.hasAttribute("speed"))
+ {
+ m_disappearSpeed=static_cast<EffectSpeed>(e.attribute("speed").toInt());
+ // this is a safty net as we had once speeds up to ten
+ m_disappearSpeed = m_appearSpeed > ES_FAST ? ES_FAST : m_appearSpeed;
+ }
+ }
+ else {
+ effect3=EF3_NONE;
+ disappear=false;
+ disappearStep=1;
+ }
+ e=element.namedItem("TIMER").toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute("appearTimer"))
+ appearTimer = e.attribute("appearTimer").toInt();
+ if(e.hasAttribute("disappearTimer"))
+ disappearTimer = e.attribute("disappearTimer").toInt();
+ }
+ else {
+ appearTimer = 1;
+ disappearTimer = 1;
+ }
+ e=element.namedItem("APPEARSOUNDEFFECT").toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute("appearSoundEffect"))
+ appearSoundEffect = static_cast<bool>(e.attribute("appearSoundEffect").toInt());
+ if(e.hasAttribute("appearSoundFileName"))
+ a_fileName = e.attribute("appearSoundFileName");
+ }
+ else {
+ appearSoundEffect = false;
+ a_fileName = QString::null;
+ }
+ e=element.namedItem("DISAPPEARSOUNDEFFECT").toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute("disappearSoundEffect"))
+ disappearSoundEffect = static_cast<bool>(e.attribute("disappearSoundEffect").toInt());
+ if(e.hasAttribute("disappearSoundFileName"))
+ d_fileName = e.attribute("disappearSoundFileName");
+ }
+ else {
+ disappearSoundEffect = false;
+ d_fileName = QString::null;
+ }
+ e=element.namedItem("OBJECTNAME").toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute("objectName"))
+ objectName = e.attribute("objectName");
+ }
+ else {
+ objectName = QString::null;
+ }
+ e=element.namedItem("PROTECT").toElement();
+ if (!e.isNull())
+ {
+ if(e.hasAttribute("state"))
+ protect=static_cast<bool>(e.attribute("state").toInt());
+ }
+
+ e=element.namedItem("RATIO").toElement();
+ if (!e.isNull())
+ {
+ if(e.hasAttribute("ratio"))
+ keepRatio=static_cast<bool>(e.attribute("ratio").toInt());
+ }
+
+ return offset;
+}
+
+KoSize KPrObject::getRealSize() const {
+ KoSize size = ext;
+
+ if ( angle != 0.0 ) {
+ float angInRad = angle * M_PI / 180;
+ size.setWidth( ext.width() * fabs( cos( angInRad ) ) + ext.height() * fabs( sin( angInRad ) ) );
+ size.setHeight( ext.width() * fabs( sin( angInRad ) ) + ext.height() * fabs( cos( angInRad ) ) );
+ }
+
+ return size;
+}
+
+KoPoint KPrObject::getRealOrig() const {
+ KoPoint origin = orig;
+
+ if ( angle != 0.0 ) {
+ KoSize dist( ( getRealSize() - ext ) / 2 );
+ origin.setX( orig.x() - dist.width() );
+ origin.setY( orig.y() - dist.height() );
+ }
+
+ return origin;
+}
+
+KoRect KPrObject::getRealRect() const {
+ return KoRect( getRealOrig(), getRealSize() );
+}
+
+KoRect KPrObject::getRepaintRect() const
+{
+ KoRect rect( getRealOrig(), getRealSize() );
+
+ if ( shadowDirection == SD_LEFT ||
+ shadowDirection == SD_LEFT_UP ||
+ shadowDirection == SD_LEFT_BOTTOM )
+ {
+ rect.setLeft( rect.left() - shadowDistance );
+ }
+ if ( shadowDirection == SD_UP ||
+ shadowDirection == SD_LEFT_UP ||
+ shadowDirection == SD_RIGHT_UP )
+ {
+ rect.setTop( rect.top() - shadowDistance );
+ }
+ if ( shadowDirection == SD_RIGHT ||
+ shadowDirection == SD_RIGHT_UP ||
+ shadowDirection == SD_RIGHT_BOTTOM )
+ {
+ rect.setRight( rect.right() + shadowDistance );
+ }
+ if ( shadowDirection == SD_BOTTOM ||
+ shadowDirection == SD_LEFT_BOTTOM ||
+ shadowDirection == SD_RIGHT_BOTTOM )
+ {
+ rect.setBottom( rect.bottom() + shadowDistance );
+ }
+
+ if ( angle != 0.0 )
+ {
+ double _dx = rect.x() - 1.0;
+ double _dy = rect.y() - 1.0;
+ double _dw = rect.width() + 2.0;
+ double _dh = rect.height() + 2.0;
+ rect.setRect( _dx, _dy, _dw, _dh );
+ }
+
+ return rect;
+}
+
+void KPrObject::flip( bool /*horizontal*/ ) {
+ // flip the angle
+ if ( angle ) {
+ angle = 360.0 - angle;
+ }
+}
+
+KoRect KPrObject::rotateRectObject() const
+{
+ KoRect br = KoRect( 0,0, ext.width(), ext.height() );
+ double pw = br.width();
+ double ph = br.height();
+ KoRect rr = br;
+ double yPos = -rr.y();
+ double xPos = -rr.x();
+ rr.moveTopLeft( KoPoint( -rr.width() / 2.0, -rr.height() / 2.0 ) );
+ QWMatrix m;
+ m.translate( pw / 2.0, ph / 2.0 );
+ m.rotate( angle );
+ m.translate( rr.left() + xPos, rr.top() + yPos );
+ KoRect r = KoRect::fromQRect(m.mapRect( br.toQRect() )); // see above TODO
+ r.moveBy( orig.x() , orig.y() );
+ return r;
+}
+
+void KPrObject::rotateObject(QPainter *paint,KoTextZoomHandler *_zoomHandler)
+{
+ KoRect rr = KoRect( 0, 0, ext.width(), ext.height() );
+ rr.moveTopLeft( KoPoint( -ext.width() / 2.0, -ext.height() / 2.0 ) );
+ QWMatrix m;
+ m.translate( _zoomHandler->zoomItX(ext.width() / 2.0), _zoomHandler->zoomItY(ext.height() / 2.0 ));
+ m.rotate( angle );
+ m.translate( _zoomHandler->zoomItX(rr.left()), _zoomHandler->zoomItY(rr.top()) );
+
+ paint->setWorldMatrix( m, true );
+}
+
+bool KPrObject::contains( const KoPoint &point ) const
+{
+ return getRealRect().contains( point );
+}
+
+bool KPrObject::intersects( const KoRect &rect ) const
+{
+ return getRealRect().intersects( rect );
+}
+
+QCursor KPrObject::getCursor( const KoPoint &_point, ModifyType &_modType,
+ KPrDocument *doc ) const
+{
+ KoTextZoomHandler * zh = doc->zoomHandler();
+ int px = zh->zoomItX(_point.x());
+ int py = zh->zoomItY(_point.y());
+
+ QRect rect = zh->zoomRect( getRealRect() );
+ int ox = rect.left();
+ int oy = rect.top();
+ int ow = rect.width();
+ int oh = rect.height();
+
+ bool headerFooter=doc->isHeaderFooter(this);
+
+ int sz = 4;
+ if ( px >= ox && py >= oy && px <= ox + QMIN( ow / 3, sz ) && py <= oy + QMIN( oh / 3, sz ) )
+ {
+ _modType = MT_RESIZE_LU;
+ if ( protect)
+ return Qt::ForbiddenCursor;
+ return Qt::sizeFDiagCursor;
+ }
+
+ if ( px >= ox && py >= oy + oh / 2 - QMIN( oh / 6, sz / 2 )
+ && px <= ox + QMIN( ow / 3, sz)
+ && py <= oy + oh / 2 + QMIN( oh / 6, sz / 2 ) )
+ {
+ _modType = MT_RESIZE_LF;
+ if ( protect)
+ return Qt::ForbiddenCursor;
+ return Qt::sizeHorCursor;
+ }
+
+ if ( px >= ox && py >= oy + oh - QMIN( oh / 3, sz ) && px <= ox + QMIN( ow / 3, sz ) && py <= oy + oh )
+ {
+ _modType = MT_RESIZE_LD;
+ if ( protect)
+ return Qt::ForbiddenCursor;
+ return Qt::sizeBDiagCursor;
+ }
+
+ if ( px >= ox + ow / 2 - QMIN( ow / 6, sz / 2 ) && py >= oy
+ && px <= ox + ow / 2 + QMIN( ow / 6, sz / 2 )
+ && py <= oy + QMIN( oh / 3, sz ) )
+ {
+ _modType = MT_RESIZE_UP;
+ if ( protect)
+ return Qt::ForbiddenCursor;
+ return Qt::sizeVerCursor;
+ }
+
+ if ( px >= ox + ow / 2 - QMIN( ow / 6, sz / 2 ) && py >= oy + oh - QMIN( oh / 3, sz )
+ && px <= ox + ow / 2 + QMIN( ow / 6, sz / 2 ) && py <= oy + oh )
+ {
+ _modType = MT_RESIZE_DN;
+ if ( protect)
+ return Qt::ForbiddenCursor;
+ return Qt::sizeVerCursor;
+ }
+
+ if ( px >= ox + ow - QMIN( ow / 3, sz ) && py >= oy && px <= ox + ow && py <= oy + QMIN( oh / 3, sz) )
+ {
+ _modType = MT_RESIZE_RU;
+ if ( protect)
+ return Qt::ForbiddenCursor;
+ return Qt::sizeBDiagCursor;
+ }
+
+ if ( px >= ox + ow - QMIN( ow / 3, sz ) && py >= oy + oh / 2 - QMIN( oh / 6, sz / 2 )
+ && px <= ox + ow && py <= oy + oh / 2 + QMIN( oh / 6, sz / 2) )
+ {
+ _modType = MT_RESIZE_RT;
+ if ( protect)
+ return Qt::ForbiddenCursor;
+ return Qt::sizeHorCursor;
+ }
+
+ if ( px >= ox + ow - QMIN( ow / 3, sz ) && py >= oy + oh - QMIN( oh / 3, sz)
+ && px <= ox + ow && py <= oy + oh )
+ {
+ _modType = MT_RESIZE_RD;
+ if ( protect)
+ return Qt::ForbiddenCursor;
+ return Qt::sizeFDiagCursor;
+ }
+
+ //header footer can't move
+ if(!headerFooter)
+ _modType = MT_MOVE;
+ if ( protect )
+ return Qt::ForbiddenCursor;
+ else
+ return Qt::sizeAllCursor;
+}
+
+void KPrObject::getShadowCoords( double& _x, double& _y ) const
+{
+ double sx = 0, sy = 0;
+
+ switch ( shadowDirection )
+ {
+ case SD_LEFT_UP:
+ {
+ sx = _x - shadowDistance;
+ sy = _y - shadowDistance;
+ } break;
+ case SD_UP:
+ {
+ sx = _x;
+ sy = _y - shadowDistance;
+ } break;
+ case SD_RIGHT_UP:
+ {
+ sx = _x + shadowDistance;
+ sy = _y - shadowDistance;
+ } break;
+ case SD_RIGHT:
+ {
+ sx = _x + shadowDistance;
+ sy = _y;
+ } break;
+ case SD_RIGHT_BOTTOM:
+ {
+ sx = _x + shadowDistance;
+ sy = _y + shadowDistance;
+ } break;
+ case SD_BOTTOM:
+ {
+ sx = _x;
+ sy = _y + shadowDistance;
+ } break;
+ case SD_LEFT_BOTTOM:
+ {
+ sx = _x - shadowDistance;
+ sy = _y + shadowDistance;
+ } break;
+ case SD_LEFT:
+ {
+ sx = _x - shadowDistance;
+ sy = _y;
+ } break;
+ }
+
+ _x = sx; _y = sy;
+}
+
+void KPrObject::paintSelection( QPainter *_painter, KoTextZoomHandler *_zoomHandler, SelectionMode mode )
+{
+ if ( !selected || mode == SM_NONE )
+ return;
+
+ _painter->save();
+ _painter->translate( _zoomHandler->zoomItX(orig.x()), _zoomHandler->zoomItY(orig.y()) );
+ _painter->setPen( QPen( Qt::black, 1, QPen::SolidLine ) );
+ _painter->setBrush( kapp->palette().color( QPalette::Active, QColorGroup::Highlight ) );
+
+ KoRect r = getRealRect();
+
+ int x = _zoomHandler->zoomItX( r.left() - orig.x());
+ int y = _zoomHandler->zoomItY( r.top() - orig.y());
+ int zX6 = /*_zoomHandler->zoomItX(*/ 6 ;
+ int zY6 = /*_zoomHandler->zoomItY(*/ 6 ;
+ int w = _zoomHandler->zoomItX(r.width()) - 6;
+ int h = _zoomHandler->zoomItY(r.height()) - 6;
+
+ if ( mode == SM_MOVERESIZE ) {
+ _painter->drawRect( x, y, zX6, zY6 );
+ _painter->drawRect( x, y + h / 2, zX6, zY6 );
+ _painter->drawRect( x, y + h, zX6, zY6 );
+ _painter->drawRect( x + w, y, zX6, zY6 );
+ _painter->drawRect( x + w, y + h / 2, zX6, zY6 );
+ _painter->drawRect( x + w, y + h, zX6, zY6 );
+ _painter->drawRect( x + w / 2, y,zX6, zY6 );
+ _painter->drawRect( x + w / 2, y + h, zX6, zY6 );
+ }
+ else if ( mode == SM_PROTECT) {
+ _painter->drawRect( x, y, zX6, zY6 );
+ _painter->drawRect( x, y + h / 2, zX6, zY6 );
+ _painter->drawRect( x, y + h, zX6, zY6 );
+ _painter->drawRect( x + w, y, zX6, zY6 );
+ _painter->drawRect( x + w, y + h / 2, zX6, zY6 );
+ _painter->drawRect( x + w, y + h, zX6, zY6 );
+ _painter->drawRect( x + w / 2, y,zX6, zY6 );
+ _painter->drawRect( x + w / 2, y + h, zX6, zY6 );
+
+ x= x + 1;
+ y= y + 1;
+ zX6=zX6-2;
+ zY6=zY6-2;
+
+ QBrush brush=kapp->palette().color( QPalette::Active,QColorGroup::Base );
+ _painter->fillRect( x, y, zX6, zY6, brush );
+ _painter->fillRect( x, y + h / 2, zX6, zY6, brush);
+ _painter->fillRect( x, y + h, zX6, zY6, brush );
+ _painter->fillRect( x + w, y, zX6, zY6, brush );
+ _painter->fillRect( x + w, y + h / 2, zX6, zY6, brush );
+ _painter->fillRect( x + w , y + h , zX6 , zY6 , brush );
+ _painter->fillRect( x + w / 2 , y ,zX6 , zY6 , brush );
+ _painter->fillRect( x + w / 2, y + h , zX6 , zY6 , brush );
+ }
+ else if ( mode == SM_ROTATE ) {
+ _painter->drawEllipse( x, y, zX6, zY6 );
+ _painter->drawEllipse( x, y + h, zX6, zY6 );
+ _painter->drawEllipse( x + w, y, zX6, zY6 );
+ _painter->drawEllipse( x + w, y + h, zX6, zY6 );
+ }
+
+ _painter->restore();
+}
+
+void KPrObject::doDelete()
+{
+ if ( cmds == 0 && !inObjList )
+ delete this;
+}
+
+DCOPObject* KPrObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrObjectIface( this );
+
+ return dcop;
+}
+
+void KPrObject::setupClipRegion( QPainter *painter, const QRegion &clipRegion )
+{
+ QRegion region = painter->clipRegion( QPainter::CoordPainter );
+ if ( region.isEmpty() )
+ region = clipRegion;
+ else
+ region.unite( clipRegion );
+
+ painter->setClipRegion( region, QPainter::CoordPainter );
+}
+
+QDomElement KPrObject::createValueElement(const QString &tag, int value, QDomDocument &doc) {
+ QDomElement elem=doc.createElement(tag);
+ elem.setAttribute(attrValue, value);
+ return elem;
+}
+
+QDomElement KPrObject::createGradientElement(const QString &tag, const QColor &c1, const QColor &c2,
+ int type, bool unbalanced, int xfactor,
+ int yfactor, QDomDocument &doc) {
+ QDomElement elem=doc.createElement(tag);
+ elem.setAttribute(attrC1, c1.name());
+ elem.setAttribute(attrC2, c2.name());
+ elem.setAttribute(attrType, type);
+ elem.setAttribute(attrUnbalanced, (uint)unbalanced);
+ elem.setAttribute(attrXFactor, xfactor);
+ elem.setAttribute(attrYFactor, yfactor);
+ return elem;
+}
+
+QDomElement KPrObject::createPenElement(const QString &tag, const KoPen &pen, QDomDocument &doc) {
+
+ QDomElement elem=doc.createElement(tag);
+ elem.setAttribute(attrColor, pen.color().name());
+ elem.setAttribute(attrWidth, pen.pointWidth());
+ elem.setAttribute(attrStyle, static_cast<int>(pen.style()));
+ return elem;
+}
+
+KoPen KPrObject::toPen(const QDomElement &element) const {
+
+ KoPen pen;
+ pen.setColor(retrieveColor(element));
+ if(element.hasAttribute(attrStyle))
+ pen.setStyle(static_cast<Qt::PenStyle>(element.attribute(attrStyle).toInt()));
+ if(element.hasAttribute(attrWidth))
+ pen.setPointWidth(element.attribute(attrWidth).toDouble());
+ return pen;
+}
+
+QDomElement KPrObject::createBrushElement(const QString &tag, const QBrush &brush, QDomDocument &doc) {
+
+ QDomElement elem=doc.createElement(tag);
+ elem.setAttribute(attrColor, brush.color().name());
+ elem.setAttribute(attrStyle, static_cast<int>(brush.style()));
+ return elem;
+}
+
+QBrush KPrObject::toBrush(const QDomElement &element) const {
+
+ QBrush brush;
+ brush.setColor(retrieveColor(element));
+ if(element.hasAttribute(attrStyle))
+ brush.setStyle(static_cast<Qt::BrushStyle>(element.attribute(attrStyle).toInt()));
+ return brush;
+}
+
+QColor KPrObject::retrieveColor(const QDomElement &element, const QString &cattr,
+ const QString &rattr, const QString &gattr, const QString &battr) const {
+ QColor ret;
+ if(element.hasAttribute(cattr))
+ ret.setNamedColor(element.attribute(cattr));
+ else {
+ int red=0, green=0, blue=0;
+ if(element.hasAttribute(rattr))
+ red=element.attribute(rattr).toInt();
+ if(element.hasAttribute(gattr))
+ green=element.attribute(gattr).toInt();
+ if(element.hasAttribute(battr))
+ blue=element.attribute(battr).toInt();
+ ret.setRgb(red, green, blue);
+ }
+ return ret;
+}
+
+void KPrObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int /*pageNum*/, SelectionMode selectionMode, bool drawContour )
+{
+ if ( selectionMode != SM_NONE && !drawContour )
+ paintSelection( _painter, _zoomHandler, selectionMode );
+}
+
+KoPen KPrObject::getPen() const
+{
+ // Return the default pen
+ return KoPen();
+}
+
+void KPrObject::getRealSizeAndOrigFromPoints( KoPointArray &points, float angle,
+ KoSize &size, KoPoint &orig )
+{
+ if ( angle == 0 )
+ return;
+
+ float angInRad = angle * M_PI / 180;
+ float sinus = sin( angInRad );
+ float cosinus = cos( angInRad );
+
+ float mid_x = size.width() / 2;
+ float mid_y = size.height() / 2;
+
+ float min_x = 0;
+ float max_x = 0;
+ float min_y = 0;
+ float max_y = 0;
+ KoPointArray::ConstIterator it;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint cord( mid_x - (*it).x(), (*it).y() - mid_y );
+ float tmp_x = cord.x() * cosinus + cord.y() * sinus;
+ float tmp_y = - cord.x() * sinus + cord.y() * cosinus;
+
+ if ( tmp_x < min_x ) {
+ min_x = tmp_x;
+ }
+ else if ( tmp_x > max_x ) {
+ max_x = tmp_x;
+ }
+
+ if ( tmp_y < min_y ) {
+ min_y = tmp_y;
+ }
+ else if ( tmp_y > max_y ) {
+ max_y = tmp_y;
+ }
+ }
+
+ size.setWidth( max_x - min_x );
+ size.setHeight( max_y - min_y );
+
+ orig.setX( orig.x() + mid_x - max_x );
+ orig.setY( orig.y() + mid_y + min_y );
+}
+
+void KPrObject::addSelfToGuides(QValueList<double> &horizontalPos, QValueList<double> &verticalPos )
+{
+ KoRect bounds = getRealRect();
+
+ horizontalPos.append( bounds.top() );
+ verticalPos.append( bounds.left() );
+ horizontalPos.append( bounds.bottom() );
+ verticalPos.append( bounds.right() );
+}
+
+KPrShadowObject::KPrShadowObject()
+ : KPrObject()
+{
+}
+
+KPrShadowObject::KPrShadowObject( const KoPen &_pen )
+ : KPrObject(), pen( _pen )
+{
+}
+
+KPrShadowObject &KPrShadowObject::operator=( const KPrShadowObject & )
+{
+ return *this;
+}
+
+QDomDocumentFragment KPrShadowObject::save( QDomDocument& doc,double offset )
+{
+ QDomDocumentFragment fragment=KPrObject::save(doc, offset);
+
+ if(pen!=defaultPen())
+ fragment.appendChild(KPrObject::createPenElement(tagPEN, pen, doc));
+ return fragment;
+}
+
+void KPrShadowObject::saveOasisStrokeElement( KoGenStyles& mainStyles, KoGenStyle &styleobjectauto ) const
+{
+ switch( pen.style() )
+ {
+ case Qt::NoPen:
+ styleobjectauto.addProperty( "draw:stroke" , "none" );
+ break;
+ case Qt::SolidLine:
+ styleobjectauto.addProperty( "draw:stroke" , "solid" );
+ break;
+ case Qt::DashLine:
+ case Qt::DotLine:
+ case Qt::DashDotLine:
+ case Qt::DashDotDotLine:
+ styleobjectauto.addProperty( "draw:stroke" , "dash" );
+ //TODO FIXME
+ styleobjectauto.addProperty( "draw:stroke-dash", saveOasisStrokeStyle( mainStyles ) );
+ break;
+ default:
+ break;
+ }
+ if ( pen.style() != Qt::NoPen )
+ {
+ styleobjectauto.addProperty( "svg:stroke-color", pen.color().name() );
+ styleobjectauto.addPropertyPt( "svg:stroke-width", pen.pointWidth() );
+ }
+}
+
+QString KPrShadowObject::saveOasisStrokeStyle( KoGenStyles& mainStyles ) const
+{
+ KoGenStyle stroke( KPrDocument::STYLE_STROKE /*, "graphic"*/ /*no name*/ );
+ switch( pen.style() )
+ {
+ case Qt::NoPen:
+ //nothing
+ break;
+ case Qt::SolidLine:
+ //nothing
+ break;
+ case Qt::DashLine: //value from ooimpress filter
+ stroke.addAttribute( "draw:style", "rect" );
+ stroke.addAttribute( "draw:dots1", "1" );
+ stroke.addAttribute( "draw:dots2", "1" );
+ stroke.addAttribute( "draw:dots1-length", "0.508cm" );
+ stroke.addAttribute( "draw:dots2-length", "0.508cm" );
+ stroke.addAttribute( "draw:distance", "0.508cm" );
+ break;
+ case Qt::DotLine:
+ stroke.addAttribute( "draw:style", "rect" );
+ stroke.addAttribute( "draw:dots1", "1" );
+ stroke.addAttribute( "draw:distance", "0.257cm" );
+ break;
+ case Qt::DashDotLine:
+ stroke.addAttribute( "draw:style", "rect" );
+ stroke.addAttribute( "draw:dots1", "1" );
+ stroke.addAttribute( "draw:dots2", "1" );
+ stroke.addAttribute( "draw:dots1-length", "0.051cm" );
+ stroke.addAttribute( "draw:dots2-length", "0.254cm" );
+ stroke.addAttribute( "draw:distance", "0.127cm" );
+ break;
+ case Qt::DashDotDotLine:
+ stroke.addAttribute( "draw:style", "rect" );
+ stroke.addAttribute( "draw:dots1", "2" );
+ stroke.addAttribute( "draw:dots2", "1" );
+ stroke.addAttribute( "draw:dots2-length", "0.203cm" );
+ stroke.addAttribute( "draw:distance", "0.203cm" );
+ break;
+ default:
+ break;
+ }
+ return mainStyles.lookup( stroke, "stroke" );
+ // <draw:stroke-dash draw:name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
+}
+
+bool KPrShadowObject::saveOasisDrawPoints( const KoPointArray &points, KPOasisSaveContext &sc )
+{
+ QString listOfPoint;
+ int maxX=0;
+ int maxY=0;
+ KoPointArray::ConstIterator it( points.begin() );
+ KoPointArray::ConstIterator end( points.end() );
+ for ( ; it != end; ++it )
+ {
+ int tmpX = int( ( *it ).x() * 10000 );
+ int tmpY = int( ( *it ).y() * 10000 );
+ // no space allows before first element
+ if ( !listOfPoint.isEmpty() )
+ listOfPoint += QString( " %1,%2" ).arg( tmpX ).arg( tmpY );
+ else
+ listOfPoint = QString( "%1,%2" ).arg( tmpX ).arg( tmpY );
+ maxX = QMAX( maxX, tmpX );
+ maxY = QMAX( maxY, tmpY );
+ }
+ sc.xmlWriter.addAttribute("draw:points", listOfPoint );
+ sc.xmlWriter.addAttribute("svg:viewBox", QString( "0 0 %1 %2" ).arg( maxX ).arg( maxY ) );
+ return true;
+}
+
+bool KPrShadowObject::loadOasisDrawPoints( KoPointArray &points, const QDomElement &element,
+ KoOasisContext & context, KPrLoadingInfo *info )
+{
+ Q_UNUSED( context );
+ Q_UNUSED( info );
+ QStringList ptList = QStringList::split(' ', element.attributeNS( KoXmlNS::draw, "points", QString::null));
+
+ unsigned int index = 0;
+ for (QStringList::Iterator it = ptList.begin(); it != ptList.end(); ++it)
+ {
+ points.putPoints( index++, 1, ( *it ).section( ',', 0, 0 ).toInt(), ( *it ).section( ',', 1, 1 ).toInt() );
+ }
+ loadOasisApplyViewBox( element, points );
+ return true;
+}
+
+
+bool KPrShadowObject::loadOasisApplyViewBox( const QDomElement &element, KoPointArray &points )
+{
+ kdDebug(33001) << "loadOasisApplayViewBox svg:viewBox = " << element.attributeNS( KoXmlNS::svg, "viewBox", QString::null ) << endl;
+ QStringList viewBoxPoints = QStringList::split( ' ', element.attributeNS( KoXmlNS::svg, "viewBox", QString::null ) );
+
+ KoRect viewBox;
+ if ( viewBoxPoints.size() == 4 )
+ {
+ QStringList::Iterator it = viewBoxPoints.begin();
+ //viewBox.setCoords( ( *it++ ).toInt(), ( *it++ ).toInt(), ( *it++ ).toInt(), ( *it ).toInt() );
+ viewBox.setLeft( ( *it++ ).toInt() );
+ viewBox.setTop( ( *it++ ).toInt() );
+ viewBox.setRight( ( *it++ ).toInt() );
+ viewBox.setBottom( ( *it ).toInt() );
+
+ kdDebug(33001) << "viewBox supplied = " << viewBox << endl;
+ }
+ else
+ {
+ //if no viewBox is found
+ KoPointArray::ConstIterator it( points.begin() );
+ bool first = true;
+ for ( ; it != points.end(); ++it )
+ {
+ KoPoint p = (*it);
+ if ( first )
+ {
+ viewBox.setCoords( p.x(), p.y(), p.x(), p.y() );
+ first = false;
+ }
+ else
+ {
+ viewBox.setLeft( QMIN( viewBox.left(), p.x() ) );
+ viewBox.setRight( QMAX( viewBox.right(), p.x() ) );
+ viewBox.setTop( QMIN( viewBox.top(), p.y() ) );
+ viewBox.setBottom( QMAX( viewBox.bottom(), p.y() ) );
+ }
+ }
+ kdDebug(33001) << "viewBox calculated = " << viewBox << endl;
+ }
+
+ if ( viewBox.width() != 0 && viewBox.height() != 0 )
+ {
+ KoPointArray::Iterator it( points.begin() );
+ for ( ; it != points.end(); ++it )
+ {
+ KoPoint *p = it;
+ p->setX( ( p->x() - viewBox.left() ) / viewBox.width() * ext.width() );
+ p->setY( ( p->y() - viewBox.top() ) / viewBox.height() * ext.height() );
+ }
+ }
+ else
+ {
+ kdDebug(33001) << "problem in viewBox: " << viewBox << endl;
+ }
+ return true;
+}
+
+
+void KPrShadowObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const
+{
+ kdDebug(33001) << "KPrShadowObject::fillStyle" << endl;
+ KPrObject::fillStyle( styleObjectAuto, mainStyles );
+ saveOasisStrokeElement( mainStyles, styleObjectAuto );
+}
+
+void KPrShadowObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
+{
+ //kdDebug()<<"void KPrShadowObject::loadOasis(const QDomElement &element)**********************\n";
+ KPrObject::loadOasis(element, context, info);
+ KoStyleStack &styleStack = context.styleStack();
+ styleStack.setTypeProperties( "graphic" );
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "stroke" ))
+ {
+ if ( styleStack.attributeNS( KoXmlNS::draw, "stroke" ) == "none" )
+ pen.setStyle(Qt::NoPen );
+ else if ( styleStack.attributeNS( KoXmlNS::draw, "stroke" ) == "solid" )
+ pen.setStyle(Qt::SolidLine );
+ else if ( styleStack.attributeNS( KoXmlNS::draw, "stroke" ) == "dash" )
+ {
+ QString style = styleStack.attributeNS( KoXmlNS::draw, "stroke-dash" );
+
+ kdDebug()<<" stroke style is : "<<style<<endl;
+ //type not defined by default
+ //try to use style.
+ QDomElement* draw = context.oasisStyles().drawStyles()[style];
+ kdDebug()<<" stroke have oasis style defined :"<<draw<<endl;
+ if ( draw )
+ {
+ //FIXME
+ if ( draw->attributeNS( KoXmlNS::draw, "style", QString::null )=="rect" )
+ {
+ if ( draw->attributeNS( KoXmlNS::draw, "dots1", QString::null )=="1" &&
+ draw->attributeNS( KoXmlNS::draw, "dots2", QString::null )=="1" &&
+ draw->attributeNS( KoXmlNS::draw, "dots1-length", QString::null )=="0.508cm" &&
+ draw->attributeNS( KoXmlNS::draw, "dots2-length", QString::null )=="0.508cm" &&
+ draw->attributeNS( KoXmlNS::draw, "distance", QString::null )=="0.508cm" )
+ pen.setStyle( Qt::DashLine );
+ else if ( draw->attributeNS( KoXmlNS::draw, "dots1", QString::null )=="1" &&
+ draw->attributeNS( KoXmlNS::draw, "distance", QString::null )=="0.257cm" )
+ pen.setStyle(Qt::DotLine );
+ else if ( draw->attributeNS( KoXmlNS::draw, "dots1", QString::null )=="1" &&
+ draw->attributeNS( KoXmlNS::draw, "dots2", QString::null )=="1" &&
+ draw->attributeNS( KoXmlNS::draw, "dots1-length", QString::null )=="0.051cm" &&
+ draw->attributeNS( KoXmlNS::draw, "dots2-length", QString::null )=="0.254cm" &&
+ draw->attributeNS( KoXmlNS::draw, "distance", QString::null )=="0.127cm" )
+ pen.setStyle(Qt::DashDotLine );
+ else if ( draw->attributeNS( KoXmlNS::draw, "dots1", QString::null )=="2" &&
+ draw->attributeNS( KoXmlNS::draw, "dots2", QString::null )=="1" &&
+ draw->attributeNS( KoXmlNS::draw, "dots2-length", QString::null )=="0.203cm" &&
+ draw->attributeNS( KoXmlNS::draw, "distance", QString::null )=="0.203cm" )
+ pen.setStyle(Qt::DashDotDotLine );
+ else
+ {
+ kdDebug()<<" stroke style undefined \n";
+ pen.setStyle(Qt::SolidLine );
+ }
+
+ }
+ }
+ }
+ //FIXME witdh pen style is not good :(
+ if ( styleStack.hasAttributeNS( KoXmlNS::svg, "stroke-width" ) )
+ pen.setPointWidth( KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::svg, "stroke-width" ) ) );
+ if ( styleStack.hasAttributeNS( KoXmlNS::svg, "stroke-color" ) )
+ pen.setColor( styleStack.attributeNS( KoXmlNS::svg, "stroke-color" ) );
+ }
+ else
+ pen = defaultPen();
+ kdDebug()<<"pen style :"<<pen<<endl;
+}
+
+double KPrShadowObject::load(const QDomElement &element)
+{
+ double offset=KPrObject::load(element);
+ QDomElement e=element.namedItem(tagPEN).toElement();
+ if(!e.isNull())
+ setPen(KPrObject::toPen(e));
+ else
+ pen = defaultPen();
+ return offset;
+}
+
+void KPrShadowObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int pageNum, SelectionMode selectionMode, bool drawContour )
+{
+ double ox = orig.x();
+ double oy = orig.y();
+ _painter->save();
+
+ // Draw the shadow if any
+ if ( shadowDistance > 0 && !drawContour )
+ {
+ _painter->save();
+ // tz TODO fix tmpPen usage
+ KoPen tmpPen( pen );
+ pen.setColor( shadowColor );
+ QBrush brush;
+ brush.setColor( shadowColor );
+
+ double sx = ox;
+ double sy = oy;
+ getShadowCoords( sx, sy );
+
+ _painter->translate( _zoomHandler->zoomItX( sx ), _zoomHandler->zoomItY( sy ) );
+
+ if ( angle != 0 )
+ {
+ rotateObject( _painter, _zoomHandler );
+ }
+
+ paint( _painter, _zoomHandler, pageNum, true, drawContour );
+
+ pen = tmpPen;
+ _painter->restore();
+ }
+
+ _painter->translate( _zoomHandler->zoomItX(ox), _zoomHandler->zoomItY(oy) );
+
+ if ( angle != 0 )
+ rotateObject(_painter,_zoomHandler);
+ paint( _painter, _zoomHandler, pageNum, false, drawContour );
+
+ _painter->restore();
+
+ KPrObject::draw( _painter, _zoomHandler, pageNum, selectionMode, drawContour );
+}
+
+KoPen KPrShadowObject::defaultPen() const
+{
+ return KoPen();
+}
+
+void KPrShadowObject::paint(QPainter* painter, KoTextZoomHandler* zoomHandler, int pageNum, bool drawingShadow, bool drawContour) {
+ Q_UNUSED(painter);
+ Q_UNUSED(zoomHandler);
+ Q_UNUSED(pageNum);
+ Q_UNUSED(drawingShadow);
+ Q_UNUSED(drawContour);
+}
+
+KPr2DObject::KPr2DObject()
+ : KPrShadowObject()
+ , gradient( 0 )
+ , m_redrawGradientPix( false )
+{
+}
+
+KPr2DObject::KPr2DObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType,
+ const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor )
+ : KPrShadowObject( _pen )
+ , m_brush( _brush, _gColor1, _gColor2, _gType, _fillType, _unbalanced, _xfactor, _yfactor )
+ , gradient( 0 )
+ , m_redrawGradientPix( false )
+{
+ if ( getFillType() == FT_GRADIENT )
+ {
+ gradient = new KPrGradient( getGColor1(), getGColor2(),
+ getGType(), getGUnbalanced(),
+ getGXFactor(), getGYFactor() );
+ m_redrawGradientPix = true;
+ }
+}
+
+void KPr2DObject::setFillType( FillType _fillType )
+{
+ m_brush.setFillType( _fillType );
+
+ if ( _fillType == FT_BRUSH && gradient )
+ {
+ delete gradient;
+ gradient = 0;
+ }
+ if ( _fillType == FT_GRADIENT && !gradient )
+ {
+ gradient = new KPrGradient( getGColor1(), getGColor2(),
+ getGType(), getGUnbalanced(),
+ getGXFactor(), getGYFactor() );
+ m_redrawGradientPix = true;
+ }
+}
+
+QDomDocumentFragment KPr2DObject::save( QDomDocument& doc,double offset )
+{
+ QDomDocumentFragment fragment=KPrShadowObject::save(doc, offset);
+ QBrush brush = getBrush();
+ if ( brush != QBrush() )
+ fragment.appendChild( KPrObject::createBrushElement( tagBRUSH, brush, doc ) );
+
+ FillType fillType = getFillType();
+ if ( fillType != FT_BRUSH )
+ fragment.appendChild( KPrObject::createValueElement( tagFILLTYPE, static_cast<int>(fillType), doc ) );
+ QColor gColor1 = getGColor1();
+ QColor gColor2 = getGColor2();
+ BCType gType = getGType();
+ bool unbalanced = getGUnbalanced();
+ int xfactor = getGXFactor();
+ int yfactor = getGYFactor();
+ if ( gColor1!=Qt::red || gColor2!=Qt::green || gType!=BCT_GHORZ || unbalanced || xfactor != 100 || yfactor != 100 )
+ fragment.appendChild( KPrObject::createGradientElement( tagGRADIENT, gColor1, gColor2, static_cast<int>(gType),
+ unbalanced, xfactor, yfactor, doc));
+ return fragment;
+}
+
+void KPr2DObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const
+{
+ kdDebug(33001) << "KPr2DObject::fillStyle" << endl;
+ KPrShadowObject::fillStyle( styleObjectAuto, mainStyles );
+ m_brush.saveOasisFillStyle( styleObjectAuto, mainStyles );
+}
+
+
+void KPr2DObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
+{
+ kdDebug()<<"void KPr2DObject::loadOasis(const QDomElement &element)\n";
+ QBrush tmpBrush;
+
+ KPrShadowObject::loadOasis(element, context, info);
+ m_brush.loadOasisFillStyle( context, "graphic" );
+ setFillType( m_brush.getFillType() );
+}
+
+double KPr2DObject::load(const QDomElement &element)
+{
+ double offset=KPrShadowObject::load(element);
+
+ QDomElement e=element.namedItem(tagFILLTYPE).toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute(attrValue))
+ setFillType(static_cast<FillType>(e.attribute(attrValue).toInt()));
+ }
+ else
+ setFillType(FT_BRUSH);
+
+ e=element.namedItem(tagBRUSH).toElement();
+ if(!e.isNull())
+ setBrush(KPrObject::toBrush(e));
+ else
+ setBrush( QBrush() );
+
+ e=element.namedItem(tagGRADIENT).toElement();
+ if(!e.isNull()) {
+ setGColor1( retrieveColor( e, attrC1, "red1", "green1", "blue1" ) );
+ setGColor2( retrieveColor( e, attrC2, "red2", "green2", "blue2" ) );
+ if( e.hasAttribute( attrType ) )
+ setGType( static_cast<BCType>( e.attribute( attrType ).toInt() ) );
+ if( e.hasAttribute( attrUnbalanced ) )
+ setGUnbalanced( static_cast<bool>( e.attribute( attrUnbalanced ).toInt() ) );
+ if( e.hasAttribute( attrXFactor ) )
+ setGXFactor( e.attribute( attrXFactor ).toInt() );
+ if( e.hasAttribute( attrYFactor ) )
+ setGYFactor( e.attribute( attrYFactor ).toInt() );
+ if(gradient)
+ gradient->setParameters(getGColor1(), getGColor2(), getGType(), getGUnbalanced(), getGXFactor(), getGYFactor() );
+ }
+ else {
+ setGColor1( Qt::red );
+ setGColor2( Qt::green );
+ setGType( BCT_GHORZ );
+ setGUnbalanced( false );
+ setGXFactor( 100 );
+ setGYFactor( 100 );
+ }
+ return offset;
+}
+
+void KPr2DObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int pageNum, SelectionMode selectionMode, bool drawContour )
+{
+ double ox = orig.x();
+ double oy = orig.y();
+ _painter->save();
+
+ // Draw the shadow if any
+ if ( shadowDistance > 0 && !drawContour )
+ {
+ _painter->save();
+ KoPen tmpPen( pen );
+ pen.setColor( shadowColor );
+ QBrush tmpBrush( m_brush.getBrush() );
+ QBrush shadowBrush( tmpBrush );
+ shadowBrush.setColor( shadowColor );
+ m_brush.setBrush( shadowBrush );
+
+ double sx = ox;
+ double sy = oy;
+ getShadowCoords( sx, sy );
+
+ _painter->translate( _zoomHandler->zoomItX( sx ), _zoomHandler->zoomItY( sy ) );
+
+ if ( angle != 0 )
+ {
+ rotateObject( _painter, _zoomHandler );
+ }
+
+ paint( _painter, _zoomHandler, pageNum, true, drawContour );
+
+ pen = tmpPen;
+ m_brush.setBrush( tmpBrush );
+ _painter->restore();
+ }
+
+ _painter->translate( _zoomHandler->zoomItX(ox), _zoomHandler->zoomItY(oy) );
+
+ if ( angle != 0 )
+ rotateObject(_painter,_zoomHandler);
+ paint( _painter, _zoomHandler, pageNum, false, drawContour );
+
+ _painter->restore();
+
+ KPrObject::draw( _painter, _zoomHandler, pageNum, selectionMode, drawContour );
+}
+
+void KPr2DObject::flip( bool horizontal ) {
+ KPrObject::flip( horizontal );
+
+ // flip the gradient
+ if ( getFillType() == FT_GRADIENT ) {
+ BCType gType = getGType();
+ if ( gType == BCT_GDIAGONAL1 ) {
+ setGType( BCT_GDIAGONAL2 );
+ }
+ else if ( gType == BCT_GDIAGONAL2 ) {
+ setGType( BCT_GDIAGONAL1 );
+ }
+ if ( ( ! horizontal && gType == BCT_GDIAGONAL1 ) ||
+ ( ! horizontal && gType == BCT_GDIAGONAL2 ) ||
+ ( ! horizontal && gType == BCT_GHORZ ) ||
+ ( horizontal && gType == BCT_GVERT ) ) {
+ QColor gColorTemp;
+ gColorTemp = getGColor1();
+ setGColor1( getGColor2() );
+ setGColor2( gColorTemp );
+ }
+ delete gradient;
+ gradient = new KPrGradient( getGColor1(), getGColor2(), gType, getGUnbalanced(), getGXFactor(), getGYFactor() );
+ }
+}
diff --git a/kpresenter/KPrObject.h b/kpresenter/KPrObject.h
new file mode 100644
index 000000000..bc532f5aa
--- /dev/null
+++ b/kpresenter/KPrObject.h
@@ -0,0 +1,557 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpobject_h
+#define kpobject_h
+
+#include <qbrush.h>
+#include <qcursor.h>
+
+#include "global.h"
+
+#include "KPrGradient.h"
+#include "KoPointArray.h"
+#include <klocale.h>
+#include <KoPoint.h>
+#include <KoSize.h>
+#include <KoRect.h>
+#include <KoStyleStack.h>
+#include <KoOasisStyles.h>
+#include <KoXmlWriter.h>
+#include <KoGenStyles.h>
+#include "KPrLoadingInfo.h"
+#include "KPrBrush.h"
+#include <KoPen.h>
+
+class KoSavingContext;
+class QPainter;
+class DCOPObject;
+class QDomDocumentFragment;
+class QDomDocument;
+class QDomElement;
+class KoTextZoomHandler;
+class KPrDocument;
+class KPrTextObject;
+class KoTextObject;
+class KoOasisContext;
+
+#define RAD_FACTOR 180.0 / M_PI
+#define MIN_SIZE 10
+
+class KPrObject
+{
+public:
+ KPrObject();
+ virtual ~KPrObject();
+
+
+ virtual DCOPObject* dcopObject();
+
+ virtual void setSelected( bool _selected )
+ { selected = _selected; }
+ virtual void rotate( float _angle )
+ { angle = _angle; }
+ virtual void setSize( const KoSize & _size )
+ { setSize( _size.width(), _size.height() ); }
+ virtual void setSize(double _width, double _height )
+ { ext = KoSize( QMAX( MIN_SIZE, _width ), QMAX( MIN_SIZE, _height ) ); } // no object is smaller than 10x10
+ virtual void setOrig( const KoPoint & _point )
+ { orig = _point; }
+ virtual void setOrig( double _x, double _y )
+ { orig = KoPoint( _x, _y ); }
+ virtual void moveBy( const KoPoint &_point )
+ { orig = orig + _point; }
+ virtual void moveBy( double _dx, double _dy )
+ { orig = orig + KoPoint( _dx, _dy ); }
+ virtual void resizeBy( const KoSize & _size )
+ { resizeBy( _size.width(), _size.height() ); }
+ virtual void resizeBy( double _dx, double _dy )
+ { setSize( ext.width() + _dx, ext.height() + _dy ); } // call (possibly reimplemented) setSize
+
+ virtual void setShadowParameter(int _distance,ShadowDirection _direction,const QColor &_color)
+ {
+ shadowDistance = _distance;
+ shadowDirection = _direction;
+ shadowColor = _color;
+ }
+
+ virtual void setShadowDistance( int _distance )
+ { shadowDistance = _distance; }
+ virtual void setShadowDirection( ShadowDirection _direction )
+ { shadowDirection = _direction; }
+ virtual void setShadowColor( const QColor & _color )
+ { shadowColor = _color; }
+ virtual void setEffect( Effect _effect )
+ { effect = _effect; }
+ virtual void setEffect2( Effect2 _effect2 )
+ { effect2 = _effect2; }
+ virtual void setAppearStep( int _appearStep )
+ { appearStep = _appearStep; }
+ virtual void setDisappear( bool b )
+ { disappear = b; }
+ virtual void setDisappearStep( int num )
+ { disappearStep = num; }
+ virtual void setEffect3( Effect3 _effect3)
+ { effect3 = _effect3; }
+ virtual void setAppearSpeed( EffectSpeed _speed )
+ { m_appearSpeed = _speed; }
+ virtual void setDisappearSpeed( EffectSpeed _speed )
+ { m_disappearSpeed = _speed; }
+ virtual void setAppearTimer( int _appearTimer )
+ { appearTimer = _appearTimer; }
+ virtual void setDisappearTimer( int _disappearTimer )
+ { disappearTimer = _disappearTimer; }
+ virtual void setAppearSoundEffect( bool b )
+ { appearSoundEffect = b; }
+ virtual void setDisappearSoundEffect( bool b )
+ { disappearSoundEffect = b; }
+ virtual void setAppearSoundEffectFileName( const QString & _a_fileName )
+ { a_fileName = _a_fileName; }
+ virtual void setDisappearSoundEffectFileName( const QString &_d_fileName )
+ { d_fileName = _d_fileName; }
+
+ virtual void setObjectName( const QString &_objectName )
+ { objectName = _objectName; }
+ virtual QString getObjectName() const
+ { return objectName; }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+ virtual double load(const QDomElement &element);
+ virtual void loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info);
+
+ struct KPOasisSaveContext
+ {
+ KPOasisSaveContext( KoXmlWriter &_xmlWriter, KoSavingContext &_context,
+ int &_indexObj, int &_partIndexObj, bool _onMaster )
+ : xmlWriter( _xmlWriter )
+ , context( _context )
+ , indexObj( _indexObj )
+ , partIndexObj( _partIndexObj )
+ , onMaster( _onMaster ) {};
+
+ KoXmlWriter &xmlWriter;
+ KoSavingContext &context;
+ int &indexObj;
+ int &partIndexObj;
+ bool onMaster;
+ };
+
+ virtual bool saveOasisObject( KPOasisSaveContext &sc ) const;
+
+ //return true if we have a animation into object
+ bool saveOasisObjectStyleShowAnimation( KoXmlWriter &animation, int objectId );
+ bool saveOasisObjectStyleHideAnimation( KoXmlWriter &animation, int objectId );
+
+ virtual void flip(bool horizontal );
+
+ virtual ObjType getType() const
+ { return OT_UNDEFINED; }
+ virtual QString getTypeString() const
+ { return QString(); }
+
+ virtual bool isSelected() const
+ { return selected; }
+ virtual float getAngle() const
+ { return angle; }
+ virtual int getShadowDistance() const
+ { return shadowDistance; }
+ virtual ShadowDirection getShadowDirection() const
+ { return shadowDirection; }
+ virtual QColor getShadowColor() const
+ { return shadowColor; }
+ virtual KoSize getSize() const
+ { return ext; }
+ virtual KoPoint getOrig() const
+ { return orig; }
+ KoRect getRect() const
+ { return KoRect( getOrig(), getSize() ); }
+
+ virtual KoSize getRealSize() const;
+ virtual KoPoint getRealOrig() const;
+ KoRect getRealRect() const;
+ /**
+ * @brief Get the rect which has to be repainted
+ *
+ * This also contains the shadow.
+ */
+ KoRect getRepaintRect() const;
+
+ virtual Effect getEffect() const
+ { return effect; }
+ virtual Effect2 getEffect2() const
+ { return effect2; }
+ virtual Effect3 getEffect3() const
+ { return effect3; }
+ virtual EffectSpeed getAppearSpeed() const
+ { return m_appearSpeed; }
+ virtual EffectSpeed getDisappearSpeed() const
+ { return m_disappearSpeed; }
+ virtual int getAppearTimer() const
+ { return appearTimer; }
+ virtual int getDisappearTimer() const
+ { return disappearTimer; }
+ virtual bool getAppearSoundEffect() const
+ { return appearSoundEffect; }
+ virtual bool getDisappearSoundEffect() const
+ { return disappearSoundEffect; }
+ virtual QString getAppearSoundEffectFileName() const
+ { return a_fileName; }
+ virtual QString getDisappearSoundEffectFileName() const
+ { return d_fileName; }
+ /**
+ * get the step when the object appears on the site
+ */
+ virtual int getAppearStep() const
+ { return appearStep; }
+ virtual int getSubPresSteps() const
+ { return 0; }
+ virtual bool getDisappear() const
+ { return disappear; }
+ /**
+ * get the step when the object disappears from the site
+ */
+ virtual int getDisappearStep() const
+ { return disappearStep; }
+
+ virtual void setOwnClipping( bool _ownClipping )
+ { ownClipping = _ownClipping; }
+ virtual void setSubPresStep( int _subPresStep )
+ { subPresStep = _subPresStep; }
+ virtual void doSpecificEffects( bool _specEffects, bool _onlyCurrStep = true )
+ { specEffects = _specEffects; onlyCurrStep = _onlyCurrStep; }
+
+ // the main drawing method.
+ virtual void draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int /*pageNum*/, SelectionMode selectionMode, bool drawContour = FALSE );
+
+ /**
+ * @brief Check if point lies in rect of object
+ *
+ * @param point to check
+ *
+ * @return true if point lies in rect of object
+ * @return false otherwise
+ */
+ virtual bool contains( const KoPoint &point ) const;
+
+ /**
+ * @brief Check if rect intersects with rect of object
+ *
+ * @param rect to check
+ *
+ * @return true if rect interesct with rect of object
+ * @return false otherwise
+ */
+ virtual bool intersects( const KoRect & rect ) const;
+
+ virtual QCursor getCursor( const KoPoint &_point, ModifyType &_modType, KPrDocument *doc ) const;
+
+ KoRect rotateRectObject() const;
+ void rotateObject(QPainter *paint,KoTextZoomHandler *_zoomHandler);
+
+ virtual void removeFromObjList()
+ { inObjList = false; }
+ virtual void addToObjList()
+ { inObjList = true; }
+ virtual void incCmdRef()
+ { cmds++; }
+ virtual void decCmdRef()
+ { cmds--; doDelete(); }
+
+ virtual void setProtect( bool b ) { protect = b; }
+ bool isProtect() const { return protect; }
+
+ virtual void setKeepRatio( bool b ) { keepRatio = b; }
+ bool isKeepRatio() const { return keepRatio; }
+
+ static void setupClipRegion( QPainter *painter, const QRegion &clipRegion );
+
+ void paintSelection( QPainter *_painter,KoTextZoomHandler *_zoomHandler,
+ SelectionMode selectionMode );
+
+ /**
+ * Collect all textobjects.
+ * (KPrTextObject returns the object it contains,
+ * a KPrGroupObject returns all the text objects it contains)
+ */
+ virtual void addTextObjects( QPtrList<KoTextObject> & ) const {}
+
+ virtual KPrTextObject *nextTextObject() { return 0L;} // deprecated
+ virtual void getAllObjectSelectedList(QPtrList<KPrObject> &lst, bool force = false )
+ { if (selected || force ) lst.append( this );}
+ virtual KoPen getPen() const;
+
+ bool hasAnimation() const;
+
+ /**
+ * Adds its edges to the KoGuides objectCollect all textobjects.
+ */
+ void addSelfToGuides( QValueList<double> &horizontalPos, QValueList<double> &verticalPos );
+
+protected:
+ /**
+ * Helper function to caluclate the size and the orig of a point object
+ * that might be also rotated.
+ * The size and orig will be changed to the real size and orig in the
+ * method.
+ */
+ static void getRealSizeAndOrigFromPoints( KoPointArray &points, float angle,
+ KoSize &size, KoPoint &orig );
+
+ /**
+ * Modifies x and y to add the shadow offsets
+ */
+ void getShadowCoords( double& _x, double& _y ) const;
+
+ virtual void doDelete();
+
+ QDomElement createValueElement(const QString &tag, int value, QDomDocument &doc);
+ QDomElement createGradientElement(const QString &tag, const QColor &c1, const QColor &c2,
+ int type, bool unbalanced, int xfactor, int yfactor, QDomDocument &doc);
+ QDomElement createPenElement(const QString &tag, const KoPen &pen, QDomDocument &doc);
+ KoPen toPen(const QDomElement &element) const;
+
+ QDomElement createBrushElement(const QString &tag, const QBrush &brush, QDomDocument &doc);
+ QBrush toBrush(const QDomElement &element) const;
+
+ QColor retrieveColor(const QDomElement &element, const QString &cattr="color",
+ const QString &rattr="red", const QString &gattr="green",
+ const QString &battr="blue") const;
+
+ void saveOasisObjectProtectStyle( KoGenStyle &styleobjectauto ) const;
+ void saveOasisShadowElement( KoGenStyle &styleobjectauto ) const;
+
+ QString getStyle( KPOasisSaveContext &sc ) const;
+ virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
+ /**
+ * Get the element name for saving the object
+ */
+ virtual const char * getOasisElementName() const = 0;
+ //virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const = 0;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+ virtual void saveOasisPosObject( KoXmlWriter &xmlWriter, int indexObj ) const;
+
+ float angle;
+ KoPoint orig;
+ KoSize ext;
+ int shadowDistance;
+ ShadowDirection shadowDirection;
+ QColor shadowColor;
+ Effect effect;
+ Effect2 effect2;
+ Effect3 effect3;
+ EffectSpeed m_appearSpeed;
+ EffectSpeed m_disappearSpeed;
+ int appearTimer, disappearTimer;
+ QString a_fileName, d_fileName;
+ QString objectName;
+ // step when objects appears/disappears
+ int appearStep, disappearStep;
+
+ bool disappear:1;
+ bool appearSoundEffect:1;
+ bool disappearSoundEffect:1;
+ bool selected:1;
+ bool specEffects:1;
+ bool onlyCurrStep:1;
+ bool ownClipping:1;
+ bool inObjList:1;
+ bool resize:1;
+ bool protect:1;
+ bool keepRatio:1;
+
+ int subPresStep;
+ int cmds;
+
+ DCOPObject *dcop;
+
+ static const QString &tagORIG, &attrX, &attrY,
+ &tagSIZE, &attrWidth, &attrHeight, &tagSHADOW,
+ &attrDistance, &attrDirection, &attrColor, &attrC1,
+ &attrC2, &attrType, &attrUnbalanced, &attrXFactor,
+ &attrYFactor, &attrStyle, &tagEFFECTS, &attrEffect,
+ &attrEffect2, &tagPRESNUM, &tagANGLE,
+ &tagDISAPPEAR, &attrDoit, &attrNum, &tagFILLTYPE,
+ &tagGRADIENT, &tagPEN, &tagBRUSH, &attrValue;
+
+private:
+ // Don't copy or assign it
+ KPrObject(const KPrObject &rhs);
+ KPrObject &operator=(const KPrObject &rhs);
+};
+
+/**
+ * Base class for objects with a pen and a brush,
+ * and which takes care of painting the shadow in draw()
+ * (by calling paint() twice)
+ */
+class KPrShadowObject : public KPrObject
+{
+public:
+ KPrShadowObject();
+ KPrShadowObject( const KoPen &_pen );
+
+ KPrShadowObject &operator=( const KPrShadowObject & );
+
+ virtual void setPen( const KoPen &_pen )
+ { pen = _pen; }
+
+ virtual KoPen getPen() const
+ { return pen; }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+ virtual double load(const QDomElement &element);
+ virtual void loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info);
+ virtual void draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int pageNum, SelectionMode selectionMode, bool drawContour = FALSE );
+ virtual void saveOasisStrokeElement( KoGenStyles& mainStyles, KoGenStyle &styleobjectauto ) const;
+ QString saveOasisStrokeStyle( KoGenStyles& mainStyles ) const;
+
+protected:
+ /**
+ * Helper method for saving draw:points. The svg:viewBox is also saved.
+ */
+ static bool saveOasisDrawPoints( const KoPointArray &points, KPOasisSaveContext &sc );
+
+ /**
+ * Helper method for loading draw:points. The svg:viewBox is taken into account.
+ */
+ bool loadOasisDrawPoints( KoPointArray &points, const QDomElement &element,
+ KoOasisContext & context, KPrLoadingInfo *info );
+
+
+ /**
+ * @brief Apply the svg:viewBox attribute to the points.
+ *
+ * This calculates the points of the object. It uses the size of the object and the
+ * viewBox attribute to calculate the object points.
+ * When no svg:viewBox is specified it is calculated form the supplied
+ * points.
+ *
+ * @param element the xml element from which the viewBox attribute should be read.
+ * @param points which should be updated.
+ */
+ bool loadOasisApplyViewBox( const QDomElement &element, KoPointArray &points );
+
+ virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
+
+ /**
+ * save() only saves if the pen is different from the default pen.
+ * The default pen can vary depending on the subclass of KPrShadowObject
+ * (e.g. it's a black solidline for lines and rects, but it's NoPen
+ * for text objects
+ */
+ virtual KoPen defaultPen() const;
+
+ /**
+ * This method is to be implemented by all KPShadowObjects, to draw themselves.
+ * draw() took care of the shadow and of preparing @p painter for rotation.
+ * paint() must take care of the gradient itself!
+ *
+ * @param drawingShadow true if called to draw the shadow of the object. Usually
+ * objects will want to draw a simpler version of themselves in that case.
+ *
+ * This method isn't pure virtual because some objects implement draw() directly.
+ */
+ virtual void paint( QPainter* /* painter */, KoTextZoomHandler* /* zoomHandler */,
+ int /* pageNum */, bool drawingShadow, bool /* drawContour */ = FALSE );
+ KoPen pen;
+};
+
+class KPr2DObject : public KPrShadowObject
+{
+public:
+ KPr2DObject();
+ KPr2DObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType,
+ const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor );
+ virtual ~KPr2DObject() { delete gradient; }
+
+ virtual void setFillType( FillType fillType );
+ virtual void setBrush( const QBrush &brush )
+ { m_brush.setBrush( brush ); }
+ virtual void setGColor1( const QColor &gColor1 )
+ { if ( gradient ) gradient->setColor1( gColor1 ); m_brush.setGColor1( gColor1 ); m_redrawGradientPix = true; }
+ virtual void setGColor2( const QColor &gColor2 )
+ { if ( gradient ) gradient->setColor2( gColor2 ); m_brush.setGColor2( gColor2 ); m_redrawGradientPix = true; }
+ virtual void setGType( BCType gType )
+ { if ( gradient ) gradient->setBackColorType( gType ); m_brush.setGType( gType ); m_redrawGradientPix = true; }
+ virtual void setGUnbalanced( bool b )
+ { if ( gradient ) gradient->setUnbalanced( b ); m_brush.setGUnbalanced( b ); m_redrawGradientPix = true; }
+ virtual void setGXFactor( int xfactor )
+ { if ( gradient ) gradient->setXFactor( xfactor ); m_brush.setGXFactor( xfactor ); m_redrawGradientPix = true; }
+ virtual void setGYFactor( int yfactor )
+ { if ( gradient ) gradient->setYFactor( yfactor ); m_brush.setGYFactor( yfactor ); m_redrawGradientPix = true; }
+
+ virtual FillType getFillType() const
+ { return m_brush.getFillType(); }
+ virtual QBrush getBrush() const
+ { return m_brush.getBrush(); }
+ virtual QColor getGColor1() const
+ { return m_brush.getGColor1(); }
+ virtual QColor getGColor2() const
+ { return m_brush.getGColor2(); }
+ virtual BCType getGType() const
+ { return m_brush.getGType(); }
+ virtual bool getGUnbalanced() const
+ { return m_brush.getGUnbalanced(); }
+ virtual int getGXFactor() const
+ { return m_brush.getGXFactor(); }
+ virtual int getGYFactor() const
+ { return m_brush.getGYFactor(); }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+ virtual double load(const QDomElement &element);
+ virtual void loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info);
+ virtual void draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int pageNum, SelectionMode selectionMode, bool drawContour = FALSE );
+
+ virtual void flip(bool horizontal );
+
+protected:
+ virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
+
+ KPrBrush m_brush;
+ KPrGradient *gradient;
+ /// holds the painted gradient
+ QPixmap m_gradientPix;
+ bool m_redrawGradientPix;
+};
+
+class KPrStartEndLine
+{
+public:
+ KPrStartEndLine( LineEnd _start, LineEnd _end );
+ void save( QDomDocumentFragment &fragment, QDomDocument& doc );
+ void load( const QDomElement &element );
+
+ void saveOasisMarkerElement( KoGenStyles& mainStyles, KoGenStyle &styleobjectauto ) const;
+ QString saveOasisMarkerStyle( KoGenStyles &mainStyles, const LineEnd &_element ) const;
+ void loadOasisMarkerElement( KoOasisContext & context, const QString & attr, LineEnd &_element );
+
+protected:
+ //duplicate from kpobject
+ QDomElement createValueElement(const QString &tag, int value, QDomDocument &doc);
+
+ LineEnd lineBegin, lineEnd;
+};
+
+#endif
diff --git a/kpresenter/KPrObject2DIface.cpp b/kpresenter/KPrObject2DIface.cpp
new file mode 100644
index 000000000..0849dfb9b
--- /dev/null
+++ b/kpresenter/KPrObject2DIface.cpp
@@ -0,0 +1,124 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrObject2DIface.h"
+#include "KPrObjectIface.h"
+
+#include "KPrObject.h"
+#include <kdebug.h>
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrObject2DIface::KPrObject2DIface(KPr2DObject *obj_)
+ : KPrObjectIface(obj_)
+{
+ obj = obj_;
+}
+
+QColor KPrObject2DIface::gradientColor1() const
+{
+ return obj->getGColor1();
+}
+
+QColor KPrObject2DIface::gradientColor2() const
+{
+ return obj->getGColor2();
+}
+
+void KPrObject2DIface::setGUnbalanced( bool b )
+{
+ obj->setGUnbalanced(b);
+}
+
+void KPrObject2DIface::setGXFactor( int f )
+{
+ obj->setGXFactor(f);
+}
+
+void KPrObject2DIface::setGYFactor( int f )
+{
+ obj->setGYFactor(f);
+}
+
+int KPrObject2DIface::xGradientFactor() const
+{
+ return obj->getGXFactor();
+}
+
+int KPrObject2DIface::yGradientFactor() const
+{
+ return obj->getGYFactor();
+}
+
+QString KPrObject2DIface::gradientFillType() const
+{
+ switch(obj->getFillType())
+ {
+ case FT_BRUSH:
+ return QString("BRUSH");
+ case FT_GRADIENT:
+ return QString("GRADIENT");
+ }
+ return QString::null;
+}
+
+void KPrObject2DIface::setGradientType( const QString & type)
+{
+ if(type=="PLAIN")
+ obj->setGType(BCT_PLAIN);
+ else if(type=="GHORZ")
+ obj->setGType(BCT_GHORZ);
+ else if(type=="GVERT")
+ obj->setGType(BCT_GVERT);
+ else if(type=="GDIAGONAL1")
+ obj->setGType(BCT_GDIAGONAL1);
+ else if(type=="GDIAGONAL2")
+ obj->setGType(BCT_GDIAGONAL2);
+ else if(type=="GCIRCLE")
+ obj->setGType(BCT_GCIRCLE);
+ else if(type=="GRECT")
+ obj->setGType(BCT_GRECT);
+ else if(type=="GPIPECROSS")
+ obj->setGType(BCT_GPIPECROSS);
+ else if(type=="GPYRAMID")
+ obj->setGType(BCT_GPYRAMID);
+ else
+ kdDebug(33001)<<"Error KPrObject2DIface::setGradientType\n";
+}
+
+void KPrObject2DIface::setFillType( const QString & type)
+{
+ if(type=="BRUSH")
+ obj->setFillType(FT_BRUSH);
+ else if(type=="GRADIENT")
+ obj->setFillType(FT_GRADIENT);
+ else
+ kdDebug(33001)<<"Error KPrObject2DIface::setFillType\n";
+}
+
+void KPrObject2DIface::setGradientColor1( const QColor &col )
+{
+ obj->setGColor1( col );
+}
+
+void KPrObject2DIface::setGradientColor2( const QColor &col )
+{
+ obj->setGColor2( col );
+}
diff --git a/kpresenter/KPrObject2DIface.h b/kpresenter/KPrObject2DIface.h
new file mode 100644
index 000000000..d1b351d06
--- /dev/null
+++ b/kpresenter/KPrObject2DIface.h
@@ -0,0 +1,59 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRESENTER_OBJ2D_IFACE_H
+#define KPRESENTER_OBJ2D_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+
+#include <qstring.h>
+#include <qcolor.h>
+
+#include "KPrObjectIface.h"
+
+class KPr2DObject;
+
+class KPrObject2DIface : public KPrObjectIface
+{
+ K_DCOP
+public:
+ KPrObject2DIface( KPr2DObject *obj_ );
+
+k_dcop:
+ virtual QColor gradientColor1() const;
+ virtual QColor gradientColor2() const;
+ virtual void setGUnbalanced( bool b );
+ virtual void setGXFactor( int f );
+ virtual void setGYFactor( int f );
+ virtual int xGradientFactor() const;
+ virtual int yGradientFactor() const;
+ virtual QString gradientFillType() const;
+ virtual void setGradientType( const QString & );
+ virtual void setFillType( const QString & );
+ virtual void setGradientColor1( const QColor &col );
+ virtual void setGradientColor2( const QColor &col );
+
+private:
+ KPr2DObject *obj;
+
+};
+
+#endif
diff --git a/kpresenter/KPrObjectIface.cpp b/kpresenter/KPrObjectIface.cpp
new file mode 100644
index 000000000..6f7913bf6
--- /dev/null
+++ b/kpresenter/KPrObjectIface.cpp
@@ -0,0 +1,288 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrObjectIface.h"
+
+#include "KPrObject.h"
+#include <kdebug.h>
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrObjectIface::KPrObjectIface( KPrObject *obj_ )
+ : DCOPObject()
+{
+ obj = obj_;
+}
+
+int KPrObjectIface::getType() const
+{
+ return (int)obj->getType();
+}
+
+bool KPrObjectIface::isSelected() const
+{
+ return obj->isSelected();
+}
+
+float KPrObjectIface::angle() const
+{
+ return obj->getAngle();
+}
+
+int KPrObjectIface::shadowDistance() const
+{
+ return obj->getShadowDistance();
+}
+
+int KPrObjectIface::shadowDirection() const
+{
+ return (int)obj->getShadowDirection();
+}
+
+QColor KPrObjectIface::shadowColor() const
+{
+ return obj->getShadowColor();
+}
+
+int KPrObjectIface::effect() const
+{
+ return (int)obj->getEffect();
+}
+
+int KPrObjectIface::effect2() const
+{
+ return (int)obj->getEffect2();
+}
+
+int KPrObjectIface::appearStep() const
+{
+ return obj->getAppearStep();
+}
+
+int KPrObjectIface::subPresSteps() const
+{
+ return obj->getSubPresSteps();
+}
+
+bool KPrObjectIface::disappear() const
+{
+ return obj->getDisappear();
+}
+
+int KPrObjectIface::disappearStep() const
+{
+ return obj->getDisappearStep();
+}
+
+int KPrObjectIface::effect3() const
+{
+ return (int)obj->getEffect3();
+}
+
+void KPrObjectIface::setSelected( bool _selected )
+{
+ obj->setSelected(_selected);
+}
+
+void KPrObjectIface::rotate( float _angle )
+{
+ obj->rotate(_angle);
+}
+
+void KPrObjectIface::setShadowDistance( int _distance )
+{
+ obj->setShadowDistance(_distance);
+}
+
+void KPrObjectIface::shadowColor( const QColor & _color )
+{
+ obj->setShadowColor(_color);
+}
+
+void KPrObjectIface::setAppearTimer( int _appearTimer )
+{
+ obj->setAppearTimer(_appearTimer);
+}
+
+void KPrObjectIface::setDisappearTimer( int _disappearTimer )
+{
+ obj->setDisappearTimer(_disappearTimer);
+}
+
+void KPrObjectIface::setAppearSoundEffect( bool b )
+{
+ obj->setAppearSoundEffect(b);
+}
+
+void KPrObjectIface::setDisappearSoundEffect( bool b )
+{
+ obj->setDisappearSoundEffect(b);
+}
+void KPrObjectIface::setAppearSoundEffectFileName( const QString & _a_fileName )
+{
+ obj->setAppearSoundEffectFileName(_a_fileName);
+}
+void KPrObjectIface::setDisappearSoundEffectFileName( const QString &_d_fileName )
+{
+ obj->setDisappearSoundEffectFileName(_d_fileName);
+}
+
+void KPrObjectIface::setObjectName( const QString &_objectName )
+{
+ obj->setObjectName(_objectName);
+}
+
+void KPrObjectIface::setAppearStep( int _appearStep )
+{
+ obj->setAppearStep(_appearStep);
+}
+
+void KPrObjectIface::setDisappear( bool b )
+{
+ obj->setDisappear(b);
+}
+
+int KPrObjectIface::appearTimer() const
+{
+ return obj->getAppearTimer();
+}
+
+int KPrObjectIface::disappearTimer() const
+{
+ return obj->getDisappearTimer();
+}
+
+bool KPrObjectIface::appearSoundEffect() const
+{
+ return obj->getAppearSoundEffect();
+}
+
+bool KPrObjectIface::disappearSoundEffect() const
+{
+ return obj->getDisappearSoundEffect();
+}
+
+QString KPrObjectIface::appearSoundEffectFileName() const
+{
+ return obj->getAppearSoundEffectFileName();
+}
+
+QString KPrObjectIface::disappearSoundEffectFileName() const
+{
+ return obj->getDisappearSoundEffectFileName();
+}
+
+QString KPrObjectIface::typeString() const
+{
+ return obj->getTypeString();
+}
+
+void KPrObjectIface::setEffect(const QString & effect)
+{
+ if(effect=="NONE")
+ obj->setEffect(EF_NONE);
+ else if(effect=="COME_RIGHT")
+ obj->setEffect(EF_COME_RIGHT);
+ else if(effect=="COME_LEFT")
+ obj->setEffect(EF_COME_LEFT);
+ else if(effect=="COME_TOP")
+ obj->setEffect(EF_COME_TOP);
+ else if(effect=="COME_BOTTOM")
+ obj->setEffect(EF_COME_BOTTOM);
+ else if(effect=="COME_RIGHT_TOP")
+ obj->setEffect(EF_COME_RIGHT_TOP);
+ else if(effect=="COME_RIGHT_BOTTOM")
+ obj->setEffect(EF_COME_RIGHT_BOTTOM);
+ else if(effect=="COME_LEFT_TOP")
+ obj->setEffect(EF_COME_LEFT_TOP);
+ else if(effect=="COME_LEFT_BOTTOM")
+ obj->setEffect(EF_COME_LEFT_BOTTOM);
+ else if(effect=="WIPE_LEFT")
+ obj->setEffect(EF_WIPE_LEFT);
+ else if(effect=="WIPE_RIGHT")
+ obj->setEffect(EF_WIPE_RIGHT);
+ else if(effect=="WIPE_TOP")
+ obj->setEffect(EF_WIPE_TOP);
+ else if(effect=="WIPE_BOTTOM")
+ obj->setEffect(EF_WIPE_BOTTOM);
+ else
+ kdDebug(33001)<<"Error : setEffect()\n";
+}
+
+void KPrObjectIface::setEffect3(const QString & effect)
+{
+ if(effect=="NONE")
+ obj->setEffect3(EF3_NONE);
+ else if(effect=="GO_RIGHT")
+ obj->setEffect3(EF3_GO_RIGHT);
+ else if(effect=="GO_LEFT")
+ obj->setEffect3(EF3_GO_LEFT);
+ else if(effect=="GO_TOP")
+ obj->setEffect3(EF3_GO_TOP);
+ else if(effect=="GO_BOTTOM")
+ obj->setEffect3(EF3_GO_BOTTOM);
+ else if(effect=="GO_RIGHT_TOP")
+ obj->setEffect3(EF3_GO_RIGHT_TOP);
+ else if(effect=="GO_RIGHT_BOTTOM")
+ obj->setEffect3(EF3_GO_RIGHT_BOTTOM);
+ else if(effect=="GO_LEFT_TOP")
+ obj->setEffect3(EF3_GO_LEFT_TOP);
+ else if(effect=="GO_LEFT_BOTTOM")
+ obj->setEffect3(EF3_GO_LEFT_BOTTOM);
+ else if(effect=="WIPE_LEFT")
+ obj->setEffect3(EF3_WIPE_LEFT);
+ else if(effect=="WIPE_RIGHT")
+ obj->setEffect3(EF3_WIPE_RIGHT);
+ else if(effect=="WIPE_TOP")
+ obj->setEffect3(EF3_WIPE_TOP);
+ else if(effect=="WIPE_BOTTOM")
+ obj->setEffect3(EF3_WIPE_BOTTOM);
+}
+
+void KPrObjectIface::setProtected( bool b )
+{
+ obj->setProtect(b);
+}
+
+bool KPrObjectIface::isProtected() const
+{
+ return obj->isProtect();
+}
+
+void KPrObjectIface::setKeepRatio( bool b )
+{
+ obj->setKeepRatio(b);
+}
+
+bool KPrObjectIface::isKeepRatio() const
+{
+ return obj->isKeepRatio();
+}
+
+void KPrObjectIface::move( double x, double y )
+{
+ obj->setOrig( x, y );
+}
+
+void KPrObjectIface::resize( double width, double height )
+{
+ obj->setSize( width, height );
+}
diff --git a/kpresenter/KPrObjectIface.h b/kpresenter/KPrObjectIface.h
new file mode 100644
index 000000000..5f8186b21
--- /dev/null
+++ b/kpresenter/KPrObjectIface.h
@@ -0,0 +1,101 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRESENTER_OBJ_IFACE_H
+#define KPRESENTER_OBJ_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+
+#include <qstring.h>
+#include <qcolor.h>
+
+class KPrObject;
+
+class KPrObjectIface : public DCOPObject
+{
+ K_DCOP
+public:
+ KPrObjectIface( KPrObject *obj_ );
+
+k_dcop:
+ int getType() const;
+
+ /// @since 1.4
+ void move( double x, double y );
+ /// @since 1.4
+ void resize( double width, double height );
+
+ bool isSelected() const;
+ float angle() const;
+ int shadowDistance() const;
+ int shadowDirection() const;
+ QColor shadowColor() const;
+ int effect() const;
+ int effect2() const;
+ int appearStep() const;
+ int subPresSteps() const;
+ bool disappear() const;
+ int disappearStep() const;
+ int effect3() const;
+
+ void setEffect(const QString & effect);
+ void setEffect3(const QString & effect);
+
+ void setSelected( bool _selected );
+ void rotate( float _angle );
+ void setShadowDistance( int _distance );
+
+ void shadowColor( const QColor & _color );
+
+ void setAppearTimer( int _appearTimer );
+ void setDisappearTimer( int _disappearTimer );
+
+ void setAppearSoundEffect( bool b );
+ void setDisappearSoundEffect( bool b );
+ void setAppearSoundEffectFileName( const QString & _a_fileName );
+ void setDisappearSoundEffectFileName( const QString &_d_fileName );
+
+ void setObjectName( const QString &_objectName );
+
+ void setAppearStep( int _appearStep );
+
+ void setDisappear( bool b );
+
+ int appearTimer() const;
+ int disappearTimer() const;
+ bool appearSoundEffect() const;
+ bool disappearSoundEffect() const;
+ QString appearSoundEffectFileName() const;
+ QString disappearSoundEffectFileName() const;
+ QString typeString() const;
+
+ void setProtected( bool b );
+ bool isProtected() const;
+
+ void setKeepRatio( bool b );
+ bool isKeepRatio() const;
+
+private:
+ KPrObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrObjectProperties.cpp b/kpresenter/KPrObjectProperties.cpp
new file mode 100644
index 000000000..ede72009d
--- /dev/null
+++ b/kpresenter/KPrObjectProperties.cpp
@@ -0,0 +1,310 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrObjectProperties.h"
+
+#include "KPrObject.h"
+#include "KPrGroupObject.h"
+#include "KPrLineObject.h"
+#include "KPrRectObject.h"
+#include "KPrPolygonObject.h"
+#include "KPrPieObject.h"
+#include "KPrPixmapObject.h"
+#include "KPrPointObject.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrTextObject.h"
+
+KPrObjectProperties::KPrObjectProperties( const QPtrList<KPrObject> &objects )
+: m_objects( objects )
+, m_flags( 0 )
+, m_pen( KoPen( Qt::black, 1.0, Qt::SolidLine ), L_NORMAL, L_NORMAL )
+, m_protectContent( STATE_UNDEF )
+{
+ getProperties( m_objects );
+}
+
+
+KPrObjectProperties::~KPrObjectProperties()
+{
+}
+
+
+void KPrObjectProperties::getProperties( const QPtrList<KPrObject> &objects )
+{
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ {
+ switch ( it.current()->getType() )
+ {
+ case OT_LINE:
+ case OT_FREEHAND:
+ case OT_POLYLINE:
+ case OT_QUADRICBEZIERCURVE:
+ case OT_CUBICBEZIERCURVE:
+ getPenProperties( it.current() );
+ getLineEndsProperties( it.current() );
+ m_flags |= PtOther;
+ break;
+ case OT_PIE:
+ getPieProperties( it.current() );
+ break;
+ case OT_RECT:
+ getRectProperties( it.current() );
+ break;
+ case OT_POLYGON:
+ getPolygonSettings( it.current() );
+ break;
+ case OT_TEXT:
+ getTextProperties( it.current() );
+ break;
+ case OT_PART:
+ case OT_ELLIPSE:
+ case OT_CLOSED_LINE:
+ case OT_AUTOFORM:
+ getPenProperties( it.current() );
+ getBrushProperties( it.current() );
+ m_flags |= PtOther;
+ break;
+ case OT_CLIPART:
+ case OT_PICTURE:
+ getPictureProperties( it.current() );
+ break;
+ case OT_GROUP:
+ {
+ KPrGroupObject *obj = dynamic_cast<KPrGroupObject*>( it.current() );
+ if ( obj )
+ {
+ getProperties( obj->objectList() );
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+
+void KPrObjectProperties::getPenProperties( KPrObject *object )
+{
+ if ( !( m_flags & PtPen ) )
+ {
+ KPrShadowObject *obj = dynamic_cast<KPrShadowObject*>( object );
+ if ( obj )
+ {
+ m_pen.pen = obj->getPen();
+
+ m_flags |= PtPen;
+ }
+ }
+ if ( !( m_flags & PtPenWidth ) )
+ {
+ KPrShadowObject *obj = dynamic_cast<KPrShadowObject*>( object );
+ if ( obj && obj->getPen().style() != Qt::NoPen )
+ {
+ m_flags |= PtPenWidth;
+ }
+ }
+}
+
+
+void KPrObjectProperties::getLineEndsProperties( KPrObject *object )
+{
+ if ( !( m_flags & PtLineEnds ) )
+ {
+ switch ( object->getType() )
+ {
+ case OT_LINE:
+ {
+ KPrLineObject *obj = dynamic_cast<KPrLineObject*>( object );
+ if ( obj )
+ {
+ m_pen.lineBegin = obj->getLineBegin();
+ m_pen.lineEnd = obj->getLineEnd();
+
+ m_flags |= PtLineEnds;
+ }
+ break;
+ }
+ case OT_FREEHAND:
+ case OT_POLYLINE:
+ case OT_QUADRICBEZIERCURVE:
+ case OT_CUBICBEZIERCURVE:
+ {
+ KPrPointObject *obj = dynamic_cast<KPrPointObject*>( object );
+ if ( obj )
+ {
+ m_pen.lineBegin = obj->getLineBegin();
+ m_pen.lineEnd = obj->getLineEnd();
+
+ m_flags |= PtLineEnds;
+ }
+ break;
+ }
+ case OT_PIE:
+ {
+ KPrPieObject *obj = dynamic_cast<KPrPieObject*>( object );
+ if ( obj )
+ {
+ m_pen.lineBegin = obj->getLineBegin();
+ m_pen.lineEnd = obj->getLineEnd();
+
+ m_flags |= PtLineEnds;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+}
+
+
+void KPrObjectProperties::getBrushProperties( KPrObject *object )
+{
+ if ( !( m_flags & PtBrush ) )
+ {
+ KPr2DObject * obj = dynamic_cast<KPr2DObject*>( object );
+ if ( obj )
+ {
+ m_brush.brush = obj->getBrush();
+ m_brush.fillType = obj->getFillType();
+ m_brush.gColor1 = obj->getGColor1();
+ m_brush.gColor2 = obj->getGColor2();
+ m_brush.gType = obj->getGType();
+ m_brush.unbalanced = obj->getGUnbalanced();
+ m_brush.xfactor = obj->getGXFactor();
+ m_brush.yfactor = obj->getGYFactor();
+
+ m_flags |= PtBrush;
+ }
+ }
+}
+
+
+void KPrObjectProperties::getRectProperties( KPrObject *object )
+{
+ if ( !( m_flags & PtRectangle ) )
+ {
+ KPrRectObject *obj = dynamic_cast<KPrRectObject*>( object );
+ if ( obj )
+ {
+ obj->getRnds( m_rectValues.xRnd, m_rectValues.yRnd );
+
+ getPenProperties( object );
+ getBrushProperties( object );
+ m_flags |= PtRectangle;
+ }
+ }
+}
+
+
+void KPrObjectProperties::getPolygonSettings( KPrObject *object )
+{
+ if ( !( m_flags & PtPolygon ) )
+ {
+ KPrPolygonObject *obj = dynamic_cast<KPrPolygonObject*>( object );
+ if ( obj )
+ {
+ m_polygonSettings.checkConcavePolygon = obj->getCheckConcavePolygon();
+ m_polygonSettings.cornersValue = obj->getCornersValue();
+ m_polygonSettings.sharpnessValue = obj->getSharpnessValue();
+
+ getPenProperties( object );
+ getBrushProperties( object );
+ m_flags |= PtPolygon;
+ }
+ }
+}
+
+
+void KPrObjectProperties::getPieProperties( KPrObject *object )
+{
+ if ( !( m_flags & PtPie ) )
+ {
+ KPrPieObject *obj = dynamic_cast<KPrPieObject*>( object );
+ if ( obj )
+ {
+ m_pieValues.pieType = obj->getPieType();
+ m_pieValues.pieAngle = obj->getPieAngle();
+ m_pieValues.pieLength = obj->getPieLength();
+
+ getPenProperties( object );
+ if ( obj->getPieType() != PT_ARC )
+ {
+ getBrushProperties( object );
+ }
+ else
+ {
+ getLineEndsProperties( object );
+ }
+
+ m_flags |= PtPie;
+ }
+ }
+}
+
+
+void KPrObjectProperties::getPictureProperties( KPrObject *object )
+{
+ if ( !( m_flags & PtPicture ) )
+ {
+ KPrPixmapObject *obj = dynamic_cast<KPrPixmapObject*>( object );
+ if ( obj )
+ {
+ m_pictureSettings.mirrorType = obj->getPictureMirrorType();
+ m_pictureSettings.depth = obj->getPictureDepth();
+ m_pictureSettings.swapRGB = obj->getPictureSwapRGB();
+ m_pictureSettings.grayscal = obj->getPictureGrayscal();
+ m_pictureSettings.bright = obj->getPictureBright();
+ m_pixmap = obj->getOriginalPixmap();
+
+ getPenProperties( object );
+ getBrushProperties( object );
+ m_flags |= PtPicture;
+ }
+ }
+}
+
+
+void KPrObjectProperties::getTextProperties( KPrObject *object )
+{
+ KPrTextObject *obj = dynamic_cast<KPrTextObject*>( object );
+ if ( obj )
+ {
+ if ( !( m_flags & PtText ) )
+ {
+ m_marginsStruct = MarginsStruct( obj );
+ m_protectContent = obj->isProtectContent() ? STATE_ON : STATE_OFF;
+
+ getPenProperties( object );
+ getBrushProperties( object );
+ m_flags |= PtText;
+ }
+ else
+ {
+ PropValue pv = obj->isProtectContent() ? STATE_ON : STATE_OFF;
+ if ( pv != m_protectContent )
+ {
+ m_protectContent = STATE_UNDEF;
+ }
+ }
+ }
+}
diff --git a/kpresenter/KPrObjectProperties.h b/kpresenter/KPrObjectProperties.h
new file mode 100644
index 000000000..3f794db0f
--- /dev/null
+++ b/kpresenter/KPrObjectProperties.h
@@ -0,0 +1,98 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPOBJECTPROPERTIES_H
+#define KPOBJECTPROPERTIES_H
+
+#include "KPrCommand.h"
+
+class KPrObjectProperties
+{
+public:
+ enum PropertyType {
+ PtPen = 1,
+ PtLineEnds = 2,
+ PtBrush = 4,
+ PtPie = 8,
+ PtPicture = 16,
+ PtPolygon = 32,
+ PtRectangle = 64,
+ PtText = 128,
+ PtOther = 256,
+ PtPenWidth = 512
+ };
+
+ KPrObjectProperties( const QPtrList<KPrObject> &objects );
+ ~KPrObjectProperties();
+
+ int getPropertyFlags() { return m_flags; }
+
+ /// get pen properties
+ KoPenCmd::Pen getPen() const { return m_pen; }
+ /// get brush properties
+ KPrBrushCmd::Brush getBrush() const { return m_brush; }
+ /// get rectangle properties
+ KPrRectValueCmd::RectValues getRectValues() const { return m_rectValues; }
+ /// get polygon properties
+ KPrPolygonSettingCmd::PolygonSettings getPolygonSettings() const { return m_polygonSettings; }
+ /// get pie properties
+ KPrPieValueCmd::PieValues getPieValues() const { return m_pieValues; }
+ // get picture properties
+ KPrPictureSettingCmd::PictureSettings getPictureSettings() const { return m_pictureSettings; }
+ const QPixmap &getPixmap() const { return m_pixmap; }
+ /// get text properties
+ MarginsStruct getMarginsStruct() { return m_marginsStruct; }
+ PropValue getProtectContent() { return m_protectContent; }
+
+protected:
+ void getProperties( const QPtrList<KPrObject> &objects );
+
+ void getPenProperties( KPrObject *object );
+ void getLineEndsProperties( KPrObject *object );
+ void getBrushProperties( KPrObject *object );
+ void getRectProperties( KPrObject *object );
+ void getPolygonSettings( KPrObject *object );
+ void getPieProperties( KPrObject *object );
+ void getPictureProperties( KPrObject *object );
+ void getTextProperties( KPrObject *object );
+
+private:
+ QPtrList<KPrObject> m_objects;
+ int m_flags;
+
+ /// pen properties
+ KoPenCmd::Pen m_pen;
+ /// brush properties
+ KPrBrushCmd::Brush m_brush;
+ /// rect properties
+ KPrRectValueCmd::RectValues m_rectValues;
+ /// polygon properties
+ KPrPolygonSettingCmd::PolygonSettings m_polygonSettings;
+ /// pie properties
+ KPrPieValueCmd::PieValues m_pieValues;
+ /// picture properties
+ KPrPictureSettingCmd::PictureSettings m_pictureSettings;
+ QPixmap m_pixmap;
+ /// text properties
+ MarginsStruct m_marginsStruct;
+ PropValue m_protectContent;
+};
+
+#endif /* KPOBJECTPROPERTIES_H */
diff --git a/kpresenter/KPrPBPreview.cpp b/kpresenter/KPrPBPreview.cpp
new file mode 100644
index 000000000..07209b938
--- /dev/null
+++ b/kpresenter/KPrPBPreview.cpp
@@ -0,0 +1,125 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPBPreview.h"
+
+#include <qpainter.h>
+
+#include <KoTextZoomHandler.h>
+#include "KPrUtils.h"
+
+KPrPBPreview::KPrPBPreview( QWidget* parent, const char* name, PaintType _paintType )
+ : QFrame( parent, name )
+{
+ //FIXME zoom
+ _zoomHandler=new KoTextZoomHandler();
+ paintType = _paintType;
+ pen = KoPen( black, 1, SolidLine );
+ brush = QBrush( white, SolidPattern );
+ gradient = new KPrGradient( Qt::red, Qt::green, BCT_GHORZ, false, 100, 100 );
+ savedGradient = gradient;
+
+ setFrameStyle( WinPanel | Sunken );
+
+ switch ( paintType ) {
+ case Pen:
+ setFixedHeight( 40 );
+ break;
+ default:
+ setMinimumWidth( 230 );
+ break;
+ }
+}
+
+void KPrPBPreview::resizeEvent( QResizeEvent *e )
+{
+ QFrame::resizeEvent( e );
+ if ( gradient )
+ {
+#if 1
+ gradient->setSize( contentsRect().size() );
+ repaint();
+#endif
+ }
+}
+
+void KPrPBPreview::drawContents( QPainter *painter )
+{
+ painter->save();
+ painter->translate( contentsRect().x(), contentsRect().y() );
+
+ if ( paintType == Pen ) {
+ painter->fillRect( 0, 0, contentsRect().width(), contentsRect().height(),
+ colorGroup().base() );
+ KoSize diff1( 0, 0 ), diff2( 0, 0 );
+ int _w = int( pen.pointWidth() );
+
+ if ( lineBegin != L_NORMAL )
+ diff1 = getOffset( lineBegin, _w, + 180.0 );
+
+ if ( lineEnd != L_NORMAL )
+ diff2 = getOffset( lineEnd, _w, 0 );
+
+ if ( lineBegin != L_NORMAL )
+ drawFigure( lineBegin, painter, KoPoint( 5, _zoomHandler->unzoomItY( contentsRect().height() ) / 2 ),
+ pen.color(), _w, 180.0, _zoomHandler );
+
+ if ( lineEnd != L_NORMAL )
+ drawFigure( lineEnd, painter, KoPoint( _zoomHandler->unzoomItX( contentsRect().width() - 7 ) ,
+ _zoomHandler->unzoomItY( contentsRect().height() ) / 2 ),
+ pen.color(), _w, 0.0, _zoomHandler );
+
+ painter->setPen( pen.zoomedPen( _zoomHandler ) );
+ painter->drawLine( - (int)diff1.width() + 8,
+ contentsRect().height() / 2,
+ contentsRect().width() - (int)diff2.width() - 7,
+ contentsRect().height() / 2 );
+
+ } else if ( paintType == Brush ) {
+ painter->fillRect( 0, 0, contentsRect().width(), contentsRect().height(),
+ colorGroup().base() );
+ painter->fillRect( 0, 0, contentsRect().width(), contentsRect().height(), brush );
+ } else if ( paintType == Gradient )
+ painter->drawPixmap( 0, 0, gradient->pixmap());
+
+ painter->restore();
+}
+
+KPrPBPreview::~KPrPBPreview()
+{
+ delete _zoomHandler;
+ delete savedGradient;
+}
+
+
+void KPrPBPreview::setGradient( const QColor &_c1, const QColor &_c2, BCType _t,
+ bool _unbalanced, int _xfactor, int _yfactor )
+{
+ gradient->setColor1( _c1 );
+ gradient->setColor2( _c2 );
+ gradient->setBackColorType( _t );
+ gradient->setUnbalanced( _unbalanced );
+ gradient->setXFactor( _xfactor );
+ gradient->setYFactor( _yfactor );
+ repaint( false );
+}
+
+
+#include "KPrPBPreview.moc"
diff --git a/kpresenter/KPrPBPreview.h b/kpresenter/KPrPBPreview.h
new file mode 100644
index 000000000..ac26918d5
--- /dev/null
+++ b/kpresenter/KPrPBPreview.h
@@ -0,0 +1,82 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PBPREVIEW_H
+#define PBPREVIEW_H
+
+#include "global.h"
+
+#include <qframe.h>
+
+#include "KPrGradient.h"
+#include <KoBrush.h>
+#include <KoPen.h>
+
+class KoTextZoomHandler;
+
+/******************************************************************/
+/* class Pen and Brush preview */
+/******************************************************************/
+
+class KPrPBPreview : public QFrame
+{
+ Q_OBJECT
+
+public:
+ enum PaintType {
+ Pen,
+ Brush,
+ Gradient
+ };
+
+ KPrPBPreview( QWidget* parent, const char* name, PaintType _paintType = Pen );
+ ~KPrPBPreview();
+ void setPen( const KoPen &_pen ) { pen = _pen; repaint( true ); }
+ void setBrush( const QBrush &_brush ) { brush = _brush; repaint( true ); }
+ void setLineBegin( LineEnd lb ) { lineBegin = lb; repaint( true ); }
+ void setLineEnd( LineEnd le ) { lineEnd = le; repaint( true ); }
+ void setGradient( KPrGradient *g ) { if ( g ) { gradient = g; } repaint( true ); }
+ void setPaintType( PaintType pt ) { paintType = pt; repaint(true); }
+
+ void setGradient( const QColor &_c1, const QColor &_c2, BCType _t,
+ bool _unbalanced, int _xfactor, int _yfactor );
+ void setColor1( const QColor &_color ) { gradient->setColor1( _color ); repaint( false ); }
+ void setColor2( const QColor &_color ) { gradient->setColor2( _color ); repaint( false ); }
+ void setBackColorType( BCType _type ) { gradient->setBackColorType( _type ); repaint( false ); }
+ void setUnbalanced( bool b ) { gradient->setUnbalanced( b ); repaint( false ); }
+ void setXFactor( int i ) { gradient->setXFactor( i ); repaint( false ); }
+ void setYFactor( int i ) { gradient->setYFactor( i ); repaint( false ); }
+
+protected:
+ void drawContents( QPainter *p );
+ void resizeEvent( QResizeEvent *e );
+
+private:
+ PaintType paintType;
+ KoPen pen;
+ QBrush brush;
+ LineEnd lineBegin, lineEnd;
+ KPrGradient *gradient;
+ KPrGradient *savedGradient;
+ KoTextZoomHandler *_zoomHandler;
+};
+
+
+#endif /* PBPREVIEW_H */
diff --git a/kpresenter/KPrPage.cpp b/kpresenter/KPrPage.cpp
new file mode 100644
index 000000000..8529d2ea9
--- /dev/null
+++ b/kpresenter/KPrPage.cpp
@@ -0,0 +1,2614 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002-2004 Laurent MONTEL <montel@kde.org>
+ Copyright (C) 2004-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <kurl.h>
+
+#include "KPrPage.h"
+#include "KPrView.h"
+#include "KPrPageIface.h"
+
+#include "KPrBackground.h"
+#include "KPrLineObject.h"
+#include "KPrRectObject.h"
+#include "KPrEllipseObject.h"
+#include "KPrAutoformObject.h"
+#include "KPrTextObject.h"
+#include "KPrPixmapObject.h"
+#include "KPrPieObject.h"
+#include "KPrPartObject.h"
+#include "KPrGroupObject.h"
+#include "KPrCommand.h"
+#include "KPrFreehandObject.h"
+#include "KPrPolylineObject.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrPolygonObject.h"
+#include "KPrClosedLineObject.h"
+#include "KPrUtils.h"
+#include <kdebug.h>
+#include <KoQueryTrader.h>
+#include "KPrDocument.h"
+
+#include <KoStore.h>
+#include <KoStoreDevice.h>
+#include <KoTextZoomHandler.h>
+#include <KoXmlNS.h>
+#include "KoPointArray.h"
+#include "KPrTextDocument.h"
+#include <KoTextObject.h>
+#include <KoTextParag.h>
+#include <KoRect.h>
+#include <qapplication.h>
+#include <KoStyleCollection.h>
+#include <KoVariable.h>
+#include <KoGenStyles.h>
+#include <KoXmlWriter.h>
+#include <ktempfile.h>
+#include <qbuffer.h>
+#include <qregexp.h>
+#include <qfile.h>
+
+struct listAnimation {
+ KPrObject *obj;
+ int objIndex;
+ bool appear;
+};
+
+typedef QMap<int, QPtrList<listAnimation> > lstMap;
+
+
+KPrPage::KPrPage(KPrDocument *_doc, KPrPage *masterPage )
+ : m_doc( _doc )
+ , m_masterPage( masterPage )
+ , m_dcop( 0 )
+ , m_selectedSlides( true )
+ , m_bHasHeader( false )
+ , m_bHasFooter( false )
+ , m_useMasterBackground( false )
+ , m_displayObjectFromMasterPage( true )
+ , m_displayBackground( true )
+ , m_pageEffect( PEF_NONE )
+ , m_pageEffectSpeed( ES_MEDIUM )
+ , m_soundEffect( false )
+ , m_soundFileName( QString::null )
+ , m_pageTimer( 1 )
+{
+ kdDebug(33001)<<"create page : KPrPage::KPrPage(KPrDocument *_doc )"<<this<<endl;
+ m_objectList.setAutoDelete( false );
+
+ m_kpbackground= new KPrBackGround( this );
+
+ //don't create dcopobject by default
+ //dcopObject();
+}
+
+KPrPage::~KPrPage()
+{
+ kdDebug(33001)<<"Delete page :KPrPage::~KPrPage() :"<<this<<endl;
+ //delete object list.
+ m_objectList.setAutoDelete( true );
+ m_objectList.clear();
+ delete m_kpbackground;
+ delete m_dcop;
+}
+
+DCOPObject* KPrPage::dcopObject()
+{
+ if ( !m_dcop ) {
+ // 0-based. 1-based would be nicer for the dcop user, but well, docs and views are 0-based,
+ // and the page(int) DCOP call is 0-based.
+ int pgnum = m_doc->pageList().findRef( this );
+ m_dcop = new KPrPageIface( this, pgnum );
+ }
+
+ return m_dcop;
+}
+
+
+void KPrPage::saveOasisObject( KoStore *store, KoXmlWriter &xmlWriter, KoSavingContext& context, int & indexObj, int &partIndexObj, KoXmlWriter* manifestWriter ) const
+{
+ Q_UNUSED( store );
+ Q_UNUSED( manifestWriter );
+ KPrObject::KPOasisSaveContext sc( xmlWriter, context, indexObj, partIndexObj, isMasterPage() );
+
+ KTempFile animationTmpFile;
+ animationTmpFile.setAutoDelete( true );
+ QFile* tmpFile = animationTmpFile.file();
+ KoXmlWriter animationTmpWriter( tmpFile );
+ lstMap listObjectAnimation;
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()== m_doc->header() || it.current()== m_doc->footer())
+ continue;
+ it.current()->saveOasisObject( sc );
+
+ if ( it.current()->hasAnimation() )
+ {
+ if ( it.current()->getEffect() != EF_NONE ||
+ it.current()->getAppearStep() != 0 ||
+ !it.current()->getAppearSoundEffectFileName().isEmpty() )
+ {
+ kdDebug(33001) << "has animation" << endl;
+ listAnimation *lstappear = new listAnimation;
+ lstappear->obj = it.current();
+ lstappear->objIndex = indexObj;
+ lstappear->appear = true;
+ //kdDebug()<<" indexObj :"<<indexObj<<endl;
+ lstMap::Iterator tmp = listObjectAnimation.find( it.current()->getAppearStep() );
+ if ( tmp!= listObjectAnimation.end() )
+ {
+ //kdDebug()<<" group already exist \n";
+ tmp.data().append( lstappear );
+ }
+ else
+ {
+ //kdDebug()<<" create new list \n";
+ QPtrList<listAnimation> tmp2;
+ tmp2.append( lstappear );
+ listObjectAnimation.insert( it.current()->getAppearStep(), tmp2 );
+ }
+ }
+ if ( it.current()->getDisappear() )
+ {
+ listAnimation *lstappear = new listAnimation;
+ lstappear->obj = it.current();
+ lstappear->objIndex = indexObj;
+ lstappear->appear = false;
+ //kdDebug()<<" indexObj :"<<indexObj<<endl;
+ lstMap::Iterator tmp = listObjectAnimation.find( it.current()->getDisappearStep() );
+ if ( tmp!= listObjectAnimation.end() )
+ {
+ //kdDebug()<<" group already exist \n";
+ tmp.data().append( lstappear );
+ }
+ else
+ {
+ //kdDebug()<<" create new list \n";
+ QPtrList<listAnimation> tmp2;
+ tmp2.append( lstappear );
+ listObjectAnimation.insert( it.current()->getDisappearStep(), tmp2 );
+ }
+ }
+
+ }
+ ++indexObj;
+ }
+
+ if ( !listObjectAnimation.isEmpty() )
+ {
+ kdDebug()<<"! listObjectAnimation.isEmpty() :"<<listObjectAnimation.count()<<endl;
+ animationTmpWriter.startElement( "presentation:animations" );
+ lstMap::Iterator it = listObjectAnimation.begin();
+ lstMap::Iterator end = listObjectAnimation.end();
+ for (; it != end; ++it )
+ {
+ if ( it.data().count() == 1 )
+ {
+ kdDebug()<<" add unique element \n";
+ if ( it.data().at( 0 )->appear )
+ it.data().at( 0 )->obj->saveOasisObjectStyleShowAnimation( animationTmpWriter, it.data().at( 0 )->objIndex );
+ else
+ it.data().at( 0 )->obj->saveOasisObjectStyleHideAnimation( animationTmpWriter, it.data().at( 0 )->objIndex );
+ }
+ else if ( it.data().count() > 1 )
+ {
+ QPtrList<listAnimation> list = it.data();
+ animationTmpWriter.startElement( "presentation:animation-group" );
+ for ( uint i = 0; i < list.count(); ++i )
+ {
+ if ( list.at(i) )
+ {
+ kdDebug()<<" add group element : "<<i<<endl;
+ if ( list.at(i)->appear )
+ list.at(i)->obj->saveOasisObjectStyleShowAnimation( animationTmpWriter, list.at(i)->objIndex );
+ else
+ list.at(i)->obj->saveOasisObjectStyleHideAnimation( animationTmpWriter, list.at(i)->objIndex );
+ }
+ }
+ animationTmpWriter.endElement();
+ }
+
+ }
+ animationTmpWriter.endElement();//close "presentation:animations"
+ tmpFile->close();
+ xmlWriter.addCompleteElement( tmpFile );
+
+ }
+ else
+ tmpFile->close();
+ animationTmpFile.close();
+}
+
+void KPrPage::load( const QDomElement &element )
+{
+ m_kpbackground->load( element );
+ QDomElement e=element.namedItem("PGEFFECT").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ setPageEffect(static_cast<PageEffect>(tmp));
+ tmp = (int)ES_MEDIUM;
+ if(e.hasAttribute("speed"))
+ tmp=e.attribute("speed").toInt();
+ setPageEffectSpeed( static_cast<EffectSpeed>(tmp) );
+ }
+ e=element.namedItem("PGTIMER").toElement();
+ if(!e.isNull()) {
+ int timer = 1;
+ if(e.hasAttribute("timer"))
+ timer=e.attribute("timer").toInt();
+ setPageTimer(timer);
+ }
+ else
+ setPageTimer(1);
+ e=element.namedItem("PGSOUNDEFFECT").toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute("soundEffect"))
+ m_soundEffect=static_cast<bool>(e.attribute("soundEffect").toInt());
+ else
+ m_soundEffect=false;
+
+ if(e.hasAttribute("soundFileNmae")) // old typo
+ m_soundFileName=e.attribute("soundFileNmae");
+ else
+ m_soundFileName=e.attribute("soundFileName");
+ }
+ else {
+ m_soundFileName=QString::null;
+ }
+
+ e=element.namedItem("HEADERFOOTER").toElement();
+ if(!e.isNull()) {
+ if(e.hasAttribute("header"))
+ m_bHasHeader =static_cast<bool>(e.attribute("header").toInt());
+ else
+ m_bHasHeader = false;
+
+ if(e.hasAttribute("footer"))
+ m_bHasFooter =static_cast<bool>(e.attribute("footer").toInt());
+ else
+ m_bHasFooter = false;
+ }
+}
+
+//TODO: implement display/hide background into old file format
+void KPrPage::loadOasis(KoOasisContext & context )
+{
+ m_kpbackground->loadOasis( context );
+
+ KoStyleStack& styleStack = context.styleStack();
+ kdDebug()<<"KPrPage::loadOasis()\n";
+ styleStack.setTypeProperties( "drawing-page" );
+
+ if ( !isMasterPage() )
+ {
+ if ( !styleStack.hasAttributeNS( KoXmlNS::draw, "fill" ) )
+ {
+ // if non is set the fill style of the master slide is used: see OD 14.13.2 Drawing Page Style
+ m_useMasterBackground = true;
+ }
+ //FIXME: fix it in old file format
+ if ( styleStack.hasAttributeNS( KoXmlNS::presentation, "background-objects-visible" ) )
+ {
+ const QString str = styleStack.attributeNS( KoXmlNS::presentation, "background-objects-visible" );
+ m_displayObjectFromMasterPage = ( str == "true" ) ? true : false;
+ }
+
+ if ( styleStack.hasAttributeNS( KoXmlNS::presentation, "background-visible" ) )
+ {
+ const QString str = styleStack.attributeNS( KoXmlNS::presentation, "background-visible" );
+ m_displayBackground = ( str == "true" ) ? true : false;
+ }
+
+ if ( styleStack.hasAttributeNS( KoXmlNS::presentation, "visibility" ) )
+ {
+ const QString str = styleStack.attributeNS( KoXmlNS::presentation, "visibility" );
+ if ( str=="hidden" )
+ slideSelected( false );
+ else
+ kdDebug()<<" presentation:visibility parameter not implemented :"<<str<<endl;
+ }
+
+ if ( styleStack.hasAttributeNS( KoXmlNS::presentation, "transition-speed" ) )
+ {
+ // this argument is not defined into kpresenter_doc and not into kprpage
+ // TODO add it into each page.
+ QString speed = styleStack.attributeNS( KoXmlNS::presentation, "transition-speed" );
+ if ( speed == "slow" )
+ {
+ m_pageEffectSpeed = ES_SLOW;
+ }
+ else if ( speed == "medium" )
+ {
+ m_pageEffectSpeed = ES_MEDIUM;
+ }
+ else if ( speed == "fast" )
+ {
+ m_pageEffectSpeed = ES_FAST;
+ }
+ else
+ kdDebug()<<" transition-speed not defined :"<<speed<<endl;
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::presentation, "duration" ))
+ {
+ m_pageTimer = loadOasisTimer( styleStack.attributeNS( KoXmlNS::presentation, "duration") );
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::presentation, "transition-type" ) )
+ {
+ //Not defined into kpresenter
+ //it's global for the moment.
+ kdDebug()<<" presentation:transition-type :"<<styleStack.attributeNS( KoXmlNS::presentation, "transition-type" )<<endl;
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::presentation, "display-header" ) )
+ {
+ QString tmp = styleStack.attributeNS( KoXmlNS::presentation, "display-header" );
+ setHeader( tmp =="true" ? true : false );
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::presentation, "display-footer" ) )
+ {
+ QString tmp = styleStack.attributeNS( KoXmlNS::presentation, "display-footer" );
+ setFooter(tmp =="true" ? true : false);
+ }
+ //TODO presentation:display-date-time; presentation:display-page-number
+ if ( styleStack.hasAttributeNS( KoXmlNS::presentation, "transition-style"))
+ {
+ //kdDebug()<<" have a presentation:transition-style------------\n";
+ const QString effect = styleStack.attributeNS( KoXmlNS::presentation, "transition-style");
+ QString additionalEffect;
+ if ( styleStack.hasAttributeNS( KoXmlNS::koffice, "additional-transition-style" ) )
+ {
+ additionalEffect = styleStack.attributeNS( KoXmlNS::koffice, "additional-transition-style" );
+ }
+ kdDebug() << "Transition name: " << effect << "additional name: " << additionalEffect << endl;
+ PageEffect pef;
+ if ( effect=="none" )
+ pef=PEF_NONE;
+ else if (effect=="vertical-stripes" || effect=="vertical-lines") // PEF_BLINDS_VER
+ pef=PEF_BLINDS_VER;
+ else if (effect=="horizontal-stripes" || effect=="horizontal-lines") // PEF_BLINDS_HOR
+ pef=PEF_BLINDS_HOR;
+ else if (effect=="spiralin-left" || effect=="spiralin-right"
+ || effect== "spiralout-left" || effect=="spiralout-right") // PEF_SURROUND1
+ pef=PEF_SURROUND1;
+ else if (effect=="fade-from-top") // PEF_COVER_DOWN
+ pef=PEF_COVER_DOWN;
+ else if (effect=="fade-from-bottom") // PEF_COVER_UP
+ pef=PEF_COVER_UP;
+ else if (effect=="fade-from-left") // PEF_COVER_RIGHT
+ pef=PEF_COVER_RIGHT;
+ else if (effect=="fade-from-right") // PEF_COVER_LEFT
+ pef=PEF_COVER_LEFT;
+ else if (effect=="fade-from-lowerleft")
+ { // PEF_COVER_RIGHT_UP
+ if ( additionalEffect.isEmpty() )
+ pef=PEF_COVER_RIGHT_UP;
+ else
+ pef=PEF_STRIPS_RIGHT_UP;
+ }
+ else if (effect=="fade-from-lowerright")
+ { // PEF_COVER_LEFT_UP
+ if ( additionalEffect.isEmpty() )
+ pef=PEF_COVER_LEFT_UP;
+ else
+ pef=PEF_STRIPS_LEFT_UP;
+ }
+ else if (effect=="fade-from-upperleft")
+ { // PEF_COVER_RIGHT_DOWN
+ if ( additionalEffect.isEmpty() )
+ pef=PEF_COVER_RIGHT_DOWN;
+ else
+ pef=PEF_STRIPS_RIGHT_DOWN;
+ }
+ else if (effect=="fade-from-upperright")
+ { // PEF_COVER_LEFT_DOWN
+ if ( additionalEffect.isEmpty() )
+ pef=PEF_COVER_LEFT_DOWN;
+ else
+ pef=PEF_STRIPS_LEFT_DOWN;
+ }
+ else if (effect=="fade-to-center") // PEF_BOX_IN
+ pef=PEF_BOX_IN;
+ else if (effect=="fade-from-center") // PEF_BOX_OUT
+ pef=PEF_BOX_OUT;
+ else if (effect=="open-vertical") // PEF_OPEN_HORZ; really, no kidding ;)
+ pef=PEF_OPEN_HORZ;
+ else if (effect=="open-horizontal") // PEF_OPEN_VERT
+ pef=PEF_OPEN_VERT;
+ else if (effect=="open") // PEF_OPEN_ALL
+ pef=PEF_OPEN_ALL;
+ else if (effect=="close-vertical") // PEF_CLOSE_HORZ
+ pef=PEF_CLOSE_HORZ;
+ else if (effect=="close-horizontal") // PEF_CLOSE_VERT
+ pef=PEF_CLOSE_VERT;
+ else if (effect=="close") // PEF_CLOSE_ALL
+ pef=PEF_CLOSE_ALL;
+ else if (effect=="dissolve") // PEF_DISSOLVE; perfect hit ;)
+ pef=PEF_DISSOLVE;
+ else if (effect=="horizontal-checkerboard") // PEF_CHECKBOARD_ACROSS
+ pef=PEF_CHECKBOARD_ACROSS;
+ else if (effect=="vertical-checkerboard") // PEF_CHECKBOARD_DOWN
+ pef=PEF_CHECKBOARD_DOWN;
+ else if (effect=="uncover-to-right" || effect=="roll-from-left") // PEF_UNCOVER_RIGHT
+ pef=PEF_UNCOVER_RIGHT;
+ else if (effect=="uncover-to-left" || effect=="roll-from-right") // PEF_UNCOVER_LEFT
+ pef=PEF_UNCOVER_LEFT;
+ else if (effect=="uncover-to-top" || effect=="roll-from-bottom") // PEF_UNCOVER_UP
+ pef=PEF_UNCOVER_UP;
+ else if (effect=="uncover-to-bottom" || effect=="roll-from-top") // PEF_UNCOVER_DOWN
+ pef=PEF_UNCOVER_DOWN;
+ else if (effect=="uncover-to-upperleft") // PEF_UNCOVER_LEFT_UP
+ pef=PEF_UNCOVER_LEFT_UP;
+ else if (effect=="uncover-to-upperright") // PEF_UNCOVER_RIGHT_UP
+ pef=PEF_UNCOVER_RIGHT_UP;
+ else if (effect=="uncover-to-lowerleft") // PEF_UNCOVER_LEFT_DOWN
+ pef=PEF_UNCOVER_LEFT_DOWN;
+ else if (effect=="uncover-to-lowerright") // PEF_UNCOVER_RIGHT_DOWN
+ pef=PEF_UNCOVER_RIGHT_DOWN;
+ else if (effect=="interlocking-horizontal-left")
+ pef=PEF_INTERLOCKING_HORZ_1;
+ else if (effect=="interlocking-horizontal-right")
+ pef=PEF_INTERLOCKING_HORZ_2;
+ else if (effect=="interlocking-vertical-top")
+ pef=PEF_INTERLOCKING_VERT_1;
+ else if (effect=="interlocking-vertical-bottom")
+ pef=PEF_INTERLOCKING_VERT_2;
+ else if ( effect=="melt" )
+ pef=PEF_MELTING;
+ else if ( effect=="fly-away" )
+ pef=PEF_FLY1;
+ else if ( effect=="random" )
+ pef=PEF_RANDOM;
+ else // we choose a random transition instead of the unsupported ones ;)
+ pef=PEF_RANDOM;
+ setPageEffect( pef );
+ }
+ if ( styleStack.hasChildNodeNS( KoXmlNS::presentation, "sound"))
+ {
+ //kdDebug()<<" presentation:sound !!!!!!!!!!!!!!!!!!!!!\n";
+ QDomElement sound = styleStack.childNodeNS( KoXmlNS::presentation, "sound");
+ m_soundEffect = true;
+ m_soundFileName = sound.attributeNS( KoXmlNS::xlink, "href", QString::null );
+ }
+ }
+}
+
+QDomElement KPrPage::save( QDomDocument &doc )
+{
+ QDomElement page = m_kpbackground->save( doc );
+ QDomElement element;
+
+ if ( m_pageEffect != PEF_NONE) {
+ element = doc.createElement("PGEFFECT");
+ element.setAttribute("value", static_cast<int>( m_pageEffect ));
+ element.setAttribute("speed", static_cast<int>( m_pageEffectSpeed ));
+ page.appendChild(element);
+ }
+
+ if ( m_pageTimer != 1 ) {
+ element = doc.createElement( "PGTIMER" );
+ element.setAttribute( "timer", m_pageTimer );
+ page.appendChild( element );
+ }
+
+ if ( m_soundEffect || !m_soundFileName.isEmpty() ) {
+ element = doc.createElement( "PGSOUNDEFFECT" );
+ element.setAttribute( "soundEffect", static_cast<int>(m_soundEffect) );
+ element.setAttribute( "soundFileName", m_soundFileName );
+ page.appendChild( element );
+ }
+ element = doc.createElement( "HEADERFOOTER" );
+ element.setAttribute( "header", static_cast<int>(m_bHasHeader ) );
+ element.setAttribute( "footer", static_cast<int>(m_bHasFooter ) );
+ page.appendChild( element );
+ return page;
+}
+
+QString KPrPage::oasisNamePage( int posPage ) const
+{
+ return ( m_manualTitle.isEmpty() ? QString( "page%1" ).arg( posPage ) : m_manualTitle );
+}
+
+bool KPrPage::saveOasisPage( KoStore *store, KoXmlWriter &xmlWriter, int posPage, KoSavingContext& context,
+ int & indexObj, int &partIndexObj, KoXmlWriter* manifestWriter, QMap<QString, int> &pageNames ) const
+{
+ if ( isMasterPage() )
+ {
+ KoGenStyle pageLayout = m_doc->pageLayout().saveOasis();
+ pageLayout.addAttribute( "style:page-usage", "all" ); // needed?
+ QString pageLayoutName( context.mainStyles().lookup( pageLayout, "pm" ) );
+
+ xmlWriter.startElement( "style:master-page" );
+ xmlWriter.addAttribute( "style:name", "Standard" );
+ xmlWriter.addAttribute( "style:page-layout-name", pageLayoutName );
+
+ QString styleName = saveOasisPageStyle( store, context.mainStyles() );
+ if ( !styleName.isEmpty() )
+ xmlWriter.addAttribute( "draw:style-name", styleName );
+
+ saveOasisObject( store, xmlWriter, context, indexObj,partIndexObj, manifestWriter );
+
+ xmlWriter.startElement( "style:header" );
+ m_doc->header()->textObject()->saveOasisContent( xmlWriter, context );
+ xmlWriter.endElement();
+
+ xmlWriter.startElement( "style:footer" );
+ m_doc->footer()->textObject()->saveOasisContent( xmlWriter, context );
+ xmlWriter.endElement();
+
+ xmlWriter.endElement();
+ }
+ else
+ {
+ //store use to save picture and co
+ xmlWriter.startElement( "draw:page" );
+
+ QString drawName( m_manualTitle );
+ QRegExp rx( "^page[0-9]+$" );
+ if ( drawName.isEmpty() || pageNames.contains( drawName ) || rx.search( drawName ) != -1 )
+ {
+ drawName = "page" + QString::number( posPage );
+ }
+ pageNames.insert( drawName, posPage );
+ xmlWriter.addAttribute( "draw:name", drawName ); //we must store a name
+ xmlWriter.addAttribute( "koffice:name", m_manualTitle ); // so that we can have the same name for different pages
+ xmlWriter.addAttribute( "draw:id", "page" + QString::number( posPage ) );
+ xmlWriter.addAttribute( "draw:master-page-name", "Standard"); //by default name of page is Standard
+
+ QString styleName = saveOasisPageStyle( store, context.mainStyles() );
+ kdDebug()<<" styleName :"<<styleName<<endl;
+ if ( !styleName.isEmpty() )
+ xmlWriter.addAttribute( "draw:style-name", styleName );
+
+ saveOasisObject( store, xmlWriter, context, indexObj,partIndexObj, manifestWriter );
+
+ saveOasisNote( xmlWriter );
+ xmlWriter.endElement();
+ }
+ return true;
+}
+
+QString KPrPage::saveOasisPageStyle( KoStore *, KoGenStyles& mainStyles ) const
+{
+ KoGenStyle stylepageauto( isMasterPage() ? KPrDocument::STYLE_BACKGROUNDPAGE : KPrDocument::STYLE_BACKGROUNDPAGEAUTO, "drawing-page" );
+
+ if ( ! isMasterPage() )
+ {
+ stylepageauto.addProperty( "presentation:background-visible", ( m_displayBackground == true ) ? "true" : "false" );
+ stylepageauto.addProperty( "presentation:background-objects-visible", ( m_displayObjectFromMasterPage == true ) ? "true" : "false" );
+ QString transition = saveOasisPageEffect();
+ if ( !transition.isEmpty() )
+ {
+ stylepageauto.addProperty( "presentation:transition-style", transition );
+ QString additionalTransition = saveOasisAdditionalPageEffect();
+ if ( !additionalTransition.isEmpty() )
+ {
+ stylepageauto.addProperty( "koffice:additional-transition-style", additionalTransition );
+ }
+ }
+ stylepageauto.addProperty( "presentation:display-header", hasHeader());
+ stylepageauto.addProperty( "presentation:display-footer", hasFooter());
+
+ if ( m_pageTimer != 1 )
+ {
+ stylepageauto.addProperty("presentation:duration", saveOasisTimer( m_pageTimer ));
+ //not used into kpresenter but necessary into ooimpress
+ //keep compatible
+ stylepageauto.addProperty( "presentation:transition-type", "automatic" );
+ }
+ if ( m_pageEffectSpeed != ES_MEDIUM ) // we don't save the default value
+ {
+ if ( m_pageEffectSpeed == ES_FAST )
+ stylepageauto.addProperty( "presentation:transition-speed", "fast" );
+ else if ( m_pageEffectSpeed == ES_SLOW )
+ stylepageauto.addProperty( "presentation:transition-speed", "slow" );
+ }
+ if ( !isSlideSelected() )
+ stylepageauto.addProperty( "presentation:visibility", "hidden" );
+ if ( !m_soundFileName.isEmpty() && m_soundEffect )
+ {
+ QBuffer buffer;
+ buffer.open( IO_WriteOnly );
+ KoXmlWriter elementWriter( &buffer ); // TODO pass indentation level
+ elementWriter.startElement( "presentation:sound" );
+ elementWriter.addAttribute( "xlink:href", m_soundFileName );
+ elementWriter.addAttribute( "xlink:type", "simple" );
+ elementWriter.addAttribute( "xlink:show", "new" );
+ elementWriter.addAttribute( "xlink:actuate", "onRequest");
+
+ elementWriter.endElement();
+ QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() );
+ stylepageauto.addChildElement( "sound effect", elementContents );
+ }
+ }
+
+ if ( ! m_useMasterBackground )
+ {
+ m_kpbackground->saveOasisBackgroundPageStyle( stylepageauto, mainStyles );
+ }
+
+ // todo return mainStyles.lookup( stylepageauto, "dp", isMasterPage() ? KoGenStyles::AutoStyleInStylesDotXml : KoGenStyles::NoFlag );
+ return mainStyles.lookup( stylepageauto, "dp" );
+}
+
+bool KPrPage::saveOasisNote( KoXmlWriter &xmlWriter ) const
+{
+ if ( m_noteText.isEmpty() )
+ return true;
+
+ //todo : add size for draw:text-box otherwise we can't import into oo
+ //<draw:text-box presentation:style-name="pr1" draw:text-style-name="P1" draw:layer="layout" svg:width="14.5cm" svg:height="11.408cm" svg:x="3.247cm" svg:y="14.126cm" presentation:class="notes">
+ xmlWriter.startElement( "presentation:notes" );
+ xmlWriter.startElement( "draw:frame" );
+ //todo save style
+
+ xmlWriter.startElement( "draw:text-box" );
+ QStringList text = QStringList::split( "\n", m_noteText );
+ for ( QStringList::Iterator it = text.begin(); it != text.end(); ++it ) {
+ xmlWriter.startElement( "text:p" );
+ xmlWriter.addTextNode( *it );
+ xmlWriter.endElement();
+ }
+ xmlWriter.endElement();
+ xmlWriter.endElement();
+ xmlWriter.endElement();
+
+ return true;
+}
+
+QString KPrPage::saveOasisPageEffect() const
+{
+ QString transition;
+ switch( m_pageEffect )
+ {
+ case PEF_NONE:
+ transition="none";
+ break;
+ case PEF_CLOSE_HORZ:
+ transition="close-vertical";
+ break;
+ case PEF_CLOSE_VERT:
+ transition="close-horizontal";
+ break;
+ case PEF_CLOSE_ALL:
+ transition="close";
+ break;
+ case PEF_OPEN_HORZ:
+ transition="open-vertical";
+ break;
+ case PEF_OPEN_VERT:
+ transition="open-horizontal";
+ break;
+ case PEF_OPEN_ALL:
+ transition="open";
+ break;
+ case PEF_INTERLOCKING_HORZ_1:
+ transition="interlocking-horizontal-left";
+ break;
+ case PEF_INTERLOCKING_HORZ_2:
+ transition="interlocking-horizontal-right";
+ break;
+ case PEF_INTERLOCKING_VERT_1:
+ transition="interlocking-vertical-top";
+ break;
+ case PEF_INTERLOCKING_VERT_2:
+ transition="interlocking-vertical-bottom";
+ break;
+ case PEF_SURROUND1:
+ transition="spiralin-left";
+ break;
+ case PEF_FLY1:
+ transition="fly-away";
+ break;
+ case PEF_BLINDS_HOR:
+ transition="horizontal-stripes";
+ break;
+ case PEF_BLINDS_VER:
+ transition="vertical-stripes";
+ break;
+ case PEF_BOX_IN:
+ transition="fade-to-center";
+ break;
+ case PEF_BOX_OUT:
+ transition="fade-from-center";
+ break;
+ case PEF_CHECKBOARD_ACROSS:
+ transition="horizontal-checkerboard";
+ break;
+ case PEF_CHECKBOARD_DOWN:
+ transition="vertical-checkerboard";
+ break;
+ case PEF_COVER_DOWN:
+ transition="fade-from-top";
+ break;
+ case PEF_COVER_UP:
+ transition="fade-from-bottom";
+ break;
+ case PEF_COVER_LEFT:
+ transition="fade-from-right";
+ break;
+ case PEF_COVER_RIGHT:
+ transition="fade-from-left";
+ break;
+ case PEF_COVER_LEFT_UP:
+ transition="fade-from-lowerright";
+ break;
+ case PEF_COVER_LEFT_DOWN:
+ transition="fade-from-upperright";
+ break;
+ case PEF_COVER_RIGHT_UP:
+ transition="fade-from-lowerleft";
+ break;
+ case PEF_COVER_RIGHT_DOWN:
+ transition="fade-from-upperleft";
+ break;
+ case PEF_UNCOVER_LEFT:
+ transition="uncover-to-left";
+ break;
+ case PEF_UNCOVER_UP:
+ transition="uncover-to-top";
+ break;
+ case PEF_UNCOVER_RIGHT:
+ transition="uncover-to-right";
+ break;
+ case PEF_UNCOVER_DOWN:
+ transition="uncover-to-bottom";
+ break;
+ case PEF_UNCOVER_LEFT_UP:
+ transition="uncover-to-upperleft";
+ break;
+ case PEF_UNCOVER_LEFT_DOWN:
+ transition="uncover-to-lowerleft";
+ break;
+ case PEF_UNCOVER_RIGHT_UP:
+ transition="uncover-to-upperright";
+ break;
+ case PEF_UNCOVER_RIGHT_DOWN:
+ transition="uncover-to-lowerright";
+ break;
+ case PEF_DISSOLVE:
+ transition="dissolve";
+ break;
+ case PEF_STRIPS_LEFT_UP:
+ transition="fade-from-lowerright";
+ break;
+ case PEF_STRIPS_LEFT_DOWN:
+ transition="fade-from-upperright";
+ break;
+ case PEF_STRIPS_RIGHT_UP:
+ transition="fade-from-lowerleft";
+ break;
+ case PEF_STRIPS_RIGHT_DOWN:
+ transition="fade-from-upperleft";
+ break;
+ case PEF_MELTING:
+ transition="melt";
+ break;
+ case PEF_LAST_MARKER://don't use it !!!
+ break;
+ case PEF_RANDOM:
+ transition="random";
+ break;
+
+ }
+ return transition;
+}
+
+
+QString KPrPage::saveOasisAdditionalPageEffect() const
+{
+ QString additionalEffect;
+ switch( m_pageEffect )
+ {
+ case PEF_STRIPS_LEFT_UP:
+ additionalEffect="stripe-from-lowerright";
+ break;
+ case PEF_STRIPS_LEFT_DOWN:
+ additionalEffect="stripe-from-upperright";
+ break;
+ case PEF_STRIPS_RIGHT_UP:
+ additionalEffect="stripe-from-lowerleft";
+ break;
+ case PEF_STRIPS_RIGHT_DOWN:
+ additionalEffect="stripe-from-upperleft";
+ break;
+ default:
+ break;
+ }
+ return additionalEffect;
+}
+
+
+KPrObject *KPrPage::getObject(int num)
+{
+ Q_ASSERT( num < (int)m_objectList.count() );
+ return m_objectList.at(num);
+}
+
+/*
+ * Check if object name already exists.
+ */
+bool KPrPage::objectNameExists( KPrObject *object, QPtrList<KPrObject> &list ) {
+ QPtrListIterator<KPrObject> it( list );
+
+ for ( it.toFirst(); it.current(); ++it ) {
+ // object name can exist in current object.
+ if ( it.current()->getObjectName() == object->getObjectName() &&
+ it.current() != object ) {
+ return true;
+ }
+ else if ( it.current()->getType() == OT_GROUP ) {
+ QPtrList<KPrObject> objectList( static_cast<KPrGroupObject*>(it.current())->getObjects() );
+ if ( objectNameExists( object, objectList ) ) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+void KPrPage::unifyObjectName( KPrObject *object ) {
+ if ( object->getObjectName().isEmpty() ) {
+ object->setObjectName( object->getTypeString() );
+ }
+ QString objectName( object->getObjectName() );
+
+ QPtrList<KPrObject> list( m_objectList );
+
+ int count = 1;
+
+ while ( objectNameExists( object, list ) ) {
+ count++;
+ QRegExp rx( " \\(\\d{1,}\\)$" );
+ if ( rx.search( objectName ) != -1 ) {
+ objectName.remove( rx );
+ }
+ objectName += QString(" (%1)").arg( count );
+ object->setObjectName( objectName );
+ }
+}
+
+void KPrPage::appendObject(KPrObject *_obj)
+{
+ unifyObjectName(_obj);
+ m_objectList.append(_obj);
+}
+
+void KPrPage::appendObjects( const QValueList<KPrObject *> &objects )
+{
+ QMap <QString, int> usedPageNames;
+ QPtrListIterator<KPrObject> it( m_objectList );
+ // find the biggest number
+ for ( ; it.current() ; ++it )
+ {
+ QString objectName( it.current()->getObjectName() );
+
+ QRegExp rx( "(.*) \\((\\d{1,})\\)$" );
+ rx.setMinimal( true );
+ if ( rx.search( objectName ) != -1 && rx.numCaptures() == 2 )
+ {
+ int id = rx.cap( 2 ).toInt();
+ if ( usedPageNames[rx.cap( 1 )] < id )
+ {
+ usedPageNames[rx.cap( 1 )] = id;
+ }
+ }
+ else
+ {
+ usedPageNames[objectName] = 1;
+ }
+ }
+
+ QValueListConstIterator<KPrObject *> oIt( objects.begin() );
+ for ( ; oIt != objects.end(); ++oIt )
+ {
+ QString objectName( ( *oIt )->getObjectName() );
+ QRegExp rx( " \\(\\d{1,}\\)$" );
+ if ( rx.search( objectName ) != -1 )
+ {
+ objectName.remove( rx );
+ }
+
+ if ( usedPageNames.contains( objectName ) )
+ {
+ usedPageNames[objectName]++;
+ objectName += QString(" (%1)").arg( usedPageNames[objectName] );
+ ( *oIt )->setObjectName( objectName );
+ }
+ m_objectList.append( *oIt );
+ }
+}
+
+int KPrPage::takeObject( KPrObject *object )
+{
+ int pos = m_objectList.findRef( object );
+ m_objectList.take( pos );
+ return pos;
+}
+
+void KPrPage::replaceObject( KPrObject *oldObject, KPrObject *newObject )
+{
+ //XXX check if object name gets set
+ unsigned int pos = m_objectList.findRef( oldObject );
+ m_objectList.take( pos );
+ m_objectList.insert( pos, newObject );
+}
+
+
+void KPrPage::insertObject( KPrObject *object, int pos )
+{
+ unifyObjectName( object );
+ m_objectList.insert( pos, object );
+}
+
+KCommand * KPrPage::deleteSelectedObjects()
+{
+ QPtrList<KPrObject> objects = getSelectedObjects( true );
+
+ KPrDeleteCmd *deleteCmd=0L;
+
+ if ( objects.count() > 0 ) {
+ deleteCmd = new KPrDeleteCmd( i18n( "Delete Objects" ), objects, m_doc, this );
+ deleteCmd->execute();
+ }
+ else
+ m_doc->setModified(true);
+
+ return deleteCmd ;
+}
+
+void KPrPage::copyObjs(QDomDocument &doc, QDomElement &presenter, QValueList<KoPictureKey> & savePictures) const
+{
+ if ( !numSelected() )
+ return;
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->isSelected())
+ {
+ if ( it.current()->getType() == OT_PICTURE )
+ {
+ KoPictureKey key = static_cast<KPrPixmapObject *>( it.current() )->getKey();
+ if ( !savePictures.contains( key ) )
+ savePictures.append( key );
+ }
+ QDomElement object=doc.createElement("OBJECT");
+ object.setAttribute("type", static_cast<int>( it.current()->getType() ));
+ object.appendChild(it.current()->save( doc,0 ));
+ presenter.appendChild(object);
+ }
+ }
+}
+
+void KPrPage::pasteObjs( const QByteArray & data,int nbCopy, double angle,
+ double increaseX, double increaseY, double moveX, double moveY )
+{
+ m_doc->deSelectAllObj();
+ int num = m_objectList.count();
+ if ( !data.size() )
+ return;
+ QBuffer buffer( data );
+ KoStore* store = KoStore::createStore( &buffer, KoStore::Read );
+ int nbNewObject = -1 ;
+ KMacroCommand *macro = 0L;
+ if ( !store->bad() )
+ {
+ if ( store->open( "root" ) )
+ {
+ QString errorMsg;
+ int errorLine;
+ int errorColumn;
+ QDomDocument domDoc;
+ if ( !domDoc.setContent( store->device(), &errorMsg, &errorLine, &errorColumn ) )
+ {
+ kdError (30003) << "Parsing Error! Aborting! (in KPrPage::PasteObj)" << endl
+ << " Line: " << errorLine << " Column: " << errorColumn << endl
+ << " Message: " << errorMsg << endl;
+ delete store;
+ return;
+ }
+ QDomElement topElem = domDoc.documentElement();
+
+ for ( int i = 0 ; i < nbCopy ; i++ )
+ {
+ KCommand *cmd = m_doc->loadPastedObjs( domDoc.toString(),this );
+ if (cmd )
+ {
+ if ( !macro )
+ macro = new KMacroCommand( i18n("Paste Objects" ));
+ macro->addCommand( cmd );
+ }
+ if ( nbNewObject == -1 )
+ nbNewObject = m_objectList.count() - num;
+ }
+
+ m_doc->loadPictureMap( topElem );
+ store->close();
+ int nbNewPartObject = -1;
+ int nbElementBefore = m_objectList.count();
+ for ( int i = 0 ; i < nbCopy ; i++ )
+ {
+ m_doc->insertEmbedded( store, topElem, macro, this, num );
+ if ( nbNewPartObject ==-1 )
+ nbNewObject = nbNewObject + (m_objectList.count() - nbElementBefore);
+ }
+ }
+ }
+ delete store;
+
+ //move and select all new pasted in objects
+ KPrObject *_tempObj;
+ int i = 0;
+ int mod = 1;
+ for (_tempObj = m_objectList.at(num); _tempObj; _tempObj = m_objectList.next(), i++ ) {
+ if ( i >= nbNewObject )
+ mod++;
+ _tempObj->moveBy( moveX*(double)mod,moveY*(double)mod);
+ _tempObj->setSelected( true );
+ if ( angle == 0.0 || (increaseY == 0.0 && increaseX == 0.0))
+ m_doc->repaint(_tempObj);
+ }
+
+ if ( angle != 0.0)
+ {
+ KCommand *cmd = rotateSelectedObjects(angle, true);
+ if (cmd )
+ {
+ if ( !macro )
+ macro = new KMacroCommand( i18n("Paste Objects" ));
+ macro->addCommand( cmd );
+ }
+ }
+ if ( increaseX != 0.0 || increaseY != 0.0 )
+ {
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->isSelected())
+ {
+ KCommand *cmd =new KPrResizeCmd( i18n("Resize"), KoPoint(0, 0),
+ KoSize(increaseX, increaseY), it.current(), m_doc );
+ if ( cmd )
+ {
+ cmd->execute();
+ if ( !macro )
+ macro = new KMacroCommand( i18n("Paste Objects" ));
+ macro->addCommand( cmd );
+ }
+ }
+ }
+ }
+
+ if (macro)
+ m_doc->addCommand(macro);
+ //update sidebar
+ if ( angle == 0.0 || (increaseY == 0.0 && increaseX == 0.0) )
+ {
+ m_doc->updateSideBarItem( this );
+ }
+
+ m_doc->setModified(true);
+}
+
+KPrTextObject * KPrPage::textFrameSet ( unsigned int _num ) const
+{
+ unsigned int i = 0;
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->getType()==OT_TEXT)
+ {
+ if(i==_num)
+ return static_cast<KPrTextObject*>(it.current());
+ i++;
+ }
+ }
+ return 0L;
+}
+
+int KPrPage::numSelected() const
+{
+ int num = 0;
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->isSelected())
+ num++;
+ }
+
+ return num;
+}
+
+int KPrPage::numTextObject() const
+{
+ int num = 0;
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->getType()==OT_TEXT)
+ num++;
+ }
+
+ return num;
+}
+
+KPrObject* KPrPage::getSelectedObj() const
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->isSelected())
+ return it.current();
+ }
+ return 0L;
+}
+
+
+QPtrList<KPrObject> KPrPage::getSelectedObjects( bool withoutHeaderFooter ) const
+{
+ QPtrList<KPrObject> objects;
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if( it.current()->isSelected()
+ && ( !withoutHeaderFooter
+ || it.current() != m_doc->header() && it.current()!= m_doc->footer() ) )
+ {
+ objects.append( it.current() );
+ }
+ }
+ return objects;
+}
+
+
+void KPrPage::groupObjects()
+{
+ QPtrList<KPrObject> objects( getSelectedObjects( true ) );
+
+ if ( objects.count() > 1 ) {
+ KPrGroupObjCmd *groupObjCmd = new KPrGroupObjCmd( i18n( "Group Objects" ), objects, m_doc,this );
+ m_doc->addCommand( groupObjCmd );
+ groupObjCmd->execute();
+ }
+}
+
+void KPrPage::ungroupObjects( KMacroCommand ** macro )
+{
+ QPtrList<KPrObject> objects( getSelectedObjects( true ) );
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current() ; ++it )
+ {
+ KPrObject *object = it.current();
+ if ( object->getType() == OT_GROUP )
+ {
+ UnGroupObjCmd *cmd = new UnGroupObjCmd( i18n( "Ungroup Objects" ),
+ (KPrGroupObject*)object, m_doc, this );
+ cmd->execute();
+
+ if ( !*macro )
+ *macro = new KMacroCommand(i18n( "Ungroup Objects" ));
+ (*macro)->addCommand( cmd );
+ }
+ }
+}
+
+void KPrPage::lowerObjs(bool backward)
+{
+ KPrObject *kpobject = 0;
+
+ QPtrList<KPrObject> _new;
+
+ for ( unsigned int j = 0; j < m_objectList.count(); j++ )
+ _new.append( m_objectList.at( j ) );
+
+ _new.setAutoDelete( false );
+ bool createCmd = false;
+ int insertPos = 0;
+ for ( int i = 0; i < static_cast<int>( _new.count() ); i++ ) {
+ kpobject = _new.at( i );
+ if ( kpobject->isSelected() ) {
+ if ( i == insertPos )
+ {
+ ++insertPos;
+ continue;
+ }
+ createCmd = true;
+ _new.take( i );
+ if ( backward )
+ _new.insert(QMAX(i-1,0) , kpobject);
+ else
+ _new.insert( insertPos++, kpobject );
+ }
+ }
+ if ( createCmd )
+ {
+ KPrLowerRaiseCmd *lrCmd = new KPrLowerRaiseCmd( i18n( "Lower Objects" ), m_objectList, _new, m_doc,this );
+ lrCmd->execute();
+ m_doc->addCommand( lrCmd );
+ }
+
+}
+
+void KPrPage::raiseObjs(bool forward)
+{
+ KPrObject *kpobject = 0;
+
+ QPtrList<KPrObject> _new;
+
+ for ( unsigned int j = 0; j < m_objectList.count(); j++ )
+ _new.append( m_objectList.at( j ) );
+
+ _new.setAutoDelete( false );
+ bool createCmd = false;
+ int size = int( _new.count() );
+ int insertPos = size - 1;
+ for ( int i = size - 1; i >= 0; i-- )
+ {
+ kpobject = _new.at( i );
+ if ( kpobject->isSelected() )
+ {
+ if ( i == insertPos )
+ {
+ --insertPos;
+ continue;
+ }
+ createCmd = true;
+ _new.take( i );
+ if ( forward )
+ _new.insert( QMIN( i+1, size - 1), kpobject);
+ else
+ _new.insert( insertPos--, kpobject );
+ }
+ }
+ if ( createCmd )
+ {
+ KPrLowerRaiseCmd *lrCmd = new KPrLowerRaiseCmd( i18n( "Raise Objects" ), m_objectList, _new, m_doc,this );
+ lrCmd->execute();
+ m_doc->addCommand( lrCmd );
+ }
+}
+
+KCommand *KPrPage::insertObject( const QString &name, KPrObject * object, const KoRect &r, bool addCommand )
+{
+ object->setOrig( r.x(), r.y() );
+ object->setSize( r.width(), r.height() );
+ object->setSelected( true );
+
+ KPrInsertCmd *insertCmd = new KPrInsertCmd( name, object, m_doc, this );
+ insertCmd->execute();
+ if ( addCommand )
+ {
+ m_doc->addCommand( insertCmd );
+ return 0L;
+ }
+ return insertCmd;
+}
+
+void KPrPage::insertLine( const KoRect &r, const KoPen & pen, LineEnd lb, LineEnd le, LineType lt )
+{
+ KPrLineObject *kplineobject = new KPrLineObject( pen, lb, le, lt );
+ insertObject( i18n( "Insert Line" ), kplineobject, r );
+}
+
+void KPrPage::insertRectangle( const KoRect &r, const KoPen & pen, const QBrush &brush, FillType ft,
+ const QColor &g1, const QColor &g2,
+ BCType gt, int rndX, int rndY, bool unbalanced, int xfactor, int yfactor )
+{
+ KPrRectObject *kprectobject = new KPrRectObject( pen, brush, ft, g1, g2, gt, rndX, rndY,
+ unbalanced, xfactor, yfactor );
+ insertObject( i18n( "Insert Rectangle" ), kprectobject, r );
+}
+
+void KPrPage::insertCircleOrEllipse( const KoRect &r, const KoPen &pen, const QBrush & brush, FillType ft,
+ const QColor &g1, const QColor &g2,
+ BCType gt, bool unbalanced, int xfactor, int yfactor )
+{
+ KPrEllipseObject *kpellipseobject = new KPrEllipseObject( pen, brush, ft, g1, g2, gt,
+ unbalanced, xfactor, yfactor );
+ insertObject( i18n( "Insert Ellipse" ), kpellipseobject, r );
+}
+
+void KPrPage::insertPie( const KoRect &r, const KoPen &pen, const QBrush &brush, FillType ft,
+ const QColor &g1, const QColor &g2,
+ BCType gt, PieType pt, int _angle, int _len, LineEnd lb, LineEnd le,
+ bool unbalanced, int xfactor, int yfactor )
+{
+ KPrPieObject *kppieobject = new KPrPieObject( pen, brush, ft, g1, g2, gt, pt, _angle,
+ _len, lb, le, unbalanced, xfactor, yfactor );
+ insertObject( i18n( "Insert Pie/Arc/Chord" ), kppieobject, r );
+}
+
+KPrTextObject* KPrPage::insertTextObject( const KoRect& r, const QString& text , KPrView * _view )
+{
+ KPrTextObject *kptextobject = new KPrTextObject( m_doc );
+ insertObject( i18n( "Insert Textbox" ), kptextobject, r );
+ //TODO create macro command : now insertObject can return KCommand
+ //TODO fix repaint object
+ if ( !text.isEmpty() )
+ {
+ KPrTextView *view = kptextobject->createKPTextView( _view ? _view->getCanvas() : 0L );
+ view->insertText( text );
+ view->terminate();
+ delete view;
+ m_doc->repaint( kptextobject );
+ }
+ return kptextobject;
+}
+
+void KPrPage::insertAutoform( const KoRect &r, const KoPen &pen, const QBrush &brush, LineEnd lb, LineEnd le, FillType ft,
+ const QColor &g1, const QColor &g2, BCType gt, const QString &fileName, bool unbalanced,
+ int xfactor, int yfactor ){
+ KPrAutoformObject *kpautoformobject = new KPrAutoformObject( pen, brush, fileName, lb, le, ft,
+ g1, g2, gt, unbalanced, xfactor, yfactor );
+ insertObject( i18n( "Insert Autoform" ), kpautoformobject, r );
+}
+
+void KPrPage::insertFreehand( const KoPointArray &points, const KoRect &r, const KoPen &pen,
+ LineEnd lb, LineEnd le )
+{
+ KoSize size( r.width(), r.height() );
+ KPrFreehandObject *kpfreehandobject = new KPrFreehandObject( points, size, pen, lb, le );
+ insertObject( i18n( "Insert Freehand" ), kpfreehandobject, r );
+}
+
+void KPrPage::insertPolyline( const KoPointArray &points, const KoRect &r, const KoPen &pen,
+ LineEnd lb, LineEnd le )
+{
+ KoSize size( r.width(), r.height() );
+ KPrPolylineObject *kppolylineobject = new KPrPolylineObject( points, size, pen, lb, le );
+ insertObject( i18n( "Insert Polyline" ), kppolylineobject, r );
+}
+
+void KPrPage::insertQuadricBezierCurve( const KoPointArray &points, const KoPointArray &allPoints,
+ const KoRect &r, const KoPen &pen,
+ LineEnd lb, LineEnd le )
+{
+ KoSize size( r.width(), r.height() );
+
+ KPrQuadricBezierCurveObject *kpQuadricBezierCurveObject = new KPrQuadricBezierCurveObject(
+ points, allPoints, size, pen, lb, le );
+ insertObject( i18n( "Insert Quadric Bezier Curve" ), kpQuadricBezierCurveObject, r );
+}
+
+void KPrPage::insertCubicBezierCurve( const KoPointArray &points, const KoPointArray &allPoints,
+ const KoRect &r, const KoPen &pen,
+ LineEnd lb, LineEnd le )
+{
+ KoSize size( r.width(), r.height() );
+
+ KPrCubicBezierCurveObject *kpCubicBezierCurveObject = new KPrCubicBezierCurveObject( points, allPoints, size, pen, lb, le );
+ insertObject( i18n( "Insert Cubic Bezier Curve" ), kpCubicBezierCurveObject, r );
+}
+
+void KPrPage::insertPolygon( const KoPointArray &points, const KoRect &r, const KoPen &pen, const QBrush &brush, FillType ft,
+ const QColor &g1, const QColor &g2, BCType gt, bool unbalanced, int xfactor, int yfactor,
+ bool _checkConcavePolygon, int _cornersValue, int _sharpnessValue )
+{
+ KoSize size( r.width(), r.height() );
+
+ KPrPolygonObject *kpPolygonObject = new KPrPolygonObject( points, size, pen, brush, ft,
+ g1, g2, gt, unbalanced, xfactor, yfactor,
+ _checkConcavePolygon, _cornersValue, _sharpnessValue );
+ insertObject( i18n( "Insert Polygon" ), kpPolygonObject, r );
+}
+
+void KPrPage::insertClosedLine( const KoPointArray &points, const KoRect &r, const KoPen &pen, const QBrush &brush,
+ FillType ft,const QColor &g1, const QColor &g2,
+ BCType gt, bool unbalanced, int xfactor, int yfactor, ToolEditMode _mode )
+{
+ QString _type;
+ QString _name;
+ if ( _mode == INS_CLOSED_FREEHAND ) {
+ _type = i18n( "Closed Freehand" );
+ _name = i18n( "Insert Closed Freehand" );
+ }
+ else if ( _mode == INS_CLOSED_POLYLINE ) {
+ _type = i18n( "Closed Polyline" );
+ _name = i18n( "Insert Closed Polyline" );
+ }
+ else if ( _mode == INS_CLOSED_QUADRICBEZIERCURVE ) {
+ _type = i18n( "Closed Quadric Bezier Curve" );
+ _name = i18n( "Insert Closed Quadric Bezier Curve" );
+ }
+ else if ( _mode == INS_CLOSED_CUBICBEZIERCURVE ) {
+ _type = i18n( "Closed Cubic Bezier Curve" );
+ _name = i18n( "Insert Closed Cubic Bezier Curve" );
+ }
+
+ KoSize size( r.width(), r.height() );
+
+ KPrClosedLineObject *kpClosedLineObject = new KPrClosedLineObject( points, size, pen, brush, ft,
+ g1, g2, gt, unbalanced, xfactor, yfactor, _type );
+ insertObject( _name, kpClosedLineObject, r );
+}
+
+KPrPartObject* KPrPage::insertObject( const KoRect& _rect, KoDocumentEntry& _e )
+{
+ KoDocument* doc = _e.createDoc( m_doc );
+ if ( !doc )
+ return NULL;
+
+ if ( !doc->showEmbedInitDialog( 0 ) ) //TODO should really have parent
+ return NULL;
+
+ QRect r = QRect( (int)_rect.left(), (int)_rect.top(),
+ (int)_rect.width(), (int)_rect.height() );
+ KPrChild* ch = new KPrChild( m_doc, doc, r );
+ m_doc->insertObject( ch );
+
+ KPrPartObject *kppartobject = new KPrPartObject( ch );
+ insertObject( i18n( "Embed Object" ), kppartobject, _rect );
+
+ //emit sig_insertObject( ch, kppartobject );
+ m_doc->repaint( false );
+
+ return kppartobject;
+}
+
+KCommand* KPrPage::setPen( const KoPen &pen, LineEnd lb, LineEnd le, int flags )
+{
+ KoPenCmd * cmd = NULL;
+
+ KoPenCmd::Pen _newPen( pen, lb, le);
+
+ QPtrList<KPrObject> _objects;
+ _objects.setAutoDelete( false );
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if( it.current()->isSelected() )
+ {
+ _objects.append( it.current() );
+ }
+ }
+
+ if ( !_objects.isEmpty() && flags ) {
+ cmd = new KoPenCmd( i18n( "Apply Styles" ), _objects, _newPen, m_doc, this, flags );
+ cmd->execute();
+ }
+
+ return cmd;
+}
+
+KCommand * KPrPage::setBrush( const QBrush &brush, FillType ft, const QColor &g1, const QColor &g2,
+ BCType gt, bool unbalanced, int xfactor, int yfactor, int flags )
+{
+ KPrBrushCmd * cmd = NULL;
+
+ KPrBrushCmd::Brush _newBrush;
+
+ _newBrush.brush = QBrush( brush );
+ _newBrush.fillType = ft;
+ _newBrush.gColor1 = g1;
+ _newBrush.gColor2 = g2;
+ _newBrush.gType = gt;
+ _newBrush.unbalanced = unbalanced;
+ _newBrush.xfactor = xfactor;
+ _newBrush.yfactor = yfactor;
+
+ QPtrList<KPrObject> _objects;
+ _objects.setAutoDelete( false );
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if( it.current()->isSelected() )
+ {
+ _objects.append( it.current() );
+ }
+ }
+
+ if ( !_objects.isEmpty() && flags ) {
+ cmd = new KPrBrushCmd( i18n( "Apply Styles" ), _objects, _newBrush, m_doc, this, flags );
+ cmd->execute();
+ }
+
+ return cmd;
+}
+
+void KPrPage::slotRepaintVariable()
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->getType() == OT_TEXT )
+ m_doc->repaint( it.current() );
+ }
+}
+
+void KPrPage::recalcPageNum()
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->getType() == OT_TEXT ) {
+ ( (KPrTextObject*)it.current() )->recalcPageNum( this );
+ m_doc->repaint( it.current() ); // TODO only if something changed
+ }
+ }
+}
+
+void KPrPage::changePicture( const KURL & url, QWidget *parent )
+{
+ // filename has been chosen in KPrView with a filedialog,
+ // so we know it exists
+ KoPicture image = m_doc->pictureCollection()->downloadPicture( url, parent );
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->isSelected() && it.current()->getType()==OT_PICTURE)
+ {
+ KPrPixmapObject* obj=dynamic_cast<KPrPixmapObject*>( it.current() );
+ if( obj)
+ {
+ KPrPixmapObject *pix = new KPrPixmapObject( m_doc->pictureCollection(), image.getKey() );
+ KPrChgPixCmd *chgPixCmd = new KPrChgPixCmd( i18n( "Change Pixmap" ),obj,pix, m_doc,this );
+ chgPixCmd->execute();
+ m_doc->addCommand( chgPixCmd );
+ }
+ break;
+ }
+ }
+}
+
+void KPrPage::insertPicture( const QString &filename, const KoPoint &pos )
+{
+ KoPictureKey key = m_doc->pictureCollection()->loadPicture( filename ).getKey();
+ KPrPixmapObject *kppixmapobject = new KPrPixmapObject(m_doc->pictureCollection() , key );
+
+ kppixmapobject->setOrig( pos );
+ kppixmapobject->setSelected( true );
+
+ kppixmapobject->setSize( m_doc->zoomHandler()->pixelXToPt( kppixmapobject->originalSize().width() ),
+ m_doc->zoomHandler()->pixelYToPt( kppixmapobject->originalSize().height() ) );
+ kppixmapobject->setKeepRatio( true ); // pics have keep-aspect-ratio on by default.
+
+ KPrInsertCmd *insertCmd = new KPrInsertCmd( i18n( "Insert Picture" ), kppixmapobject, m_doc, this );
+ insertCmd->execute();
+ m_doc->addCommand( insertCmd );
+
+ KoRect s = getPageRect();
+ float fakt = 1;
+ if ( kppixmapobject->getSize().width() > s.width() )
+ fakt = (float)s.width() / (float)kppixmapobject->getSize().width();
+ if ( kppixmapobject->getSize().height() > s.height() )
+ fakt = QMIN( fakt, (float)s.height() / (float)kppixmapobject->getSize().height() );
+
+ //kdDebug(33001) << k_funcinfo << "Fakt: " << fakt << endl;
+
+ if ( fakt < 1 ) {
+ int w = (int)( fakt * (float)kppixmapobject->getSize().width() );
+ int h = (int)( fakt * (float)kppixmapobject->getSize().height() );
+ //kdDebug(33001) << k_funcinfo << "Size: " << w << ", " << h << endl;
+ kppixmapobject->setOrig(0,0);
+ kppixmapobject->setSize(w, h);
+ m_doc->repaint( false );
+ }
+}
+
+void KPrPage::insertPicture( const QString &_file, const KoRect &_rect )
+{
+ KoPictureKey key = m_doc->pictureCollection()->loadPicture( _file ).getKey();
+ KPrPixmapObject *kppixmapobject = new KPrPixmapObject( m_doc->pictureCollection(), key );
+ kppixmapobject->setKeepRatio( true ); // pics have keep-aspect-ratio on by default.
+ insertObject( i18n( "Insert Picture" ), kppixmapobject, _rect );
+}
+
+void KPrPage::enableEmbeddedParts( bool f )
+{
+ KPrPartObject *obj=0L;
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->getType()==OT_PART)
+ {
+ obj=dynamic_cast<KPrPartObject*>( it.current() );
+ if(obj)
+ obj->enableDrawing( f );
+ }
+ }
+}
+
+
+void KPrPage::setBackColor(const QColor &backColor1, const QColor &backColor2, BCType bcType,
+ bool unbalanced, int xfactor, int yfactor )
+{
+ m_kpbackground->setBackColor1( backColor1 );
+ m_kpbackground->setBackColor2( backColor2 );
+ m_kpbackground->setBackColorType( bcType );
+ m_kpbackground->setBackUnbalanced( unbalanced );
+ m_kpbackground->setBackXFactor( xfactor );
+ m_kpbackground->setBackYFactor( yfactor );
+}
+
+void KPrPage::setBackPicture( const KoPictureKey & key )
+{
+ m_kpbackground->setBackPicture( key );
+}
+
+bool KPrPage::getBackUnbalanced() const
+{
+ return m_kpbackground->getBackUnbalanced();
+}
+
+void KPrPage::setBackView( BackView backView )
+{
+ m_kpbackground->setBackView( backView );
+}
+
+void KPrPage::setBackType( BackType backType )
+{
+ m_kpbackground->setBackType( backType );
+}
+
+void KPrPage::setPageEffectSpeed( EffectSpeed pageEffectSpeed )
+{
+ m_pageEffectSpeed = pageEffectSpeed;
+}
+
+void KPrPage::setPageEffect( PageEffect pageEffect )
+{
+ m_pageEffect = pageEffect;
+}
+
+void KPrPage::setPageTimer( int pageTimer )
+{
+ m_pageTimer = pageTimer;
+}
+
+void KPrPage::setPageSoundEffect( bool soundEffect )
+{
+ m_soundEffect = soundEffect;
+}
+
+void KPrPage::setPageSoundFileName( const QString &fileName )
+{
+ m_soundFileName = fileName;
+}
+
+BackType KPrPage::getBackType() const
+{
+ return m_kpbackground->getBackType();
+}
+
+BackView KPrPage::getBackView() const
+{
+ return m_kpbackground->getBackView();
+}
+
+KoPictureKey KPrPage::getBackPictureKey() const
+{
+ return m_kpbackground->getBackPictureKey();
+}
+
+KoPicture KPrPage::getBackPicture() const
+{
+ return m_kpbackground->getBackPicture();
+}
+
+QColor KPrPage::getBackColor1() const
+{
+ return m_kpbackground->getBackColor1();
+}
+
+QColor KPrPage::getBackColor2() const
+{
+ return m_kpbackground->getBackColor2();
+}
+
+int KPrPage::getBackXFactor() const
+{
+ return m_kpbackground->getBackXFactor();
+}
+
+int KPrPage::getBackYFactor() const
+{
+ return m_kpbackground->getBackYFactor();
+}
+
+BCType KPrPage::getBackColorType() const
+{
+ return m_kpbackground->getBackColorType();
+}
+
+EffectSpeed KPrPage::getPageEffectSpeed() const
+{
+ return m_pageEffectSpeed;
+}
+
+PageEffect KPrPage::getPageEffect() const
+{
+ return m_pageEffect;
+}
+
+int KPrPage::getPageTimer() const
+{
+ return m_pageTimer;
+}
+
+bool KPrPage::getPageSoundEffect() const
+{
+ return m_soundEffect;
+}
+
+QString KPrPage::getPageSoundFileName() const
+{
+ return m_soundFileName;
+}
+
+KoRect KPrPage::getPageRect() const
+{
+ const KoPageLayout& p = m_doc->pageLayout();
+ return KoRect( p.ptLeft, p.ptTop, p.ptWidth - p.ptRight - p.ptLeft, p.ptHeight - p.ptTop - p.ptBottom );
+}
+
+QRect KPrPage::getZoomPageRect() const
+{
+ return m_doc->zoomHandler()->zoomRect(getPageRect());
+}
+
+void KPrPage::completeLoading( bool _clean, int lastObj )
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ // Pictures and cliparts have been loaded from the store, we can now
+ // get the picture from the collection, and set it in the image/clipart object
+ if ( ( it.current()->getType() == OT_PICTURE )
+ || ( it.current()->getType() == OT_CLIPART ) ) {
+ if ( _clean || m_objectList.findRef( it.current() ) > lastObj )
+ {
+ KPrPixmapObject* obj=dynamic_cast<KPrPixmapObject*>( it.current());
+ if(obj)
+ obj->reload();
+ }
+ }
+ else if ( it.current()->getType() == OT_TEXT )
+ {
+ KPrTextObject*obj=dynamic_cast<KPrTextObject*>( it.current() );
+ if(obj)
+ obj->recalcPageNum( this );
+ }
+ else if ( it.current()->getType() == OT_GROUP )
+ completeLoadingForGroupObject( it.current() );
+ }
+ m_kpbackground->reload();
+}
+
+void KPrPage::completeLoadingForGroupObject( KPrObject *_obj )
+{
+ KPrGroupObject *_groupObj = static_cast<KPrGroupObject*>( _obj );
+
+ if ( _groupObj ) {
+ QPtrListIterator<KPrObject> it( _groupObj->objectList() );
+ for ( ; it.current(); ++it ) {
+ if ( ( it.current()->getType() == OT_PICTURE )
+ || ( it.current()->getType() == OT_CLIPART ) ) {
+ KPrPixmapObject *_pixObj = dynamic_cast<KPrPixmapObject*>( it.current() );
+ if ( _pixObj )
+ _pixObj->reload();
+ }
+ else if ( it.current()->getType() == OT_TEXT ) {
+ KPrTextObject *_textObj= dynamic_cast<KPrTextObject*>( it.current() );
+ if ( _textObj )
+ _textObj->recalcPageNum( this );
+ }
+ else if ( it.current()->getType() == OT_GROUP )
+ completeLoadingForGroupObject( it.current() ); // recursion
+ }
+ }
+}
+
+KCommand * KPrPage::replaceObjs( bool createUndoRedo, double _orastX,double _orastY,const QColor & _txtBackCol,
+ const QColor & _otxtBackCol )
+{
+ KPrObject *kpobject = 0;
+ double ox=0, oy=0;
+ QPtrList<KPrObject> _objects;
+ QValueList<KoPoint> _diffs;
+ _objects.setAutoDelete( false );
+
+ for ( int i = 0; i < static_cast<int>( m_objectList.count() ); i++ ) {
+ kpobject = m_objectList.at( i );
+ ox = kpobject->getOrig().x();
+ oy = kpobject->getOrig().y();
+ ox = static_cast<int>(ox / m_doc->getGridX() * m_doc->getGridX());
+ oy = static_cast<int>(oy / m_doc->getGridY() * m_doc->getGridY());
+
+ _diffs.append( KoPoint( ox - kpobject->getOrig().x(), oy - kpobject->getOrig().y() ) );
+ _objects.append( kpobject );
+ }
+
+ KPrSetOptionsCmd *setOptionsCmd = new KPrSetOptionsCmd( i18n( "Set New Options" ), _diffs, _objects, m_doc->getGridX(),
+ m_doc->getGridY(),_orastX, _orastY, _txtBackCol, _otxtBackCol, m_doc );
+ if ( createUndoRedo )
+ return setOptionsCmd;
+
+ delete setOptionsCmd;
+ return 0L;
+}
+
+QString KPrPage::manualTitle() const
+{
+ return m_manualTitle;
+}
+
+void KPrPage::insertManualTitle(const QString & title)
+{
+ m_manualTitle=title;
+}
+
+QString KPrPage::pageTitle( const QString &_title ) const
+{
+ // If a user sets a title with manual, return it.
+ if ( !m_manualTitle.isEmpty() )
+ return m_manualTitle;
+
+ QPtrList<KPrTextObject> objs;
+
+ // Create list of text objects in this page
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->getType()==OT_TEXT)
+ objs.append( static_cast<KPrTextObject*>( it.current() ) );
+ }
+
+ QString title;
+ if ( _title.isNull() )
+ {
+ // MASTERPAGE
+ if ( m_masterPage )
+ title = i18n( "Slide %1" ).arg( m_doc->pageList().findRef( this ) + 1 );
+ else
+ title = i18n( "Slide Master" );
+ }
+ else
+ {
+ title = _title;
+ }
+
+ if ( objs.isEmpty() )
+ return title;
+
+ // Find object most on top
+ KPrTextObject *tmp = objs.first();
+ KPrTextObject *textobject=tmp;
+ for ( tmp = objs.next(); tmp; tmp = objs.next() )
+ if ( tmp->getOrig().y() < textobject->getOrig().y() )
+ textobject = tmp;
+
+ // this can't happen, but you never know :- )
+ if ( !textobject )
+ return QString( title );
+
+ QString txt;
+ if ( textobject->textDocument()->firstParag() )
+ txt = textobject->textDocument()->firstParag()->toString();
+ if ( txt.stripWhiteSpace().isEmpty() || txt=="\n" )
+ return title;
+ return txt;
+}
+
+void KPrPage::setNoteText( const QString &_text )
+{
+ m_noteText=_text;
+ m_doc->setModified(true);
+}
+
+QString KPrPage::noteText() const
+{
+ return m_noteText;
+}
+
+void KPrPage::makeUsedPixmapList()
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if( it.current()->getType()==OT_PICTURE || it.current()->getType()==OT_CLIPART)
+ m_doc->insertPixmapKey(static_cast<KPrPixmapObject*>( it.current() )->getKey() );
+ else if ( it.current()->getType() == OT_GROUP )
+ makeUsedPixmapListForGroupObject( it.current() );
+ }
+
+ if( m_kpbackground->getBackType()==BT_PICTURE || m_kpbackground->getBackType()==BT_CLIPART)
+ m_doc->insertPixmapKey(m_kpbackground->getBackPictureKey());
+}
+
+void KPrPage::makeUsedPixmapListForGroupObject( KPrObject *_obj )
+{
+ KPrGroupObject *_groupObj = static_cast<KPrGroupObject*>( _obj );
+
+ if ( _groupObj ) {
+ QPtrListIterator<KPrObject> it( _groupObj->objectList() );
+ for ( ; it.current(); ++it ) {
+ if ( ( it.current()->getType() == OT_PICTURE )
+ || ( it.current()->getType() == OT_CLIPART ) )
+ m_doc->insertPixmapKey(static_cast<KPrPixmapObject*>( it.current() )->getKey() );
+ else if ( it.current()->getType() == OT_GROUP )
+ makeUsedPixmapListForGroupObject( it.current() ); // recursion
+ }
+ }
+}
+
+
+QValueList<int> KPrPage::getEffectSteps() const
+{
+ QMap<int,bool> stepmap;
+ stepmap[0] = true;
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current(); ++it )
+ {
+ stepmap[it.current()->getAppearStep()] = true;
+
+ if ( it.current()->getDisappear() )
+ {
+ stepmap[it.current()->getDisappearStep()] = true;
+ }
+ }
+
+ return stepmap.keys();
+}
+
+
+void KPrPage::deSelectAllObj()
+{
+ QPtrListIterator<KPrObject> sIt( m_objectList );
+ for ( ; sIt.current() ; ++sIt )
+ {
+ if(sIt.current()->isSelected())
+ deSelectObj(sIt.current() );
+ }
+}
+
+void KPrPage::deSelectObj( KPrObject *kpobject )
+{
+ kpobject->setSelected( false );
+ m_doc->repaint( kpobject );
+}
+
+QDomElement KPrPage::saveObjects( QDomDocument &doc, QDomElement &objects, double yoffset,
+ int saveOnlyPage ) const
+{
+ QPtrListIterator<KPrObject> oIt(m_objectList);
+ for (; oIt.current(); ++oIt )
+ {
+ //don't store header/footer (store in header/footer section)
+ if ( oIt.current()==m_doc->header()
+ || oIt.current()==m_doc->footer()
+ || oIt.current()->getType() == OT_PART)
+ continue;
+ QDomElement object=doc.createElement("OBJECT");
+ object.setAttribute("type", static_cast<int>( oIt.current()->getType() ));
+ bool _sticky = ( this->m_masterPage == 0 );
+ if (_sticky)
+ object.setAttribute("sticky", static_cast<int>(_sticky));
+ if ( saveOnlyPage != -1 )
+ yoffset=0;
+ //add yoffset to compatibility with koffice 1.1
+ object.appendChild(oIt.current()->save( doc, yoffset ));
+
+ objects.appendChild(object);
+ }
+ return objects;
+}
+
+bool KPrPage::oneObjectTextExist(bool forceAllTextObject)
+{
+ QPtrList<KPrObject> lst;
+ getAllObjectSelectedList(lst,forceAllTextObject );
+ QPtrListIterator<KPrObject> it( lst );
+ for ( ; it.current() ; ++it )
+ {
+ if ( (it.current() == m_doc->header() && !hasHeader())
+ || (it.current() == m_doc->footer() && !hasFooter()) )
+ continue;
+ if (it.current()->getType()==OT_TEXT)
+ return true;
+ }
+ return false;
+}
+
+bool KPrPage::oneObjectTextSelected()
+{
+ return oneObjectTextExist(false);
+}
+
+
+bool KPrPage::isOneObjectSelected()
+{
+ return 0 != getSelectedObj();
+}
+
+bool KPrPage::haveASelectedPartObj()
+{
+ QPtrList<KPrObject> lst;
+ getAllObjectSelectedList(lst );
+ QPtrListIterator<KPrObject> it( lst );
+ for ( ; it.current(); ++it ) {
+ if (it.current()->getType() == OT_PART )
+ return true;
+ }
+ return false;
+}
+
+bool KPrPage::haveASelectedGroupObj()
+{
+ QPtrList<KPrObject> objects( getSelectedObjects( true ) );
+ QPtrListIterator<KPrObject> it( objects );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->getType() == OT_GROUP )
+ return true;
+ }
+ return false;
+}
+
+bool KPrPage::haveASelectedPixmapObj()
+{
+ QPtrList<KPrObject> lst;
+ getAllObjectSelectedList(lst );
+ QPtrListIterator<KPrObject> it( lst );
+ for ( ; it.current() ; ++it ) {
+ if (( it.current()->getType() == OT_PICTURE )
+ || ( it.current()->getType() == OT_CLIPART ) )
+ return true;
+ }
+ return false;
+}
+
+KoRect KPrPage::getRealRect( bool all ) const
+{
+ KoRect rect;
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()== m_doc->header() || it.current()== m_doc->footer())
+ continue;
+
+ if ( all || ( it.current()->isSelected() && ! it.current()->isProtect() ) )
+ rect |= it.current()->getRealRect();
+ }
+
+ return rect;
+}
+
+//return true if we change picture
+bool KPrPage::chPic( KPrView *_view)
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->isSelected() &&
+ ( ( it.current()->getType() == OT_PICTURE )
+ || ( it.current()->getType() == OT_CLIPART ) ) )
+ {
+ KPrPixmapObject* obj=dynamic_cast<KPrPixmapObject*>( it.current() );
+ if( obj)
+ {
+ _view->changePicture( obj->getFileName() );
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool KPrPage::savePicture( KPrView *_view ) const
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->isSelected() &&
+ ( ( it.current()->getType() == OT_PICTURE )
+ || ( it.current()->getType() == OT_CLIPART ) ) )
+ {
+ KPrPixmapObject* obj=dynamic_cast<KPrPixmapObject*>( it.current() );
+ if( obj)
+ {
+ _view->savePicture( obj );
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+// move object for releasemouseevent
+KCommand *KPrPage::moveObject(KPrView *_view, double diffx, double diffy)
+{
+ bool createCommand=false;
+ KPrMoveByCmd *moveByCmd=0L;
+ QPtrList<KPrObject> _objects;
+ _objects.setAutoDelete( false );
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ //don't move a header/footer
+ if ( it.current() == m_doc->header() || it.current() == m_doc->footer())
+ continue;
+ if ( it.current()->isSelected() && !it.current()->isProtect())
+ {
+ _objects.append( it.current() );
+ QRect br = _view->zoomHandler()->zoomRect( it.current()->getRepaintRect() );
+ br.moveBy( _view->zoomHandler()->zoomItX( diffx ), _view->zoomHandler()->zoomItY( diffy ) );
+ m_doc->repaint( br ); // Previous position
+ m_doc->repaint( it.current() ); // New position
+ createCommand=true;
+ }
+ }
+ if(createCommand) {
+ moveByCmd = new KPrMoveByCmd( i18n( "Move Objects" ), KoPoint( diffx, diffy ),
+ _objects, m_doc,this );
+
+ m_doc->updateSideBarItem( this );
+ }
+ return moveByCmd;
+}
+
+KCommand *KPrPage::moveObject(KPrView *m_view,const KoPoint &_move,bool key)
+{
+ QPtrList<KPrObject> _objects;
+ _objects.setAutoDelete( false );
+ KPrMoveByCmd *moveByCmd=0L;
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ //don't move a header/footer
+ if ( it.current()== m_doc->header() || it.current()== m_doc->footer())
+ continue;
+ if ( it.current()->isSelected() && !it.current()->isProtect()) {
+
+ QRect oldBoundingRect = m_view->zoomHandler()->zoomRect( it.current()->getRepaintRect() );
+
+ it.current()->moveBy( _move );
+ _objects.append( it.current() );
+ m_doc->repaint( oldBoundingRect );
+ m_doc->repaint( it.current() );
+ }
+ }
+
+ if ( key && !_objects.isEmpty())
+ moveByCmd = new KPrMoveByCmd( i18n( "Move Objects" ),
+ KoPoint( _move ),
+ _objects, m_doc,this );
+
+ return moveByCmd;
+}
+
+void KPrPage::repaintObj()
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->isSelected())
+ m_doc->repaint(it.current() );
+ }
+}
+
+KCommand *KPrPage::rotateSelectedObjects( float _newAngle, bool addAngle )
+{
+ KPrRotateCmd * cmd = NULL;
+
+ QPtrList<KPrObject> _objects;
+ _objects.setAutoDelete( false );
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()== m_doc->header() || it.current()== m_doc->footer() )
+ continue;
+ if( it.current()->isSelected() && !it.current()->isProtect())
+ {
+ _objects.append( it.current() );
+ }
+ }
+
+ if ( !_objects.isEmpty() ) {
+ cmd = new KPrRotateCmd( i18n( "Change Rotation" ), _newAngle, _objects, m_doc, addAngle );
+ cmd->execute();
+ }
+
+ return cmd;
+}
+
+
+KCommand *KPrPage::shadowObj(ShadowDirection dir,int dist, const QColor &col)
+{
+ KPrShadowCmd *shadowCmd=0L;
+ bool newShadow=false;
+ QPtrList<KPrObject> _objects;
+ QPtrList<KPrShadowCmd::ShadowValues> _oldShadow;
+ KPrShadowCmd::ShadowValues _newShadow, *tmp;
+
+ _objects.setAutoDelete( false );
+ _oldShadow.setAutoDelete( false );
+
+ _newShadow.shadowDirection = dir;
+ _newShadow.shadowDistance = dist;
+ _newShadow.shadowColor = col;
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ //don't shadow a header/footer
+ if ( it.current()== m_doc->header() || it.current()== m_doc->footer())
+ continue;
+
+ if ( it.current()->isSelected() ) {
+ tmp = new KPrShadowCmd::ShadowValues;
+ tmp->shadowDirection = it.current()->getShadowDirection();
+ tmp->shadowDistance =it.current()->getShadowDistance();
+ tmp->shadowColor = it.current()->getShadowColor();
+
+ if(!newShadow &&( tmp->shadowDirection!=_newShadow.shadowDirection
+ || tmp->shadowDistance!=_newShadow.shadowDistance
+ || tmp->shadowColor!=_newShadow.shadowColor))
+ newShadow=true;
+
+ _oldShadow.append( tmp );
+ _objects.append( it.current() );
+ }
+ }
+
+ if ( !_objects.isEmpty() && newShadow ) {
+ shadowCmd = new KPrShadowCmd( i18n( "Change Shadow" ),
+ _oldShadow, _newShadow, _objects, m_doc );
+ shadowCmd->execute();
+ }
+ else
+ {
+ _oldShadow.setAutoDelete( true );
+ _oldShadow.clear();
+ }
+ return shadowCmd;
+}
+
+QPtrList<KoTextObject> KPrPage::allTextObjects() const
+{
+ QPtrList<KoTextObject> lst;
+ addTextObjects( lst );
+ return lst;
+}
+
+void KPrPage::addTextObjects(QPtrList<KoTextObject>& lst) const
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ it.current()->addTextObjects( lst );
+}
+
+KPrObject * KPrPage::getCursor( const QPoint &pos )
+{
+ return getCursor( m_doc->zoomHandler()->unzoomPoint( pos ) );
+}
+
+KPrObject * KPrPage::getCursor(const KoPoint &pos )
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ KPrObject *kpobject = it.toLast();
+ while ( kpobject ) {
+ if ( kpobject->contains( pos ) && kpobject->isSelected() )
+ return kpobject;
+ kpobject = --it;
+ }
+ return 0L;
+}
+
+KPrObject* KPrPage::getObjectAt( const KoPoint &pos, bool withoutProtected ) const
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ KPrObject *o = 0;
+ //tz Check first if there is a selected object at this pos!
+ for ( int i = 0; i < 2; ++i )
+ {
+ o = it.toLast();
+ while ( o ) {
+ if ( o != m_doc->footer() ||
+ o != m_doc->header() ||
+ ( m_bHasFooter && o == m_doc->footer() ) ||
+ ( m_bHasHeader && o == m_doc->header() ) )
+ {
+ if ( ( o->isSelected() || i > 0 ) &&
+ o->contains( pos ) && !( o->isProtect() && withoutProtected ) )
+ return o;
+ }
+ o = --it;
+ }
+ }
+ return 0L;
+}
+
+KPrPixmapObject * KPrPage::picViewOrigHelper() const
+{
+ KPrPixmapObject *obj=0L;
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->isSelected() &&
+ ( ( it.current()->getType() == OT_PICTURE )
+ || ( it.current()->getType() == OT_CLIPART ) ) )
+ {
+ obj=(KPrPixmapObject*)it.current();
+ break;
+ }
+ }
+ return obj;
+}
+
+void KPrPage::applyStyleChange( KoStyleChangeDefMap changed )
+{
+ QPtrList<KPrObject> lst;
+ getAllObjectSelectedList(lst,true /*force*/ );
+ QPtrListIterator<KPrObject> it( lst );
+
+ for ( ; it.current() ; ++it )
+ {
+ KPrTextObject *obj=dynamic_cast<KPrTextObject*>(it.current());
+ if( obj)
+ obj->applyStyleChange( changed );
+ }
+}
+
+void KPrPage::reactivateBgSpellChecking(bool refreshTextObj)
+{
+ QPtrList<KPrObject> lst;
+ getAllObjectSelectedList(lst,true /*force*/ );
+ QPtrListIterator<KPrObject> oIt( lst );
+
+ for ( ; oIt.current() ; ++oIt )
+ {
+ if(oIt.current()->getType()==OT_TEXT)
+ {
+ static_cast<KPrTextObject*>( oIt.current() )->textObject()->setNeedSpellCheck(true);
+ if(refreshTextObj)
+ m_doc->repaint( oIt.current() );
+ }
+ }
+}
+
+bool KPrPage::canMoveOneObject() const
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ //don't test header/footer all the time sticky
+ if ( it.current()== m_doc->header() || it.current()== m_doc->footer())
+ continue;
+ if(it.current()->isSelected()&& !it.current()->isProtect())
+ return true;
+ }
+ return false;
+}
+
+KCommand *KPrPage::alignVertical( VerticalAlignmentType _type )
+{
+ KMacroCommand *macro = 0L;
+ QPtrList<KPrObject> lst;
+ getAllObjectSelectedList(lst );
+ QPtrListIterator<KPrObject> it( lst );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->getType()==OT_TEXT)
+ {
+ KPrTextObject *obj = dynamic_cast<KPrTextObject *>(it.current());
+ if ( obj && !obj->isProtectContent())
+ {
+ KPrChangeVerticalAlignmentCommand * cmd = new KPrChangeVerticalAlignmentCommand( i18n("Change Vertical Alignment"),
+ obj, obj->verticalAlignment(),_type, m_doc);
+ if ( !macro )
+ macro = new KMacroCommand( i18n("Change Vertical Alignment"));
+ macro->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+ }
+ return macro;
+}
+
+void KPrPage::changeTabStopValue ( double _tabStop )
+{
+ QPtrList<KPrObject> lst;
+ getAllObjectSelectedList(lst,true /*force*/ );
+ QPtrListIterator<KPrObject> it( lst );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->getType()==OT_TEXT)
+ {
+ KPrTextObject *obj = dynamic_cast<KPrTextObject *>(it.current());
+ if ( obj )
+ {
+ obj->textDocument()->setTabStops( m_doc->zoomHandler()->ptToLayoutUnitPixX( _tabStop ));
+ obj->layout();
+ m_doc->repaint( obj );
+ }
+ }
+ }
+}
+
+KPrObject *KPrPage::nextTextObject(KPrTextObject *obj)
+{
+ if ( m_objectList.count()==0 )
+ return 0L;
+ int pos = -1;
+ if ( obj )
+ pos = m_objectList.findNextRef(obj);
+
+ if (pos != -1 )
+ {
+ KPrObject *frm=0L;
+ for ( frm=m_objectList.at(pos); frm != 0; frm=m_objectList.next() )
+ {
+ KPrTextObject *newObj = frm->nextTextObject();
+ if(newObj && newObj->nextTextObject()->textObject()->needSpellCheck())
+ return frm;
+ }
+ }
+ else
+ {
+ KPrObject *frm=0L;
+ for ( frm=m_objectList.at(0); frm != 0; frm=m_objectList.next() )
+ {
+ KPrTextObject *newObj = frm->nextTextObject();
+ if(newObj && newObj->nextTextObject()->textObject()->needSpellCheck())
+ return frm;
+ }
+ }
+ return 0L;
+}
+
+bool KPrPage::findTextObject( KPrObject *obj )
+{
+ return (m_objectList.findRef( obj )>=0 );
+}
+
+void KPrPage::getAllObjectSelectedList(QPtrList<KPrObject> &lst, bool force )
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ it.current()->getAllObjectSelectedList( lst,force );
+}
+
+void KPrPage::getAllEmbeddedObjectSelected(QPtrList<KoDocumentChild> &embeddedObjects )
+{
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->isSelected() && it.current()->getType() == OT_PART )
+ embeddedObjects.append( static_cast<KPrPartObject *>(it.current())->getChild() );
+ }
+}
+
+KPrPixmapObject* KPrPage::getSelectedImage() const
+{
+ KPrPixmapObject *obj=0L;
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current() ; ++it )
+ {
+ if ( it.current()->isSelected() && it.current()->getType() == OT_PICTURE )
+ {
+ obj=dynamic_cast<KPrPixmapObject*>(it.current());
+ break;
+ }
+ }
+ return obj;
+}
+
+KCommand * KPrPage::setImageEffect(ImageEffect eff, QVariant param1, QVariant param2, QVariant param3)
+{
+ bool changed = false;
+ KPrImageEffectCmd *imageEffectCmd = 0L;
+ QPtrList<KPrObject> _objects;
+ QPtrList<KPrImageEffectCmd::ImageEffectSettings> _oldSettings;
+ KPrImageEffectCmd::ImageEffectSettings _newSettings, *tmp;
+
+ _objects.setAutoDelete( false );
+ _oldSettings.setAutoDelete( false );
+
+ _newSettings.effect = eff;
+ _newSettings.param1 = param1;
+ _newSettings.param2 = param2;
+ _newSettings.param3 = param3;
+
+ QPtrListIterator<KPrObject> it( m_objectList );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->getType() == OT_PICTURE && it.current()->isSelected()) {
+ tmp = new KPrImageEffectCmd::ImageEffectSettings;
+ tmp->effect = static_cast<KPrPixmapObject*>(it.current())->getImageEffect();
+ tmp->param1 = static_cast<KPrPixmapObject*>(it.current())->getIEParam1();
+ tmp->param2 = static_cast<KPrPixmapObject*>(it.current())->getIEParam2();
+ tmp->param3 = static_cast<KPrPixmapObject*>(it.current())->getIEParam3();
+ _oldSettings.append( tmp );
+ _objects.append( it.current() );
+
+ if( !changed && ( tmp->effect != _newSettings.effect
+ || tmp->param1 != _newSettings.param1
+ || tmp->param2 != _newSettings.param2
+ || tmp->param3 != _newSettings.param3 ) )
+ changed = true;
+ }
+ }
+
+ if ( !_objects.isEmpty() && changed ) {
+ imageEffectCmd = new KPrImageEffectCmd( i18n( "Change Image Effect" ), _oldSettings, _newSettings,
+ _objects, m_doc );
+ imageEffectCmd->execute();
+ }
+ else {
+ _oldSettings.setAutoDelete( true );
+ _oldSettings.clear();
+ }
+
+ m_doc->setModified( true );
+
+ return imageEffectCmd;
+}
+
+void KPrPage::setHeader( bool b, bool _updateDoc )
+{
+ m_bHasHeader = b;
+ if ( _updateDoc )
+ m_doc->setHeader(b);
+}
+
+void KPrPage::setFooter( bool b, bool _updateDoc )
+{
+ m_bHasFooter = b;
+ if ( _updateDoc )
+ m_doc->setFooter( b );
+}
+
+void KPrPage::setUseMasterBackground( bool useMasterBackground )
+{
+ m_useMasterBackground = useMasterBackground;
+}
+
+bool KPrPage::useMasterBackground() const
+{
+ return m_useMasterBackground;
+}
+
+bool KPrPage::isMasterPage() const
+{
+ return ( m_masterPage==0 );
+}
+
+void KPrPage::setDisplayObjectFromMasterPage( bool _b )
+{
+ m_displayObjectFromMasterPage = _b;
+ m_doc->setDisplayObjectMasterPage( _b );
+}
+
+void KPrPage::setDisplayBackground( bool _b )
+{
+ m_displayBackground = _b;
+ m_doc->setDisplayBackground( _b );
+}
+
+
diff --git a/kpresenter/KPrPage.h b/kpresenter/KPrPage.h
new file mode 100644
index 000000000..533e1e0cf
--- /dev/null
+++ b/kpresenter/KPrPage.h
@@ -0,0 +1,607 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+ Copyright (C) 2004-2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRPAGE_H
+#define KPRPAGE_H
+
+#include <qwidget.h>
+#include <qptrlist.h>
+#include "global.h"
+#include <KoBrush.h>
+#include <KoPoint.h>
+#include <KoRect.h>
+#include <KoStyleCollection.h> // for KoStyleChangeDefMap
+#include <qvariant.h>
+#include <KoDocumentChild.h>
+#include <KoPictureCollection.h>
+
+class KMacroCommand;
+class KoSavingContext;
+class KURL;
+class KPrTextView;
+class KPrObject;
+class KPrDocument;
+class KPrView;
+class KoDocumentEntry;
+class KoPageLayout;
+class KCommand;
+class KoPointArray;
+class DCOPObject;
+class KPrTextObject;
+class KoTextObject;
+class KPrPixmapObject;
+class KPrPartObject;
+class KPrBackGround;
+
+class KoXmlWriter;
+class KoGenStyles;
+class KoPen;
+
+
+class KPrPage
+{
+public:
+ /**
+ * @brief Constructor
+ *
+ * @param doc pointer to the kpresenter document
+ * @param masterPage master page, 0 if it is a master page
+ */
+ KPrPage(KPrDocument *_doc, KPrPage *masterPage = 0 );
+
+ /**
+ * @brief Desctructor
+ */
+ virtual ~KPrPage();
+
+ /**
+ * @brief Return a DCOP interface for this page
+ */
+ virtual DCOPObject* dcopObject();
+
+ /**
+ * @brief Return a DCOP interface for this page
+ */
+ KPrDocument * kPresenterDoc() const {return m_doc; }
+
+ /**
+ * @brief Get the manual title
+ *
+ * @return the manual title
+ */
+ QString manualTitle()const;
+
+ /**
+ * @brief Set the manual title
+ *
+ * @param title which sould be set
+ */
+ void insertManualTitle(const QString & title);
+
+ /**
+ * @brief Get the page title.
+ *
+ * The page title is found out like following:
+ * - If a manual title is set the manual title is returned.
+ * - If there are text objects on the page the title is generated
+ * for the first paragraph of top most text object.
+ * - If a title is passed to the function it is returned
+ * - Slide %PAGENUMBER or Master Slide
+ */
+ QString pageTitle( const QString &_title = QString() ) const;
+
+ /**
+ * @brief Set the note text
+ *
+ * @param text which should be set
+ */
+ void setNoteText( const QString &_text );
+
+ /**
+ * @brief Get the note text
+ *
+ * @return the text of the note
+ */
+ QString noteText( )const;
+
+ /**
+ * @brief Set the master page to masterPage
+ *
+ * @param masterpage to set
+ */
+ void setMasterPage( KPrPage *_masterPage ) { m_masterPage = _masterPage; }
+
+ /**
+ * @brief Get the master page
+ *
+ * @return the master page, 0 if it is a master page
+ */
+ KPrPage * masterPage() const { return m_masterPage; }
+
+ /**
+ * @brief Check if page is a master page
+ *
+ * @return true if master page
+ * @return false otherwise
+ */
+ bool isMasterPage() const;
+
+ /**
+ * @brief Get object list
+ *
+ * @return object list
+ */
+ const QPtrList<KPrObject> & objectList() const { return m_objectList; }
+
+ /**
+ * @brief Get object at position
+ *
+ * @param pos position of object
+ *
+ * @return object at position num
+ */
+ KPrObject *getObject( int num );
+
+ /**
+ * @brief Appends object to page
+ *
+ * Appends the object to the page. The name of the object
+ * is unified.
+ *
+ * @param obj object to append
+ */
+ void appendObject( KPrObject *_obj );
+
+ /**
+ * @brief Appends object to page
+ *
+ * Appends the objects to the page. The name of the objects
+ * is unified.
+ *
+ * @param obj objects to append
+ */
+ void appendObjects( const QValueList<KPrObject *> &objects );
+
+ /**
+ * @brief Replaces an object
+ *
+ * The object oldObject by the object newObject
+ *
+ * @param oldObject object which will be removed from the page
+ * @param newObject object which will take the place of the oldObject
+ */
+ void replaceObject( KPrObject *oldObject, KPrObject *newObject );
+
+ /**
+ * @brief Take object from page
+ *
+ * @param object to be take from page
+ *
+ * @return the position of the taken object
+ */
+ int takeObject( KPrObject *object );
+
+ /**
+ * @brief Delete selected objects from page
+ *
+ * The returned command will be executed.
+ *
+ * @return KCommand the command
+ * @return 0 if no object is selected
+ */
+ KCommand * deleteSelectedObjects();
+
+ /**
+ * @brief Insert object in page
+ *
+ * Inserts the object at pos to the page. The name of the object
+ * is unified.
+ *
+ * @param object to insert
+ * @param position the object should be insert
+ */
+ void insertObject( KPrObject *object, int pos );
+
+ /**
+ * @brief
+ */
+ void completeLoading( bool _clean, int lastObj );
+
+ /**
+ * @brief Create a uniq name for an object.
+ *
+ * Create a uniq name for the object. If no name is set for the object
+ * a name according to its type is created. If the name already exists
+ * append ' (x)'. // FIXME: not allowed by I18N
+ *
+ * @param object to work on
+ */
+ void unifyObjectName( KPrObject *object );
+
+ /**
+ * @brief Get the page rect
+ *
+ * @return the page rect
+ */
+ KoRect getPageRect() const;
+
+ /**
+ * @brief Get the page rect with applied zoom
+ *
+ * @return the page rect
+ */
+ QRect getZoomPageRect()const;
+
+ /**
+ * @brief Set object for the page
+ *
+ * @param list of objects
+ */
+ void setObjectList( QPtrList<KPrObject> objectLlist ) {
+ m_objectList.setAutoDelete( false ); m_objectList = objectLlist; m_objectList.setAutoDelete( false );
+ }
+
+ /**
+ * @brief Get the number ob objects on the page
+ *
+ * @return the number of objects on the page
+ */
+ unsigned int objNums() const { return m_objectList.count(); }
+
+ /**
+ * @brief Get the number of text objects
+ *
+ * The functions in only used by KPrPageIface.
+ *
+ * @return the number os text object on the page
+ */
+ int numTextObject() const;
+ /**
+ * @brief Get the text object
+ *
+ * The functions in only used by KPrPageIface.
+ *
+ * @param num the number of the text object to get
+ *
+ * @return the text object with the number
+ * @return 0 if no such object exists
+ */
+ KPrTextObject *textFrameSet( unsigned int _num ) const;
+
+ /**
+ * @brief Get the amount of selected objects
+ *
+ * @return the amount of select objects
+ */
+ int numSelected() const;
+
+ /**
+ * @brief
+ */
+ void pasteObjs( const QByteArray & data, int nbCopy = 1, double angle = 0.0 ,
+ double _increaseX=0.0, double increaseY = 0.0, double moveX=0.0, double moveY=0.0);
+
+ /**
+ * @brief
+ */
+ KCommand * replaceObjs( bool createUndoRedo, double _orastX, double _orastY,
+ const QColor & _txtBackCol, const QColor & _otxtBackCol);
+
+ /**
+ * @brief
+ */
+ void copyObjs(QDomDocument &doc, QDomElement &presenter, QValueList<KoPictureKey> & lst) const;
+
+ /**
+ * @brief Get the first selected object
+ *
+ * @return the first selected object of this page
+ * @return O if none exists
+ */
+ KPrObject* getSelectedObj() const;
+
+ /**
+ * @brief Get a list of all selected objects
+ *
+ * @param withoutHeaderFooter if true a selected header
+ * or footer will not be in the list returned.
+ *
+ * @return list of selected objets.
+ */
+ QPtrList<KPrObject> getSelectedObjects( bool withoutHeaderFooter = false ) const;
+
+ /**
+ * @brief Get the first selected pictur
+ *
+ * @return first selected picture
+ * @return 0 if none is selected
+ */
+ KPrPixmapObject* getSelectedImage() const;
+
+ /**
+ * @brief Set the image effect for all selected pictures
+ *
+ * @param eff image effect
+ * @param param1 effect parameter 1
+ * @param param1 effect parameter 2
+ * @param param1 effect parameter 3
+ */
+ KCommand * setImageEffect(ImageEffect eff, QVariant param1, QVariant param2, QVariant param3);
+
+ /**
+ * @brief Group selected objects.
+ *
+ * This will create a KPrGroupObjCmd, executes it and adds it to the history.
+ * If less than 2 objects are selected nothing happens.
+ */
+ void groupObjects();
+
+ /**
+ * @brief Ungroup all selected group objects
+ *
+ * @param macro to store the commands in
+ */
+ void ungroupObjects( KMacroCommand ** macro );
+
+ /**
+ * @brief
+ */
+ void raiseObjs( bool forward );
+
+ /**
+ * @brief
+ */
+ void lowerObjs( bool backward );
+
+ KCommand* setPen( const KoPen &pen, LineEnd lb, LineEnd le, int flags );
+ KCommand* setBrush( const QBrush &brush, FillType ft, const QColor& g1, const QColor &g2,
+ BCType gt, bool unbalanced, int xfactor, int yfactor, int flags );
+
+ /**
+ * Insert an object into the page
+ */
+ KCommand * insertObject( const QString &name, KPrObject * object, const KoRect &r, bool addCommand = true );
+
+ virtual KPrPartObject* insertObject( const KoRect&, KoDocumentEntry& );
+
+ void insertRectangle( const KoRect &r, const KoPen & pen, const QBrush &brush, FillType ft,
+ const QColor &g1, const QColor & g2,BCType gt, int rndX, int rndY,
+ bool unbalanced, int xfactor, int yfactor );
+
+ void insertCircleOrEllipse( const KoRect &r, const KoPen &pen, const QBrush &brush, FillType ft,
+ const QColor &g1, const QColor &g2, BCType gt, bool unbalanced, int xfactor, int yfactor );
+
+ void insertPie( const KoRect &r, const KoPen &pen, const QBrush &brush, FillType ft,
+ const QColor &g1, const QColor &g2,BCType gt, PieType pt, int _angle, int _len,
+ LineEnd lb,LineEnd le,bool unbalanced, int xfactor, int yfactor );
+
+ KPrTextObject* insertTextObject( const KoRect& r, const QString& text = QString::null, KPrView *_view = 0L );
+ void insertLine( const KoRect &r, const KoPen &pen, LineEnd lb, LineEnd le, LineType lt );
+
+ void insertAutoform( const KoRect &r, const KoPen &pen, const QBrush &brush, LineEnd lb, LineEnd le,
+ FillType ft,const QColor &g1, const QColor &g2, BCType gt, const QString &fileName,
+ bool unbalanced,int xfactor, int yfactor );
+
+ void insertFreehand( const KoPointArray &points, const KoRect &r, const KoPen &pen,LineEnd lb, LineEnd le );
+ void insertPolyline( const KoPointArray &points, const KoRect &r, const KoPen &pen,LineEnd lb, LineEnd le );
+ void insertQuadricBezierCurve( const KoPointArray &points, const KoPointArray &allPoints, const KoRect &r,
+ const KoPen &pen,LineEnd lb, LineEnd le );
+ void insertCubicBezierCurve( const KoPointArray &points, const KoPointArray &allPoints, const KoRect &r,
+ const KoPen &pen,LineEnd lb, LineEnd le );
+
+ void insertPolygon( const KoPointArray &points, const KoRect &r, const KoPen &pen, const QBrush &brush,
+ FillType ft,const QColor &g1, const QColor &g2, BCType gt, bool unbalanced,
+ int xfactor, int yfactor, bool _checkConcavePolygon, int _cornersValue, int _sharpnessValue );
+
+ void insertClosedLine( const KoPointArray &points, const KoRect &r, const KoPen &pen, const QBrush &brush,
+ FillType ft,const QColor &g1, const QColor &g2,
+ BCType gt, bool unbalanced, int xfactor, int yfactor, ToolEditMode _mode );
+
+ void slotRepaintVariable();
+ void recalcPageNum();
+ void changePicture( const KURL & url, QWidget *parent );
+ void insertPicture( const QString &filename, const KoPoint &pos );
+ void insertPicture( const QString &_file, const KoRect &_rect );
+
+ void enableEmbeddedParts( bool f );
+
+ KPrBackGround *background() { return m_kpbackground; }
+
+ void makeUsedPixmapList();
+
+ void setBackColor( const QColor &backColor1, const QColor &backColor2, BCType bcType,
+ bool unbalanced, int xfactor, int yfactor );
+ void setBackPicture( const KoPictureKey & key );
+ bool getBackUnbalanced( )const;
+ void setBackView( BackView backView );
+ void setBackType( BackType backType );
+
+ void setPageEffect( PageEffect pageEffect );
+ void setPageEffectSpeed( EffectSpeed pageEffectSpeed );
+ void setPageTimer( int pageTimer );
+ void setPageSoundEffect( bool soundEffect );
+ void setPageSoundFileName( const QString &fileName );
+ BackType getBackType( ) const ;
+ BackView getBackView( )const ;
+ KoPictureKey getBackPictureKey( )const ;
+ KoPicture getBackPicture( )const ;
+ QColor getBackColor1( )const ;
+ QColor getBackColor2()const ;
+ int getBackXFactor()const ;
+ int getBackYFactor( )const;
+ BCType getBackColorType( )const;
+ PageEffect getPageEffect( )const;
+ EffectSpeed getPageEffectSpeed() const;
+ int getPageTimer( )const;
+ bool getPageSoundEffect( )const;
+ QString getPageSoundFileName()const;
+
+
+ void setUseMasterBackground( bool useMasterBackground );
+ bool useMasterBackground() const;
+
+ /**
+ * return the list of steps where objects appear/disappear.
+ */
+ QValueList<int> getEffectSteps() const;
+
+ bool isSlideSelected() const {return m_selectedSlides;}
+ void slideSelected(bool _b){m_selectedSlides=_b;}
+
+ void setInsPictureFile( const QString &_file ) { m_pictureFile = _file; }
+
+ QString insPictureFile() const { return m_pictureFile; }
+
+ void deSelectAllObj();
+ void deSelectObj( KPrObject *kpobject );
+ QDomElement saveObjects( QDomDocument &doc, QDomElement &objects, double yoffset,
+ int saveOnlyPage ) const;
+
+ bool oneObjectTextExist(bool forceAllTextObject = true) ;
+ bool oneObjectTextSelected();
+ bool isOneObjectSelected();
+ bool haveASelectedPartObj();
+ bool haveASelectedGroupObj();
+ bool haveASelectedPixmapObj();
+
+ /**
+ * @brief get the rect for the objects
+ *
+ * @param all true if the rect for all objects shoud be returned
+ * false if only the rect for selected objects sould be returned
+ *
+ * @return rect of the objects
+ */
+ KoRect getRealRect( bool all ) const;
+ bool chPic( KPrView *_view);
+
+ //return command when we move object
+ KCommand *moveObject(KPrView *_view, double diffx, double diffy);
+ KCommand *moveObject(KPrView *m_view,const KoPoint &_move,bool key);
+
+ KCommand *rotateSelectedObjects(float _newAngle, bool addAngle=false);
+ KCommand *shadowObj(ShadowDirection dir,int dist, const QColor &col);
+
+ QPtrList<KoTextObject> allTextObjects() const;
+ void addTextObjects(QPtrList<KoTextObject>& lst) const;
+
+ void repaintObj();
+
+ KPrObject * getCursor(const QPoint &pos );
+ KPrObject * getCursor(const KoPoint &pos );
+
+ /**
+ * Returns the object at position pos
+ * @param pos the position in the document on which to look
+ * @param withoutProtected if set to true only unprotecred objects are returned
+ * @return the object at position pos
+ */
+ KPrObject* getObjectAt( const KoPoint &pos, bool withoutProtected = false ) const;
+ KPrPixmapObject * picViewOrigHelper() const;
+ void applyStyleChange( KoStyleChangeDefMap changed );
+
+ void reactivateBgSpellChecking(bool refreshTextObj);
+
+ bool canMoveOneObject() const;
+ KCommand *alignVertical( VerticalAlignmentType _type );
+ void changeTabStopValue ( double _tabStop );
+ bool savePicture( KPrView *_view ) const;
+ bool findTextObject( KPrObject *obj );
+ KPrObject *nextTextObject(KPrTextObject *obj);
+
+ void getAllObjectSelectedList(QPtrList<KPrObject> &lst,bool force = false );
+ void getAllEmbeddedObjectSelected(QPtrList<KoDocumentChild> &embeddedObjects );
+
+ void load( const QDomElement &element );
+ void loadOasis( KoOasisContext & context );
+
+ QDomElement save( QDomDocument &doc );
+
+ bool saveOasisPage( KoStore *store, KoXmlWriter &xmlWriter, int posPage, KoSavingContext& context,
+ int & indexObj, int &partIndexObj, KoXmlWriter* manifestWriter, QMap<QString, int> &pageNames ) const;
+ QString saveOasisPageStyle( KoStore *store, KoGenStyles& mainStyles ) const;
+ QString saveOasisPageEffect() const;
+ QString saveOasisAdditionalPageEffect() const;
+ bool saveOasisNote( KoXmlWriter &xmlWriter ) const;
+
+ bool hasHeader() const { return m_bHasHeader; }
+ bool hasFooter() const { return m_bHasFooter; }
+ void setHeader( bool b, bool _updateDoc = true );
+ void setFooter( bool b, bool _updateDoc = true );
+
+ void setDisplayObjectFromMasterPage( bool _b );
+ bool displayObjectFromMasterPage() const { return m_displayObjectFromMasterPage;}
+
+ void setDisplayBackground( bool _b );
+ bool displayBackground() const { return m_displayBackground; }
+
+ QString oasisNamePage( int posPage ) const;
+
+private:
+ void makeUsedPixmapListForGroupObject( KPrObject *_obj );
+ void completeLoadingForGroupObject( KPrObject *_obj );
+ bool objectNameExists( KPrObject *object, QPtrList<KPrObject> &list );
+ void saveOasisObject( KoStore *store, KoXmlWriter &xmlWriter, KoSavingContext& context, int & indexObj, int &partIndexObj, KoXmlWriter* manifestWriter ) const;
+
+
+ // list of objects
+ QPtrList<KPrObject> m_objectList;
+ KPrDocument *m_doc;
+ KPrPage *m_masterPage;
+ KPrBackGround *m_kpbackground;
+ QString m_manualTitle;
+ QString m_noteText;
+ DCOPObject *m_dcop;
+ bool m_selectedSlides;
+
+ QString m_pictureFile;
+ bool m_bHasHeader, m_bHasFooter;
+ bool m_useMasterBackground;
+
+
+ bool m_displayObjectFromMasterPage;
+
+ bool m_displayBackground;
+
+ /**
+ * The page effect
+ */
+ PageEffect m_pageEffect;
+ /**
+ * The speed of the page effect.
+ */
+ EffectSpeed m_pageEffectSpeed;
+
+ /**
+ * true when a sound effect will be played when going to this page
+ */
+ // ### This could be simply !soundFileName.isEmpty()...
+ bool m_soundEffect;
+ /**
+ * Sound played when showing this page
+ */
+ QString m_soundFileName;
+ /**
+ * TODO
+ */
+ int m_pageTimer;
+};
+#endif //KPRPAGE_H
diff --git a/kpresenter/KPrPageEffects.cpp b/kpresenter/KPrPageEffects.cpp
new file mode 100644
index 000000000..d98f51414
--- /dev/null
+++ b/kpresenter/KPrPageEffects.cpp
@@ -0,0 +1,1590 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2002 Ariya Hidayat <ariya@kde.org>
+ Copyright (C) 2002 Harri Porten <porten@kde.org>
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPageEffects.h"
+
+#include <qpixmap.h>
+#include <qwidget.h>
+#include <qwmatrix.h>
+
+#include <kapplication.h>
+#include <kdebug.h>
+#include <krandomsequence.h>
+
+
+KPrPageEffects::KPrPageEffects( QPaintDevice *dst, const QPixmap &pageTo, PageEffect effect, EffectSpeed speed )
+: m_dst( dst ), m_pageTo( pageTo ), m_pageFrom(m_pageTo.width(),m_pageTo.height()), m_effect(effect), m_speed(speed), m_effectStep(0)
+, m_width(m_pageTo.width()), m_height(m_pageTo.height()), m_finished(false)
+{
+ if ( m_effect == PEF_RANDOM )
+ {
+ KRandomSequence random;
+ m_randomEffect = static_cast<PageEffect>( random.getLong( PEF_LAST_MARKER ) );
+ }
+ int div[] = { 100, 65, 30 };
+
+ m_stepWidth = (int) ( m_width / div[m_speed] );
+ m_stepHeight = (int) ( m_height / div[m_speed] );
+}
+
+
+KPrPageEffects::~KPrPageEffects()
+{
+}
+
+
+bool KPrPageEffects::doEffect()
+{
+ if ( !m_finished )
+ {
+ PageEffect effect = m_effect == PEF_RANDOM ? m_randomEffect : m_effect;
+ switch ( effect )
+ {
+ case PEF_NONE:
+ m_finished = effectNone();
+ break;
+ case PEF_CLOSE_HORZ:
+ m_finished = effectCloseHorizontal();
+ break;
+ case PEF_CLOSE_VERT:
+ m_finished = effectCloseVertical();
+ break;
+ case PEF_CLOSE_ALL:
+ m_finished = effectCloseFromAllDirections();
+ break;
+ case PEF_OPEN_HORZ:
+ m_finished = effectOpenHorizontal();
+ break;
+ case PEF_OPEN_VERT:
+ m_finished = effectOpenVertical();
+ break;
+ case PEF_OPEN_ALL:
+ m_finished = effectOpenFromAllDirections();
+ break;
+ case PEF_INTERLOCKING_HORZ_1:
+ m_finished = effectInterlockingHorizontal1();
+ break;
+ case PEF_INTERLOCKING_HORZ_2:
+ m_finished = effectInterlockingHorizontal2();
+ break;
+ case PEF_INTERLOCKING_VERT_1:
+ m_finished = effectInterlockingVertical1();
+ break;
+ case PEF_INTERLOCKING_VERT_2:
+ m_finished = effectInterlockingVertical2();
+ break;
+ case PEF_SURROUND1:
+ m_finished = effectSurround1();
+ break;
+ case PEF_FLY1:
+ m_finished = effectFlyAway1();
+ break;
+ case PEF_BLINDS_HOR:
+ m_finished = effectBlindsHorizontal();
+ break;
+ case PEF_BLINDS_VER:
+ m_finished = effectBlindsVertical();
+ break;
+ case PEF_BOX_IN:
+ m_finished = effectBoxIn();
+ break;
+ case PEF_BOX_OUT:
+ m_finished = effectBoxOut();
+ break;
+ case PEF_CHECKBOARD_ACROSS:
+ m_finished = effectCheckboardAcross();
+ break;
+ case PEF_CHECKBOARD_DOWN:
+ m_finished = effectCheckboardDown();
+ break;
+ case PEF_COVER_DOWN:
+ m_finished = effectCoverDown();
+ break;
+ case PEF_UNCOVER_DOWN:
+ m_finished = effectUncoverDown();
+ break;
+ case PEF_COVER_UP:
+ m_finished = effectCoverUp();
+ break;
+ case PEF_UNCOVER_UP:
+ m_finished = effectUncoverUp();
+ break;
+ case PEF_COVER_LEFT:
+ m_finished = effectCoverLeft();
+ break;
+ case PEF_UNCOVER_LEFT:
+ m_finished = effectUncoverLeft();
+ break;
+ case PEF_COVER_RIGHT:
+ m_finished = effectCoverRight();
+ break;
+ case PEF_UNCOVER_RIGHT:
+ m_finished = effectUncoverRight();
+ break;
+ case PEF_COVER_LEFT_UP:
+ m_finished = effectCoverLeftUp();
+ break;
+ case PEF_UNCOVER_LEFT_UP:
+ m_finished = effectUncoverLeftUp();
+ break;
+ case PEF_COVER_LEFT_DOWN:
+ m_finished = effectCoverLeftDown();
+ break;
+ case PEF_UNCOVER_LEFT_DOWN:
+ m_finished = effectUncoverLeftDown();
+ break;
+ case PEF_COVER_RIGHT_UP:
+ m_finished = effectCoverRightUp();
+ break;
+ case PEF_UNCOVER_RIGHT_UP:
+ m_finished = effectUncoverRightUp();
+ break;
+ case PEF_COVER_RIGHT_DOWN:
+ m_finished = effectCoverRightDown();
+ break;
+ case PEF_UNCOVER_RIGHT_DOWN:
+ m_finished = effectUncoverRightDown();
+ break;
+ case PEF_DISSOLVE:
+ m_finished = effectDissolve();
+ break;
+ case PEF_STRIPS_LEFT_UP:
+ m_finished = effectStripesLeftUp();
+ break;
+ case PEF_STRIPS_LEFT_DOWN:
+ m_finished = effectStripesLeftDown();
+ break;
+ case PEF_STRIPS_RIGHT_UP:
+ m_finished = effectStripesRightUp();
+ break;
+ case PEF_STRIPS_RIGHT_DOWN:
+ m_finished = effectStripesRigthDown();
+ break;
+ case PEF_MELTING:
+ m_finished = effectMelting();
+ break;
+ default:
+ m_finished = effectCloseHorizontal();
+ break;
+ }
+ ++m_effectStep;
+ }
+ return m_finished;
+}
+
+
+void KPrPageEffects::finish()
+{
+ if ( !m_finished )
+ {
+ bitBlt( m_dst, 0, 0, &m_pageTo );
+ m_finished = true;
+ }
+}
+
+
+bool KPrPageEffects::effectNone() const
+{
+ bitBlt( m_dst, 0, 0, &m_pageTo );
+ return true;
+}
+
+
+bool KPrPageEffects::effectCloseHorizontal() const
+{
+ int h = m_effectStep * m_stepHeight;
+
+ bool finished = false;
+ if ( h >= m_height / 2 )
+ {
+ h = m_height / 2;
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, 0, &m_pageTo, 0, m_height / 2 - h, m_width, h );
+ bitBlt( m_dst, 0, m_height - h, &m_pageTo, 0, m_height / 2, m_width, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCloseVertical() const
+{
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( w >= m_width / 2 )
+ {
+ w = m_width / 2;
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, 0, &m_pageTo, m_width / 2 - w, 0, w, m_height );
+ bitBlt( m_dst, m_width - w, 0, &m_pageTo, m_width / 2, 0, w, m_height );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCloseFromAllDirections() const
+{
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height / 2 )
+ {
+ h = m_height / 2;
+ }
+ if ( w >= m_width / 2 )
+ {
+ w = m_width / 2;
+ }
+ if ( h >= m_height / 2 && w >= m_width / 2 )
+ {
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, 0, &m_pageTo, m_width / 2 - w, m_height / 2 - h, w, h );
+ bitBlt( m_dst, m_width - w, 0, &m_pageTo, m_width / 2, m_height / 2 - h, w, h );
+ bitBlt( m_dst, 0, m_height - h, &m_pageTo, m_width / 2 - w, m_height / 2, w, h );
+ bitBlt( m_dst, m_width - w, m_height - h, &m_pageTo, m_width / 2, m_height / 2, w, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectOpenHorizontal() const
+{
+ int h = m_effectStep * m_stepHeight;
+
+ bool finished = false;
+ if ( h >= m_height / 2 )
+ {
+ h = m_height / 2;
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, m_height / 2 - h, &m_pageTo, 0, 0, m_width, h );
+ bitBlt( m_dst, 0, m_height / 2, &m_pageTo, 0, m_height - h, m_width, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectOpenVertical() const
+{
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( w >= m_width / 2 )
+ {
+ w = m_width / 2;
+ finished = true;
+ }
+
+ bitBlt( m_dst, m_width / 2 - w, 0, &m_pageTo, 0, 0, w, m_height );
+ bitBlt( m_dst, m_width / 2, 0, &m_pageTo, m_width - w, 0, w, m_height );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectOpenFromAllDirections() const
+{
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height / 2 )
+ {
+ h = m_height / 2;
+ }
+ if ( w >= m_width / 2 )
+ {
+ w = m_width / 2;
+ }
+ if ( h >= m_height / 2 && w >= m_width / 2 )
+ {
+ finished = true;
+ }
+
+ bitBlt( m_dst, m_width / 2 - w, m_height / 2 - h, &m_pageTo, 0, 0, w, h );
+ bitBlt( m_dst, m_width / 2, m_height / 2 - h, &m_pageTo, m_width - w, 0, w, h );
+ bitBlt( m_dst, m_width / 2 - w, m_height / 2, &m_pageTo, 0, m_height - h, w, h );
+ bitBlt( m_dst, m_width / 2, m_height / 2, &m_pageTo, m_width - w, m_height - h, w, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectInterlockingHorizontal1() const
+{
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( w >= m_width )
+ {
+ w = m_width;
+ finished = true;
+ }
+
+ int h = m_height / 4;
+
+ bitBlt( m_dst, w, 0, &m_pageTo, w, 0, m_stepWidth, h );
+ bitBlt( m_dst, m_width - w - m_stepWidth, h, &m_pageTo, m_width - w - m_stepWidth, h, m_stepWidth, h );
+ bitBlt( m_dst, w, 2 * h, &m_pageTo, w, 2 * h, m_stepWidth, h );
+ bitBlt( m_dst, m_width - w - m_stepWidth, 3 * h, &m_pageTo, m_width - w - m_stepWidth, 3 * h, m_stepWidth, m_height - 3 * h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectInterlockingHorizontal2() const
+{
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( w >= m_width )
+ {
+ w = m_width;
+ finished = true;
+ }
+
+ int h = m_height / 4;
+
+ bitBlt( m_dst, m_width - w - m_stepWidth, 0, &m_pageTo, m_width - w - m_stepWidth, 0, m_stepWidth, h );
+ bitBlt( m_dst, w, h, &m_pageTo, w, h, m_stepWidth, h );
+ bitBlt( m_dst, m_width - w - m_stepWidth, 2 * h, &m_pageTo, m_width - w - m_stepWidth, 2 * h, m_stepWidth, h );
+ bitBlt( m_dst, w, 3 * h, &m_pageTo, w, 3 * h, m_stepWidth, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectInterlockingVertical1() const
+{
+ int h = m_effectStep * m_stepHeight;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ finished = true;
+ }
+
+ int w = m_width / 4;
+
+ bitBlt( m_dst, 0, h, &m_pageTo, 0, h, w, m_stepHeight );
+ bitBlt( m_dst, w, m_height - h - m_stepHeight, &m_pageTo, w, m_height - h - m_stepHeight, w, m_stepHeight );
+ bitBlt( m_dst, 2 * w, h, &m_pageTo, 2 * w, h, w, m_stepHeight );
+ bitBlt( m_dst, 3 * w, m_height - h - m_stepHeight, &m_pageTo, 3 * w, m_height - h - m_stepHeight, w, m_stepHeight );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectInterlockingVertical2() const
+{
+ int h = m_effectStep * m_stepHeight;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ finished = true;
+ }
+
+ int w = m_width / 4;
+
+ bitBlt( m_dst, 0, m_height - h - m_stepHeight, &m_pageTo, 0, m_height - h - m_stepHeight, w, m_stepHeight );
+ bitBlt( m_dst, w, h, &m_pageTo, w, h, w, m_stepHeight );
+ bitBlt( m_dst, 2 * w, m_height - h - m_stepHeight, &m_pageTo, 2 * w, m_height - h - m_stepHeight, w, m_stepHeight );
+ bitBlt( m_dst, 3 * w, h, &m_pageTo, 3 * w, h, w, m_stepHeight );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectSurround1() const
+{
+ int div[] = { 20, 15, 10 };
+ int stepSize = m_height / div[m_speed];
+ int step = m_effectStep * stepSize;
+
+ int h = m_height / 10;
+ int w = m_width / 10;
+ int repaint_h = h;
+ int repaint_w = w;
+
+ bool finished = false;
+ bool repaint= false;
+ int rh = 0;
+ int rw = 0;
+ int repaint_rh = 0;
+ int repaint_rw = 0;
+
+ // 1
+ if ( step < m_height )
+ {
+ rh = step;
+ rw = 0;
+ h = stepSize;
+ if ( step + stepSize >= m_height )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - repaint_h;
+ repaint_rw = step - m_height + repaint_w;
+ repaint_w = stepSize;
+ }
+ }
+ // 2
+ else if ( step < m_height + m_width - w )
+ {
+ rh = m_height - h;
+ rw = step - m_height + w;
+ w = stepSize;
+ if ( step + stepSize >= m_height + m_width - repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - ( step - m_height + repaint_h - m_width + repaint_w + stepSize );
+ repaint_rw = m_width - repaint_w;
+ repaint_h = stepSize;
+ }
+ }
+ // 3
+ else if ( step < 2 * m_height - h + m_width - w )
+ {
+ rh = m_height - ( step - m_height + h - m_width + w + stepSize );
+ rw = m_width - w;
+ h = stepSize;
+ if ( step + stepSize >= 2 * m_height - repaint_h + m_width - repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = 0;
+ repaint_rw = m_width - ( step - 2 * m_height + repaint_h - m_width + 2 * repaint_w + stepSize );
+ repaint_w = stepSize;
+ }
+ }
+ // 4
+ else if ( step < 2 * m_height - h + 2 * m_width - 3 * w )
+ {
+ rh = 0;
+ rw = m_width - ( step - 2 * m_height + h - m_width + 2 * w + stepSize );
+ w = stepSize;
+ if ( step + stepSize >= 2 * m_height - repaint_h + 2 * m_width - 3 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = step - 2 * m_height + 2 * repaint_h - 2 * m_width + 3 * repaint_w;
+ repaint_rw = repaint_w;
+ repaint_h = stepSize;
+ }
+ }
+ // 5
+ else if ( step < 3 * m_height - 3 * h + 2 * m_width - 3 * w )
+ {
+ rh = step - 2 * m_height + 2 * h - 2 * m_width + 3 * w;
+ rw = w;
+ h = stepSize;
+ if ( step + stepSize >= 3 * m_height - 3 * repaint_h + 2 * m_width - 3 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - 2 * repaint_h;
+ repaint_rw = step - 3 * m_height + 3 * repaint_h - 2 * m_width + 5 * repaint_w;
+ repaint_w = stepSize;
+ }
+ }
+ // 6
+ else if ( step < 3 * m_height - 3 * h + 3 * m_width - 6 * w )
+ {
+ rh = m_height - 2 * h;
+ rw = step - 3 * m_height + 3 * h - 2 * m_width + 5 * w;
+ w = stepSize;
+ if ( step + stepSize >= 3 * m_height - 3 * repaint_h + 3 * m_width - 6 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - ( step - 3 * m_height + 5 * repaint_h - 3 * m_width + 6 * repaint_w + stepSize );
+ repaint_rw = m_width - 2 * repaint_w;
+ repaint_h = stepSize;
+ }
+ }
+ // 7
+ else if ( step < 4 * m_height - 6 * h + 3 * m_width - 6 * w )
+ {
+ rh = m_height - ( step - 3 * m_height + 5 * h - 3 * m_width + 6 * w + stepSize );
+ rw = m_width - 2 * w;
+ h = stepSize;
+ if ( step + stepSize >= 4 * m_height - 6 * repaint_h + 3 * m_width - 6 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = repaint_h;
+ repaint_rw = m_width - ( step - 4 * m_height + 6 * repaint_h - 3 * m_width + 8 * repaint_w + stepSize );
+ repaint_w = stepSize;
+ }
+ }
+ // 8
+ else if ( step < 4 * m_height - 6 * h + 4 * m_width - 10 * w )
+ {
+ rh = h;
+ rw = m_width - ( step - 4 * m_height + 6 * h - 3 * m_width + 8 * w + stepSize );
+ w = stepSize;
+ if ( step + stepSize >= 4 * m_height - 6 * repaint_h + 4 * m_width - 10 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = step - 4 * m_height + 8 * repaint_h - 4 * m_width + 10 * repaint_w;
+ repaint_rw = 2 * repaint_w;
+ repaint_h = stepSize;
+ }
+ }
+ // 9
+ else if ( step < 5 * m_height - 10 * h + 4 * m_width - 10 * w )
+ {
+ rh = step - 4 * m_height + 8 * h - 4 * m_width + 10 * w;
+ rw = 2 * w;
+ h = stepSize;
+ if ( step + stepSize >= 5 * m_height - 10 * repaint_h + 4 * m_width - 10 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - 3 * repaint_h;
+ repaint_rw = step - 5 * m_height + 10 * repaint_h - 4 * m_width + 13 * repaint_w;
+ repaint_w = stepSize;
+ }
+ }
+ // 10
+ else if ( step < 5 * m_height - 10 * h + 5 * m_width - 15 * w )
+ {
+ rh = m_height - 3 * h;
+ rw = step - 5 * m_height + 10 * h - 4 * m_width + 13 * w;
+ w = stepSize;
+ if ( step + stepSize >= 5 * m_height - 10 * repaint_h + 5 * m_width - 15 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - ( step - 5 * m_height + 13 * repaint_h - 5 * m_width + 15 * repaint_w + stepSize );
+ repaint_rw = m_width - 3 * repaint_w;
+ repaint_h = stepSize;
+ }
+ }
+ // 11
+ else if ( step < 6 * m_height - 15 * h + 5 * m_width - 15 * w )
+ {
+ rh = m_height - ( step - 5 * m_height + 13 * h - 5 * m_width + 15 * w + stepSize );
+ rw = m_width - 3 * w;
+ h = stepSize;
+ if ( step + stepSize >= 6 * m_height - 15 * repaint_h + 5 * m_width - 15 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = 2 * repaint_h;
+ repaint_rw = m_width - ( step - 6 * m_height + 15 * repaint_h - 5 * m_width + 18 * repaint_w + stepSize );
+ repaint_w = stepSize;
+ }
+ }
+ // 12
+ else if ( step < 6 * m_height - 15 * h + 6 * m_width - 21 * w )
+ {
+ rh = 2 * h;
+ rw = m_width - ( step - 6 * m_height + 15 * h - 5 * m_width + 18 * w + stepSize );
+ w = stepSize;
+ if ( step + stepSize >= 6 * m_height - 15 * repaint_h + 6 * m_width - 21 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = step - 6 * m_height + 18 * repaint_h - 6 * m_width + 21 * repaint_w;
+ repaint_rw = 3 * repaint_w;
+ repaint_h = stepSize;
+ }
+ }
+ // 13
+ else if ( step < 7 * m_height - 21 * h + 6 * m_width - 21 * w )
+ {
+ rh = step - 6 * m_height + 18 * h - 6 * m_width + 21 * w;
+ rw = 3 * w;
+ h = stepSize;
+ if ( step + stepSize >= 7 * m_height - 21 * repaint_h + 6 * m_width - 21 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - 4 * repaint_h;
+ repaint_rw = step - 7 * m_height + 21 * repaint_h - 6 * m_width + 25 * repaint_w;
+ repaint_w = stepSize;
+ }
+ }
+ // 14
+ else if ( step < 7 * m_height - 21 * h + 7 * m_width - 28 * w )
+ {
+ rh = m_height - 4 * h;
+ rw = step - 7 * m_height + 21 * h - 6 * m_width + 25 * w;
+ w = stepSize;
+ if ( step + stepSize >= 7 * m_height - 21 * repaint_h + 7 * m_width - 28 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - ( step - 7 * m_height + 25 * repaint_h - 7 * m_width + 28 * repaint_w + stepSize );
+ repaint_rw = m_width - 4 * repaint_w;
+ repaint_h = stepSize;
+ }
+ }
+ // 15
+ else if ( step < 8 * m_height - 28 * h + 7 * m_width - 28 * w )
+ {
+ rh = m_height - ( step - 7 * m_height + 25 * h - 7 * m_width + 28 * w + stepSize );
+ rw = m_width - 4 * w;
+ h = stepSize;
+ if ( step + stepSize >= 8 * m_height - 28 * repaint_h + 7 * m_width - 28 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = 3 * repaint_h;
+ repaint_rw = m_width - ( step - 8 * m_height + 28 * repaint_h - 7 * m_width + 32 * repaint_w + stepSize );
+ repaint_w = stepSize;
+ }
+ }
+ // 16
+ else if ( step < 8 * m_height - 28 * h + 8 * m_width - 36 * w )
+ {
+ rh = 3 * h;
+ rw = m_width - ( step - 8 * m_height + 28 * h - 7 * m_width + 32 * w + stepSize );
+ w = stepSize;
+ if ( step + stepSize >= 8 * m_height - 28 * repaint_h + 8 * m_width - 36 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = step - 8 * m_height + 32 * repaint_h - 8 * m_width + 36 * repaint_w;
+ repaint_rw = 4 * repaint_w;
+ repaint_h = stepSize;
+ }
+ }
+ // 17
+ else if ( step < 9 * m_height - 36 * h + 8 * m_width - 36 * w )
+ {
+ rh = step - 8 * m_height + 32 * h - 8 * m_width + 36 * w;
+ rw = 4 * w;
+ h = stepSize;
+ if ( step + stepSize >= 9 * m_height - 36 * repaint_h + 8 * m_width - 36 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - 5 * repaint_h;
+ repaint_rw = step - 9 * m_height + 36 * repaint_h - 8 * m_width + 41 * repaint_w;
+ repaint_w = stepSize;
+ }
+ }
+ // 18
+ else if ( step < 9 * m_height - 36 * h + 9 * m_width - 45 * w )
+ {
+ rh = m_height - 5 * h;
+ rw = step - 9 * m_height + 36 * h - 8 * m_width + 41 * w;
+ w = stepSize;
+ if ( step + stepSize >= 9 * m_height - 36 * repaint_h + 9 * m_width - 45 * repaint_w )
+ {
+ repaint = true;
+
+ repaint_rh = m_height - ( step - 9 * m_height + 41 * repaint_h - 9 * m_width + 45 * repaint_w + stepSize );
+ repaint_rw = m_width - 5 * repaint_w;
+ repaint_h = stepSize;
+ }
+ }
+ // 19
+ else if ( step < 10 * m_height - 45 * h + 9 * m_width - 45 * w )
+ {
+ rh = m_height - ( step - 9 * m_height + 41 * h - 9 * m_width + 45 * w + stepSize );
+ rw = m_width - 5 * w;
+ h = stepSize;
+ }
+ // 20
+ /*else if ( step < 8 * m_height - 28 * h + 8 * m_width - 36 * w )
+ {
+ rh = 3 * h;
+ rw = m_width - ( step - 8 * m_height + 28 * h - 7 * m_width + 32 * w + stepSize );
+ w = stepSize;
+ }*/
+ else
+ {
+ finished = true;
+ }
+
+ bitBlt( m_dst, rw, rh, &m_pageTo, rw, rh, w, h );
+
+ if ( repaint )
+ {
+ bitBlt( m_dst, repaint_rw, repaint_rh, &m_pageTo, repaint_rw, repaint_rh, repaint_w, repaint_h );
+ }
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectFlyAway1()
+{
+ bool finished = false;
+ int steps[] = { 20, 15, 10 };
+ int pSteps = steps[m_speed];
+
+ if ( m_effectStep == 0 )
+ {
+ bitBlt( &m_pageFrom, 0, 0, m_dst );
+ m_list.append( m_width );
+ m_list.append( m_height );
+ m_list.append( 0 );
+ m_list.append( 0 );
+ }
+ else if ( m_effectStep <= pSteps )
+ {
+ double dw = 1.0 - 83.0 / 100.0 * m_effectStep / (double)pSteps;
+
+ QWMatrix m;
+ m.scale( dw, dw );
+ QPixmap pix( m_pageFrom.xForm( m ) );
+
+ if ( m_effectStep == pSteps )
+ m_pageFrom = pix;
+
+ int w = pix.width();
+ int h = pix.height();
+ int x = ( m_width - w ) / 2;
+ int y = ( m_height - h ) / 2;
+
+ int ow = *(m_list.at(0));
+ int oh = *(m_list.at(1));
+ int ox = *(m_list.at(2));
+ int oy = *(m_list.at(3));
+
+ bitBlt( m_dst, x, y, &pix, 0, 0 , w, h );
+ // top
+ bitBlt( m_dst, ox, oy, &m_pageTo, ox, oy, ow, y - oy );
+ // left
+ bitBlt( m_dst, ox, y, &m_pageTo, ox, y, x - ox, h );
+ // right
+ bitBlt( m_dst, x + w, y, &m_pageTo, x + w, y, ( ow - w + 1 ) / 2, h );
+ // bottom
+ bitBlt( m_dst, ox, y + h, &m_pageTo, ox, y + h, ow, ( oh - h + 1 ) / 2 );
+
+ *(m_list.at(0)) = w;
+ *(m_list.at(1)) = h;
+ *(m_list.at(2)) = x;
+ *(m_list.at(3)) = y;
+ }
+ else if ( m_effectStep <= 2 * pSteps )
+ {
+ int w = m_pageFrom.width();
+ int h = m_pageFrom.height();
+ int x = ( m_width - w ) / 2;
+ int y = ( m_height - h ) / 2 - ( m_height - h ) / 2 * ( m_effectStep - pSteps ) / pSteps;
+
+ int oy = *(m_list.at(3));
+
+ bitBlt( m_dst, x, y, &m_pageFrom, 0, 0 , w, h );
+ bitBlt( m_dst, x, y + h, &m_pageTo, x, y + h, w, oy - y);
+
+ *(m_list.at(3)) = y;
+ }
+ else if ( m_effectStep <= 3 * pSteps )
+ {
+ int w = m_pageFrom.width();
+ int h = m_pageFrom.height();
+ int x = ( m_width - w ) / 2 - ( m_width - w ) / 2 * ( m_effectStep - 2 * pSteps ) / pSteps;
+ int y = ( m_height - h ) / 2 * ( m_effectStep - 2 * pSteps ) / pSteps;
+
+ int ox = *(m_list.at(2));
+ int oy = *(m_list.at(3));
+
+ bitBlt( m_dst, x, y, &m_pageFrom, 0, 0 , w, h );
+ bitBlt( m_dst, ox, oy, &m_pageTo, ox, oy, w, y - oy);
+ bitBlt( m_dst, x + w, oy, &m_pageTo, x + w, oy, x - ox, h );
+
+ *(m_list.at(2)) = x;
+ *(m_list.at(3)) = y;
+ }
+ else
+ {
+ int w = m_pageFrom.width();
+ int h = m_pageFrom.height();
+ int x = ( m_width - w ) / 2 * ( m_effectStep - 3 * pSteps ) / pSteps;
+ int y = ( m_height - h ) / 2 * ( m_effectStep - 2 * pSteps ) / pSteps;
+
+ int ox = *(m_list.at(2));
+ int oy = *(m_list.at(3));
+
+ bitBlt( m_dst, x, y, &m_pageFrom, 0, 0 , w, h );
+ bitBlt( m_dst, ox, oy, &m_pageTo, ox, oy, w, y - oy);
+ bitBlt( m_dst, ox, oy, &m_pageTo, ox, oy, x - ox, h );
+
+ if ( x >= m_height )
+ {
+ finished = true;
+ }
+ else
+ {
+ *(m_list.at(2)) = x;
+ *(m_list.at(3)) = y;
+ }
+ }
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectBlindsHorizontal() const
+{
+ int h = m_effectStep * m_stepHeight;
+ int blockSize = m_height / 8;
+
+ bool finished = false;
+ if ( h >= blockSize )
+ {
+ h = blockSize;
+ finished = true;
+ }
+
+ for ( int i=0; i < m_height; i += blockSize )
+ bitBlt( m_dst, 0, h + i, &m_pageTo, 0, h + i, m_width, m_stepHeight );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectBlindsVertical() const
+{
+ int w = m_effectStep * m_stepWidth;
+ int blockSize = m_width / 8;
+
+ bool finished = false;
+ if ( w >= blockSize )
+ {
+ w = blockSize;
+ finished = true;
+ }
+
+ for ( int i=0; i < m_width; i += blockSize )
+ bitBlt( m_dst, w + i, 0, &m_pageTo, w + i, 0, m_stepWidth, m_height );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectBoxIn() const
+{
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int stepHeight = (int)( ( m_effectStep + 1 ) * m_stepWidth * fact - h );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height / 2 )
+ {
+ h = m_height / 2;
+ }
+ if ( w >= m_width / 2 )
+ {
+ w = m_width / 2;
+ }
+ if ( h >= m_height / 2 && w >= m_width / 2 )
+ {
+ finished = true;
+ }
+
+ // top
+ bitBlt( m_dst, w, h, &m_pageTo, w, h, m_width - 2 * w, stepHeight );
+ // left
+ bitBlt( m_dst, w, h, &m_pageTo, w, h, m_stepWidth, m_height - 2 * h );
+ //right
+ bitBlt( m_dst, m_width - w, h, &m_pageTo, m_width - w, h, m_stepWidth, m_height - 2 * h );
+ // bottom
+ bitBlt( m_dst, w, m_height - h - stepHeight, &m_pageTo, w, m_height - h - stepHeight, m_width - 2 * w, stepHeight );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectBoxOut() const
+{
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int stepHeight = (int)( ( m_effectStep + 1 ) * m_stepWidth * fact - h );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height / 2 )
+ {
+ h = m_height / 2;
+ }
+ if ( w >= m_width / 2 )
+ {
+ w = m_width / 2;
+ }
+ if ( h >= m_height / 2 && w >= m_width / 2 )
+ {
+ finished = true;
+ }
+
+ bitBlt( m_dst, m_width / 2 - w - m_stepWidth, m_height / 2 - h - stepHeight,
+ &m_pageTo, m_width / 2 - w - m_stepWidth, m_height / 2 - h - stepHeight, 2 * ( w + m_stepWidth ), stepHeight );
+ bitBlt( m_dst, m_width / 2 - w - m_stepWidth, m_height / 2 - h,
+ &m_pageTo, m_width / 2 - w - m_stepWidth, m_height / 2 - h, m_stepWidth, 2 * h );
+ bitBlt( m_dst, m_width / 2 + w, m_height / 2 - h,
+ &m_pageTo, m_width / 2 + w, m_height / 2 - h, m_stepWidth, 2 * h );
+ bitBlt( m_dst, m_width / 2 - w - m_stepWidth, m_height / 2 + h,
+ &m_pageTo, m_width / 2 - w - m_stepWidth, m_height / 2 + h, 2 * ( w + m_stepWidth), stepHeight );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCheckboardAcross() const
+{
+ int w = m_effectStep * m_stepWidth;
+ int blockSize = m_height / 8;
+
+ bool finished = false;
+ if ( w >= blockSize * 2 )
+ {
+ w = blockSize * 2;
+ finished = true;
+ }
+
+ for ( int y = 0; y < m_height; y += blockSize )
+ {
+ int x = ( ( y / blockSize ) & 1 ) * blockSize;
+
+ if ( x == blockSize && w >= blockSize - m_stepWidth )
+ bitBlt( m_dst, w - blockSize, y, &m_pageTo, w - blockSize, y, m_stepWidth, blockSize );
+
+ for ( ; x < m_width; x += 2 * blockSize )
+ {
+ bitBlt( m_dst, x + w, y, &m_pageTo, x + w, y, m_stepWidth, blockSize );
+ }
+ }
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCheckboardDown() const
+{
+ int h = m_effectStep * m_stepHeight;
+ int blockSize = m_height / 8;
+
+ bool finished = false;
+ if ( h >= blockSize * 2 )
+ {
+ h = blockSize * 2;
+ finished = true;
+ }
+
+ for ( int x = 0; x < m_width; x += blockSize )
+ {
+ int y = ( ( x / blockSize ) & 1 ) * blockSize;
+
+ if ( y == blockSize && h >= blockSize - m_stepHeight )
+ bitBlt( m_dst, x, h - blockSize, &m_pageTo, x, h - blockSize, blockSize, m_stepHeight );
+
+ for ( ; y < m_width; y += 2 * blockSize )
+ {
+ bitBlt( m_dst, x, y + h, &m_pageTo, x, y + h, blockSize, m_stepHeight );
+ }
+ }
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCoverDown() const
+{
+ int h = m_effectStep * m_stepHeight;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, 0, &m_pageTo, 0, m_height - h, m_width, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectUncoverDown() const
+{
+ int h = m_effectStep * m_stepHeight;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, h + m_stepHeight, m_dst, 0, h, m_width, m_height - h - m_stepHeight );
+ bitBlt( m_dst, 0, h, &m_pageTo, 0, h, m_width, m_stepHeight );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCoverUp() const
+{
+ int h = m_effectStep * m_stepHeight;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, m_height - h, &m_pageTo, 0, 0, m_width, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectUncoverUp()
+{
+ if ( m_effectStep == 0 )
+ bitBlt( &m_pageFrom, 0, 0, m_dst );
+
+ int h = m_effectStep * m_stepHeight;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, 0, &m_pageFrom, 0, h + m_stepHeight, m_width, m_height - h - m_stepHeight );
+ bitBlt( m_dst, 0, m_height - h - m_stepHeight, &m_pageTo, 0, m_height - h - m_stepHeight, m_width, m_stepHeight );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCoverLeft() const
+{
+ int w = m_effectStep * m_stepHeight;
+
+ bool finished = false;
+ if ( w >= m_width )
+ {
+ w = m_width;
+ finished = true;
+ }
+
+ bitBlt( m_dst, m_width - w, 0, &m_pageTo, 0, 0, w, m_height );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectUncoverLeft()
+{
+ if ( m_effectStep == 0 )
+ bitBlt( &m_pageFrom, 0, 0, m_dst );
+
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( w >= m_width )
+ {
+ w = m_width;
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, 0, &m_pageFrom, w + m_stepWidth, 0, m_width - w - m_stepWidth, m_height );
+ bitBlt( m_dst, m_width - w - m_stepWidth, 0, &m_pageTo, m_width - w - m_stepWidth, 0, m_stepWidth, m_height );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCoverRight() const
+{
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( w >= m_width )
+ {
+ w = m_width;
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, 0, &m_pageTo, m_width - w, 0, w, m_height );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectUncoverRight()
+{
+ if ( m_effectStep == 0 )
+ bitBlt( &m_pageFrom, 0, 0, m_dst );
+
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( w >= m_width )
+ {
+ w = m_width;
+ finished = true;
+ }
+
+ bitBlt( m_dst, w + m_stepWidth, 0, &m_pageFrom, 0, 0, m_width - w - m_stepWidth, m_height );
+ bitBlt( m_dst, w, 0, &m_pageTo, w, 0, m_stepWidth, m_height );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCoverLeftUp() const
+{
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ }
+ if ( w >= m_width )
+ {
+ w = m_width;
+ }
+ if ( h >= m_height && w >= m_width )
+ {
+ finished = true;
+ }
+
+ bitBlt( m_dst, m_width - w, m_height - h, &m_pageTo, 0, 0, w, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectUncoverLeftUp()
+{
+ if ( m_effectStep == 0 )
+ bitBlt( &m_pageFrom, 0, 0, m_dst );
+
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ }
+ if ( w >= m_width )
+ {
+ w = m_width;
+ }
+ if ( h >= m_height && w >= m_width )
+ {
+ finished = true;
+ }
+
+ // fix only copy what is nesseccary
+ bitBlt( m_dst, 0, 0, &m_pageFrom, w, h, m_width - w, m_height - h );
+ bitBlt( m_dst, m_width - w, 0, &m_pageTo, m_width - w, 0, w, m_height );
+ bitBlt( m_dst, 0, m_height - h, &m_pageTo, 0, m_height - h, m_width, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCoverLeftDown() const
+{
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ }
+ if ( w >= m_width )
+ {
+ w = m_width;
+ }
+ if ( h >= m_height && w >= m_width )
+ {
+ finished = true;
+ }
+
+ bitBlt( m_dst, m_width - w, 0, &m_pageTo, 0, m_height - h, w, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectUncoverLeftDown()
+{
+ if ( m_effectStep == 0 )
+ bitBlt( &m_pageFrom, 0, 0, m_dst );
+
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ }
+ if ( w >= m_width )
+ {
+ w = m_width;
+ }
+ if ( h >= m_height && w >= m_width )
+ {
+ finished = true;
+ }
+
+ // fix only copy what is nesseccary
+ bitBlt( m_dst, 0, h, &m_pageFrom, w, 0, m_width - w, m_height - h );
+ bitBlt( m_dst, 0, 0, &m_pageTo, 0, 0, m_width, h );
+ bitBlt( m_dst, m_width - w, h, &m_pageTo, m_width - w, h, w, m_height - h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCoverRightUp() const
+{
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ }
+ if ( w >= m_width )
+ {
+ w = m_width;
+ }
+ if ( h >= m_height && w >= m_width )
+ {
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, m_height - h, &m_pageTo, m_width - w, 0, w, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectUncoverRightUp()
+{
+ if ( m_effectStep == 0 )
+ bitBlt( &m_pageFrom, 0, 0, m_dst );
+
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ }
+ if ( w >= m_width )
+ {
+ w = m_width;
+ }
+ if ( h >= m_height && w >= m_width )
+ {
+ finished = true;
+ }
+ // only draw what nesseccary
+ bitBlt( m_dst, w, 0, &m_pageFrom, 0, h, m_width - w, m_height - h );
+ bitBlt( m_dst, 0, 0, &m_pageTo, 0, 0, w, m_height );
+ bitBlt( m_dst, w, m_height - h, &m_pageTo, w, m_height - h, m_width - w, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectCoverRightDown() const
+{
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ }
+ if ( w >= m_width )
+ {
+ w = m_width;
+ }
+ if ( h >= m_height && w >= m_width )
+ {
+ finished = true;
+ }
+
+ bitBlt( m_dst, 0, 0, &m_pageTo, m_width - w, m_height - h, w, h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectUncoverRightDown()
+{
+ if ( m_effectStep == 0 )
+ bitBlt( &m_pageFrom, 0, 0, m_dst );
+
+ double fact = (double) m_height / (double) m_width;
+ int h = (int)( m_effectStep * m_stepWidth * fact );
+ int w = m_effectStep * m_stepWidth;
+
+ bool finished = false;
+ if ( h >= m_height )
+ {
+ h = m_height;
+ }
+ if ( w >= m_width )
+ {
+ w = m_width;
+ }
+ if ( h >= m_height && w >= m_width )
+ {
+ finished = true;
+ }
+ // only draw what nesseccary
+ bitBlt( m_dst, w, h, &m_pageFrom, 0, 0, m_width - w, m_height - h );
+ bitBlt( m_dst, 0, 0, &m_pageTo, 0, 0, m_width, h );
+ bitBlt( m_dst, 0, h, &m_pageTo, 0, h, w, m_height - h );
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectDissolve()
+{
+ KRandomSequence random;
+
+ int blockSize = m_height / 32; // small enough
+ int rowno = ( m_height + blockSize - 1 ) / blockSize;
+ int colno = ( m_width + blockSize - 1 ) / blockSize;
+ int cellno = rowno * colno;
+
+ if ( m_effectStep == 0 )
+ {
+ for( int c = 0; c < cellno; c++ )
+ m_list.append( c );
+ }
+
+ int steps[] = { 30, 60, 90 };
+ int dissove = steps[m_speed];
+ while ( !m_list.isEmpty() && dissove > 0 )
+ {
+ --dissove;
+
+ int index = random.getLong( m_list.count() );
+ QValueListIterator<int> it = m_list.at( index );
+
+ unsigned int x = ( *it % colno ) * blockSize;
+ unsigned int y = ( *it / colno ) * blockSize;
+
+ m_list.remove( it );
+
+ bitBlt( m_dst, x, y, &m_pageTo, x, y, blockSize, blockSize );
+ }
+
+ return m_list.isEmpty();
+}
+
+
+bool KPrPageEffects::effectStripesLeftUp() const
+{
+ int wSteps = m_width / m_stepWidth + 1;
+ int hSteps = m_height / m_stepWidth + 1;
+
+ int xStart = m_effectStep < wSteps ? m_effectStep : wSteps;
+ int xStop = 1 > m_effectStep - hSteps + 1 ? 1 : m_effectStep - hSteps + 1;
+
+ bool finished = false;
+ if ( m_effectStep >= wSteps + hSteps )
+ {
+ finished = true;
+ }
+
+ int y = m_effectStep - wSteps + 1 > 1 ? m_effectStep - wSteps + 1 : 1;
+
+ for ( int x = xStart; x >= xStop; --x )
+ {
+ bitBlt( m_dst, m_width - x * m_stepWidth, m_height - y * m_stepWidth,
+ &m_pageTo, m_width - x * m_stepWidth, m_height - y * m_stepWidth , m_stepWidth, m_stepWidth );
+ ++y;
+ }
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectStripesLeftDown() const
+{
+ int wSteps = m_width / m_stepWidth + 1;
+ int hSteps = m_height / m_stepWidth + 1;
+
+ int xStart = m_effectStep < wSteps ? m_effectStep : wSteps;
+ int xStop = 1 > m_effectStep - hSteps + 1 ? 1 : m_effectStep - hSteps + 1;
+
+ bool finished = false;
+ if ( m_effectStep >= wSteps + hSteps )
+ {
+ finished = true;
+ }
+
+ int y = m_effectStep - wSteps + 1 > 1 ? m_effectStep - wSteps + 1 : 1;
+
+ for ( int x = xStart; x >= xStop; --x )
+ {
+ bitBlt( m_dst, m_width - x * m_stepWidth, ( y - 1 ) * m_stepWidth,
+ &m_pageTo, m_width - x * m_stepWidth, ( y - 1 ) * m_stepWidth , m_stepWidth, m_stepWidth );
+ ++y;
+ }
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectStripesRightUp() const
+{
+ int wSteps = m_width / m_stepWidth + 1;
+ int hSteps = m_height / m_stepWidth + 1;
+
+ int xStart = m_effectStep < wSteps ? m_effectStep : wSteps;
+ int xStop = 1 > m_effectStep - hSteps + 1 ? 1 : m_effectStep - hSteps + 1;
+
+ bool finished = false;
+ if ( m_effectStep >= wSteps + hSteps )
+ {
+ finished = true;
+ }
+
+ int y = m_effectStep - wSteps + 1 > 1 ? m_effectStep - wSteps + 1 : 1;
+
+ for ( int x = xStart; x >= xStop; --x )
+ {
+ bitBlt( m_dst, ( x - 1 ) * m_stepWidth, m_height - y * m_stepWidth,
+ &m_pageTo, ( x - 1 ) * m_stepWidth, m_height - y * m_stepWidth , m_stepWidth, m_stepWidth );
+ ++y;
+ }
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectStripesRigthDown() const
+{
+ int wSteps = m_width / m_stepWidth + 1;
+ int hSteps = m_height / m_stepWidth + 1;
+
+ int xStart = m_effectStep < wSteps ? m_effectStep : wSteps;
+ int xStop = 1 > m_effectStep - hSteps + 1 ? 1 : m_effectStep - hSteps + 1;
+
+ bool finished = false;
+ if ( m_effectStep >= wSteps + hSteps )
+ {
+ finished = true;
+ }
+
+ int y = m_effectStep - wSteps + 1 > 1 ? m_effectStep - wSteps + 1 : 1;
+
+ for ( int x = xStart; x >= xStop; --x )
+ {
+ bitBlt( m_dst, ( x - 1 ) * m_stepWidth, ( y - 1 ) * m_stepWidth,
+ &m_pageTo, ( x - 1 ) * m_stepWidth, ( y - 1 ) * m_stepWidth , m_stepWidth, m_stepWidth );
+ ++y;
+ }
+
+ return finished;
+}
+
+
+bool KPrPageEffects::effectMelting()
+{
+ int count = 32;
+ int max_melt = 2 * m_stepHeight;
+
+ if ( m_effectStep == 0 )
+ {
+ bitBlt( &m_pageFrom, 0, 0, m_dst );
+
+ for( int c = 0; c < count; c++ )
+ m_list.append( 0 );
+ }
+
+ int w = ( m_width + count - 1 ) / count;
+
+ QValueListIterator<int> it = m_list.begin();
+
+ int finished = 32;
+ for ( int c = 0; c < count; c++ )
+ {
+ int x = c * w;
+
+ KRandomSequence random;
+ int grow = 1 + random.getLong( max_melt );
+
+ if ( *it + grow >= m_height )
+ {
+ grow = m_height - *it;
+ --finished;
+ }
+
+ if( *it < m_height )
+ {
+ bitBlt( m_dst, x, *it, &m_pageTo, x, *it, w, grow );
+ bitBlt( m_dst, x, *it + grow, &m_pageFrom, x, 0, w, m_height - *it - grow );
+
+ *it += grow;
+ }
+ ++it;
+ }
+
+ return finished == 0;
+}
+
+
diff --git a/kpresenter/KPrPageEffects.h b/kpresenter/KPrPageEffects.h
new file mode 100644
index 000000000..5c52b24d3
--- /dev/null
+++ b/kpresenter/KPrPageEffects.h
@@ -0,0 +1,121 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2002 Ariya Hidayat <ariya@kde.org>
+ Copyright (C) 2002 Harri Porten <porten@kde.org>
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PAGEEFFECTS_H
+#define PAGEEFFECTS_H
+
+#include "global.h"
+#include <qvaluelist.h>
+
+
+class QPaintDevice;
+class QPixmap;
+
+
+class KPrPageEffects
+{
+public:
+ /**
+ * Class for displaying page effects. This class takes a paint device
+ * and a pixmap and according to the effect it changes the paint device
+ * to contain the pixmap.
+ *
+ * dst The paint device to which the output will be directed.
+ * It has to show the current pixmap.
+ * pageTo The pixmap which will be shown when the effect is finished.
+ * effect The effect which sould be used.
+ * speed The speed which should be used.
+ */
+ KPrPageEffects( QPaintDevice *dst, const QPixmap &pageTo, PageEffect effect, EffectSpeed speed );
+
+ ~KPrPageEffects();
+
+ /**
+ * doEffect handles the next step of the page effect.
+ * Returns true if the effect is finished.
+ */
+ bool doEffect();
+
+ /**
+ * Ends the page effect by displaying the m_pageTo.
+ */
+ void finish();
+protected:
+ bool effectNone() const;
+ bool effectCloseHorizontal() const;
+ bool effectCloseVertical() const;
+ bool effectCloseFromAllDirections() const;
+ bool effectOpenHorizontal() const;
+ bool effectOpenVertical() const;
+ bool effectOpenFromAllDirections() const;
+ bool effectInterlockingHorizontal1() const;
+ bool effectInterlockingHorizontal2() const;
+ bool effectInterlockingVertical1() const;
+ bool effectInterlockingVertical2() const;
+ bool effectSurround1() const;
+ bool effectFlyAway1();
+ bool effectBlindsHorizontal() const;
+ bool effectBlindsVertical() const;
+ bool effectBoxIn() const;
+ bool effectBoxOut() const ;
+ bool effectCheckboardAcross() const;
+ bool effectCheckboardDown() const;
+ bool effectCoverDown() const;
+ bool effectUncoverDown() const;
+ bool effectCoverUp() const;
+ bool effectUncoverUp();
+ bool effectCoverLeft() const;
+ bool effectUncoverLeft();
+ bool effectCoverRight() const;
+ bool effectUncoverRight();
+ bool effectCoverLeftUp() const;
+ bool effectUncoverLeftUp();
+ bool effectCoverLeftDown() const;
+ bool effectUncoverLeftDown();
+ bool effectCoverRightUp() const;
+ bool effectUncoverRightUp();
+ bool effectCoverRightDown() const;
+ bool effectUncoverRightDown();
+ bool effectDissolve();
+ bool effectStripesLeftUp() const;
+ bool effectStripesLeftDown() const;
+ bool effectStripesRightUp() const;
+ bool effectStripesRigthDown() const;
+ bool effectMelting();
+
+ QPaintDevice *m_dst;
+ const QPixmap m_pageTo;
+ QPixmap m_pageFrom;
+ PageEffect m_effect;
+ PageEffect m_randomEffect;
+ EffectSpeed m_speed;
+ QValueList<int> m_list;
+ int m_effectStep;
+ int m_stepWidth;
+ int m_stepHeight;
+ int m_width;
+ int m_height;
+ bool m_finished;
+};
+
+#endif /* PAGEEFFECTS_H */
diff --git a/kpresenter/KPrPageIface.cpp b/kpresenter/KPrPageIface.cpp
new file mode 100644
index 000000000..4eaa2078c
--- /dev/null
+++ b/kpresenter/KPrPageIface.cpp
@@ -0,0 +1,699 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002,2003,2004 Laurent MONTEL <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPageIface.h"
+
+#include "KPrPage.h"
+#include "KPrTextObject.h"
+#include "KPrView.h"
+#include "KPrBackground.h"
+#include <kapplication.h>
+#include <dcopclient.h>
+#include "KPrDocument.h"
+#include "KPrCanvas.h"
+#include <kdebug.h>
+#include <kcommand.h>
+#include "KPrCommand.h"
+#include <KoPoint.h>
+#include <KoRect.h>
+
+KPrPageIface::KPrPageIface( KPrPage *_page, int pgnum )
+ // Make up a nice DCOPObject name like "Document-0 Page-1".
+ // ### But the page number will be stale if pages are added/removed/moved around....
+ : DCOPObject( QCString( _page->kPresenterDoc()->dcopObject()->objId() ) + " Page-" + QString::number( pgnum ).latin1() )
+{
+ m_page = _page;
+}
+
+DCOPRef KPrPageIface::textObject( int num )
+{
+ KPrTextObject * textObj=m_page->textFrameSet(num);
+ if(textObj)
+ return DCOPRef( kapp->dcopClient()->appId(),
+ textObj->dcopObject()->objId() );
+ return DCOPRef();
+}
+
+//return a reference to selected object
+DCOPRef KPrPageIface::selectedObject( )
+{
+ KPrObject * obj=m_page->getSelectedObj();
+ if(obj)
+ return DCOPRef( kapp->dcopClient()->appId(),
+ obj->dcopObject()->objId() );
+ return DCOPRef();
+}
+
+
+int KPrPageIface::numTextObject() const
+{
+ return m_page->numTextObject();
+}
+
+DCOPRef KPrPageIface::object( int num )
+{
+ if( num >= (int)m_page->objNums())
+ return DCOPRef();
+ return DCOPRef( kapp->dcopClient()->appId(),
+ m_page->getObject(num)->dcopObject()->objId() );
+}
+
+QString KPrPageIface::manualTitle()const
+{
+ return m_page->manualTitle();
+}
+
+void KPrPageIface::insertManualTitle(const QString & title)
+{
+ m_page->insertManualTitle(title);
+ m_page->kPresenterDoc()->updateSideBarItem( m_page );
+}
+
+QString KPrPageIface::pageTitle( const QString &_title ) const
+{
+ return m_page->pageTitle(_title);
+}
+
+void KPrPageIface::setNoteText( const QString &_text )
+{
+ m_page->setNoteText(_text);
+}
+
+QString KPrPageIface::noteText( )const
+{
+ return m_page->noteText();
+}
+
+unsigned int KPrPageIface::objNums() const
+{
+ return m_page->objNums();
+}
+
+int KPrPageIface::numSelected() const
+{
+ return m_page->numSelected();
+}
+
+DCOPRef KPrPageIface::groupObjects()
+{
+ m_page->groupObjects();
+ return selectedObject();
+}
+
+void KPrPageIface::ungroupObjects()
+{
+ //FIXME
+ //m_page->ungroupObjects();
+}
+
+void KPrPageIface::raiseObjs()
+{
+ m_page->raiseObjs(false);
+}
+
+void KPrPageIface::lowerObjs()
+{
+ m_page->lowerObjs(false);
+}
+
+void KPrPageIface::sendBackward()
+{
+ m_page->lowerObjs(true);
+}
+
+void KPrPageIface::bringForward()
+{
+ m_page->raiseObjs(true);
+}
+
+void KPrPageIface::copyObjs()
+{
+ //FIXME
+ //m_page->copyObjs();
+}
+
+void KPrPageIface::slotRepaintVariable()
+{
+ m_page->slotRepaintVariable();
+}
+
+void KPrPageIface::recalcPageNum()
+{
+ m_page->recalcPageNum();
+}
+
+void KPrPageIface::setPageTimer( int pageTimer )
+{
+ m_page->setPageTimer(pageTimer);
+}
+
+void KPrPageIface::setPageSoundEffect( bool soundEffect )
+{
+ m_page->setPageSoundEffect(soundEffect);
+}
+
+void KPrPageIface::setPageSoundFileName( const QString &fileName )
+{
+ m_page->setPageSoundFileName(fileName);
+}
+
+int KPrPageIface::backXFactor() const
+{
+ return m_page->getBackXFactor();
+}
+
+int KPrPageIface::backYFactor( ) const
+{
+ return m_page->getBackYFactor();
+}
+
+int KPrPageIface::pageTimer( ) const
+{
+ return m_page->getPageTimer();
+}
+
+bool KPrPageIface::pageSoundEffect( ) const
+{
+ return m_page->getPageSoundEffect();
+}
+
+int KPrPageIface::backType() const
+{
+ return (int)m_page->getBackType();
+}
+
+int KPrPageIface::backView() const
+{
+ return (int)m_page->getBackView();
+}
+
+QColor KPrPageIface::backColor1() const
+{
+ return m_page->getBackColor1();
+}
+
+QColor KPrPageIface::backColor2() const
+{
+ return m_page->getBackColor2();
+}
+
+int KPrPageIface::backColorType() const
+{
+ return (int)m_page->getBackColorType();
+}
+
+QString KPrPageIface::backPixFilename() const
+{
+ return m_page->getBackPictureKey().filename();
+}
+
+QString KPrPageIface::backClipFilename() const
+{
+ return m_page->getBackPictureKey().filename();
+}
+
+int KPrPageIface::pageEffect() const
+{
+ return (int)m_page->getPageEffect();
+}
+
+void KPrPageIface::setPageEffect(const QString &effect )
+{
+ if(effect=="NONE")
+ m_page->setPageEffect(PEF_NONE);
+ else if(effect=="CLOSE_HORZ")
+ m_page->setPageEffect(PEF_CLOSE_HORZ);
+ else if(effect=="CLOSE_VERT")
+ m_page->setPageEffect(PEF_CLOSE_VERT);
+ else if(effect=="CLOSE_ALL")
+ m_page->setPageEffect(PEF_CLOSE_ALL);
+ else if(effect=="OPEN_HORZ")
+ m_page->setPageEffect(PEF_OPEN_HORZ);
+ else if(effect=="OPEN_VERT")
+ m_page->setPageEffect(PEF_OPEN_VERT);
+ else if(effect=="OPEN_ALL")
+ m_page->setPageEffect(PEF_OPEN_ALL);
+ else if(effect=="INTERLOCKING_HORZ_1")
+ m_page->setPageEffect(PEF_INTERLOCKING_HORZ_1);
+ else if(effect=="INTERLOCKING_HORZ_2")
+ m_page->setPageEffect(PEF_INTERLOCKING_HORZ_2);
+ else if(effect=="INTERLOCKING_VERT_1")
+ m_page->setPageEffect(PEF_INTERLOCKING_VERT_1);
+ else if(effect=="INTERLOCKING_VERT_2")
+ m_page->setPageEffect(PEF_INTERLOCKING_VERT_2);
+ else if(effect=="SURROUND1")
+ m_page->setPageEffect(PEF_SURROUND1);
+ else if(effect=="FLY1")
+ m_page->setPageEffect(PEF_FLY1);
+ else if(effect=="BLINDS_HOR")
+ m_page->setPageEffect(PEF_BLINDS_HOR);
+ else if(effect=="BLINDS_VER")
+ m_page->setPageEffect(PEF_BLINDS_VER);
+ else if(effect=="BOX_IN")
+ m_page->setPageEffect(PEF_BOX_IN);
+ else if(effect=="BOX_OUT")
+ m_page->setPageEffect(PEF_BOX_OUT);
+ else if(effect=="CHECKBOARD_ACROSS")
+ m_page->setPageEffect(PEF_CHECKBOARD_ACROSS);
+ else if(effect=="CHECKBOARD_DOWN")
+ m_page->setPageEffect(PEF_CHECKBOARD_DOWN);
+ else if(effect=="COVER_DOWN")
+ m_page->setPageEffect(PEF_COVER_DOWN);
+ else if(effect=="UNCOVER_DOWN")
+ m_page->setPageEffect(PEF_UNCOVER_DOWN);
+ else if(effect=="COVER_UP")
+ m_page->setPageEffect(PEF_COVER_UP);
+ else if(effect=="UNCOVER_UP")
+ m_page->setPageEffect(PEF_UNCOVER_UP);
+ else if(effect=="COVER_LEFT")
+ m_page->setPageEffect(PEF_COVER_LEFT);
+ else if(effect=="UNCOVER_LEFT")
+ m_page->setPageEffect(PEF_UNCOVER_LEFT);
+ else if(effect=="COVER_RIGHT")
+ m_page->setPageEffect(PEF_COVER_RIGHT);
+ else if(effect=="UNCOVER_RIGHT")
+ m_page->setPageEffect(PEF_UNCOVER_RIGHT);
+ else if(effect=="COVER_LEFT_UP")
+ m_page->setPageEffect(PEF_COVER_LEFT_UP);
+ else if(effect=="UNCOVER_LEFT_UP")
+ m_page->setPageEffect(PEF_UNCOVER_LEFT_UP);
+ else if(effect=="COVER_LEFT_DOWN")
+ m_page->setPageEffect(PEF_COVER_LEFT_DOWN);
+ else if(effect=="UNCOVER_LEFT_DOWN")
+ m_page->setPageEffect(PEF_UNCOVER_LEFT_DOWN);
+ else if(effect=="COVER_RIGHT_UP")
+ m_page->setPageEffect(PEF_COVER_RIGHT_UP);
+ else if(effect=="UNCOVER_RIGHT_UP")
+ m_page->setPageEffect(PEF_UNCOVER_RIGHT_UP);
+ else if(effect=="COVER_RIGHT_DOWN")
+ m_page->setPageEffect(PEF_COVER_RIGHT_DOWN);
+ else if(effect=="UNCOVER_RIGHT_DOWN")
+ m_page->setPageEffect(PEF_UNCOVER_RIGHT_DOWN);
+ else if(effect=="DISSOLVE")
+ m_page->setPageEffect(PEF_DISSOLVE);
+ else if(effect=="STRIPS_LEFT_UP")
+ m_page->setPageEffect(PEF_STRIPS_LEFT_UP);
+ else if(effect=="STRIPS_LEFT_DOWN")
+ m_page->setPageEffect(PEF_STRIPS_LEFT_DOWN);
+ else if(effect=="STRIPS_RIGHT_UP")
+ m_page->setPageEffect(PEF_STRIPS_RIGHT_UP);
+ else if(effect=="STRIPS_RIGHT_DOWN")
+ m_page->setPageEffect(PEF_STRIPS_RIGHT_DOWN);
+ else if(effect=="MELTING")
+ m_page->setPageEffect(PEF_MELTING);
+ else if(effect=="RANDOM")
+ m_page->setPageEffect(PEF_RANDOM);
+ else
+ kdDebug(33001) << "Error in setPageEffect" << endl;
+}
+
+QString KPrPageIface::pageEffectString( )const
+{
+ switch(m_page->getPageEffect( ))
+ {
+ case PEF_NONE:
+ return QString("NONE");
+ break;
+ case PEF_CLOSE_HORZ:
+ return QString("CLOSE_HORZ");
+ break;
+ case PEF_CLOSE_VERT:
+ return QString("CLOSE_VERT");
+ break;
+ case PEF_CLOSE_ALL:
+ return QString("CLOSE_ALL");
+ break;
+ case PEF_OPEN_HORZ:
+ return QString("OPEN_HORZ");
+ break;
+ case PEF_OPEN_VERT:
+ return QString("OPEN_VERT");
+ break;
+ case PEF_OPEN_ALL:
+ return QString("OPEN_ALL");
+ break;
+ case PEF_INTERLOCKING_HORZ_1:
+ return QString("INTERLOCKING_HORZ_1");
+ break;
+ case PEF_INTERLOCKING_HORZ_2:
+ return QString("INTERLOCKING_HORZ_2");
+ break;
+ case PEF_INTERLOCKING_VERT_1:
+ return QString("INTERLOCKING_VERT_1");
+ break;
+ case PEF_INTERLOCKING_VERT_2:
+ return QString("INTERLOCKING_VERT_2");
+ break;
+ case PEF_SURROUND1:
+ return QString("SURROUND1");
+ break;
+ case PEF_BLINDS_HOR:
+ return QString("BLINDS_HOR");
+ break;
+ case PEF_BLINDS_VER:
+ return QString("BLINDS_VER");
+ break;
+ case PEF_BOX_IN:
+ return QString("BOX_IN");
+ break;
+ case PEF_BOX_OUT:
+ return QString("BOX_OUT");
+ break;
+ case PEF_CHECKBOARD_ACROSS:
+ return QString("CHECKBOARD_ACROSS");
+ break;
+ case PEF_COVER_DOWN:
+ return QString("COVER_DOWN");
+ break;
+ case PEF_UNCOVER_DOWN:
+ return QString("UNCOVER_DOWN");
+ break;
+ case PEF_COVER_UP:
+ return QString("COVER_UP");
+ break;
+ case PEF_UNCOVER_UP:
+ return QString("UNCOVER_UP");
+ break;
+ case PEF_COVER_LEFT:
+ return QString("COVER_LEFT");
+ break;
+ case PEF_UNCOVER_LEFT:
+ return QString("UNCOVER_LEFT");
+ break;
+ case PEF_COVER_RIGHT:
+ return QString("COVER_RIGHT");
+ break;
+ case PEF_UNCOVER_RIGHT:
+ return QString("UNCOVER_RIGHT");
+ break;
+ case PEF_COVER_LEFT_UP:
+ return QString("COVER_LEFT_UP");
+ break;
+ case PEF_UNCOVER_LEFT_UP:
+ return QString("UNCOVER_LEFT_UP");
+ break;
+ case PEF_COVER_LEFT_DOWN:
+ return QString("COVER_LEFT_DOWN");
+ break;
+ case PEF_UNCOVER_LEFT_DOWN:
+ return QString("UNCOVER_LEFT_DOWN");
+ break;
+ case PEF_COVER_RIGHT_UP:
+ return QString("COVER_RIGHT_UP");
+ break;
+ case PEF_UNCOVER_RIGHT_UP:
+ return QString("UNCOVER_RIGHT_UP");
+ break;
+ case PEF_COVER_RIGHT_DOWN:
+ return QString("COVER_RIGHT_DOWN");
+ break;
+ case PEF_UNCOVER_RIGHT_DOWN:
+ return QString("UNCOVER_RIGHT_DOWN");
+ break;
+ case PEF_DISSOLVE:
+ return QString("DISSOLVE");
+ break;
+ case PEF_STRIPS_LEFT_UP:
+ return QString("STRIPS_LEFT_UP");
+ break;
+ case PEF_STRIPS_LEFT_DOWN:
+ return QString("STRIPS_LEFT_DOWN");
+ break;
+ case PEF_STRIPS_RIGHT_UP:
+ return QString("STRIPS_RIGHT_UP");
+ break;
+ case PEF_STRIPS_RIGHT_DOWN:
+ return QString("STRIPS_RIGHT_DOWN");
+ break;
+ case PEF_MELTING:
+ return QString("MELTING");
+ break;
+ case PEF_RANDOM:
+ return QString("RANDOM");
+ break;
+ default:
+ kdDebug(33001) << "Page effect not defined!" << endl;
+ break;
+ }
+ return QString("");
+}
+
+bool KPrPageIface::backUnbalanced() const
+{
+ return (int)m_page->getBackUnbalanced();
+}
+
+QString KPrPageIface::pageSoundFileName() const
+{
+ return m_page->getPageSoundFileName();
+}
+
+QRect KPrPageIface::pageRect() const
+{
+ return m_page->getZoomPageRect();
+}
+
+bool KPrPageIface::isSlideSelected()
+{
+ return m_page->isSlideSelected();
+}
+
+void KPrPageIface::slideSelected(bool _b)
+{
+ m_page->slideSelected(_b);
+ m_page->kPresenterDoc()->updateSideBarItem( m_page );
+ m_page->kPresenterDoc()->updatePresentationButton();
+}
+
+void KPrPageIface::changePicture( const QString & filename )
+{
+ // TODO: find a better parent
+ m_page->changePicture(filename, 0);
+}
+
+//create a rectangle and return a dcop reference!
+DCOPRef KPrPageIface::insertRectangle(double x, double y, double h, double w)
+{
+ KPrView *view=m_page->kPresenterDoc()->firstView();
+ m_page->kPresenterDoc()->deSelectAllObj();
+ if ( !view )
+ return DCOPRef();
+ view->getCanvas()->insertRect( KoRect( x, y, h, w ) );
+ return selectedObject();
+}
+
+DCOPRef KPrPageIface::insertEllipse( double x, double y, double h, double w )
+{
+ KPrView *view=m_page->kPresenterDoc()->firstView();
+ m_page->kPresenterDoc()->deSelectAllObj();
+ if ( !view )
+ return DCOPRef();
+
+ view->getCanvas()->insertEllipse( KoRect( x, y, h, w ) );
+ return selectedObject();
+}
+
+DCOPRef KPrPageIface::insertPie( double x, double y, double h, double w )
+{
+ KPrView *view=m_page->kPresenterDoc()->firstView();
+ m_page->kPresenterDoc()->deSelectAllObj();
+ if ( !view )
+ return DCOPRef();
+
+ view->getCanvas()->insertPie( KoRect( x, y, h, w ) );
+ return selectedObject();
+}
+
+DCOPRef KPrPageIface::insertLine( double x1, double y1, double x2, double y2 )
+{
+ KPrView *view=m_page->kPresenterDoc()->firstView();
+ m_page->kPresenterDoc()->deSelectAllObj();
+ if ( !view )
+ return DCOPRef();
+
+ view->getCanvas()->insertLine( KoPoint( x1, y1), KoPoint( x2, y2 ) );
+ return selectedObject();
+}
+
+DCOPRef KPrPageIface::insertTextObject( double x, double y, double h, double w )
+{
+ KPrView *view=m_page->kPresenterDoc()->firstView();
+ m_page->kPresenterDoc()->deSelectAllObj();
+ if ( !view )
+ return DCOPRef();
+
+ view->getCanvas()->insertTextObject( KoRect( x, y, h, w ) );
+ return selectedObject();
+}
+
+DCOPRef KPrPageIface::insertPicture( const QString & file, double x, double y, double h, double w )
+{
+ m_page->setInsPictureFile(file);
+ KPrView *view=m_page->kPresenterDoc()->firstView();
+ m_page->kPresenterDoc()->deSelectAllObj();
+ if ( !view )
+ return DCOPRef();
+
+ view->getCanvas()->insertPicture( KoRect( x, y, h, w ) );
+ return selectedObject();
+}
+
+void KPrPageIface::setBackGroundColor1(const QColor &col)
+{
+ const QColor col2=backColor2();
+ m_page->setBackColor( col, col2, m_page->getBackColorType(),
+ m_page->getBackUnbalanced(), backXFactor(), backYFactor() );
+}
+
+void KPrPageIface::setBackGroundColor2(const QColor &col)
+{
+ const QColor col1=backColor1();
+ m_page->setBackColor( col1, col, m_page->getBackColorType(),
+ m_page->getBackUnbalanced(), backXFactor(), backYFactor() );
+}
+
+void KPrPageIface::setBackGroundColorType(const QString &type)
+{
+ BCType bctype;
+ if(type=="PLAIN")
+ bctype=BCT_PLAIN;
+ else if(type=="GHORZ")
+ bctype=BCT_GHORZ;
+ else if(type=="GVERT")
+ bctype=BCT_GVERT;
+ else if(type=="GDIAGONAL1")
+ bctype=BCT_GDIAGONAL1;
+ else if(type=="GDIAGONAL2")
+ bctype=BCT_GDIAGONAL2;
+ else if(type=="GCIRCLE")
+ bctype=BCT_GCIRCLE;
+ else if(type=="GRECT")
+ bctype=BCT_GRECT;
+ else if(type=="GPIPECROSS")
+ bctype=BCT_GPIPECROSS;
+ else if(type=="GPYRAMID")
+ bctype=BCT_GPYRAMID;
+ else
+ {
+ kdDebug(33001)<<"Error KPrPageIface::setBackGroundColorType" << endl;
+ return;
+ }
+
+ m_page->setBackColor( backColor1(), backColor2(), bctype,m_page->getBackUnbalanced(),
+ backXFactor(), backYFactor() );
+}
+
+void KPrPageIface::deSelectAllObj()
+{
+ m_page->deSelectAllObj();
+}
+
+bool KPrPageIface::oneObjectTextExist() const
+{
+ return m_page->oneObjectTextExist();
+}
+
+bool KPrPageIface::isOneObjectSelected() const
+{
+ return m_page->isOneObjectSelected();
+}
+
+bool KPrPageIface::haveASelectedPartObj() const
+{
+ return m_page->haveASelectedPartObj();
+}
+
+bool KPrPageIface::haveASelectedGroupObj() const
+{
+ return m_page->haveASelectedGroupObj();
+}
+
+void KPrPageIface::rotateAllObjSelected(float _newAngle)
+{
+ KCommand *cmd= m_page->rotateSelectedObjects( _newAngle);
+ delete cmd;
+}
+
+void KPrPageIface::moveAllObjectSelected( int diffx,int diffy)
+{
+ KPrView *_view=m_page->kPresenterDoc()->firstView();
+ if(_view)
+ {
+ KCommand *cmd=m_page->moveObject(_view, diffx,diffy);
+ delete cmd;
+ }
+}
+
+void KPrPageIface::deleteAllObjectSelected()
+{
+ KCommand * cmd=m_page->deleteSelectedObjects();
+ delete cmd;
+}
+
+bool KPrPageIface::hasHeader()const
+{
+ return m_page->hasHeader();
+}
+
+bool KPrPageIface::hasFooter()const
+{
+ return m_page->hasFooter();
+}
+
+void KPrPageIface::setHeader( bool b )
+{
+ m_page->setHeader( b );
+}
+
+void KPrPageIface::setFooter( bool b )
+{
+ m_page->setFooter( b );
+}
+
+
+void KPrPageIface::setUseMasterBackground( bool useMasterBackground )
+{
+ m_page->setUseMasterBackground( useMasterBackground );
+}
+
+bool KPrPageIface::useMasterBackground() const
+{
+ return m_page->useMasterBackground();
+}
+
+void KPrPageIface::setDisplayObjectFromMasterPage( bool _b )
+{
+ m_page->setDisplayObjectFromMasterPage( _b );
+}
+
+bool KPrPageIface::displayObjectFromMasterPage() const
+{
+ return m_page->displayObjectFromMasterPage();
+}
+
+void KPrPageIface::setDisplayBackground( bool _b )
+{
+ m_page->setDisplayBackground( _b );
+}
+
+bool KPrPageIface::displayBackground() const
+{
+ return m_page->displayBackground();
+}
diff --git a/kpresenter/KPrPageIface.h b/kpresenter/KPrPageIface.h
new file mode 100644
index 000000000..e1c2d1acf
--- /dev/null
+++ b/kpresenter/KPrPageIface.h
@@ -0,0 +1,137 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002,2003,2004 Laurent MONTEL <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRESENTER_PAGE_IFACE_H
+#define KPRESENTER_PAGE_IFACE_H
+
+#include <KoDocumentIface.h>
+#include <dcopref.h>
+
+#include <qstring.h>
+#include <qcolor.h>
+#include "global.h"
+class KPrPage;
+
+class KPrPageIface :public DCOPObject
+{
+ K_DCOP
+public:
+ KPrPageIface( KPrPage *_page, int pgnum );
+
+k_dcop:
+ virtual DCOPRef object( int num );
+ virtual DCOPRef selectedObject();
+ virtual DCOPRef textObject( int num );
+
+ virtual DCOPRef groupObjects();
+
+ virtual int numTextObject() const;
+
+
+ virtual QString manualTitle()const;
+ virtual void insertManualTitle(const QString & title);
+ virtual QString pageTitle( const QString &_title = QString() ) const;
+
+ virtual void setNoteText( const QString &_text );
+ virtual QString noteText( )const;
+
+ virtual unsigned int objNums() const;
+ virtual int numSelected() const;
+ virtual void ungroupObjects();
+ virtual void raiseObjs();
+ virtual void lowerObjs();
+ virtual void copyObjs();
+
+ virtual void slotRepaintVariable();
+ virtual void recalcPageNum();
+
+ virtual void setPageTimer( int pageTimer );
+ virtual void setPageSoundEffect( bool soundEffect );
+ virtual void setPageSoundFileName( const QString &fileName );
+ virtual QString pageSoundFileName()const;
+
+ virtual bool pageSoundEffect() const;
+ virtual int pageTimer() const;
+ virtual int backYFactor() const;
+ virtual int backXFactor() const;
+
+ virtual int backType()const ;
+ virtual int backView()const;
+ virtual QColor backColor1()const;
+ virtual QColor backColor2()const ;
+ virtual int backColorType()const;
+ virtual QString backPixFilename()const;
+ virtual QString backClipFilename()const;
+ virtual int pageEffect()const;
+ virtual QString pageEffectString( )const;
+ virtual void setPageEffect(const QString & );
+
+ virtual bool backUnbalanced()const ;
+
+ virtual QRect pageRect()const;
+
+ virtual bool isSlideSelected();
+ virtual void slideSelected(bool _b);
+ virtual void changePicture( const QString & );
+
+ virtual void setBackGroundColor1(const QColor &col);
+ virtual void setBackGroundColor2(const QColor &col);
+ virtual void setBackGroundColorType(const QString &type);
+
+ DCOPRef insertRectangle(double x,double y, double h, double w);
+ DCOPRef insertEllipse(double x,double y, double h, double w );
+ DCOPRef insertPie( double x,double y, double h, double w );
+ DCOPRef insertLine( double x1, double y1, double x2, double y2 );
+ DCOPRef insertTextObject( double x, double y, double h, double w );
+ DCOPRef insertPicture( const QString & file, double x, double y, double h, double w );
+
+ void deSelectAllObj();
+
+ bool oneObjectTextExist() const ;
+ bool isOneObjectSelected() const;
+
+ bool haveASelectedPartObj() const;
+ bool haveASelectedGroupObj() const;
+ void rotateAllObjSelected(float _newAngle);
+
+ void moveAllObjectSelected( int diffx,int diffy);
+ void deleteAllObjectSelected();
+
+ void sendBackward();
+ void bringForward();
+
+ bool hasHeader()const;
+ bool hasFooter()const;
+ void setHeader( bool b );
+ void setFooter( bool b );
+ void setUseMasterBackground( bool useMasterBackground );
+ bool useMasterBackground() const;
+
+ void setDisplayObjectFromMasterPage( bool _b );
+ bool displayObjectFromMasterPage() const;
+
+ void setDisplayBackground( bool _b );
+ bool displayBackground() const;
+
+private:
+ KPrPage *m_page;
+};
+
+#endif
diff --git a/kpresenter/KPrPartObject.cpp b/kpresenter/KPrPartObject.cpp
new file mode 100644
index 000000000..f4bbd3d2d
--- /dev/null
+++ b/kpresenter/KPrPartObject.cpp
@@ -0,0 +1,203 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPartObject.h"
+#include "KPrDocument.h"
+#include "KPrView.h"
+#include "KPrGradient.h"
+#include <KoDom.h>
+#include <KoXmlNS.h>
+#include "KoOasisContext.h"
+#include <kparts/partmanager.h>
+
+#include <qpainter.h>
+#include <kdebug.h>
+using namespace std;
+
+KPrPartObject::KPrPartObject( KPrChild *_child )
+ : KPr2DObject()
+{
+ child = _child;
+ pen = KoPen( Qt::black, 1.0, Qt::NoPen );
+ _enableDrawing = true;
+}
+
+KPrPartObject &KPrPartObject::operator=( const KPrPartObject & )
+{
+ return *this;
+}
+
+void KPrPartObject::updateChildGeometry()
+{
+ KoTextZoomHandler* zh = child->parent()->zoomHandler();
+ child->setGeometry( zh->zoomRect( getRect() ), true );
+ child->setRotationPoint( QPoint( zh->zoomItX( getOrig().x() + getSize().width() / 2 ),
+ zh->zoomItY( getOrig().y() + getSize().height() / 2 ) ) );
+}
+
+void KPrPartObject::rotate( float _angle )
+{
+ KPrObject::rotate( _angle );
+
+ child->setRotation( _angle );
+ KoTextZoomHandler* zh = child->parent()->zoomHandler();
+ child->setRotationPoint( QPoint( zh->zoomItX( getOrig().x() + getSize().width() / 2 ),
+ zh->zoomItY( getOrig().y() + getSize().height() / 2 ) ) );
+}
+
+bool KPrPartObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ kdDebug() << "KPrPartObject::saveOasisPart " << sc.partIndexObj << endl;
+
+ sc.xmlWriter.startElement( "draw:object" );
+ const QString name = QString( "Object_%1" ).arg( sc.partIndexObj + 1 );
+ ++sc.partIndexObj;
+ child->saveOasisAttributes( sc.xmlWriter, name );
+
+ sc.xmlWriter.endElement();
+ return true;
+}
+
+const char * KPrPartObject::getOasisElementName() const
+{
+ return "draw:frame";
+}
+
+
+void KPrPartObject::loadOasis(const QDomElement &element, KoOasisContext&context, KPrLoadingInfo */*info*/)
+{
+ kdDebug()<<"void KPrPartObject::loadOasis(const QDomElement &element)******************\n";
+
+ QDomElement objectElement = KoDom::namedItemNS( element, KoXmlNS::draw, "object" );
+ child->loadOasis( element, objectElement );
+ if(element.hasAttributeNS( KoXmlNS::draw, "name" ))
+ objectName = element.attributeNS( KoXmlNS::draw, "name", QString::null);
+ (void)child->loadOasisDocument( context.store(), context.manifestDocument() );
+}
+
+void KPrPartObject::draw( QPainter *_painter, KoTextZoomHandler *_zoomhandler,
+ int pageNum, SelectionMode selectionMode, bool drawContour )
+{
+ updateChildGeometry();
+ double ow = ext.width();
+ double oh = ext.height();
+
+ QSize size( _zoomhandler->zoomSize( ext ) );
+ int penw = ( ( pen.style() == Qt::NoPen ) ? 1 : int( pen.pointWidth() ) ) / 2;
+
+ QPen pen2;
+ if ( drawContour )
+ pen2 = QPen( Qt::black, 1, Qt::NoPen );
+ else {
+ pen2 = pen.zoomedPen( _zoomhandler );
+ }
+ _painter->save();
+ child->transform( *_painter );
+ _painter->setPen( Qt::NoPen );
+ _painter->setBrush( getBrush() );
+
+ if ( angle == 0 ) {
+ if ( getFillType() == FT_BRUSH || !gradient )
+ _painter->drawRect( penw, penw, _zoomhandler->zoomItX( ext.width() - 2 * penw ),
+ _zoomhandler->zoomItY( ext.height() - 2 * penw ) );
+ else {
+ gradient->setSize( size );
+ _painter->drawPixmap( penw, penw, gradient->pixmap(), 0, 0,
+ _zoomhandler->zoomItX( ow - 2 * penw ),
+ _zoomhandler->zoomItY( oh - 2 * penw ) );
+ }
+ }
+ else
+ {
+ if ( getFillType() == FT_BRUSH || !gradient )
+ _painter->drawRect( _zoomhandler->zoomItX( penw ), _zoomhandler->zoomItY( penw ),
+ _zoomhandler->zoomItX( ext.width() - 2 * penw ),
+ _zoomhandler->zoomItY( ext.height() - 2 * penw ) );
+ else {
+ gradient->setSize( size );
+ _painter->drawPixmap( penw, penw, gradient->pixmap(), 0, 0,
+ _zoomhandler->zoomItX( ow - 2 * penw ),
+ _zoomhandler->zoomItY( oh - 2 * penw ) );
+ }
+ }
+
+ _painter->setPen( pen2 );
+ _painter->setBrush( Qt::NoBrush );
+ _painter->drawRect( _zoomhandler->zoomItX( penw ), _zoomhandler->zoomItY( penw ),
+ _zoomhandler->zoomItX( ow - 2 * penw ), _zoomhandler->zoomItY( oh - 2 * penw ) );
+ paint( _painter, _zoomhandler, pageNum, selectionMode, drawContour );
+ _painter->restore();
+
+ KPrObject::draw( _painter, _zoomhandler, pageNum, selectionMode, drawContour );
+}
+
+void KPrPartObject::slot_changed( KoChild *_koChild )
+{
+ KoTextZoomHandler* zh = child->parent()->zoomHandler();
+ KoRect g = zh->unzoomRect( _koChild->geometry() );
+ KPrObject::setOrig( g.x(), g.y() );
+ KPrObject::setSize( g.width(), g.height() );
+}
+
+void KPrPartObject::paint( QPainter *_painter, KoTextZoomHandler *_zoomHandler,
+ int /* pageNum */, bool /*drawingShadow*/, bool drawContour )
+{
+ if ( !_enableDrawing ) return;
+
+ if ( drawContour ) {
+ QPen pen3( Qt::black, 1, Qt::DotLine );
+ _painter->setPen( pen3 );
+ _painter->setRasterOp( Qt::NotXorROP );
+ _painter->drawRect( _zoomHandler->zoomRect( KoRect( KoPoint( 0.0, 0.0 ), getSize() ) ) );
+ return;
+ }
+
+ if ( !child || !child->document() )
+ return;
+
+ int penw = ( pen.style() == Qt::NoPen ) ? 0 : int( pen.pointWidth() );
+ KoRect r( KoPoint( penw, penw ), KoPoint( getSize().width() - ( penw * 2.0 ),
+ getSize().height() - ( penw * 2.0 ) ) );
+ double zoomX = static_cast<double>( _zoomHandler->zoom() ) / 100;
+ double zoomY = static_cast<double>( _zoomHandler->zoom() ) / 100;
+ child->document()->paintEverything( *_painter,
+ _zoomHandler->zoomRect( r ),
+ true, // flicker?
+ 0 /* View isn't known from here - is that a problem? */,
+ zoomX,
+ zoomY );
+}
+
+void KPrPartObject::activate( QWidget *_widget )
+{
+ KPrView *view = dynamic_cast<KPrView*>( _widget );
+ KoDocument* part = child->document();
+ if ( !part )
+ return;
+ view->partManager()->addPart( part, false );
+ view->partManager()->setActivePart( part, view );
+}
+
+void KPrPartObject::deactivate()
+{
+}
+
+#include "KPrPartObject.moc"
diff --git a/kpresenter/KPrPartObject.h b/kpresenter/KPrPartObject.h
new file mode 100644
index 000000000..a2f40ece1
--- /dev/null
+++ b/kpresenter/KPrPartObject.h
@@ -0,0 +1,69 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kppartobject_h
+#define kppartobject_h
+
+#include <KoChild.h>
+
+#include "KPrObject.h"
+
+class KPrChild;
+class KoXmlWriter;
+class KoStore;
+
+class KPrPartObject : public QObject, public KPr2DObject
+{
+ Q_OBJECT
+public:
+ KPrPartObject( KPrChild *_child );
+ virtual ~KPrPartObject() {}
+
+ KPrPartObject &operator=( const KPrPartObject & );
+ virtual void rotate( float _angle );
+
+ virtual ObjType getType() const { return OT_PART; }
+ virtual QString getTypeString() const { return i18n("Embedded Object"); }
+
+ virtual void draw( QPainter *_painter, KoTextZoomHandler *_zoomhandler,
+ int pageNum, SelectionMode selectionMode, bool drawContour = FALSE );
+
+ void activate( QWidget *_widget );
+ void deactivate();
+
+ KPrChild *getChild() const { return child; }
+ void enableDrawing( bool f ) { _enableDrawing = f; }
+ virtual void loadOasis(const QDomElement &element, KoOasisContext &context, KPrLoadingInfo *info);
+
+public slots:
+ void slot_changed( KoChild *_koChild );
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+
+ void updateChildGeometry();
+ virtual void paint( QPainter *_painter,KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour = FALSE );
+
+ bool _enableDrawing;
+ KPrChild *child;
+};
+
+#endif
diff --git a/kpresenter/KPrPenStyleWidget.cpp b/kpresenter/KPrPenStyleWidget.cpp
new file mode 100644
index 000000000..6973c2f47
--- /dev/null
+++ b/kpresenter/KPrPenStyleWidget.cpp
@@ -0,0 +1,279 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004-2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPenStyleWidget.h"
+
+#include "penstyle.h"
+#include "KPrPBPreview.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qvbox.h>
+
+#include <kcolorbutton.h>
+#include <kcombobox.h>
+#include <klocale.h>
+#include <knuminput.h>
+
+
+KPrPenStyleWidget::KPrPenStyleWidget( QWidget *parent, const char *name, const KoPenCmd::Pen &pen, bool configureLineEnds )
+: QWidget( parent, name )
+, m_pen( pen )
+{
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->addWidget( m_ui = new PenStyleUI( this ) );
+
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ layout->addItem( spacer );
+
+ connect( m_ui->colorChooser, SIGNAL( changed( const QColor& ) ),
+ this, SLOT( slotPenChanged() ) );
+
+ m_ui->styleCombo->insertItem( i18n( "No Outline" ) );
+ m_ui->styleCombo->insertItem( "__________" );
+ m_ui->styleCombo->insertItem( "__ __ __ __" );
+ m_ui->styleCombo->insertItem( "_ _ _ _ _ _" );
+ m_ui->styleCombo->insertItem( "__ _ __ _ __" );
+ m_ui->styleCombo->insertItem( "__ _ _ __ _" );
+
+ m_ui->widthInput->setRange( 1, 10, 1, false);
+
+ connect( m_ui->styleCombo, SIGNAL( activated( int ) ),
+ this, SLOT( slotPenChanged() ) );
+
+ connect( m_ui->widthInput, SIGNAL( valueChanged( double ) ),
+ this, SLOT( slotPenChanged() ) );
+
+ m_ui->lineBeginCombo->insertItem( i18n("Normal") );
+ m_ui->lineBeginCombo->insertItem( i18n("Arrow") );
+ m_ui->lineBeginCombo->insertItem( i18n("Square") );
+ m_ui->lineBeginCombo->insertItem( i18n("Circle") );
+ m_ui->lineBeginCombo->insertItem( i18n("Line Arrow") );
+ m_ui->lineBeginCombo->insertItem( i18n("Dimension Line") );
+ m_ui->lineBeginCombo->insertItem( i18n("Double Arrow") );
+ m_ui->lineBeginCombo->insertItem( i18n("Double Line Arrow") );
+
+ connect( m_ui->lineBeginCombo, SIGNAL( activated( int ) ),
+ this, SLOT( slotLineBeginChanged() ) );
+
+ m_ui->lineEndCombo->insertItem( i18n("Normal") );
+ m_ui->lineEndCombo->insertItem( i18n("Arrow") );
+ m_ui->lineEndCombo->insertItem( i18n("Square") );
+ m_ui->lineEndCombo->insertItem( i18n("Circle") );
+ m_ui->lineEndCombo->insertItem( i18n("Line Arrow") );
+ m_ui->lineEndCombo->insertItem( i18n("Dimension Line") );
+ m_ui->lineEndCombo->insertItem( i18n("Double Arrow") );
+ m_ui->lineEndCombo->insertItem( i18n("Double Line Arrow") );
+
+ connect( m_ui->lineEndCombo, SIGNAL( activated( int ) ),
+ this, SLOT( slotLineEndChanged() ) );
+
+ if ( !configureLineEnds )
+ m_ui->arrowGroup->hide();
+ //m_ui->arrowGroup->setEnabled( configureLineEnds );
+
+ slotReset();
+}
+
+
+KPrPenStyleWidget::~KPrPenStyleWidget()
+{
+ delete m_ui;
+}
+
+
+void KPrPenStyleWidget::setPen( const KoPen &pen )
+{
+ m_ui->colorChooser->setColor( pen.color() );
+
+ switch ( pen.style() )
+ {
+ case NoPen:
+ m_ui->styleCombo->setCurrentItem( 0 );
+ break;
+ case SolidLine:
+ m_ui->styleCombo->setCurrentItem( 1 );
+ break;
+ case DashLine:
+ m_ui->styleCombo->setCurrentItem( 2 );
+ break;
+ case DotLine:
+ m_ui->styleCombo->setCurrentItem( 3 );
+ break;
+ case DashDotLine:
+ m_ui->styleCombo->setCurrentItem( 4 );
+ break;
+ case DashDotDotLine:
+ m_ui->styleCombo->setCurrentItem( 5 );
+ break;
+ case MPenStyle:
+ break; // not supported.
+ }
+
+ m_ui->widthInput->setValue( pen.pointWidth() );
+ m_ui->pbPreview->setPen( pen );
+}
+
+
+void KPrPenStyleWidget::setLineBegin( LineEnd lb )
+{
+ m_ui->lineBeginCombo->setCurrentItem( (int)lb );
+ m_ui->pbPreview->setLineBegin( lb );
+}
+
+
+void KPrPenStyleWidget::setLineEnd( LineEnd le )
+{
+ m_ui->lineEndCombo->setCurrentItem( (int)le );
+ m_ui->pbPreview->setLineEnd( le );
+}
+
+
+KoPen KPrPenStyleWidget::getKPPen() const
+{
+ KoPen pen;
+
+ switch ( m_ui->styleCombo->currentItem() )
+ {
+ case 0:
+ pen.setStyle( NoPen );
+ break;
+ case 1:
+ pen.setStyle( SolidLine );
+ break;
+ case 2:
+ pen.setStyle( DashLine );
+ break;
+ case 3:
+ pen.setStyle( DotLine );
+ break;
+ case 4:
+ pen.setStyle( DashDotLine );
+ break;
+ case 5:
+ pen.setStyle( DashDotDotLine );
+ break;
+ }
+
+ pen.setColor( m_ui->colorChooser->color() );
+ pen.setPointWidth( m_ui->widthInput->value() );
+
+ return pen;
+}
+
+
+LineEnd KPrPenStyleWidget::getLineBegin() const
+{
+ return (LineEnd) m_ui->lineBeginCombo->currentItem();
+}
+
+
+LineEnd KPrPenStyleWidget::getLineEnd() const
+{
+ return (LineEnd) m_ui->lineEndCombo->currentItem();
+}
+
+
+int KPrPenStyleWidget::getPenConfigChange() const
+{
+ int flags = 0;
+
+ if ( getLineEnd() != m_pen.lineEnd )
+ flags = flags | KoPenCmd::LineEnd;
+ if ( getLineBegin() != m_pen.lineBegin )
+ flags = flags | KoPenCmd::LineBegin;
+ if ( getKPPen().color() != m_pen.pen.color() )
+ flags = flags | KoPenCmd::Color;
+ if ( getKPPen().style() != m_pen.pen.style() )
+ flags = flags | KoPenCmd::Style;
+ if ( getKPPen().pointWidth() != m_pen.pen.pointWidth() )
+ flags = flags | KoPenCmd::Width;
+
+ return flags;
+}
+
+
+KoPenCmd::Pen KPrPenStyleWidget::getPen() const
+{
+ KoPenCmd::Pen pen( getKPPen(), getLineBegin(), getLineEnd() );
+ return pen;
+}
+
+
+void KPrPenStyleWidget::setPen( const KoPenCmd::Pen &pen )
+{
+ m_pen = pen;
+ slotReset();
+}
+
+
+void KPrPenStyleWidget::apply()
+{
+ int flags = getPenConfigChange();
+
+ if ( flags & KoPenCmd::LineEnd )
+ m_pen.lineEnd = getLineEnd();
+
+ if ( flags & KoPenCmd::LineBegin )
+ m_pen.lineBegin = getLineBegin();
+
+ if ( flags & KoPenCmd::Color )
+ m_pen.pen.setColor( getKPPen().color() );
+
+ if ( flags & KoPenCmd::Style )
+ m_pen.pen.setStyle( getKPPen().style() );
+
+ if ( flags & KoPenCmd::Width )
+ m_pen.pen.setPointWidth( getKPPen().pointWidth() );
+}
+
+
+void KPrPenStyleWidget::slotReset()
+{
+ setPen( m_pen.pen );
+ m_ui->widthLabel->setEnabled( m_pen.pen.style() != NoPen );
+ m_ui->widthInput->setEnabled( m_pen.pen.style() != NoPen );
+
+ setLineBegin( m_pen.lineBegin );
+ setLineEnd( m_pen.lineEnd );
+}
+
+
+void KPrPenStyleWidget::slotPenChanged()
+{
+ KoPen pen = getKPPen();
+ m_ui->widthLabel->setEnabled( pen.style() != NoPen );
+ m_ui->widthInput->setEnabled( pen.style() != NoPen );
+ m_ui->pbPreview->setPen( pen );
+}
+
+
+void KPrPenStyleWidget::slotLineBeginChanged()
+{
+ m_ui->pbPreview->setLineBegin( getLineBegin() );
+}
+
+
+void KPrPenStyleWidget::slotLineEndChanged()
+{
+ m_ui->pbPreview->setLineEnd( getLineEnd() );
+}
+
+#include "KPrPenStyleWidget.moc"
diff --git a/kpresenter/KPrPenStyleWidget.h b/kpresenter/KPrPenStyleWidget.h
new file mode 100644
index 000000000..42ce56dca
--- /dev/null
+++ b/kpresenter/KPrPenStyleWidget.h
@@ -0,0 +1,67 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.orgReginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PENSTYLEWIDGET_H
+#define PENSTYLEWIDGET_H
+
+#include "global.h"
+
+#include <qwidget.h>
+
+#include "KPrCommand.h"
+#include <KoPen.h>
+
+class PenStyleUI;
+
+
+class KPrPenStyleWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrPenStyleWidget( QWidget *parent, const char *name, const KoPenCmd::Pen &pen, bool configureLineEnds = true );
+ ~KPrPenStyleWidget();
+
+ int getPenConfigChange() const;
+ KoPenCmd::Pen getPen() const;
+
+ void setPen( const KoPenCmd::Pen &pen );
+ void apply();
+
+private:
+ KoPen getKPPen() const;
+ LineEnd getLineBegin() const;
+ LineEnd getLineEnd() const;
+
+ void setPen( const KoPen &pen );
+ void setLineBegin( LineEnd lb );
+ void setLineEnd( LineEnd le );
+
+ KoPenCmd::Pen m_pen;
+
+ PenStyleUI *m_ui;
+
+private slots:
+ void slotReset();
+ void slotPenChanged();
+ void slotLineBeginChanged();
+ void slotLineEndChanged();
+};
+
+#endif /* PENSTYLEWIDGET_H */
diff --git a/kpresenter/KPrPgConfDia.cpp b/kpresenter/KPrPgConfDia.cpp
new file mode 100644
index 000000000..ccb127191
--- /dev/null
+++ b/kpresenter/KPrPgConfDia.cpp
@@ -0,0 +1,324 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2002, 2003 Ariya Hidayat <ariya@kde.org>
+ Copyright (C) 2004, 2005 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPgConfDia.h"
+#include "KPrDocument.h"
+#include "KPrPage.h"
+
+#include <qbuttongroup.h>
+#include <qhbuttongroup.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qhbox.h>
+#include <qvbox.h>
+#include <qvgroupbox.h>
+#include <qheader.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlistview.h>
+#include <qpen.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qvaluelist.h>
+#include <qvbuttongroup.h>
+#include <qwhatsthis.h>
+
+#include <kcolorbutton.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <knuminput.h>
+#include <qslider.h>
+
+KPrPgConfDia::KPrPgConfDia( QWidget* parent, KPrDocument* doc )
+ : KDialogBase( KDialogBase::Tabbed, i18n("Configure Slide Show"),
+ Ok|Cancel, Ok, parent, "pgConfDia", true ),
+ m_doc( doc )
+{
+ setupPageGeneral();
+ setupPageSlides();
+
+ connect( this, SIGNAL( okClicked() ), this, SLOT( confDiaOk() ) );
+ connect( this, SIGNAL( okClicked() ), this, SLOT( accept() ) );
+}
+
+void KPrPgConfDia::setupPageGeneral()
+{
+ QFrame* generalPage = addPage( i18n("&General") );
+ QWhatsThis::add( generalPage, i18n("<p>This dialog allows you to configure how the slideshow "
+ "will be displayed, including whether the slides are "
+ "automatically sequenced or manually controlled, and also "
+ "allows you to configure a <em>drawing pen</em> that can "
+ "be used during the display of the presentation to add "
+ "additional information or to emphasise particular points.</p>") );
+ QVBoxLayout *generalLayout = new QVBoxLayout( generalPage, 0, KDialog::spacingHint() );
+
+ QVButtonGroup *switchGroup = new QVButtonGroup( i18n("&Transition Type"), generalPage );
+ generalLayout->addWidget( switchGroup );
+ QWhatsThis::add( switchGroup, i18n("<li><p>If you select <b>Manual transition to next step or slide</b> "
+ "then each transition and effect on a slide, or transition from "
+ "one slide to the next, will require an action. Typically this "
+ "action will be a mouse click, or the space bar.</p></li>"
+ "<li><p>If you select <b>Automatic transition to next step or slide</b> "
+ "then the presentation will automatically sequence each transition "
+ "and effect on a slide, and will automatically transition to the "
+ "next slide when the current slide is fully displayed. The speed "
+ "of sequencing is controlled using the slider below. This also "
+ "enables the option to automatically loop back to the first "
+ "slide after the last slide has been shown.</p></li>") );
+ m_manualButton = new QRadioButton( i18n("&Manual transition to next step or slide"), switchGroup );
+ m_manualButton->setChecked( m_doc->spManualSwitch() );
+ m_autoButton = new QRadioButton( i18n("&Automatic transition to next step or slide"), switchGroup );
+ m_autoButton->setChecked( !m_doc->spManualSwitch() );
+
+ infiniteLoop = new QCheckBox( i18n( "&Infinite loop" ), generalPage );
+ generalLayout->addWidget( infiniteLoop );
+ QWhatsThis::add( infiniteLoop, i18n("<p>If this checkbox is selected, then the slideshow "
+ "will restart at the first slide after the last slide "
+ "has been displayed. It is only available if the "
+ "<b>Automatic transition to next step or slide</b> "
+ "button is selected above.</p> <p>This option may be "
+ "useful if you are running a promotional display.</p>") );
+
+ infiniteLoop->setEnabled( !m_doc->spManualSwitch() );
+ connect( m_autoButton, SIGNAL( toggled(bool) ), infiniteLoop, SLOT( setEnabled(bool) ) );
+ connect( m_autoButton, SIGNAL( toggled(bool) ), infiniteLoop, SLOT( setChecked(bool) ) );
+
+ endOfPresentationSlide = new QCheckBox( i18n( "&Show 'End of presentation' slide" ), generalPage );
+ generalLayout->addWidget( endOfPresentationSlide );
+ QWhatsThis::add( endOfPresentationSlide, i18n("<p>If this checkbox is selected, when the slideshow "
+ "has finished a black slideshow containing the "
+ "message 'End of presentation. Click to exit' will "
+ "be shown.") );
+ endOfPresentationSlide->setChecked( m_doc->spShowEndOfPresentationSlide() );
+ endOfPresentationSlide->setDisabled( infiniteLoop->isEnabled() && getInfiniteLoop() );
+ connect( infiniteLoop, SIGNAL( toggled(bool) ), endOfPresentationSlide, SLOT( setDisabled(bool) ) );
+
+ presentationDuration = new QCheckBox( i18n( "Measure presentation &duration" ), generalPage );
+ generalLayout->addWidget( presentationDuration );
+ QWhatsThis::add( presentationDuration, i18n("<p>If this checkbox is selected, the time that "
+ "each slide was displayed for, and the total time "
+ "for the presentation will be measured.</p> "
+ "<p>The times will be displayed at the end of the "
+ "presentation.</p> "
+ "<p>This can be used during rehearsal to check "
+ "coverage for each issue in the presentation, "
+ "and to verify that the presentation duration "
+ "is correct.</p>" ) );
+ presentationDuration->setChecked( m_doc->presentationDuration() );
+
+ // presentation pen (color and width)
+
+ QGroupBox* penGroup = new QGroupBox( 2, Qt::Horizontal, i18n("Presentation Pen") , generalPage );
+ generalLayout->addWidget( penGroup );
+ QWhatsThis::add( penGroup, i18n("<p>This part of the dialog allows you to configure the "
+ "<em>drawing mode</em>, which allows you to add additional "
+ "information, emphasise particular content, or to correct "
+ "errors during the presentation by drawing on the slides "
+ "using the mouse.</p>"
+ "<p>You can configure the color of the drawing pen and the "
+ "width of the pen.</p>" ) );
+ penGroup->layout()->setSpacing(KDialog::marginHint());
+ penGroup->layout()->setMargin(KDialog::spacingHint());
+ //QGridLayout *grid = new QGridLayout(penGroup->layout(), 3, 2 );
+
+ QLabel* label = new QLabel( i18n( "Color:" ), penGroup );
+ //grid->addWidget( label, 0, 0 );
+ penColor = new KColorButton( m_doc->presPen().color(), m_doc->presPen().color(), penGroup );
+ //grid->addWidget( penColor, 0, 1 );
+
+ label = new QLabel( i18n( "Width:" ), penGroup );
+ // grid->addWidget( label, 1, 0 );
+ penWidth = new QSpinBox( 1, 10, 1, penGroup );
+ penWidth->setSuffix( i18n(" pt") );
+ penWidth->setValue( m_doc->presPen().width() );
+ //grid->addWidget( penWidth, 1, 1 );
+
+ generalLayout->addStretch();
+}
+
+void KPrPgConfDia::setupPageSlides()
+{
+ QFrame* slidesPage = addPage( i18n("&Slides") );
+ QWhatsThis::add( slidesPage, i18n("<p>This dialog allows you to configure which slides "
+ "are used in the presentation. Slides that are not "
+ "selected will not be displayed during the slide "
+ "show.</p>") );
+ QGridLayout *slidesLayout = new QGridLayout( slidesPage,7 , 2, 0, KDialog::spacingHint());
+
+
+ QButtonGroup *group=new QVButtonGroup( slidesPage );
+ group->setRadioButtonExclusive( true );
+
+ m_customSlide = new QRadioButton( i18n( "Custom slide show" ), group, "customslide" );
+
+ connect( m_customSlide, SIGNAL( clicked () ), this, SLOT( radioButtonClicked() ) );
+
+ QHBox *box = new QHBox( group );
+
+ m_labelCustomSlide = new QLabel( i18n( "Custom slide:" ),box );
+
+ m_customSlideCombobox = new QComboBox( box );
+ m_customSlideCombobox->insertStringList( m_doc->presentationList() );
+
+ m_selectedSlide = new QRadioButton( i18n( "Selected pages:" ), group, "selectedslide" );
+ slidesLayout->addMultiCellWidget( group, 0,2,0,1 );
+ connect( m_selectedSlide, SIGNAL( clicked () ), this, SLOT( radioButtonClicked() ) );
+
+ slides = new QListView( slidesPage );
+ slidesLayout->addMultiCellWidget( slides, 3, 3, 0, 1 );
+ slidesLayout->setRowStretch( 3, 10 );
+ slides->addColumn( i18n("Slide") );
+ slides->setSorting( -1 );
+ slides->header()->hide();
+
+ for ( int i = m_doc->getPageNums() - 1; i >= 0; --i )
+ {
+ KPrPage *page=m_doc->pageList().at( i );
+ QCheckListItem* item = new QCheckListItem( slides,
+ page->pageTitle(),
+ QCheckListItem::CheckBox );
+ item->setOn( page->isSlideSelected() );
+ }
+
+ QHBox* buttonGroup = new QHBox( slidesPage );
+ buttonGroup->setSpacing( KDialog::spacingHint() );
+
+ QPushButton* selectAllButton = new QPushButton( i18n( "Select &All" ), buttonGroup );
+ connect( selectAllButton, SIGNAL( clicked() ), this, SLOT( selectAllSlides() ) );
+
+ QPushButton* deselectAllButton = new QPushButton( i18n( "&Deselect All" ), buttonGroup );
+ connect( deselectAllButton, SIGNAL( clicked() ), this, SLOT( deselectAllSlides() ) );
+
+ QWidget* spacer = new QWidget( buttonGroup );
+
+ spacer->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
+ slidesLayout->addMultiCellWidget( buttonGroup, 4, 4, 0, 1 );
+
+ if ( !m_doc->presentationName().isEmpty() )
+ {
+ m_customSlide->setChecked( true );
+ m_customSlideCombobox->setCurrentText( m_doc->presentationName() );
+ }
+ else
+ m_selectedSlide->setChecked( true );
+
+ if ( m_customSlideCombobox->count()==0 )
+ {
+ m_customSlide->setEnabled( false );
+ m_labelCustomSlide->setEnabled( false );
+ m_customSlideCombobox->setEnabled( false );
+ }
+ radioButtonClicked();
+}
+
+KPrPgConfDia::~KPrPgConfDia()
+{
+}
+
+void KPrPgConfDia::radioButtonClicked()
+{
+ if ( m_customSlide->isChecked() )
+ {
+ m_labelCustomSlide->setEnabled( true );
+ m_customSlideCombobox->setEnabled( true );
+ slides->setEnabled( false );
+ }
+ else
+ {
+ m_labelCustomSlide->setEnabled( false );
+ m_customSlideCombobox->setEnabled( false );
+ slides->setEnabled( true );
+ }
+}
+
+bool KPrPgConfDia::getInfiniteLoop() const
+{
+ return infiniteLoop->isChecked();
+}
+
+bool KPrPgConfDia::getShowEndOfPresentationSlide() const
+{
+ return endOfPresentationSlide->isChecked();
+}
+
+bool KPrPgConfDia::getManualSwitch() const
+{
+ return m_manualButton->isChecked();
+}
+
+bool KPrPgConfDia::getPresentationDuration() const
+{
+ return presentationDuration->isChecked();
+}
+
+QPen KPrPgConfDia::getPen() const
+{
+ return QPen( penColor->color(), penWidth->value() );
+}
+
+QValueList<bool> KPrPgConfDia::getSelectedSlides() const
+{
+ QValueList<bool> selectedSlides;
+
+ QListViewItem *item = slides->firstChild();
+ while( item )
+ {
+ QCheckListItem *checkItem = dynamic_cast<QCheckListItem*>( item );
+ bool selected = false;
+ if( checkItem ) selected = checkItem->isOn();
+ item = item->nextSibling();
+ selectedSlides.append( selected );
+ }
+ return selectedSlides;
+}
+
+void KPrPgConfDia::selectAllSlides()
+{
+ QListViewItem *item = slides->firstChild();
+ while( item )
+ {
+ QCheckListItem *checkItem = dynamic_cast<QCheckListItem*>( item );
+ if( checkItem ) checkItem->setOn( true );
+ item = item->nextSibling();
+ }
+}
+
+void KPrPgConfDia::deselectAllSlides()
+{
+ QListViewItem *item = slides->firstChild();
+ while( item )
+ {
+ QCheckListItem *checkItem = dynamic_cast<QCheckListItem*>( item );
+ if( checkItem ) checkItem->setOn( false );
+ item = item->nextSibling();
+ }
+}
+
+QString KPrPgConfDia::presentationName() const
+{
+ if ( m_customSlide->isChecked() )
+ return m_customSlideCombobox->currentText();
+ else
+ return QString::null;
+}
+
+#include "KPrGradient.h"
+#include "KPrPgConfDia.moc"
diff --git a/kpresenter/KPrPgConfDia.h b/kpresenter/KPrPgConfDia.h
new file mode 100644
index 000000000..e25fdf79c
--- /dev/null
+++ b/kpresenter/KPrPgConfDia.h
@@ -0,0 +1,90 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2002, 2003 Ariya Hidayat <ariya@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PGCONFDIA_H
+#define PGCONFDIA_H
+
+#include "global.h"
+
+#include <qmap.h>
+#include <qpen.h>
+#include <qvaluelist.h>
+
+#include <kdialogbase.h>
+
+class KPrDocument;
+
+class QCheckBox;
+class QComboBox;
+class QColor;
+class QListView;
+class QRadioButton;
+class QSpinBox;
+
+class KColorButton;
+class QSlider;
+
+class KPrPgConfDia : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+
+ // constructor - destructor
+ KPrPgConfDia( QWidget* parent, KPrDocument* doc );
+ ~KPrPgConfDia();
+ bool getInfiniteLoop() const;
+ bool getShowEndOfPresentationSlide() const;
+ bool getManualSwitch() const;
+ bool getPresentationDuration() const;
+ QPen getPen() const;
+ QValueList<bool> getSelectedSlides() const;
+
+ QString presentationName() const;
+
+protected:
+
+ KPrDocument* m_doc;
+
+ QCheckBox *infiniteLoop, *presentationDuration, *endOfPresentationSlide;
+ QRadioButton *m_manualButton, *m_autoButton;
+ KColorButton* penColor;
+ QSpinBox* penWidth;
+ QComboBox *m_customSlideCombobox;
+ QListView *slides;
+ QRadioButton *m_customSlide, *m_selectedSlide;
+ QLabel *m_labelCustomSlide;
+ void setupPageGeneral();
+ void setupPageSlides();
+
+public slots:
+ void confDiaOk() { emit pgConfDiaOk(); }
+
+signals:
+ void pgConfDiaOk();
+
+protected slots:
+ void selectAllSlides();
+ void deselectAllSlides();
+ void radioButtonClicked();
+};
+
+#endif
diff --git a/kpresenter/KPrPicturePreview.cpp b/kpresenter/KPrPicturePreview.cpp
new file mode 100644
index 000000000..7dd8cf8ce
--- /dev/null
+++ b/kpresenter/KPrPicturePreview.cpp
@@ -0,0 +1,307 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ The code is based on work of
+ Copyright (C) 2002 Toshitaka Fujioka <fujioka@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPicturePreview.h"
+
+#include <qimage.h>
+#include <qpainter.h>
+
+
+KPrPicturePreview::KPrPicturePreview( QWidget* parent, const char* name)
+: QFrame( parent, name )
+, mirrorType( PM_NORMAL )
+, depth( 0 )
+, swapRGB( false )
+, bright( 0 )
+, grayscal( false )
+{
+ setFrameStyle( WinPanel | Sunken );
+ setMinimumSize( 300, 200 );
+}
+
+
+void KPrPicturePreview::drawContents( QPainter *painter )
+{
+ QSize ext = contentsRect().size();
+
+ QPixmap _pix = origPixmap;
+ QImage img( _pix.convertToImage().smoothScale( ext.width(),ext.height(), QImage::ScaleMin ) );
+
+ bool _horizontal = false;
+ bool _vertical = false;
+ if ( mirrorType == PM_HORIZONTAL )
+ _horizontal = true;
+ else if ( mirrorType == PM_VERTICAL )
+ _vertical = true;
+ else if ( mirrorType == PM_HORIZONTALANDVERTICAL ) {
+ _horizontal = true;
+ _vertical = true;
+ }
+
+ img = img.mirror( _horizontal, _vertical );
+
+ if ( depth != 0 ) {
+ QImage tmpImg = img.convertDepth( depth );
+ if ( !tmpImg.isNull() )
+ img = tmpImg;
+ }
+
+ if ( swapRGB )
+ img = img.swapRGB();
+
+
+ if ( grayscal ) {
+ if ( depth == 1 || depth == 8 ) {
+ for ( int i = 0; i < img.numColors(); ++i ) {
+ QRgb rgb = img.color( i );
+ int gray = qGray( rgb );
+ rgb = qRgb( gray, gray, gray );
+ img.setColor( i, rgb );
+ }
+ }
+ else {
+ int _width = img.width();
+ int _height = img.height();
+ int _x = 0;
+ int _y = 0;
+
+ for ( _x = 0; _x < _width; ++_x ) {
+ for ( _y = 0; _y < _height; ++_y ) {
+ if ( img.valid( _x, _y ) ) {
+ QRgb rgb = img.pixel( _x, _y );
+ int gray = qGray( rgb );
+ rgb = qRgb( gray, gray, gray );
+ img.setPixel( _x, _y, rgb );
+ }
+ }
+ }
+ }
+ }
+
+
+ if ( bright != 0 ) {
+ if ( depth == 1 || depth == 8 ) {
+ for ( int i = 0; i < img.numColors(); ++i ) {
+ QRgb rgb = img.color( i );
+ QColor c( rgb );
+
+ if ( bright > 0 )
+ rgb = c.light( 100 + bright ).rgb();
+ else
+ rgb = c.dark( 100 + abs( bright ) ).rgb();
+
+ img.setColor( i, rgb );
+ }
+ }
+ else {
+ int _width = img.width();
+ int _height = img.height();
+ int _x = 0;
+ int _y = 0;
+
+ for ( _x = 0; _x < _width; ++_x ) {
+ for ( _y = 0; _y < _height; ++_y ) {
+ if ( img.valid( _x, _y ) ) {
+ QRgb rgb = img.pixel( _x, _y );
+ QColor c( rgb );
+
+ if ( bright > 0 )
+ rgb = c.light( 100 + bright ).rgb();
+ else
+ rgb = c.dark( 100 + abs( bright ) ).rgb();
+
+ img.setPixel( _x, _y, rgb );
+ }
+ }
+ }
+ }
+ }
+
+ _pix.convertFromImage( img );
+
+ QPixmap tmpPix( _pix.size() );
+ tmpPix.fill( Qt::white );
+
+ QPainter _p;
+ _p.begin( &tmpPix );
+ _p.drawPixmap( 0, 0, _pix );
+ _p.end();
+
+ QSize _pixSize = _pix.size();
+ int _x = 0, _y = 0;
+ int w = _pixSize.width(), h = _pixSize.height();
+ _x = ( ext.width() - w ) / 2;
+ _y = ( ext.height() - h ) / 2;
+
+ painter->drawPixmap( _x, _y, tmpPix );
+}
+
+
+void KPrPicturePreview::slotNormalPicture()
+{
+ if ( mirrorType != PM_NORMAL )
+ {
+ mirrorType = PM_NORMAL;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotHorizontalMirrorPicture()
+{
+ if ( mirrorType != PM_HORIZONTAL )
+ {
+ mirrorType = PM_HORIZONTAL;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotVerticalMirrorPicture()
+{
+ if ( mirrorType != PM_VERTICAL )
+ {
+ mirrorType = PM_VERTICAL;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotHorizontalAndVerticalMirrorPicture()
+{
+ if ( mirrorType != PM_HORIZONTALANDVERTICAL )
+ {
+ mirrorType = PM_HORIZONTALANDVERTICAL;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotPictureDepth0()
+{
+ if ( depth !=0 )
+ {
+ depth = 0;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotPictureDepth1()
+{
+ if ( depth != 1 )
+ {
+ depth = 1;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotPictureDepth8()
+{
+ if ( depth != 8)
+ {
+ depth = 8;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotPictureDepth16()
+{
+ if ( depth != 16 )
+ {
+ depth = 16;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotPictureDepth32()
+{
+ if ( depth !=32 )
+ {
+ depth = 32;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotSwapRGBPicture( bool _on )
+{
+ if ( swapRGB != _on )
+ {
+ swapRGB = _on;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotGrayscalPicture( bool _on )
+{
+ if ( grayscal != _on )
+ {
+ grayscal = _on;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::slotBrightValue( int _value )
+{
+ if ( bright != _value )
+ {
+ bright = _value;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::setDepth( int _depth)
+{
+ if ( _depth != depth )
+ {
+ depth = _depth;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::setMirrorType (PictureMirrorType _t)
+{
+ if ( mirrorType != _t )
+ {
+ mirrorType = _t;
+ repaint( false );
+ }
+}
+
+
+void KPrPicturePreview::setPicturePixmap(const QPixmap &_pixmap)
+{
+ origPixmap = _pixmap;
+ repaint( false );
+}
+
+
+#include "KPrPicturePreview.moc"
diff --git a/kpresenter/KPrPicturePreview.h b/kpresenter/KPrPicturePreview.h
new file mode 100644
index 000000000..abe70ca88
--- /dev/null
+++ b/kpresenter/KPrPicturePreview.h
@@ -0,0 +1,74 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ The code is based on work of
+ Copyright (C) 2002 Toshitaka Fujioka <fujioka@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PICTUREPREVIEW_H
+#define PICTUREPREVIEW_H
+
+#include <qframe.h>
+
+#include "global.h"
+
+class KPrPicturePreview : public QFrame
+{
+ Q_OBJECT
+
+public:
+ KPrPicturePreview( QWidget* parent, const char* name);
+ ~KPrPicturePreview() {}
+
+ void setDepth( int depth);
+ void setMirrorType (PictureMirrorType _t);
+ void setPicturePixmap(const QPixmap &_pixmap);
+
+ int getDepth() const { return depth; }
+
+public slots:
+ void slotNormalPicture();
+ void slotHorizontalMirrorPicture();
+ void slotVerticalMirrorPicture();
+ void slotHorizontalAndVerticalMirrorPicture();
+
+ void slotPictureDepth0();
+ void slotPictureDepth1();
+ void slotPictureDepth8();
+ void slotPictureDepth16();
+ void slotPictureDepth32();
+
+ void slotSwapRGBPicture( bool _on );
+
+ void slotGrayscalPicture( bool _on );
+
+ void slotBrightValue( int _value );
+
+protected:
+ virtual void drawContents( QPainter *painter );
+
+ PictureMirrorType mirrorType;
+ int depth;
+ bool swapRGB;
+ int bright;
+ bool grayscal;
+ QPixmap origPixmap;
+};
+
+#endif /* PICTUREPREVIEW_H */
diff --git a/kpresenter/KPrPictureProperty.cpp b/kpresenter/KPrPictureProperty.cpp
new file mode 100644
index 000000000..c34926735
--- /dev/null
+++ b/kpresenter/KPrPictureProperty.cpp
@@ -0,0 +1,132 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPictureProperty.h"
+
+#include "picturepropertyui.h"
+#include "KPrPicturePreview.h"
+
+#include <knuminput.h>
+#include <qradiobutton.h>
+#include <qcheckbox.h>
+#include <qlayout.h>
+
+KPrPictureProperty::KPrPictureProperty( QWidget *parent, const char *name, const QPixmap &pixmap,
+ KPrPictureSettingCmd::PictureSettings pictureSettings )
+: QWidget( parent, name )
+, m_pictureSettings( pictureSettings )
+{
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->addWidget( m_ui = new PicturePropertyUI( this ) );
+
+ connect( m_ui->depth0, SIGNAL( clicked() ), m_ui->picturePreview, SLOT( slotPictureDepth0() ) );
+ connect( m_ui->depth1, SIGNAL( clicked() ), m_ui->picturePreview, SLOT( slotPictureDepth1() ) );
+ connect( m_ui->depth8, SIGNAL( clicked() ), m_ui->picturePreview, SLOT( slotPictureDepth8() ) );
+ connect( m_ui->depth16, SIGNAL( clicked() ), m_ui->picturePreview, SLOT( slotPictureDepth16() ) );
+ connect( m_ui->depth32, SIGNAL( clicked() ), m_ui->picturePreview, SLOT( slotPictureDepth32() ) );
+
+ connect( m_ui->swapRGB, SIGNAL( toggled( bool ) ), m_ui->picturePreview, SLOT( slotSwapRGBPicture( bool ) ) );
+
+ connect( m_ui->grayscale, SIGNAL( toggled( bool ) ), m_ui->picturePreview, SLOT( slotGrayscalPicture( bool ) ) );
+
+ connect( m_ui->brightnessInput, SIGNAL( valueChanged( int ) ), m_ui->picturePreview, SLOT( slotBrightValue( int ) ) );
+
+ m_ui->picturePreview->setPicturePixmap( pixmap );
+
+ slotReset();
+}
+
+
+KPrPictureProperty::~KPrPictureProperty()
+{
+}
+
+
+int KPrPictureProperty::getPicturePropertyChange() const
+{
+ int flags = 0;
+
+ KPrPictureSettingCmd::PictureSettings pictureSettings = getPictureSettings();
+
+ if ( pictureSettings.depth != m_pictureSettings.depth )
+ flags |= KPrPictureSettingCmd::Depth;
+
+ if ( pictureSettings.swapRGB != m_pictureSettings.swapRGB )
+ flags |= KPrPictureSettingCmd::SwapRGB;
+
+ if ( pictureSettings.grayscal != m_pictureSettings.grayscal )
+ flags |= KPrPictureSettingCmd::Grayscal;
+
+ if ( pictureSettings.bright != m_pictureSettings.bright )
+ flags |= KPrPictureSettingCmd::Bright;
+
+ return flags;
+}
+
+
+KPrPictureSettingCmd::PictureSettings KPrPictureProperty::getPictureSettings() const
+{
+ KPrPictureSettingCmd::PictureSettings pictureSettings;
+ pictureSettings.mirrorType = m_pictureSettings.mirrorType;
+ pictureSettings.depth = m_ui->picturePreview->getDepth();
+ pictureSettings.swapRGB = m_ui->swapRGB->isOn();
+ pictureSettings.grayscal = m_ui->grayscale->isOn();
+ pictureSettings.bright = m_ui->brightnessInput->value();
+ return pictureSettings;
+}
+
+
+void KPrPictureProperty::apply()
+{
+ int flags = getPicturePropertyChange();
+
+ KPrPictureSettingCmd::PictureSettings pictureSettings = getPictureSettings();
+
+ if ( flags & KPrPictureSettingCmd::Depth )
+ m_pictureSettings.depth = pictureSettings.depth;
+
+ if ( flags & KPrPictureSettingCmd::SwapRGB )
+ m_pictureSettings.swapRGB = pictureSettings.swapRGB;
+
+ if ( flags & KPrPictureSettingCmd::Grayscal )
+ m_pictureSettings.grayscal = pictureSettings.grayscal;
+
+ if ( flags & KPrPictureSettingCmd::Bright )
+ m_pictureSettings.bright = pictureSettings.bright;
+}
+
+
+void KPrPictureProperty::slotReset()
+{
+ m_ui->depth0->setChecked( m_pictureSettings.depth == 0 );
+ m_ui->depth1->setChecked( m_pictureSettings.depth == 1 );
+ m_ui->depth8->setChecked( m_pictureSettings.depth == 8 );
+ m_ui->depth16->setChecked( m_pictureSettings.depth == 16 );
+ m_ui->depth32->setChecked( m_pictureSettings.depth == 32 );
+ m_ui->picturePreview->setDepth( m_pictureSettings.depth );
+
+ m_ui->swapRGB->setChecked( m_pictureSettings.swapRGB );
+ m_ui->grayscale->setChecked( m_pictureSettings.grayscal );
+
+ m_ui->brightnessInput->setValue( m_pictureSettings.bright );
+}
+
+
+#include "KPrPictureProperty.moc"
diff --git a/kpresenter/KPrPictureProperty.h b/kpresenter/KPrPictureProperty.h
new file mode 100644
index 000000000..5c1e4d7c7
--- /dev/null
+++ b/kpresenter/KPrPictureProperty.h
@@ -0,0 +1,53 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PICTUREPROPERTY_H
+#define PICTUREPROPERTY_H
+
+#include <qwidget.h>
+
+#include "KPrCommand.h"
+
+class PicturePropertyUI;
+class QPixmap;
+
+class KPrPictureProperty : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrPictureProperty( QWidget *parent, const char *name, const QPixmap &pixmap,
+ KPrPictureSettingCmd::PictureSettings pictureSettings );
+ ~KPrPictureProperty();
+
+ int getPicturePropertyChange() const;
+ KPrPictureSettingCmd::PictureSettings getPictureSettings() const;
+
+ void apply();
+
+private:
+ PicturePropertyUI *m_ui;
+
+ KPrPictureSettingCmd::PictureSettings m_pictureSettings;
+
+protected slots:
+ void slotReset();
+};
+
+#endif /* PICTUREPROPERTY_H */
diff --git a/kpresenter/KPrPieObject.cpp b/kpresenter/KPrPieObject.cpp
new file mode 100644
index 000000000..9ed851096
--- /dev/null
+++ b/kpresenter/KPrPieObject.cpp
@@ -0,0 +1,607 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPieObject.h"
+#include "KPrGradient.h"
+#include "KPrUtils.h"
+#include "KPrPieObjectIface.h"
+
+#include <KoTextZoomHandler.h>
+#include <KoOasisContext.h>
+#include <KoStyleStack.h>
+#include <KoXmlNS.h>
+
+#include <kdebug.h>
+
+#include <qregion.h>
+#include <qpicture.h>
+#include <qdom.h>
+#include <qpainter.h>
+#include <qbitmap.h>
+using namespace std;
+
+KPrPieObject::KPrPieObject()
+: KPr2DObject()
+, KPrStartEndLine( L_NORMAL, L_NORMAL )
+{
+ pieType = PT_PIE;
+ p_angle = 45 * 16;
+ p_len = 270 * 16;
+}
+
+KPrPieObject::KPrPieObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType,
+ const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ PieType _pieType, int _p_angle, int _p_len,
+ LineEnd _lineBegin, LineEnd _lineEnd,
+ bool _unbalanced, int _xfactor, int _yfactor )
+: KPr2DObject( _pen, _brush, _fillType, _gColor1, _gColor2, _gType, _unbalanced, _xfactor, _yfactor )
+, KPrStartEndLine( _lineBegin, _lineEnd )
+{
+ pieType = _pieType;
+ p_angle = _p_angle;
+ p_len = _p_len;
+}
+
+DCOPObject* KPrPieObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrPieObjectIface( this );
+ return dcop;
+}
+
+KPrPieObject &KPrPieObject::operator=( const KPrPieObject & )
+{
+ return *this;
+}
+
+QDomDocumentFragment KPrPieObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment=KPr2DObject::save(doc, offset);
+ KPrStartEndLine::save( fragment, doc );
+ if (p_angle!=720)
+ fragment.appendChild(KPrObject::createValueElement("PIEANGLE", p_angle, doc));
+ if (p_len!=1440)
+ fragment.appendChild(KPrObject::createValueElement("PIELENGTH", p_len, doc));
+ if (pieType!=PT_PIE)
+ fragment.appendChild(KPrObject::createValueElement("PIETYPE", static_cast<int>(pieType), doc));
+ return fragment;
+}
+
+bool KPrPieObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ switch( pieType )
+ {
+ case PT_PIE:
+ sc.xmlWriter.addAttribute( "draw:kind", "section" );
+ break;
+ case PT_CHORD:
+ sc.xmlWriter.addAttribute( "draw:kind", "cut" );
+ break;
+ case PT_ARC:
+ sc.xmlWriter.addAttribute( "draw:kind", "arc" );
+ break;
+ default:
+ kdDebug() << " type of pie not supported" << endl;
+ }
+
+ int startangle = ( (int)p_angle / 16 );
+ sc.xmlWriter.addAttribute( "draw:start-angle", startangle );
+
+ int endangle = ( (int) p_len / 16 ) + startangle;
+ sc.xmlWriter.addAttribute( "draw:end-angle", endangle );
+
+ return true;
+}
+
+void KPrPieObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const
+{
+ KPrShadowObject::fillStyle( styleObjectAuto, mainStyles );
+ if ( pieType == PT_ARC )
+ {
+ saveOasisMarkerElement( mainStyles, styleObjectAuto );
+ }
+ else
+ {
+ m_brush.saveOasisFillStyle( styleObjectAuto, mainStyles );
+ }
+}
+
+const char * KPrPieObject::getOasisElementName() const
+{
+ return ext.width() == ext.height() ? "draw:circle" : "draw:ellipse";
+}
+
+
+void KPrPieObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
+{
+ kdDebug()<<"void KPrPieObject::loadOasis(const QDomElement &element) ***************\n";
+ KPr2DObject::loadOasis(element, context, info);
+ QString kind = element.attributeNS( KoXmlNS::draw, "kind", QString::null );
+ if ( kind == "section" )
+ pieType = PT_PIE;
+ else if ( kind == "cut" )
+ pieType = PT_CHORD;
+ else if ( kind == "arc" )
+ pieType =PT_ARC;
+ else
+ {
+ kdDebug()<<" KPrPieObject::loadOasis(const QDomElement &element) type indefined :"<<kind<<endl;
+ pieType = PT_PIE;
+ }
+ kdDebug()<<" type of pie object :"<<( ( pieType == PT_PIE ) ? "pie" : ( pieType == PT_CHORD )?"cut" : "arc" )<<endl;
+
+ int start = (int) ( element.attributeNS( KoXmlNS::draw, "start-angle", QString::null ).toDouble() );
+ p_angle=start*16;
+
+ int end = (int) ( element.attributeNS( KoXmlNS::draw, "end-angle", QString::null ).toDouble() );
+ if ( end < start )
+ p_len = ( ( 360 - start + end ) * 16 );
+ else
+ p_len = ( ( end - start ) * 16 );
+
+ kdDebug()<<"KPrPieObject::loadOasis(const QDomElement &element) : p_angle :"<<p_angle<<" p_len :"<<p_len<<endl;
+ if ( pieType == PT_ARC )
+ {
+ loadOasisMarkerElement( context, "marker-start", lineBegin );
+ loadOasisMarkerElement( context, "marker-end", lineEnd );
+ }
+}
+
+double KPrPieObject::load(const QDomElement &element)
+{
+ double offset=KPr2DObject::load(element);
+ KPrStartEndLine::load( element );
+ QDomElement e=element.namedItem("PIEANGLE").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ p_angle=tmp;
+ }
+ e=element.namedItem("PIELENGTH").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ p_len=tmp;
+ }
+ else
+ p_len=1440; //necessary to reinitialise p_len
+ //I don't know who change default value
+ e=element.namedItem("PIETYPE").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("value"))
+ tmp=e.attribute("value").toInt();
+ pieType=static_cast<PieType>(tmp);
+ }
+ return offset;
+}
+
+void KPrPieObject::paint( QPainter* _painter, KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour )
+{
+ double ow = ext.width();
+ double oh = ext.height();
+ double pw = ( ( pen.style() == Qt::NoPen ) ? 1 : pen.pointWidth() ) / 2.0;
+
+ if ( drawContour ) {
+ QPen pen3( Qt::black, 1, Qt::DotLine );
+ _painter->setPen( pen3 );
+ _painter->setRasterOp( Qt::NotXorROP );
+ }
+ else {
+ QPen pen2 = pen.zoomedPen( _zoomHandler );
+ _painter->setPen( pen2 );
+ if ( drawingShadow || getFillType() == FT_BRUSH || !gradient )
+ {
+ _painter->setBrush( getBrush() );
+ }
+ else
+ {
+ if ( pieType != PT_ARC )
+ {
+ QSize size( _zoomHandler->zoomSize( ext ) );
+
+ if ( m_redrawGradientPix || gradient->size() != size )
+ {
+ m_redrawGradientPix = false;
+ gradient->setSize( size );
+
+ m_gradientPix.resize ( size );
+ m_gradientPix.fill( Qt::white );
+ QPainter p;
+ p.begin( &m_gradientPix );
+ p.drawPixmap( 0, 0, gradient->pixmap() );
+ p.end();
+
+ QBitmap mask( size, true );
+ p.begin( &mask );
+ p.setPen( QPen( Qt::color1 ) );
+ p.setBrush( QBrush( Qt::color1 ) );
+ if ( pieType == PT_CHORD )
+ {
+ p.drawChord( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItY(pw),
+ _zoomHandler->zoomItX(ow - 2 * pw),
+ _zoomHandler->zoomItY(oh - 2 * pw), p_angle, p_len );
+ }
+ else
+ {
+ p.drawPie( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItY(pw),
+ _zoomHandler->zoomItX( ow - 2 * pw),
+ _zoomHandler->zoomItY( oh - 2 * pw), p_angle, p_len );
+ }
+ p.end();
+ m_gradientPix.setMask( mask );
+ }
+ _painter->drawPixmap( 0, 0, m_gradientPix, 0, 0, size.width(), size.height() );
+ _painter->setBrush( Qt::NoBrush );
+ }
+ }
+ if ( pieType == PT_ARC )
+ {
+ KoPointArray points( 2 );
+ setEndPoints( points );
+ KoPoint start( points.point( 0 ) );
+ KoPoint end( points.point( 1 ) );
+
+ double ys = ( ( 1 - start.x() / ( ext.width() * ext.width() / 4 ) ) * ext.height() * ext.height() / 4 ) / start.y();
+ double s_angle = 90 + ( atan( ( start.x() - 1 ) / ( start.y() - ys ) ) * 180 / M_PI );
+ if ( p_angle / 16 >= 90 && p_angle / 16 <= 270 )
+ {
+ s_angle += 180.0;
+ }
+ double ye = ( ( 1 - end.x() / ( ext.width() * ext.width() / 4 ) ) * ext.height() * ext.height() / 4 ) / end.y();
+ double e_angle = 270 + ( atan( ( end.x() - 1 ) / ( end.y() - ye ) ) * 180 / M_PI );
+ if ( ( ( p_angle + p_len ) / 16 ) % 360 >= 90 && ( ( p_angle + p_len ) / 16 ) % 360 <= 270 )
+ {
+ e_angle -= 180.0;
+ }
+
+ start = KoPoint( ext.width() / 2.0 + start.x(), ext.height() / 2.0 - start.y() );
+ end = KoPoint( ext.width() / 2.0 + end.x(), ext.height() / 2.0 - end.y() );
+
+
+
+ if ( lineBegin != L_NORMAL )
+ drawFigureWithOffset( lineBegin, _painter, start,
+ pen2.color(), int( pen.pointWidth() ), s_angle, _zoomHandler, true );
+
+ if ( lineEnd != L_NORMAL )
+ drawFigureWithOffset( lineEnd, _painter, end,
+ pen2.color(), int( pen.pointWidth() ), e_angle, _zoomHandler, false );
+ }
+ }
+ switch ( pieType )
+ {
+ case PT_PIE:
+ _painter->drawPie( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItY( pw),
+ _zoomHandler->zoomItX( ow - 2 * pw),
+ _zoomHandler->zoomItY( oh - 2 * pw), p_angle, p_len );
+ break;
+ case PT_ARC:
+ _painter->drawArc( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItY(pw),
+ _zoomHandler->zoomItX(ow - 2 * pw),
+ _zoomHandler->zoomItY(oh - 2 * pw), p_angle, p_len );
+ break;
+ case PT_CHORD:
+ _painter->drawChord( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItY(pw),
+ _zoomHandler->zoomItX(ow - 2 * pw),
+ _zoomHandler->zoomItY(oh - 2 * pw), p_angle, p_len );
+ break;
+ default: break;
+ }
+}
+
+void KPrPieObject::flip( bool horizontal )
+{
+ KPr2DObject::flip( horizontal );
+ if ( ! horizontal )
+ {
+ p_angle = 360*16 - p_angle -p_len;
+ }
+ else
+ {
+ p_angle = 180*16 - p_angle - p_len;
+ }
+ // angle smaller 0
+ while ( p_angle < 0 ) {
+ p_angle += 360*16;
+ }
+
+}
+
+
+void KPrPieObject::setMinMax( double &min_x, double &min_y,
+ double &max_x, double &max_y, KoPoint point ) const
+{
+ double tmp_x = point.x();
+ double tmp_y = point.y();
+
+ if ( tmp_x < min_x ) {
+ min_x = tmp_x;
+ }
+ else if ( tmp_x > max_x ) {
+ max_x = tmp_x;
+ }
+
+ if ( tmp_y < min_y ) {
+ min_y = tmp_y;
+ }
+ else if ( tmp_y > max_y ) {
+ max_y = tmp_y;
+ }
+}
+
+
+/*
+ * The calculation of the real size and origin for a pie object is a little more
+ * complicated. It took me quite a whlie to get it right.
+ * Here is how it works:
+ * 1. calculate the position of the end points
+ * 2. calculate the 4 maximal points, the points with max x or y position, of the
+ * hole ellipse
+ * 3. find minimal and maximal points
+ * 4. check if the maximal points lie on the arc
+ *
+ */
+void KPrPieObject::getRealSizeAndOrig( KoSize &size, KoPoint &realOrig ) const {
+ double radius1 = size.width() / 2.0;
+ double radius2 = size.height() / 2.0;
+
+ // the rotation angle
+ double angInRad = angle * M_PI / 180;
+
+ // 1. calulate position of end points
+ KoPointArray points(2);
+ setEndPoints( points );
+
+ // rotate point
+ for ( int i = 0; i < 2; i++ ) {
+ if ( angle != 0 ) {
+ double sinus = sin( angInRad );
+ double cosinus = cos( angInRad );
+
+ double tmp_x = points.point( i ).x();
+ double tmp_y = points.point( i ).y();
+
+ double x = tmp_x * cosinus + tmp_y * sinus;
+ double y = - tmp_x * sinus + tmp_y * cosinus;
+ points.setPoint( i, x, y );
+ }
+ }
+
+ KoPoint firstPoint( points.point(0) );
+ KoPoint secondPoint( points.point(1) );
+
+ // 2. calulate maximal points
+ KoPointArray maxPoints(4);
+ if ( angle == 0 ) {
+ maxPoints.setPoint( 0, 0, radius2 );
+ maxPoints.setPoint( 1, radius1, 0 );
+ maxPoints.setPoint( 2, 0, -radius2 );
+ maxPoints.setPoint( 3, -radius1, 0 );
+ }
+ else {
+ double sinus = sin( angInRad );
+ double cosinus = cos( angInRad );
+
+ double x = sqrt( pow( radius1 * cosinus , 2 ) + pow(radius2 * sinus, 2));
+ double y = ( pow( radius2, 2 ) - pow( radius1, 2) ) * sinus * cosinus / x;
+ maxPoints.setPoint( 0, x, y );
+ maxPoints.setPoint( 1, -x, -y );
+
+ y = sqrt( pow( radius1 * sinus , 2 ) + pow(radius2 * cosinus, 2));
+ x = ( pow( radius1, 2 ) - pow( radius2, 2) ) * sinus * cosinus / y;
+ maxPoints.setPoint( 2, x, y);
+ maxPoints.setPoint( 3, -x, -y );
+ }
+
+ // 3. find minimal and maximal points
+ double min_x = firstPoint.x();
+ double min_y = firstPoint.y();
+ double max_x = firstPoint.x();
+ double max_y = firstPoint.y();
+
+ if ( pieType == PT_PIE ) {
+ KoPoint zero(0,0);
+ setMinMax( min_x, min_y, max_x, max_y, zero );
+ }
+ setMinMax( min_x, min_y, max_x, max_y, secondPoint );
+
+ /* 4. check if maximal points lie on the arc.
+ * There are three posibilities how many sections have to
+ * been checked.
+ * 1. the arc is only once on one side of the x axis
+ * 2. the arc is on both sides of the x axis
+ * 3. the arc is twice on one one side of the x axis
+ *
+ * 1) 2) 3)
+ * y y y
+ * ex|xx xx|xs s |
+ * | x x | x | e
+ * | s x | x | x
+ * ----+---- x ----+---- x ----+---- x
+ * | x | x | x
+ * | x | x | x
+ * | e | xx|xx
+ *
+ */
+ if ( firstPoint.y() >= 0 ) {
+ if ( secondPoint.y() >= 0 ) {
+ if ( firstPoint.x() > secondPoint.x() || p_len == 0 ) {
+ // 1 section
+ // f.x() <= x <= s.x() && y >= 0
+ KoPointArray::ConstIterator it( maxPoints.begin() );
+ for ( ; it != maxPoints.end(); ++it ) {
+ if ( (*it).y() >= 0 &&
+ (*it).x() <= firstPoint.x() && (*it).x() >= secondPoint.x() )
+ {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ }
+ else {
+ // 3 sections
+ // x <= f.x() && y >= 0
+ // y < 0
+ // x >= s.x() && y >= 0
+ KoPointArray::ConstIterator it( maxPoints.begin() );
+ for ( ; it != maxPoints.end(); ++it ) {
+ if ( (*it).y() >= 0 ) {
+ if ( (*it).x() <= firstPoint.x() || (*it).x() >= secondPoint.x() ) {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ else {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ }
+ }
+ else {
+ // 2 sections
+ // x <= f.x() && y >= 0
+ // x <= s.x() && y < 0
+ KoPointArray::ConstIterator it( maxPoints.begin() );
+ for ( ; it != maxPoints.end(); ++it ) {
+ if ( (*it).y() >= 0 ) {
+ if ( (*it).x() <= firstPoint.x() ) {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ else {
+ if ( (*it).x() <= secondPoint.x() ) {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ }
+ }
+ }
+ else {
+ if ( secondPoint.y() >= 0 ) {
+ // 2 sections
+ // x >= f.x() && y < 0
+ // x >= s.x() && y >= 0
+ KoPointArray::ConstIterator it( maxPoints.begin() );
+ for ( ; it != maxPoints.end(); ++it ) {
+ if ( (*it).y() < 0 ) {
+ if ( (*it).x() >= firstPoint.x() ) {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ else {
+ if ( (*it).x() >= secondPoint.x() ) {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ }
+ }
+ else {
+ if ( firstPoint.x() < secondPoint.x() || p_len == 0 ) {
+ // 1 section
+ // f.x() <= x <= s.x() && y < 0
+ KoPointArray::ConstIterator it( maxPoints.begin() );
+ for ( ; it != maxPoints.end(); ++it ) {
+ if ( (*it).y() < 0 &&
+ (*it).x() >= firstPoint.x() && (*it).x() <= secondPoint.x() )
+ {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ }
+ else {
+ // 3 sections
+ // x >= f.x() && y < 0
+ // y >= 0
+ // x <= s.x() && y < 0
+ KoPointArray::ConstIterator it( maxPoints.begin() );
+ for ( ; it != maxPoints.end(); ++it ) {
+ if ( (*it).y() < 0 ) {
+ if ( (*it).x() >= firstPoint.x() || (*it).x() <= secondPoint.x() ) {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ else {
+ setMinMax( min_x, min_y, max_x, max_y, *it );
+ }
+ }
+ }
+ }
+ }
+
+ double mid_x = size.width() / 2;
+ double mid_y = size.height() / 2;
+
+ size.setWidth( max_x - min_x );
+ size.setHeight( max_y - min_y );
+
+ realOrig.setX( realOrig.x() + mid_x + min_x );
+ realOrig.setY( realOrig.y() + mid_y - max_y );
+}
+
+void KPrPieObject::setEndPoints( KoPointArray &points ) const
+{
+ int angles[] = { p_angle, ( p_angle + p_len ) % ( 16 * 360 ) };
+ double anglesInRad[] = { p_angle / 16.0 * M_PI / 180, ( angles[1] ) / 16.0 * M_PI / 180 };
+
+ double radius1 = ext.width() / 2.0;
+ double radius2 = ext.height() / 2.0;
+
+ double prop = radius2 / radius1;
+
+ for ( int i = 0; i < 2; i++ ) {
+ double x = 0;
+ double y = 0;
+
+ // be carefull
+ if ( angles[i] == 90 * 16 ) {
+ y = radius2;
+ }
+ else if ( angles[i] == 270 * 16 ) {
+ y = -radius2;
+ }
+ else {
+ // The real angle is not what was given. It is only ok if radius1 == radius2,
+ // otherwise it is arctan ( radius2 / radius1 tan ( angle ) )
+ double tanalpha = tan( anglesInRad[i] ) * prop;
+ x = sqrt( 1 / ( pow ( 1 / radius1, 2 ) + pow( tanalpha / radius2, 2 ) ) );
+ if ( angles[i] > 90 * 16 && angles[i] < 270 * 16 )
+ x = -x;
+ y = tanalpha * x;
+ }
+ points.setPoint( i, x, y );
+ }
+}
+
+KoSize KPrPieObject::getRealSize() const {
+ KoSize size( ext );
+ KoPoint realOrig( orig );
+ getRealSizeAndOrig( size, realOrig );
+ return size;
+}
+
+
+KoPoint KPrPieObject::getRealOrig() const {
+ KoSize size( ext );
+ KoPoint realOrig( orig );
+ getRealSizeAndOrig( size, realOrig );
+ return realOrig;
+}
diff --git a/kpresenter/KPrPieObject.h b/kpresenter/KPrPieObject.h
new file mode 100644
index 000000000..0bb75e904
--- /dev/null
+++ b/kpresenter/KPrPieObject.h
@@ -0,0 +1,109 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kppieobject_h
+#define kppieobject_h
+
+#include "KPrObject.h"
+#include <KoBrush.h>
+#include <KoStyleStack.h>
+
+class KPrGradient;
+class DCOPObject;
+
+class KPrPieObject : public KPr2DObject, public KPrStartEndLine
+{
+public:
+ KPrPieObject();
+ KPrPieObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType,
+ const QColor &_gColor1, const QColor &_gColor2, BCType _gType, PieType _pieType,
+ int _p_angle, int _p_len, LineEnd _lineBegin, LineEnd _lineEnd,
+ bool _unbalanced, int _xfactor, int _yfactor );
+ virtual ~KPrPieObject() {}
+ virtual DCOPObject* dcopObject();
+ KPrPieObject &operator=( const KPrPieObject & );
+
+ virtual void setPieType( PieType _pieType )
+ { pieType = _pieType; m_redrawGradientPix = true; }
+ virtual void setPieAngle( int _p_angle )
+ { p_angle = _p_angle; m_redrawGradientPix = true; }
+ virtual void setPieLength( int _p_len )
+ { p_len = _p_len; m_redrawGradientPix = true; }
+ virtual void setLineBegin( LineEnd _lineBegin )
+ { lineBegin = _lineBegin; }
+ virtual void setLineEnd( LineEnd _lineEnd )
+ { lineEnd = _lineEnd; }
+
+ virtual ObjType getType() const
+ { return OT_PIE; }
+ virtual QString getTypeString() const
+ {
+ switch ( pieType ) {
+ case PT_PIE:
+ return i18n("Pie");
+ break;
+ case PT_ARC:
+ return i18n("Arc");
+ break;
+ case PT_CHORD:
+ return i18n("Chord");
+ break;
+ }
+ return QString::null;
+ }
+
+ virtual PieType getPieType() const
+ { return pieType; }
+ virtual int getPieAngle() const
+ { return p_angle; }
+ virtual int getPieLength() const
+ { return p_len; }
+ virtual LineEnd getLineBegin() const
+ { return lineBegin; }
+ virtual LineEnd getLineEnd() const
+ { return lineEnd; }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+
+ virtual double load(const QDomElement &element);
+ virtual void flip(bool horizontal );
+ virtual void loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info);
+
+ virtual KoSize getRealSize() const;
+ virtual KoPoint getRealOrig() const;
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+ virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
+
+ virtual void paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour );
+
+ void setMinMax( double &min_x, double &min_y, double &max_x, double &max_y, KoPoint point ) const;
+ void getRealSizeAndOrig( KoSize &size, KoPoint &realOrig ) const;
+
+ void setEndPoints( KoPointArray &points ) const;
+
+ PieType pieType;
+ int p_angle, p_len;
+};
+
+#endif
diff --git a/kpresenter/KPrPieObjectIface.cpp b/kpresenter/KPrPieObjectIface.cpp
new file mode 100644
index 000000000..080b188c3
--- /dev/null
+++ b/kpresenter/KPrPieObjectIface.cpp
@@ -0,0 +1,83 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPieObjectIface.h"
+#include "KPrPieObject.h"
+#include "KPrObject.h"
+#include "KPrUtils.h"
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <kdebug.h>
+
+KPrPieObjectIface::KPrPieObjectIface( KPrPieObject *_obj )
+ : KPrObject2DIface(_obj)
+{
+ obj = _obj;
+}
+
+void KPrPieObjectIface::setPieAngle( int _p_angle )
+{
+ obj->setPieAngle(_p_angle);
+}
+
+void KPrPieObjectIface::setPieLength( int _p_len )
+{
+ obj->setPieLength(_p_len);
+}
+
+int KPrPieObjectIface::pieAngle() const
+{
+ return obj->getPieAngle();
+}
+
+int KPrPieObjectIface::pieLength() const
+{
+ return obj->getPieLength();
+}
+
+void KPrPieObjectIface::setPieType( const QString & type )
+{
+ if( type =="Pie")
+ obj->setPieType(PT_PIE);
+ else if(type=="Arc")
+ obj->setPieType(PT_ARC);
+ else if(type=="Chord")
+ obj->setPieType(PT_CHORD);
+}
+
+void KPrPieObjectIface::setLineBegin( const QString & type)
+{
+ obj->setLineBegin(lineEndBeginFromString( type ));
+}
+
+void KPrPieObjectIface::setLineEnd( const QString & type)
+{
+ obj->setLineEnd(lineEndBeginFromString( type ));
+}
+
+void KPrPieObjectIface::horizontalFlip()
+{
+ obj->flip( true);
+}
+
+void KPrPieObjectIface::verticalFlip()
+{
+ obj->flip( false );
+}
diff --git a/kpresenter/KPrPieObjectIface.h b/kpresenter/KPrPieObjectIface.h
new file mode 100644
index 000000000..362ae0d8c
--- /dev/null
+++ b/kpresenter/KPrPieObjectIface.h
@@ -0,0 +1,52 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPPIE_OBJECT_IFACE_H
+#define KPPIE_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObject2DIface.h"
+#include <qstring.h>
+
+class KPrPieObject;
+
+class KPrPieObjectIface : public KPrObject2DIface
+{
+ K_DCOP
+public:
+ KPrPieObjectIface( KPrPieObject *obj_ );
+
+k_dcop:
+ virtual void setPieAngle( int _p_angle );
+ virtual void setPieLength( int _p_len );
+ virtual int pieAngle() const;
+ virtual int pieLength() const;
+ void setPieType( const QString & type );
+ virtual void setLineBegin( const QString &);
+ virtual void setLineEnd(const QString & );
+ void horizontalFlip();
+ void verticalFlip();
+
+private:
+ KPrPieObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrPiePreview.cpp b/kpresenter/KPrPiePreview.cpp
new file mode 100644
index 000000000..e9feb9ef5
--- /dev/null
+++ b/kpresenter/KPrPiePreview.cpp
@@ -0,0 +1,66 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+ based on work by
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPiePreview.h"
+
+#include <qpainter.h>
+
+KPrPiePreview::KPrPiePreview( QWidget* parent, const char* name )
+ : QFrame( parent, name )
+{
+ setFrameStyle( WinPanel | Sunken );
+ setBackgroundColor( white );
+ angle = 720; //45 * 16
+ len = 1440; //90 * 16
+ pen = QPen( black );
+ brush = QBrush( white );
+ type = PT_PIE;
+
+ setMinimumSize( 200, 100 );
+}
+
+void KPrPiePreview::drawContents( QPainter* painter )
+{
+ int ow = width() - 8;
+ int oh = height() - 8;
+
+ painter->setPen( pen );
+ int pw = pen.width();
+ painter->setBrush( brush );
+
+ switch ( type )
+ {
+ case PT_PIE:
+ painter->drawPie( pw + 4, pw + 4, ow - 2 * pw, oh - 2 * pw, angle, len );
+ break;
+ case PT_ARC:
+ painter->drawArc( pw + 4, pw + 4, ow - 2 * pw, oh - 2 * pw, angle, len );
+ break;
+ case PT_CHORD:
+ painter->drawChord( pw + 4, pw + 4, ow - 2 * pw, oh - 2 * pw, angle, len );
+ break;
+ default:
+ break;
+ }
+}
+
+#include "KPrPiePreview.moc"
diff --git a/kpresenter/KPrPiePreview.h b/kpresenter/KPrPiePreview.h
new file mode 100644
index 000000000..4e796be99
--- /dev/null
+++ b/kpresenter/KPrPiePreview.h
@@ -0,0 +1,58 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+ based on work by
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PIEPREVIEW_H
+#define PIEPREVIEW_H
+
+#include <qframe.h>
+#include <qpen.h>
+#include <qbrush.h>
+
+#include "global.h"
+
+class KPrPiePreview : public QFrame
+{
+ Q_OBJECT
+
+public:
+ KPrPiePreview( QWidget* parent, const char* );
+ ~KPrPiePreview() {}
+
+ void setAngle( int _angle )
+ { angle = _angle; repaint( true ); }
+ void setLength( int _len )
+ { len = _len; repaint( true ); }
+ void setType( PieType _type )
+ { type = _type; repaint( true ); }
+ void setPenBrush( const QPen &_pen, const QBrush &_brush )
+ { pen = _pen; brush = _brush; repaint( true ); }
+
+protected:
+ void drawContents( QPainter* );
+
+ int angle, len;
+ PieType type;
+ QPen pen;
+ QBrush brush;
+};
+
+#endif /* PIEPREVIEW_H */
diff --git a/kpresenter/KPrPieProperty.cpp b/kpresenter/KPrPieProperty.cpp
new file mode 100644
index 000000000..6aeffe3f4
--- /dev/null
+++ b/kpresenter/KPrPieProperty.cpp
@@ -0,0 +1,141 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPieProperty.h"
+
+#include <qlayout.h>
+
+#include <kcombobox.h>
+#include <klocale.h>
+#include <knuminput.h>
+
+#include "global.h"
+#include "piepropertyui.h"
+#include "KPrPiePreview.h"
+
+
+KPrPieProperty::KPrPieProperty( QWidget *parent, const char *name, KPrPieValueCmd::PieValues pieValues )
+: QWidget( parent, name )
+, m_pieValues( pieValues )
+{
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->addWidget( m_ui = new PiePropertyUI( this ) );
+
+ m_ui->typeCombo->insertItem( i18n( "Pie" ) );
+ m_ui->typeCombo->insertItem( i18n( "Arc" ) );
+ m_ui->typeCombo->insertItem( i18n( "Chord" ) );
+
+ connect( m_ui->typeCombo, SIGNAL( activated( int ) ), this, SLOT( slotTypeChanged( int ) ) );
+
+ connect( m_ui->angleInput, SIGNAL( valueChanged( int ) ), this, SLOT( slotAngleChanged( int ) ) );
+ connect( m_ui->lengthInput, SIGNAL( valueChanged( int ) ), this, SLOT( slotLengthChanged( int ) ) );
+
+ slotReset();
+}
+
+
+KPrPieProperty::~KPrPieProperty()
+{
+}
+
+
+int KPrPieProperty::getPiePropertyChange() const
+{
+ int flags = 0;
+
+ KPrPieValueCmd::PieValues pieValues = getPieValues();
+
+ if ( pieValues.pieType != m_pieValues.pieType )
+ flags |= KPrPieValueCmd::Type;
+
+ if ( pieValues.pieAngle != m_pieValues.pieAngle )
+ flags |= KPrPieValueCmd::Angle;
+
+ if ( pieValues.pieLength != m_pieValues.pieLength )
+ flags |= KPrPieValueCmd::Length;
+
+ return flags;
+}
+
+
+KPrPieValueCmd::PieValues KPrPieProperty::getPieValues() const
+{
+ KPrPieValueCmd::PieValues pieValues;
+ pieValues.pieType = static_cast<PieType>( m_ui->typeCombo->currentItem() );
+ pieValues.pieAngle = m_ui->angleInput->value() * 16;
+ pieValues.pieLength = m_ui->lengthInput->value() * 16;
+ return pieValues;
+}
+
+
+void KPrPieProperty::setPieValues( const KPrPieValueCmd::PieValues &pieValues )
+{
+ m_pieValues = pieValues;
+ slotReset();
+}
+
+
+void KPrPieProperty::apply()
+{
+ int flags = getPiePropertyChange();
+
+ KPrPieValueCmd::PieValues pieValues = getPieValues();
+
+ if ( flags & KPrPieValueCmd::Type )
+ m_pieValues.pieType = pieValues.pieType;
+
+ if ( flags & KPrPieValueCmd::Angle )
+ m_pieValues.pieAngle = pieValues.pieAngle;
+
+ if ( flags & KPrPieValueCmd::Length )
+ m_pieValues.pieLength = pieValues.pieLength;
+}
+
+
+void KPrPieProperty::slotReset()
+{
+ m_ui->typeCombo->setCurrentItem( ( int ) m_pieValues.pieType );
+ m_ui->piePreview->setType( m_pieValues.pieType );
+ m_ui->angleInput->setValue( m_pieValues.pieAngle / 16 );
+ m_ui->piePreview->setAngle( m_pieValues.pieAngle );
+ m_ui->lengthInput->setValue( m_pieValues.pieLength / 16 );
+ m_ui->piePreview->setLength( m_pieValues.pieLength );
+}
+
+
+void KPrPieProperty::slotTypeChanged( int pos )
+{
+ m_ui->piePreview->setType( static_cast<PieType>( pos ) );
+}
+
+
+void KPrPieProperty::slotAngleChanged( int num )
+{
+ m_ui->piePreview->setAngle( num * 16 );
+}
+
+
+void KPrPieProperty::slotLengthChanged( int num )
+{
+ m_ui->piePreview->setLength( num * 16 );
+}
+
+
+#include "KPrPieProperty.moc"
diff --git a/kpresenter/KPrPieProperty.h b/kpresenter/KPrPieProperty.h
new file mode 100644
index 000000000..5507222b2
--- /dev/null
+++ b/kpresenter/KPrPieProperty.h
@@ -0,0 +1,55 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PIEPROPERTY_H
+#define PIEPROPERTY_H
+
+#include <qwidget.h>
+
+#include "KPrCommand.h"
+
+class PiePropertyUI;
+
+class KPrPieProperty : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrPieProperty( QWidget *parent, const char *name, KPrPieValueCmd::PieValues pieValues );
+ ~KPrPieProperty();
+
+ int getPiePropertyChange() const;
+ KPrPieValueCmd::PieValues getPieValues() const;
+
+ void setPieValues( const KPrPieValueCmd::PieValues &pieValues );
+ void apply();
+
+private:
+ PiePropertyUI *m_ui;
+
+ KPrPieValueCmd::PieValues m_pieValues;
+
+protected slots:
+ void slotReset();
+ void slotTypeChanged( int pos );
+ void slotAngleChanged( int num );
+ void slotLengthChanged( int num );
+};
+
+#endif /* PIEPROPERTY_H */
diff --git a/kpresenter/KPrPixmapObject.cpp b/kpresenter/KPrPixmapObject.cpp
new file mode 100644
index 000000000..34e3ff3ff
--- /dev/null
+++ b/kpresenter/KPrPixmapObject.cpp
@@ -0,0 +1,958 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+// ### TODO: fix copyright date/authors
+
+// for getenv ()
+#include <stdlib.h>
+#include <float.h>
+
+#include <qbuffer.h>
+#include <qpainter.h>
+#include <qwmatrix.h>
+#include <qfileinfo.h>
+#include <qpixmap.h>
+#include <qdom.h>
+#include <qimage.h>
+#include <qbitmap.h>
+
+#include <kdebug.h>
+#include <kimageeffect.h>
+#include <KoSize.h>
+#include <KoTextZoomHandler.h>
+#include <KoStore.h>
+#include <KoStoreDevice.h>
+#include <KoOasisContext.h>
+#include <KoXmlNS.h>
+#include <KoDom.h>
+
+#include "KPrPixmapObject.h"
+#include "KPrGradient.h"
+#include "KPrPixmapObjectIface.h"
+
+
+KPrPixmapObject::KPrPixmapObject( KoPictureCollection *_imageCollection )
+ : KPr2DObject()
+{
+ imageCollection = _imageCollection;
+ pen = KoPen( Qt::black, 1.0, Qt::NoPen );
+ mirrorType = PM_NORMAL;
+ depth = 0;
+ swapRGB = false;
+ grayscal = false;
+ bright = 0;
+ m_effect = IE_NONE;
+ m_ie_par1 = QVariant();
+ m_ie_par2 = QVariant();
+ m_ie_par3 = QVariant();
+ // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!)
+ m_cachedPixmap.setOptimization(QPixmap::MemoryOptim);
+ keepRatio = true;
+}
+
+KPrPixmapObject::KPrPixmapObject( KoPictureCollection *_imageCollection, const KoPictureKey & key )
+ : KPr2DObject()
+{
+ imageCollection = _imageCollection;
+
+ ext = KoSize(); // invalid size means unset
+ pen = KoPen( Qt::black, 1.0, Qt::NoPen );
+ mirrorType = PM_NORMAL;
+ depth = 0;
+ swapRGB = false;
+ grayscal = false;
+ bright = 0;
+ m_effect = IE_NONE;
+ m_ie_par1 = QVariant();
+ m_ie_par2 = QVariant();
+ m_ie_par3 = QVariant();
+ // Forbid QPixmap to cache the X-Window resources (Yes, it is slower!)
+ m_cachedPixmap.setOptimization(QPixmap::MemoryOptim);
+
+ setPicture( key );
+}
+
+DCOPObject* KPrPixmapObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrPixmapObjectIface( this );
+ return dcop;
+}
+
+QString KPrPixmapObject::convertValueToPercent( int val ) const
+{
+ return QString::number( val )+"%";
+}
+
+void KPrPixmapObject::saveOasisPictureElement( KoGenStyle &styleobjectauto ) const
+{
+
+ if ( bright != 0 )
+ {
+ styleobjectauto.addProperty( "draw:luminance", convertValueToPercent( bright ) );
+ }
+ if ( grayscal )
+ {
+ styleobjectauto.addProperty( "draw:color-mode","greyscale" );
+ }
+
+ switch (m_effect)
+ {
+ case IE_NONE:
+ //nothing
+ break;
+ case IE_CHANNEL_INTENSITY:
+ {
+ //for the moment kpresenter support just one channel
+ QString percent = convertValueToPercent( m_ie_par1.toInt() );
+ KImageEffect::RGBComponent channel = static_cast<KImageEffect::RGBComponent>( m_ie_par2.toInt() );
+ switch( channel )
+ {
+ case KImageEffect::Red:
+ styleobjectauto.addProperty( "draw:red", percent );
+ styleobjectauto.addProperty( "draw:blue", "0%" );
+ styleobjectauto.addProperty( "draw:green", "0%" );
+ break;
+ case KImageEffect::Green:
+ styleobjectauto.addProperty( "draw:green", percent );
+ styleobjectauto.addProperty( "draw:red", "0%" );
+ styleobjectauto.addProperty( "draw:blue", "0%" );
+ break;
+ case KImageEffect::Blue:
+ styleobjectauto.addProperty( "draw:blue", percent );
+ styleobjectauto.addProperty( "draw:red", "0%" );
+ styleobjectauto.addProperty( "draw:green", "0%" );
+ break;
+ case KImageEffect::Gray:
+ break;
+ case KImageEffect::All:
+ break;
+ }
+ }
+ break;
+ case IE_FADE:
+ break;
+ case IE_FLATTEN:
+ break;
+ case IE_INTENSITY:
+ break;
+ case IE_DESATURATE:
+ break;
+ case IE_CONTRAST:
+ {
+ //kpresenter use value between -255 and 255
+ //oo impress between -100% and 100%
+ int val = m_ie_par1.toInt();
+ val = ( int )( ( double )val*100.0/255.0 );
+ styleobjectauto.addProperty( "draw:contrast", convertValueToPercent( val ) );
+ }
+ break;
+ case IE_NORMALIZE:
+ break;
+ case IE_EQUALIZE:
+ break;
+ case IE_THRESHOLD:
+ break;
+ case IE_SOLARIZE:
+ break;
+ case IE_EMBOSS:
+ break;
+ case IE_DESPECKLE:
+ break;
+ case IE_CHARCOAL:
+ break;
+ case IE_NOISE:
+ break;
+ case IE_BLUR:
+ break;
+ case IE_EDGE:
+ break;
+ case IE_IMPLODE:
+ break;
+ case IE_OIL_PAINT:
+ break;
+ case IE_SHARPEN:
+ break;
+ case IE_SPREAD:
+ break;
+ case IE_SHADE:
+ break;
+ case IE_SWIRL:
+ break;
+ case IE_WAVE:
+ break;
+ }
+}
+
+bool KPrPixmapObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ sc.xmlWriter.startElement( "draw:image" );
+ sc.xmlWriter.addAttribute( "xlink:type", "simple" );
+ sc.xmlWriter.addAttribute( "xlink:show", "embed" );
+ sc.xmlWriter.addAttribute( "xlink:actuate", "onLoad" );
+ sc.xmlWriter.addAttribute( "xlink:href", imageCollection->getOasisFileName( image ) );
+ sc.xmlWriter.endElement();
+
+ return true;
+}
+
+const char * KPrPixmapObject::getOasisElementName() const
+{
+ return "draw:frame";
+}
+
+
+// Deprecated, same as KPrPixmapObject::loadPicture
+void KPrPixmapObject::loadImage( const QString & fileName )
+{
+ loadPicture( fileName );
+}
+
+void KPrPixmapObject::loadPicture( const QString & fileName )
+{
+ image = imageCollection->loadPicture( fileName );
+}
+
+KPrPixmapObject &KPrPixmapObject::operator=( const KPrPixmapObject & )
+{
+ return *this;
+}
+
+// Deprecated, same as KPrPixmapObject::setPicture
+void KPrPixmapObject::setPixmap( const KoPictureKey & key )
+{
+ setPicture( key );
+}
+
+void KPrPixmapObject::setPicture( const KoPictureKey & key )
+{
+ image = imageCollection->findPicture( key );
+}
+
+void KPrPixmapObject::reload( void )
+{
+ // ### FIXME: this seems wrong, KoPictureCollection will never reload it (or perhaps it is the function name that is wrong)
+ setPicture( image.getKey() );
+ if (image.isNull()) {
+ // this happens for example when doing copy&paste from a different KPresenter instance
+ image = imageCollection->loadPicture( image.getKey().filename() );
+ }
+}
+
+QDomDocumentFragment KPrPixmapObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment=KPr2DObject::save(doc, offset);
+ QDomElement elem=doc.createElement("KEY");
+ image.getKey().saveAttributes(elem);
+ fragment.appendChild(elem);
+
+ QDomElement elemSettings = doc.createElement( "PICTURESETTINGS" );
+
+ elemSettings.setAttribute( "mirrorType", static_cast<int>( mirrorType ) );
+ elemSettings.setAttribute( "depth", depth );
+ elemSettings.setAttribute( "swapRGB", static_cast<int>( swapRGB ) );
+ elemSettings.setAttribute( "grayscal", static_cast<int>( grayscal ) );
+ elemSettings.setAttribute( "bright", bright );
+ fragment.appendChild( elemSettings );
+
+ if (m_effect!=IE_NONE) {
+ QDomElement imageEffects = doc.createElement("EFFECTS");
+ imageEffects.setAttribute("type", static_cast<int>(m_effect));
+ if (m_ie_par1.isValid())
+ imageEffects.setAttribute("param1", m_ie_par1.toString());
+ if (m_ie_par2.isValid())
+ imageEffects.setAttribute("param2", m_ie_par2.toString());
+ if (m_ie_par3.isValid())
+ imageEffects.setAttribute("param3", m_ie_par3.toString());
+ fragment.appendChild( imageEffects );
+ }
+
+ return fragment;
+}
+
+void KPrPixmapObject::loadOasisPictureEffect(KoOasisContext & context )
+{
+ KoStyleStack &styleStack = context.styleStack();
+ styleStack.setTypeProperties( "graphic" );
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "color-mode" ) && ( styleStack.attributeNS( KoXmlNS::draw, "color-mode" )=="greyscale" ) )
+ {
+ grayscal = true;
+ }
+
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "contrast" ) )
+ {
+ QString str( styleStack.attributeNS( KoXmlNS::draw, "contrast" ) );
+ str = str.remove( '%' );
+ int val = str.toInt();
+ m_effect = IE_CONTRAST;
+ val = ( int )( 255.0 *val/100.0 );
+ m_ie_par1 = QVariant(val);
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "red" ) && styleStack.attributeNS( KoXmlNS::draw, "red" ) != "0%" )
+ {
+ QString str( styleStack.attributeNS( KoXmlNS::draw, "red" ) );
+ str = str.remove( '%' );
+ int val = str.toInt();
+ m_effect = IE_CHANNEL_INTENSITY;
+ m_ie_par1 = QVariant(val);
+ m_ie_par2 = QVariant( ( int )KImageEffect::Red );
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "green" ) && styleStack.attributeNS( KoXmlNS::draw, "green" ) != "0%" )
+ {
+ QString str( styleStack.attributeNS( KoXmlNS::draw, "green" ) );
+ str = str.remove( '%' );
+ int val = str.toInt();
+ m_effect = IE_CHANNEL_INTENSITY;
+ m_ie_par1 = QVariant(val);
+ m_ie_par2 = QVariant( ( int )KImageEffect::Green );
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "blue" ) && styleStack.attributeNS( KoXmlNS::draw, "blue" ) != "0%" )
+ {
+ QString str( styleStack.attributeNS( KoXmlNS::draw, "blue" ) );
+ str = str.remove( '%' );
+ int val = str.toInt();
+ m_effect = IE_CHANNEL_INTENSITY;
+ m_ie_par1 = QVariant(val);
+ m_ie_par2 = QVariant( ( int )KImageEffect::Blue );
+ }
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "luminance" ) )
+ {
+ QString str( styleStack.attributeNS( KoXmlNS::draw, "luminance" ) );
+ str = str.remove( '%' );
+ bright = str.toInt();
+ }
+
+}
+
+void KPrPixmapObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const
+{
+ KPr2DObject::fillStyle( styleObjectAuto, mainStyles );
+ saveOasisPictureElement( styleObjectAuto );
+}
+
+void KPrPixmapObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
+{
+ //load it into kpresenter_doc
+ KPr2DObject::loadOasis( element, context, info );
+ loadOasisPictureEffect( context );
+ QDomNode imageBox = KoDom::namedItemNS( element, KoXmlNS::draw, "image" );
+ const QString href( imageBox.toElement().attributeNS( KoXmlNS::xlink, "href", QString::null) );
+ kdDebug()<<" href: "<<href<<endl;
+ if ( !href.isEmpty() /*&& href[0] == '#'*/ )
+ {
+ QString strExtension;
+ const int result=href.findRev(".");
+ if (result>=0)
+ {
+ strExtension=href.mid(result+1); // As we are using KoPicture, the extension should be without the dot.
+ }
+ QString filename(href/*.mid(1)*/);
+ const KoPictureKey key(filename, QDateTime::currentDateTime(Qt::UTC));
+ image.setKey(key);
+
+ KoStore* store = context.store();
+ if ( store->open( filename ) )
+ {
+ KoStoreDevice dev(store);
+ if ( !image.load( &dev, strExtension ) )
+ kdWarning() << "Cannot load picture: " << filename << " " << href << endl;
+ store->close();
+ }
+ imageCollection->insertPicture( key, image );
+ }
+ // ### TODO: load remote file
+}
+
+
+double KPrPixmapObject::load(const QDomElement &element)
+{
+ double offset=KPr2DObject::load(element);
+ QDomElement e=element.namedItem("KEY").toElement();
+ if(!e.isNull()) {
+ KoPictureKey key;
+ key.loadAttributes( e );
+ image.clear();
+ image.setKey(key);
+ }
+ else {
+ // try to find a PIXMAP tag if the KEY is not available...
+ e=element.namedItem("PIXMAP").toElement();
+ if (e.isNull()) {
+ // try to find a FILENAME tag (old cliparts...)
+ e=element.namedItem("FILENAME").toElement();
+ if(!e.isNull()) {
+ // Loads from the disk directly (unless it's in the collection already?)
+ image = imageCollection->loadPicture( e.attribute("filename") );
+ }
+ } else {
+ bool openPic = true;
+ QString _data;
+ QString _fileName;
+ if(e.hasAttribute("data"))
+ _data=e.attribute("data");
+ if ( _data.isEmpty() )
+ openPic = true;
+ else
+ openPic = false;
+ if(e.hasAttribute("filename"))
+ _fileName=e.attribute("filename");
+ if ( !_fileName.isEmpty() )
+ {
+ if ( int _envVarB = _fileName.find( '$' ) >= 0 )
+ {
+ int _envVarE = _fileName.find( '/', _envVarB );
+ // ### FIXME: it should be QString::local8Bit instead of QFile::encodeName, shouldn't it?
+ QString path = getenv( QFile::encodeName(_fileName.mid( _envVarB, _envVarE-_envVarB )) );
+ _fileName.replace( _envVarB-1, _envVarE-_envVarB+1, path );
+ }
+ }
+
+ if ( openPic )
+ // !! this loads it from the disk (unless it's in the image collection already)
+ image = imageCollection->loadPicture( _fileName );
+ else
+ {
+ KoPictureKey key( _fileName );
+ image.clear();
+ image.setKey(key);
+ QByteArray rawData=_data.utf8(); // XPM is normally ASCII, therefore UTF-8
+ rawData[rawData.size()-1]=char(10); // Replace the NULL character by a LINE FEED
+ QBuffer buffer(rawData); // ### TODO: open?
+ image.loadXpm(&buffer);
+ }
+ }
+ }
+
+ e = element.namedItem( "PICTURESETTINGS" ).toElement();
+ if ( !e.isNull() ) {
+ PictureMirrorType _mirrorType = PM_NORMAL;
+ int _depth = 0;
+ bool _swapRGB = false;
+ bool _grayscal = false;
+ int _bright = 0;
+
+ if ( e.hasAttribute( "mirrorType" ) )
+ _mirrorType = static_cast<PictureMirrorType>( e.attribute( "mirrorType" ).toInt() );
+ if ( e.hasAttribute( "depth" ) )
+ _depth = e.attribute( "depth" ).toInt();
+ if ( e.hasAttribute( "swapRGB" ) )
+ _swapRGB = static_cast<bool>( e.attribute( "swapRGB" ).toInt() );
+ if ( e.hasAttribute( "grayscal" ) )
+ _grayscal = static_cast<bool>( e.attribute( "grayscal" ).toInt() );
+ if ( e.hasAttribute( "bright" ) )
+ _bright = e.attribute( "bright" ).toInt();
+
+ mirrorType = _mirrorType;
+ depth = _depth;
+ swapRGB = _swapRGB;
+ grayscal = _grayscal;
+ bright = _bright;
+ }
+ else {
+ mirrorType = PM_NORMAL;
+ depth = 0;
+ swapRGB = false;
+ grayscal = false;
+ bright = 0;
+ }
+
+ e = element.namedItem( "EFFECTS" ).toElement();
+ if (!e.isNull()) {
+ if (e.hasAttribute("type"))
+ m_effect = static_cast<ImageEffect>(e.attribute("type").toInt());
+ if (e.hasAttribute("param1"))
+ m_ie_par1 = QVariant(e.attribute("param1"));
+ else
+ m_ie_par1 = QVariant();
+ if (e.hasAttribute("param2"))
+ m_ie_par2 = QVariant(e.attribute("param2"));
+ else
+ m_ie_par2 = QVariant();
+ if (e.hasAttribute("param3"))
+ m_ie_par3 = QVariant(e.attribute("param3"));
+ else
+ m_ie_par3 = QVariant();
+ }
+ else
+ m_effect = IE_NONE;
+
+ return offset;
+}
+
+void KPrPixmapObject::drawShadow( QPainter* _painter, KoZoomHandler* _zoomHandler)
+{
+ const double ox = orig.x();
+ const double oy = orig.y();
+ const double ow = ext.width();
+ const double oh = ext.height();
+
+ _painter->save();
+
+ QPen pen2 = pen.zoomedPen( _zoomHandler );
+ _painter->setPen( pen2 );
+ _painter->setBrush( getBrush() );
+
+ double sx = 0;
+ double sy = 0;
+
+ getShadowCoords( sx, sy );
+
+ _painter->translate( _zoomHandler->zoomItX( ox ), _zoomHandler->zoomItY( oy ) );
+ _painter->setPen( QPen( shadowColor ) );
+ _painter->setBrush( shadowColor );
+ if ( kAbs(angle) <= DBL_EPSILON )
+ _painter->drawRect( _zoomHandler->zoomItX( sx ), _zoomHandler->zoomItY( sy ),
+ _zoomHandler->zoomItX( ext.width() ), _zoomHandler->zoomItY( ext.height() ) );
+ else
+ {
+ QSize bs = QSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) );
+ QRect br = QRect( 0, 0, bs.width(), bs.height() );
+ int pw = br.width();
+ int ph = br.height();
+ QRect rr = br;
+ int pixYPos = -rr.y();
+ int pixXPos = -rr.x();
+ br.moveTopLeft( QPoint( -br.width() / 2, -br.height() / 2 ) );
+ rr.moveTopLeft( QPoint( -rr.width() / 2, -rr.height() / 2 ) );
+
+ QWMatrix m;
+ m.translate( pw / 2, ph / 2 );
+ m.rotate( angle );
+ m.translate( rr.left() + pixXPos + _zoomHandler->zoomItX( sx ),
+ rr.top() + pixYPos + _zoomHandler->zoomItY( sy ) );
+
+ _painter->setWorldMatrix( m, true );
+
+ _painter->drawRect( 0, 0, bs.width(), bs.height() );
+ }
+
+ _painter->restore();
+}
+
+QPixmap KPrPixmapObject::generatePixmap(KoZoomHandler*_zoomHandler)
+{
+ const double penw = _zoomHandler->zoomItX( ( ( pen.style() == Qt::NoPen ) ? 1 : pen.width() ) / 2.0 );
+
+ QSize size( _zoomHandler->zoomSize( ext ) );
+ //kdDebug(33001) << "KPrPixmapObject::generatePixmap size= " << size << endl;
+ QPixmap pixmap(size);
+ QPainter paint;
+
+ paint.begin( &pixmap );
+ pixmap.fill( Qt::white );
+
+ // Draw background
+ paint.setPen( Qt::NoPen );
+ paint.setBrush( getBrush() );
+
+ QRect rect( (int)( penw ), (int)( penw ),
+ (int)( _zoomHandler->zoomItX( ext.width() ) - 2.0 * penw ),
+ (int)( _zoomHandler->zoomItY( ext.height() ) - 2.0 * penw ) );
+
+ if ( getFillType() == FT_BRUSH || !gradient )
+ paint.drawRect( rect );
+ else {
+ // ### TODO: this was also drawn for drawContour==true, but why?
+ gradient->setSize( size );
+ paint.drawPixmap( (int)( penw ), (int)( penw ),
+ gradient->pixmap(), 0, 0,
+ (int)( _zoomHandler->zoomItX( ext.width() ) - 2 * penw ),
+ (int)( _zoomHandler->zoomItY( ext.height() ) - 2 * penw ) );
+ }
+
+
+ image.draw(paint, 0, 0, size.width(), size.height(), 0, 0, -1, -1, false); // Always slow mode!
+ image.clearCache(); // Release the memoy of the picture cache
+
+ image.setAlphaBuffer(true);
+ QBitmap tmpMask;
+ tmpMask = image.createAlphaMask().scale(size);
+ pixmap.setMask(tmpMask);
+
+ paint.end();
+ return pixmap;
+}
+
+void KPrPixmapObject::draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int pageNum, SelectionMode selectionMode, bool drawContour )
+{
+ if ( image.isNull() ) return;
+
+ if ( shadowDistance > 0 && !drawContour )
+ drawShadow(_painter, _zoomHandler);
+
+ const double ox = orig.x();
+ const double oy = orig.y();
+ const double ow = ext.width();
+ const double oh = ext.height();
+ const double penw = _zoomHandler->zoomItX( ( ( pen.style() == Qt::NoPen ) ? 1.0 : pen.width() ) / 2.0 );
+
+ _painter->save();
+
+ _painter->translate( _zoomHandler->zoomItX( ox ), _zoomHandler->zoomItY( oy ) );
+
+ if ( kAbs(angle)> DBL_EPSILON ) {
+ QSize bs = QSize( _zoomHandler->zoomItX( ow ), _zoomHandler->zoomItY( oh ) );
+ QRect br = QRect( 0, 0, bs.width(), bs.height() );
+ int pw = br.width();
+ int ph = br.height();
+ QRect rr = br;
+ int pixYPos = -rr.y();
+ int pixXPos = -rr.x();
+ br.moveTopLeft( QPoint( -br.width() / 2, -br.height() / 2 ) );
+ rr.moveTopLeft( QPoint( -rr.width() / 2, -rr.height() / 2 ) );
+
+ QWMatrix m;
+ m.translate( pw / 2, ph / 2 );
+ m.rotate( angle );
+ m.translate( rr.left() + pixXPos, rr.top() + pixYPos );
+ _painter->setWorldMatrix( m, true );
+ }
+
+ if ( !drawContour )
+ {
+ QRect rect( 0, 0, (int)( _zoomHandler->zoomItX( ow ) ),
+ (int)( _zoomHandler->zoomItY( oh ) ) );
+ // ### HACK QT seems not to be able to correctly compare QVariant
+ bool variants1;
+ if (m_ie_par1.isNull())
+ variants1=m_cachedPar1.isNull();
+ else
+ variants1=(m_ie_par1 == m_cachedPar1);
+ bool variants2;
+ if (m_ie_par2.isNull())
+ variants2=m_cachedPar2.isNull();
+ else
+ variants2=(m_ie_par2 == m_cachedPar2);
+ bool variants3;
+ if (m_ie_par3.isNull())
+ variants3=m_cachedPar3.isNull();
+ else
+ variants3=(m_ie_par3 == m_cachedPar3);
+
+ if (m_cachedRect == rect
+ // All what KPrPixmapObject::changePictureSettings needs
+ && m_cachedMirrorType == mirrorType && m_cachedSwapRGB == swapRGB && m_cachedGrayscal == grayscal
+ && m_cachedBright == bright && m_cachedEffect == m_effect
+ // Who needs it?
+ && m_cachedDepth == depth
+#if 0
+ && m_ie_par1 == m_cachedPar1 && m_ie_par2 == m_cachedPar2 && m_ie_par3 == m_cachedPar3
+#else
+ && variants1 && variants2 && variants3
+#endif
+ )
+ {
+ //kdDebug(33001) << "Drawing cached pixmap " << (void*) this << " " << k_funcinfo << endl;
+ }
+ else
+ {
+ if (mirrorType != PM_NORMAL || depth != 0 || swapRGB || grayscal || bright != 0 || m_effect!=IE_NONE)
+ m_cachedPixmap = changePictureSettings( generatePixmap( _zoomHandler ) );
+ else
+ m_cachedPixmap = generatePixmap( _zoomHandler );
+ m_cachedRect = rect;
+ m_cachedMirrorType = mirrorType;
+ m_cachedSwapRGB = swapRGB;
+ m_cachedGrayscal = grayscal;
+ m_cachedBright = bright;
+ m_cachedEffect = m_effect;
+ m_cachedDepth = depth;
+ m_cachedPar1 = m_ie_par1;
+ m_cachedPar2 = m_ie_par2;
+ m_cachedPar3 = m_ie_par3;
+ //kdDebug(33001) << "Drawing non-cached pixmap " << (void*) this << " " << k_funcinfo << endl;
+ }
+ _painter->drawPixmap( rect, m_cachedPixmap);
+ }
+
+ // Draw border
+ // ### TODO port to KoBorder::drawBorders() (after writing a simplified version of it, that takes the same border on each size)
+ QPen pen2;
+ if ( drawContour ) {
+ pen2 = QPen( Qt::black, 1, Qt::DotLine );
+ _painter->setRasterOp( Qt::NotXorROP );
+ }
+ else {
+ pen2 = pen;
+ pen2.setWidth( _zoomHandler->zoomItX( ( pen.style() == Qt::NoPen ) ? 1.0 : (double)pen.width() ) );
+ }
+ _painter->setPen( pen2 );
+ _painter->setBrush( Qt::NoBrush );
+ _painter->drawRect( (int)( penw ), (int)( penw ),
+ (int)( _zoomHandler->zoomItX( ow ) - 2.0 * penw ),
+ (int)( _zoomHandler->zoomItY( oh ) - 2.0 * penw ) );
+
+ _painter->restore();
+
+ KPrObject::draw( _painter, _zoomHandler, pageNum, selectionMode, drawContour );
+}
+
+QPixmap KPrPixmapObject::getOriginalPixmap()
+{
+ QSize _pixSize = image.getOriginalSize();
+ kdDebug(33001) << "KPrPixmapObject::getOriginalPixmap size= " << _pixSize << endl;
+ QPixmap _pixmap = image.generatePixmap( _pixSize, true );
+ image.clearCache(); // Release the memoy of the picture cache
+
+ return _pixmap;
+}
+
+QPixmap KPrPixmapObject::changePictureSettings( QPixmap _tmpPixmap )
+{
+ QImage _tmpImage = _tmpPixmap.convertToImage();
+
+ if (_tmpImage.isNull())
+ return _tmpPixmap;
+
+ bool _horizontal = false;
+ bool _vertical = false;
+ if ( mirrorType == PM_HORIZONTAL )
+ _horizontal = true;
+ else if ( mirrorType == PM_VERTICAL )
+ _vertical = true;
+ else if ( mirrorType == PM_HORIZONTALANDVERTICAL ) {
+ _horizontal = true;
+ _vertical = true;
+ }
+
+ _tmpImage = _tmpImage.mirror( _horizontal, _vertical );
+
+ if ( depth != 0 ) {
+ QImage tmpImg = _tmpImage.convertDepth( depth );
+ if ( !tmpImg.isNull() )
+ _tmpImage = tmpImg;
+ }
+
+ if ( swapRGB )
+ _tmpImage = _tmpImage.swapRGB();
+
+ if ( grayscal ) {
+ if ( depth == 1 || depth == 8 ) {
+ for ( int i = 0; i < _tmpImage.numColors(); ++i ) {
+ QRgb rgb = _tmpImage.color( i );
+ int gray = qGray( rgb );
+ rgb = qRgb( gray, gray, gray );
+ _tmpImage.setColor( i, rgb );
+ }
+ }
+ else {
+ int _width = _tmpImage.width();
+ int _height = _tmpImage.height();
+ int _x = 0;
+ int _y = 0;
+
+ for ( _x = 0; _x < _width; ++_x ) {
+ for ( _y = 0; _y < _height; ++_y ) {
+ if ( _tmpImage.valid( _x, _y ) ) {
+ QRgb rgb = _tmpImage.pixel( _x, _y );
+ int gray = qGray( rgb );
+ rgb = qRgb( gray, gray, gray );
+ _tmpImage.setPixel( _x, _y, rgb );
+ }
+ }
+ }
+ }
+ }
+
+ if ( bright != 0 ) {
+ if ( depth == 1 || depth == 8 ) {
+ for ( int i = 0; i < _tmpImage.numColors(); ++i ) {
+ QRgb rgb = _tmpImage.color( i );
+ QColor c( rgb );
+
+ if ( bright > 0 )
+ rgb = c.light( 100 + bright ).rgb();
+ else
+ rgb = c.dark( 100 + abs( bright ) ).rgb();
+
+ _tmpImage.setColor( i, rgb );
+ }
+ }
+ else {
+ int _width = _tmpImage.width();
+ int _height = _tmpImage.height();
+ int _x = 0;
+ int _y = 0;
+
+ for ( _x = 0; _x < _width; ++_x ) {
+ for ( _y = 0; _y < _height; ++_y ) {
+ if ( _tmpImage.valid( _x, _y ) ) {
+ QRgb rgb = _tmpImage.pixel( _x, _y );
+ QColor c( rgb );
+
+ if ( bright > 0 )
+ rgb = c.light( 100 + bright ).rgb();
+ else
+ rgb = c.dark( 100 + abs( bright ) ).rgb();
+
+ _tmpImage.setPixel( _x, _y, rgb );
+ }
+ }
+ }
+ }
+ }
+
+ switch (m_effect) {
+ case IE_CHANNEL_INTENSITY: {
+ _tmpImage = KImageEffect::channelIntensity(_tmpImage, m_ie_par1.toDouble()/100.0,
+ static_cast<KImageEffect::RGBComponent>(m_ie_par2.toInt()));
+ break;
+ }
+ case IE_FADE: {
+ _tmpImage = KImageEffect::fade(_tmpImage, m_ie_par1.toDouble(), m_ie_par2.toColor());
+ break;
+ }
+ case IE_FLATTEN: {
+ _tmpImage = KImageEffect::flatten(_tmpImage, m_ie_par1.toColor(), m_ie_par2.toColor());
+ break;
+ }
+ case IE_INTENSITY: {
+ _tmpImage = KImageEffect::intensity(_tmpImage, m_ie_par1.toDouble()/100.0);
+ break;
+ }
+ case IE_DESATURATE: {
+ _tmpImage = KImageEffect::desaturate(_tmpImage, m_ie_par1.toDouble());
+ break;
+ }
+ case IE_CONTRAST: {
+ _tmpImage = KImageEffect::contrast(_tmpImage, m_ie_par1.toInt());
+ break;
+ }
+ case IE_NORMALIZE: {
+ KImageEffect::normalize(_tmpImage);
+ break;
+ }
+ case IE_EQUALIZE: {
+ KImageEffect::equalize(_tmpImage);
+ break;
+ }
+ case IE_THRESHOLD: {
+ KImageEffect::threshold(_tmpImage, m_ie_par1.toInt());
+ break;
+ }
+ case IE_SOLARIZE: {
+ KImageEffect::solarize(_tmpImage, m_ie_par1.toDouble());
+ break;
+ }
+ case IE_EMBOSS: {
+ _tmpImage = KImageEffect::emboss(_tmpImage);
+ break;
+ }
+ case IE_DESPECKLE: {
+ _tmpImage = KImageEffect::despeckle(_tmpImage);
+ break;
+ }
+ case IE_CHARCOAL: {
+ _tmpImage = KImageEffect::charcoal(_tmpImage, m_ie_par1.toDouble());
+ break;
+ }
+ case IE_NOISE: {
+ _tmpImage = KImageEffect::addNoise(_tmpImage, static_cast<KImageEffect::NoiseType>(m_ie_par1.toInt()));
+ break;
+ }
+ case IE_BLUR: {
+ _tmpImage = KImageEffect::blur(_tmpImage, m_ie_par1.toDouble());
+ break;
+ }
+ case IE_EDGE: {
+ _tmpImage = KImageEffect::edge(_tmpImage, m_ie_par1.toDouble());
+ break;
+ }
+ case IE_IMPLODE: {
+ _tmpImage = KImageEffect::implode(_tmpImage, m_ie_par1.toDouble());
+ break;
+ }
+ case IE_OIL_PAINT: {
+ _tmpImage = KImageEffect::oilPaint(_tmpImage, m_ie_par1.toInt());
+ break;
+ }
+ case IE_SHARPEN: {
+ _tmpImage = KImageEffect::sharpen(_tmpImage, m_ie_par1.toDouble());
+ break;
+ }
+ case IE_SPREAD: {
+ _tmpImage = KImageEffect::spread(_tmpImage, m_ie_par1.toInt());
+ break;
+ }
+ case IE_SHADE: {
+ _tmpImage = KImageEffect::shade(_tmpImage, m_ie_par1.toBool(), m_ie_par2.toDouble(), m_ie_par3.toDouble());
+ break;
+ }
+ case IE_SWIRL: {
+ _tmpImage = KImageEffect::swirl(_tmpImage, m_ie_par1.toDouble());
+ break;
+ }
+ case IE_WAVE: {
+ _tmpImage = KImageEffect::wave(_tmpImage, m_ie_par1.toDouble(), m_ie_par2.toDouble());
+ break;
+ }
+ case IE_NONE:
+ default:
+ break;
+ }
+
+ _tmpPixmap.convertFromImage( _tmpImage );
+
+ return _tmpPixmap;
+}
+
+void KPrPixmapObject::flip( bool horizontal )
+{
+ KPr2DObject::flip( horizontal );
+ if ( horizontal )
+ {
+ switch ( mirrorType )
+ {
+ case PM_NORMAL:
+ mirrorType = PM_HORIZONTAL;
+ break;
+ case PM_HORIZONTAL:
+ mirrorType = PM_NORMAL;
+ break;
+ case PM_VERTICAL:
+ mirrorType = PM_HORIZONTALANDVERTICAL;
+ break;
+ case PM_HORIZONTALANDVERTICAL:
+ mirrorType = PM_VERTICAL;
+ break;
+ }
+ }
+ else
+ {
+ switch ( mirrorType )
+ {
+ case PM_NORMAL:
+ mirrorType = PM_VERTICAL;
+ break;
+ case PM_HORIZONTAL:
+ mirrorType = PM_HORIZONTALANDVERTICAL;
+ break;
+ case PM_VERTICAL:
+ mirrorType = PM_NORMAL;
+ break;
+ case PM_HORIZONTALANDVERTICAL:
+ mirrorType = PM_HORIZONTAL;
+ break;
+ }
+ }
+}
+
diff --git a/kpresenter/KPrPixmapObject.h b/kpresenter/KPrPixmapObject.h
new file mode 100644
index 000000000..1be1dbee5
--- /dev/null
+++ b/kpresenter/KPrPixmapObject.h
@@ -0,0 +1,153 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+// ### TODO: fix copyright date/authors
+
+#ifndef kppixmapobject_h
+#define kppixmapobject_h
+
+#include <qdatetime.h>
+#include <qvariant.h>
+
+#include "KPrObject.h"
+#include <KoPictureCollection.h>
+#include <KoSize.h>
+
+class QPixmap;
+
+// ### TODO rename the class (and the related files/classes) to a better name (for example KPPictureObject)
+
+class KPrPixmapObject : public KPr2DObject
+{
+
+public:
+ KPrPixmapObject( KoPictureCollection *_imageCollection );
+ KPrPixmapObject( KoPictureCollection *_imageCollection, const KoPictureKey & key );
+ virtual ~KPrPixmapObject() {}
+
+ KPrPixmapObject &operator=( const KPrPixmapObject & );
+
+ virtual DCOPObject* dcopObject();
+
+ /**
+ * Only used as a default value in the filedialog, in changePicture
+ * \warning Do not use for anything else
+ */
+ QString getFileName() const
+ { return image.getKey().filename(); }
+
+ KoPictureKey getKey() const
+ { return image.getKey(); }
+
+ QSize originalSize() const
+ { return image.getOriginalSize(); }
+
+ /// Deprecated, please use KPrPixmapObject::setPicture
+ void setPixmap( const KoPictureKey & key ) KDE_DEPRECATED;
+ void setPicture( const KoPictureKey & key );
+
+ void reload( void );
+
+ virtual ObjType getType() const
+ { return OT_PICTURE; }
+ virtual QString getTypeString() const
+ { return i18n("Picture"); }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+
+ virtual double load(const QDomElement &element);
+ virtual void loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info);
+
+ virtual void draw( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int /* page */, SelectionMode selectionMode, bool drawContour = FALSE );
+
+ QPixmap getOriginalPixmap();
+ PictureMirrorType getPictureMirrorType() const { return mirrorType; }
+ int getPictureDepth() const { return depth; }
+ bool getPictureSwapRGB() const { return swapRGB; }
+ bool getPictureGrayscal() const { return grayscal; }
+ int getPictureBright() const { return bright; }
+
+ ImageEffect getImageEffect() const {return m_effect;}
+ QVariant getIEParam1() const {return m_ie_par1;}
+ QVariant getIEParam2() const {return m_ie_par2;}
+ QVariant getIEParam3() const {return m_ie_par3;}
+ void setImageEffect(ImageEffect eff) { m_effect = eff; }
+ void setIEParams(QVariant p1, QVariant p2, QVariant p3) {
+ m_ie_par1=p1;
+ m_ie_par2=p2;
+ m_ie_par3=p3;
+ }
+
+ void setPictureMirrorType(const PictureMirrorType &_mirrorType) { mirrorType = _mirrorType; }
+ void setPictureDepth(int _depth) { depth = _depth; }
+ void setPictureSwapRGB(bool _swapRGB) { swapRGB = _swapRGB; }
+ void setPictureGrayscal(bool _grayscal) { grayscal = _grayscal; }
+ void setPictureBright(int _bright) { bright = _bright; }
+
+ KoPicture picture() const { return image;}
+
+ /// Deprecated, please use KPrPixmapObject::loadPicture
+ void loadImage( const QString & fileName ) KDE_DEPRECATED;
+ void loadPicture( const QString & fileName );
+
+ virtual void flip(bool horizontal );
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+
+ KPrPixmapObject() {}
+
+ QPixmap changePictureSettings( QPixmap _tmpPixmap );
+ virtual void saveOasisPictureElement( KoGenStyle &styleobjectauto ) const;
+ void loadOasisPictureEffect(KoOasisContext & context );
+ virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
+
+ /**
+ * @internal
+ * Draws the shadow
+ */
+ void drawShadow( QPainter* _painter, KoZoomHandler* _zoomHandler);
+
+ QPixmap generatePixmap(KoZoomHandler*_zoomHandler);
+ QString convertValueToPercent( int val ) const;
+
+ KoPictureCollection *imageCollection;
+ KoPicture image;
+
+ PictureMirrorType mirrorType, m_cachedMirrorType;
+ int depth, m_cachedDepth;
+ bool swapRGB, m_cachedSwapRGB;
+ bool grayscal, m_cachedGrayscal;
+ int bright, m_cachedBright;
+
+ //image effect and its params
+ ImageEffect m_effect, m_cachedEffect;
+ QVariant m_ie_par1, m_cachedPar1;
+ QVariant m_ie_par2, m_cachedPar2;
+ QVariant m_ie_par3, m_cachedPar3;
+
+ QPixmap m_cachedPixmap;
+ QRect m_cachedRect;
+};
+
+#endif
diff --git a/kpresenter/KPrPixmapObjectIface.cpp b/kpresenter/KPrPixmapObjectIface.cpp
new file mode 100644
index 000000000..ec7b10d7a
--- /dev/null
+++ b/kpresenter/KPrPixmapObjectIface.cpp
@@ -0,0 +1,101 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPixmapObjectIface.h"
+#include "KPrPixmapObject.h"
+#include "KPrObject.h"
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrPixmapObjectIface::KPrPixmapObjectIface( KPrPixmapObject *_obj )
+ : KPrObject2DIface(_obj)
+{
+ obj = _obj;
+}
+
+QString KPrPixmapObjectIface::fileName() const
+{
+ return obj->getFileName();
+}
+
+bool KPrPixmapObjectIface::swapRGB() const
+{
+ return obj->getPictureSwapRGB();
+}
+
+bool KPrPixmapObjectIface::grayscale() const
+{
+ return obj->getPictureGrayscal();
+}
+
+int KPrPixmapObjectIface::depth() const
+{
+ return obj->getPictureDepth();
+}
+
+int KPrPixmapObjectIface::pictureMirrorType() const
+{
+ return obj->getPictureMirrorType();
+}
+
+int KPrPixmapObjectIface::brightness() const
+{
+ return obj->getPictureBright();
+}
+
+void KPrPixmapObjectIface::setDepth(int depth )
+{
+ obj->setPictureDepth(depth);
+}
+
+void KPrPixmapObjectIface::setBrightness(int bright )
+{
+ obj->setPictureBright(bright);
+}
+
+void KPrPixmapObjectIface::setSwapRGB(bool swapRGB )
+{
+ obj->setPictureSwapRGB(swapRGB);
+}
+
+void KPrPixmapObjectIface::setGrayscale( bool grayscal )
+{
+ obj->setPictureGrayscal(grayscal);
+}
+
+void KPrPixmapObjectIface::loadImage( const QString & fileName )
+{
+ obj->loadPicture(fileName);
+}
+
+void KPrPixmapObjectIface::setPictureMirrorType(const QString & _mirror)
+{
+ if ( _mirror.lower()=="normal")
+ obj->setPictureMirrorType( PM_NORMAL);
+ else if ( _mirror.lower()=="horizontal")
+ obj->setPictureMirrorType( PM_HORIZONTAL );
+ else if ( _mirror.lower()=="vertical")
+ obj->setPictureMirrorType( PM_VERTICAL );
+ else if ( _mirror.lower()=="horizontalandvertical")
+ obj->setPictureMirrorType( PM_HORIZONTALANDVERTICAL );
+ else
+ kdDebug(33001)<<" Error in setPictureMirrorType :"<<_mirror<<endl;
+}
diff --git a/kpresenter/KPrPixmapObjectIface.h b/kpresenter/KPrPixmapObjectIface.h
new file mode 100644
index 000000000..6a9cb388c
--- /dev/null
+++ b/kpresenter/KPrPixmapObjectIface.h
@@ -0,0 +1,56 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPPIXMAP_OBJECT_IFACE_H
+#define KPPIXMAP_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObject2DIface.h"
+#include <qstring.h>
+
+class KPrPixmapObject;
+
+class KPrPixmapObjectIface : public KPrObject2DIface
+{
+ K_DCOP
+public:
+ KPrPixmapObjectIface( KPrPixmapObject *obj_ );
+
+k_dcop:
+ QString fileName() const;
+ int depth() const;
+ bool swapRGB() const;
+ bool grayscale() const;
+ int pictureMirrorType() const;
+ int brightness() const;
+
+ void setDepth(int depth );
+ void setBrightness(int bright );
+ void setSwapRGB(bool swapRGB );
+ void setGrayscale( bool grayscal );
+ void loadImage( const QString & fileName );
+ void setPictureMirrorType(const QString & _mirror);
+
+private:
+ KPrPixmapObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrPointObject.cpp b/kpresenter/KPrPointObject.cpp
new file mode 100644
index 000000000..5295228bf
--- /dev/null
+++ b/kpresenter/KPrPointObject.cpp
@@ -0,0 +1,276 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004-2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPointObject.h"
+#include "KPrUtils.h"
+#include "KPrDocument.h"
+#include "KPrSVGPathParser.h"
+#include <KoTextZoomHandler.h>
+#include <KoUnit.h>
+#include <qdom.h>
+#include <qpainter.h>
+#include <KoStyleStack.h>
+#include <KoOasisContext.h>
+#include <KoXmlNS.h>
+
+KPrPointObject::KPrPointObject()
+ : KPrShadowObject(), KPrStartEndLine( L_NORMAL, L_NORMAL )
+{
+}
+
+
+KPrPointObject::KPrPointObject( const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd )
+ : KPrShadowObject( _pen ), KPrStartEndLine(_lineBegin, _lineEnd)
+{
+}
+
+
+KoSize KPrPointObject::getRealSize() const
+{
+ KoSize size( ext );
+ KoPoint realOrig( orig );
+ KoPointArray p( getDrawingPoints() );
+ getRealSizeAndOrigFromPoints( p, angle, size, realOrig );
+ return size;
+}
+
+
+KoPoint KPrPointObject::getRealOrig() const
+{
+ KoSize size( ext );
+ KoPoint realOrig( orig );
+ KoPointArray p( getDrawingPoints() );
+ getRealSizeAndOrigFromPoints( p, angle, size, realOrig );
+ return realOrig;
+}
+
+
+void KPrPointObject::loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo* info )
+{
+ kdDebug(33001) << "KPrPointObject::loadOasis" << endl;
+
+ KPrShadowObject::loadOasis( element, context, info );
+ QString d = element.attributeNS( KoXmlNS::svg, "d", QString::null);
+ kdDebug(33001) << "path d: " << d << endl;
+
+ KPrSVGPathParser parser;
+ points = parser.getPoints( d, getType() == OT_FREEHAND );
+ loadOasisApplyViewBox( element, points );
+}
+
+
+QDomDocumentFragment KPrPointObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment = KPrShadowObject::save( doc, offset );
+ if ( !points.isNull() ) {
+ QDomElement elemPoints = doc.createElement( "POINTS" );
+ KoPointArray::ConstIterator it;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ QDomElement elemPoint = doc.createElement( "Point" );
+ KoPoint point = (*it);
+ elemPoint.setAttribute( "point_x", point.x() );
+ elemPoint.setAttribute( "point_y", point.y() );
+
+ elemPoints.appendChild( elemPoint );
+ }
+ fragment.appendChild( elemPoints );
+ }
+
+ KPrStartEndLine::save( fragment,doc );
+
+ return fragment;
+}
+
+const char * KPrPointObject::getOasisElementName() const
+{
+ return "draw:custom-shape";
+}
+
+void KPrPointObject::loadOasisMarker( KoOasisContext & context )
+{
+ loadOasisMarkerElement( context, "marker-start", lineBegin );
+ loadOasisMarkerElement( context, "marker-end", lineEnd );
+}
+
+void KPrPointObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const
+{
+ KPrShadowObject::fillStyle( styleObjectAuto, mainStyles );
+ saveOasisMarkerElement( mainStyles, styleObjectAuto );
+}
+
+
+double KPrPointObject::load( const QDomElement &element )
+{
+ double offset = KPrShadowObject::load( element );
+
+ QDomElement e = element.namedItem( "POINTS" ).toElement();
+ if ( !e.isNull() ) {
+ QDomElement elemPoint = e.firstChild().toElement();
+ unsigned int index = 0;
+ while ( !elemPoint.isNull() ) {
+ if ( elemPoint.tagName() == "Point" ) {
+ double tmpX = 0;
+ double tmpY = 0;
+ if( elemPoint.hasAttribute( "point_x" ) )
+ tmpX = elemPoint.attribute( "point_x" ).toDouble();
+ if( elemPoint.hasAttribute( "point_y" ) )
+ tmpY = elemPoint.attribute( "point_y" ).toDouble();
+
+ points.putPoints( index, 1, tmpX,tmpY );
+ }
+ elemPoint = elemPoint.nextSibling().toElement();
+ ++index;
+ }
+ }
+ KPrStartEndLine::load( element );
+ return offset;
+}
+
+
+void KPrPointObject::setSize( double _width, double _height )
+{
+ KoSize origSize( ext );
+ KPrObject::setSize( _width, _height );
+
+ double fx = ext.width() / origSize.width();
+ double fy = ext.height() / origSize.height();
+
+ updatePoints( fx, fy );
+}
+
+
+void KPrPointObject::flip( bool horizontal )
+{
+ KPrObject::flip( horizontal );
+
+ KoPointArray tmpPoints;
+ int index = 0;
+ if ( ! horizontal )
+ {
+ KoPointArray::ConstIterator it;
+ double horiz = getSize().height()/2;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint point = (*it);
+ if ( point.y()> horiz )
+ tmpPoints.putPoints( index, 1, point.x(),point.y()- 2*(point.y()-horiz) );
+ else
+ tmpPoints.putPoints( index, 1, point.x(),point.y()+ 2*(horiz - point.y()) );
+ ++index;
+ }
+ }
+ else
+ {
+ KoPointArray::ConstIterator it;
+ double vert = getSize().width()/2;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint point = (*it);
+ if ( point.x()> vert )
+ tmpPoints.putPoints( index, 1, point.x()- 2*(point.x()-vert), point.y() );
+ else
+ tmpPoints.putPoints( index, 1, point.x()+ 2*(vert - point.x()),point.y() );
+ ++index;
+ }
+ }
+
+ points = tmpPoints;
+}
+
+
+void KPrPointObject::paint( QPainter* _painter, KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool /*drawingShadow*/, bool drawContour )
+{
+ int _w = int( pen.pointWidth() );
+
+ QPen pen2;
+ if ( drawContour ) {
+ pen2 = QPen( Qt::black, 1, Qt::DotLine );
+ _painter->setRasterOp( Qt::NotXorROP );
+ }
+ else {
+ pen2 = pen.zoomedPen( _zoomHandler );
+ }
+ _painter->setPen( pen2 );
+
+ QPointArray pointArray = getDrawingPoints().zoomPointArray( _zoomHandler, _w );
+ _painter->drawPolyline( pointArray );
+
+ if ( lineBegin != L_NORMAL && !drawContour ) {
+ QPoint startPoint;
+ bool first = true;
+ QPointArray::ConstIterator it1;
+ for ( it1 = pointArray.begin(); it1 != pointArray.end(); ++it1 ) {
+ if ( first ) {
+ startPoint = (*it1);
+ first = false;
+ }
+
+ QPoint point = (*it1);
+ if ( startPoint != point ) {
+ float angle = KoPoint::getAngle( KoPoint( startPoint ), KoPoint( point ) );
+ drawFigureWithOffset( lineBegin, _painter, startPoint, pen2.color(), _w, angle,_zoomHandler );
+
+ break;
+ }
+ }
+ }
+
+ if ( lineEnd != L_NORMAL && !drawContour ) {
+ QPoint endPoint;
+ bool last = true;
+ QPointArray::ConstIterator it2 = pointArray.end();
+ for ( it2 = it2 - 1; it2 != pointArray.begin(); --it2 ) {
+ if ( last ) {
+ endPoint = (*it2);
+ last = false;
+ }
+
+ QPoint point = (*it2);
+ if ( endPoint != point ) {
+ float angle = KoPoint::getAngle( KoPoint( endPoint ), KoPoint( point ) );
+ drawFigureWithOffset( lineEnd, _painter, endPoint, pen2.color(), _w, angle,_zoomHandler );
+
+ break;
+ }
+ }
+ }
+}
+
+
+void KPrPointObject::updatePoints( double _fx, double _fy )
+{
+ int index = 0;
+ KoPointArray tmpPoints;
+ KoPointArray::ConstIterator it;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint point = (*it);
+ double tmpX = point.x() * _fx;
+ double tmpY = point.y() * _fy;
+
+ tmpPoints.putPoints( index, 1, tmpX,tmpY );
+ ++index;
+ }
+ points = tmpPoints;
+}
+
+
+KoPointArray KPrPointObject::getDrawingPoints() const
+{
+ return points;
+}
diff --git a/kpresenter/KPrPointObject.h b/kpresenter/KPrPointObject.h
new file mode 100644
index 000000000..a93ede274
--- /dev/null
+++ b/kpresenter/KPrPointObject.h
@@ -0,0 +1,74 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004-2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kppointobject_h
+#define kppointobject_h
+
+#include "KPrObject.h"
+#include <KoStyleStack.h>
+
+class KPrPointObject : public KPrShadowObject, public KPrStartEndLine
+{
+public:
+ KPrPointObject();
+ KPrPointObject( const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd );
+
+ virtual KoSize getRealSize() const;
+ virtual KoPoint getRealOrig() const;
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+
+ virtual double load( const QDomElement &element );
+ virtual void loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo* info );
+
+ virtual void setLineBegin( LineEnd _lineBegin ) { lineBegin = _lineBegin; }
+ virtual void setLineEnd( LineEnd _lineEnd ) { lineEnd = _lineEnd; }
+
+ virtual LineEnd getLineBegin() const { return lineBegin; }
+ virtual LineEnd getLineEnd() const { return lineEnd; }
+
+ virtual void setSize( double _width, double _height );
+ virtual void setSize( const KoSize & _size )
+ { setSize( _size.width(), _size.height() ); }
+
+ virtual void flip( bool horizontal );
+
+ /**
+ * @brief Get the points of the object
+ *
+ * @return points of the object
+ */
+ virtual const KoPointArray getPoints() const { return getDrawingPoints(); }
+
+protected:
+ virtual const char * getOasisElementName() const;
+
+ void loadOasisMarker( KoOasisContext & context );
+ virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
+
+ virtual void paint( QPainter *_painter,KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour = FALSE );
+ virtual void updatePoints( double _fx, double _fy );
+ virtual KoPointArray getDrawingPoints() const;
+
+ KoPointArray points;
+};
+
+#endif
diff --git a/kpresenter/KPrPolyLineObjectIface.cpp b/kpresenter/KPrPolyLineObjectIface.cpp
new file mode 100644
index 000000000..8283a4c56
--- /dev/null
+++ b/kpresenter/KPrPolyLineObjectIface.cpp
@@ -0,0 +1,45 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPolyLineObjectIface.h"
+#include "KPrPolylineObject.h"
+#include "KPrObject.h"
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrPolyLineObjectIface::KPrPolyLineObjectIface( KPrPolylineObject *_obj )
+ : KPrObjectIface(_obj)
+
+{
+ obj = _obj;
+}
+
+void KPrPolyLineObjectIface::horizontalFlip()
+{
+ //todo repaint it
+ obj->flip(true );
+}
+
+void KPrPolyLineObjectIface::verticalFlip()
+{
+ //todo repaint it
+ obj->flip( false );
+}
diff --git a/kpresenter/KPrPolyLineObjectIface.h b/kpresenter/KPrPolyLineObjectIface.h
new file mode 100644
index 000000000..48eba571e
--- /dev/null
+++ b/kpresenter/KPrPolyLineObjectIface.h
@@ -0,0 +1,43 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPPOLYLINE_OBJECT_IFACE_H
+#define KPPOLYLINE_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObjectIface.h"
+
+class KPrPolylineObject;
+
+class KPrPolyLineObjectIface : public KPrObjectIface
+{
+ K_DCOP
+public:
+ KPrPolyLineObjectIface( KPrPolylineObject *obj_ );
+
+k_dcop:
+ void horizontalFlip();
+ void verticalFlip();
+private:
+ KPrPolylineObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrPolygonObject.cpp b/kpresenter/KPrPolygonObject.cpp
new file mode 100644
index 000000000..120cd89c1
--- /dev/null
+++ b/kpresenter/KPrPolygonObject.cpp
@@ -0,0 +1,377 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPolygonObject.h"
+#include "KPrGradient.h"
+#include <KoTextZoomHandler.h>
+#include <kdebug.h>
+#include <qbitmap.h>
+#include <qregion.h>
+#include <qdom.h>
+#include <qpicture.h>
+#include <qpainter.h>
+#include "KPrPolygonObjectIface.h"
+#include <KoUnit.h>
+#include <KoOasisContext.h>
+#include <math.h>
+#include <KoXmlNS.h>
+#include "KoPen.h"
+
+using namespace std;
+
+KPrPolygonObject::KPrPolygonObject()
+ : KPr2DObject()
+{
+}
+
+KPrPolygonObject::KPrPolygonObject( const KoPointArray &_points, const KoSize &_size,
+ const KoPen &_pen, const QBrush &_brush,
+ FillType _fillType, const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor,
+ bool _checkConcavePolygon, int _cornersValue, int _sharpnessValue )
+ : KPr2DObject( _pen, _brush, _fillType, _gColor1, _gColor2, _gType, _unbalanced, _xfactor, _yfactor )
+{
+ points = KoPointArray( _points );
+ ext = _size;
+
+ checkConcavePolygon = _checkConcavePolygon;
+ cornersValue = _cornersValue;
+ sharpnessValue = _sharpnessValue;
+}
+
+KPrPolygonObject &KPrPolygonObject::operator=( const KPrPolygonObject & )
+{
+ return *this;
+}
+
+DCOPObject* KPrPolygonObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrPolygonObjectIface( this );
+ return dcop;
+}
+
+bool KPrPolygonObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ sc.xmlWriter.addAttribute( "draw:corners", cornersValue );
+ sc.xmlWriter.addAttribute( "draw:concave", checkConcavePolygon ? "true" : "false" );
+ if ( checkConcavePolygon )
+ {
+ sc.xmlWriter.addAttribute( "draw:sharpness", QString( "%1%").arg( sharpnessValue ) );
+ }
+
+ return true;
+}
+
+const char * KPrPolygonObject::getOasisElementName() const
+{
+ return "draw:regular-polygon";
+}
+
+
+QDomDocumentFragment KPrPolygonObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment = KPr2DObject::save( doc, offset );
+
+ QDomElement elemSettings = doc.createElement( "SETTINGS" );
+
+ elemSettings.setAttribute( "checkConcavePolygon", static_cast<int>( checkConcavePolygon ) );
+ elemSettings.setAttribute( "cornersValue", cornersValue );
+ elemSettings.setAttribute( "sharpnessValue", sharpnessValue );
+
+ fragment.appendChild( elemSettings );
+
+ if ( !points.isNull() ) {
+ QDomElement elemPoints = doc.createElement( "POINTS" );
+ KoPointArray::ConstIterator it;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ QDomElement elemPoint = doc.createElement( "Point" );
+ KoPoint point = (*it);
+ elemPoint.setAttribute( "point_x", point.x() );
+ elemPoint.setAttribute( "point_y", point.y() );
+
+ elemPoints.appendChild( elemPoint );
+ }
+ fragment.appendChild( elemPoints );
+ }
+
+ return fragment;
+}
+
+void KPrPolygonObject::loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info )
+{
+ kdDebug()<<"void KPrPolygonObject::loadOasis( const QDomElement &element )***********\n";
+ KPr2DObject::loadOasis( element,context, info );
+ cornersValue = element.attributeNS( KoXmlNS::draw, "corners", QString::null ).toInt();
+ checkConcavePolygon = element.attributeNS( KoXmlNS::draw, "concave", QString::null ) == "true";
+ sharpnessValue = 0;
+ if ( checkConcavePolygon )
+ {
+ sharpnessValue = element.attributeNS( KoXmlNS::draw, "sharpness", QString::null ).remove( '%').toInt();
+ }
+ drawPolygon();
+}
+
+double KPrPolygonObject::load( const QDomElement &element )
+{
+ double offset=KPr2DObject::load( element );
+
+ QDomElement e = element.namedItem( "SETTINGS" ).toElement();
+ if ( !e.isNull() ) {
+ bool _checkConcavePolygon = false;
+ int _cornersValue = 3;
+ int _sharpnessValue = 0;
+
+ if ( e.hasAttribute( "checkConcavePolygon" ) )
+ _checkConcavePolygon = static_cast<bool>( e.attribute( "checkConcavePolygon" ).toInt() );
+ if ( e.hasAttribute( "cornersValue" ) )
+ _cornersValue = e.attribute( "cornersValue" ).toInt();
+ if ( e.hasAttribute( "sharpnessValue" ) )
+ _sharpnessValue = e.attribute( "sharpnessValue" ).toInt();
+
+ checkConcavePolygon = _checkConcavePolygon;
+ cornersValue = _cornersValue;
+ sharpnessValue = _sharpnessValue;
+ }
+
+ e = element.namedItem( "POINTS" ).toElement();
+ if ( !e.isNull() ) {
+ QDomElement elemPoint = e.firstChild().toElement();
+ unsigned int index = 0;
+ while ( !elemPoint.isNull() ) {
+ if ( elemPoint.tagName() == "Point" ) {
+ double tmpX = 0;
+ double tmpY = 0;
+ if( elemPoint.hasAttribute( "point_x" ) )
+ tmpX = elemPoint.attribute( "point_x" ).toDouble();
+ if( elemPoint.hasAttribute( "point_y" ) )
+ tmpY = elemPoint.attribute( "point_y" ).toDouble();
+
+ points.putPoints( index, 1, tmpX,tmpY );
+ }
+ elemPoint = elemPoint.nextSibling().toElement();
+ ++index;
+ }
+ }
+ return offset;
+}
+
+void KPrPolygonObject::setSize( double _width, double _height )
+{
+ KoSize origSize( ext );
+ KPrObject::setSize( _width, _height );
+
+ double fx = ext.width() / origSize.width();
+ double fy = ext.height() / origSize.height();
+
+ updatePoints( fx, fy );
+}
+
+void KPrPolygonObject::updatePoints( double _fx, double _fy )
+{
+ int index = 0;
+ KoPointArray tmpPoints;
+ KoPointArray::ConstIterator it;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint point = (*it);
+ double tmpX = point.x() * _fx;
+ double tmpY = point.y() * _fy;
+
+ tmpPoints.putPoints( index, 1, tmpX,tmpY );
+ ++index;
+ }
+ points = tmpPoints;
+}
+
+void KPrPolygonObject::paint( QPainter* _painter,KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour )
+{
+ int _w = ( pen.style() == Qt::NoPen ) ? 1 : pen.width();//pen.width();
+
+ if ( drawContour ) {
+ QPointArray pointArray2 = points.zoomPointArray( _zoomHandler );
+ QPen pen3( Qt::black, 1, Qt::DotLine );
+ _painter->setPen( pen3 );
+ _painter->setRasterOp( Qt::NotXorROP );
+ _painter->drawPolygon( pointArray2 );
+ return;
+ }
+
+ QPointArray pointArray = points.zoomPointArray( _zoomHandler, _w );
+ QPen pen2 = pen.zoomedPen( _zoomHandler );
+
+ if ( drawingShadow || getFillType() == FT_BRUSH || !gradient ) {
+ _painter->setPen( pen2 );
+ _painter->setBrush( getBrush() );
+ _painter->drawPolygon( pointArray );
+ }
+ else {
+ QSize size( _zoomHandler->zoomSize( ext ) );
+ if ( m_redrawGradientPix || gradient->size() != size )
+ {
+ m_redrawGradientPix = false;
+ gradient->setSize( size );
+ QRegion clipregion( pointArray );
+ m_gradientPix.resize( size );
+ m_gradientPix.fill( Qt::white );
+
+ QPainter p;
+ p.begin( &m_gradientPix );
+ p.setClipRegion( clipregion );
+ p.drawPixmap( 0, 0, gradient->pixmap() );
+ p.end();
+
+ m_gradientPix.setMask( m_gradientPix.createHeuristicMask() );
+ }
+
+ QRect _rect = pointArray.boundingRect();
+ _painter->drawPixmap( 0, 0, m_gradientPix, 0, 0, _rect.width(), _rect.height() );
+
+ _painter->setPen( pen2 );
+ _painter->setBrush( Qt::NoBrush );
+ _painter->drawPolygon( pointArray );
+
+ }
+}
+
+void KPrPolygonObject::drawPolygon()
+{
+ kdDebug()<<"void KPrPolygonObject::drawPolygon()***********\n";
+ KoRect _rect( 0, 0, ext.width(), ext.height() );
+ double angle = 2 * M_PI / cornersValue;
+ double diameter = static_cast<double>( QMAX( _rect.width(), _rect.height() ) );
+ double radius = diameter * 0.5;
+
+ KoPointArray _points( checkConcavePolygon ? cornersValue * 2 : cornersValue );
+ _points.setPoint( 0, 0, qRound( -radius ) );
+
+ double xmin = 0;
+ double ymin = qRound( -radius );
+
+ if ( checkConcavePolygon ) {
+ angle = angle / 2.0;
+ double a = angle;
+ double r = radius - ( sharpnessValue / 100.0 * radius );
+ for ( int i = 1; i < cornersValue * 2; ++i ) {
+ double xp, yp;
+ if ( i % 2 ) {
+ xp = r * sin( a );
+ yp = -r * cos( a );
+ }
+ else {
+ xp = radius * sin( a );
+ yp = -radius * cos( a );
+ }
+ a += angle;
+ _points.setPoint( i, xp, yp );
+ if (xp < xmin)
+ xmin = xp;
+ if (yp < ymin)
+ ymin = yp;
+ }
+ }
+ else {
+ double a = angle;
+ for ( int i = 1; i < cornersValue; ++i ) {
+ double xp = radius * sin( a );
+ double yp = -radius * cos( a );
+ a += angle;
+ _points.setPoint( i, xp, yp );
+ if (xp < xmin)
+ xmin = xp;
+ if (yp < ymin)
+ ymin = yp;
+ }
+ }
+
+ // calculate the points as offsets to 0,0
+ KoRect _changRect = _points.boundingRect();
+ double fx = _rect.width() / _changRect.width();
+ double fy = _rect.height() / _changRect.height();
+
+ int _index = 0;
+ KoPointArray tmpPoints;
+ KoPointArray::ConstIterator it;
+ for ( it = _points.begin(); it != _points.end(); ++it ) {
+ KoPoint point = (*it);
+ double tmpX = ( point.x() - xmin) * fx;
+ double tmpY = ( point.y() - ymin) * fy;
+
+ tmpPoints.putPoints( _index, 1, tmpX,tmpY );
+ ++_index;
+ }
+
+ points = tmpPoints;
+
+ if ( getFillType() == FT_GRADIENT && gradient )
+ m_redrawGradientPix = true;
+}
+
+void KPrPolygonObject::flip( bool horizontal )
+{
+ KPr2DObject::flip( horizontal );
+ // flip the points
+ KoPointArray tmpPoints;
+ int index = 0;
+ if ( ! horizontal )
+ {
+ KoPointArray::ConstIterator it;
+ double horiz = getSize().height()/2;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint point = (*it);
+ if ( point.y()> horiz )
+ tmpPoints.putPoints( index, 1, point.x(),point.y()- 2*(point.y()-horiz) );
+ else
+ tmpPoints.putPoints( index, 1, point.x(),point.y()+ 2*(horiz - point.y()) );
+ ++index;
+ }
+ }
+ else
+ {
+ KoPointArray::ConstIterator it;
+ double vert = getSize().width()/2;
+ for ( it = points.begin(); it != points.end(); ++it ) {
+ KoPoint point = (*it);
+ if ( point.x()> vert )
+ tmpPoints.putPoints( index, 1, point.x()- 2*(point.x()-vert), point.y() );
+ else
+ tmpPoints.putPoints( index, 1, point.x()+ 2*(vert - point.x()),point.y() );
+ ++index;
+ }
+ }
+ points = tmpPoints;
+}
+
+KoSize KPrPolygonObject::getRealSize() const {
+ KoSize size( ext );
+ KoPoint realOrig( orig );
+ KoPointArray p( points );
+ getRealSizeAndOrigFromPoints( p, angle, size, realOrig );
+ return size;
+}
+
+KoPoint KPrPolygonObject::getRealOrig() const {
+ KoSize size( ext );
+ KoPoint realOrig( orig );
+ KoPointArray p( points );
+ getRealSizeAndOrigFromPoints( p, angle, size, realOrig );
+ return realOrig;
+}
diff --git a/kpresenter/KPrPolygonObject.h b/kpresenter/KPrPolygonObject.h
new file mode 100644
index 000000000..a7506ca80
--- /dev/null
+++ b/kpresenter/KPrPolygonObject.h
@@ -0,0 +1,88 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kppolygonobject_h
+#define kppolygonobject_h
+
+#include <qpointarray.h>
+#include "KoPointArray.h"
+#include "KPrObject.h"
+
+class KPrGradient;
+class QPainter;
+class DCOPObject;
+class KoPen;
+
+class KPrPolygonObject : public KPr2DObject
+{
+public:
+ KPrPolygonObject();
+ KPrPolygonObject( const KoPointArray &_points, const KoSize &_size, const KoPen &_pen, const QBrush &_brush,
+ FillType _fillType, const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
+ bool _unbalanced, int _xfactor, int _yfactor,
+ bool _checkConcavePolygon, int _cornersValue, int _sharpnessValue );
+
+ virtual ~KPrPolygonObject() {}
+ virtual DCOPObject* dcopObject();
+
+ KPrPolygonObject &operator=( const KPrPolygonObject & );
+
+ virtual void setSize( double _width, double _height );
+ virtual void setSize( const KoSize & _size )
+ { setSize( _size.width(), _size.height() ); }
+
+ virtual ObjType getType() const { return OT_POLYGON; }
+ virtual QString getTypeString() const { return i18n( "Polygon" ); }
+
+ void setCheckConcavePolygon(bool _concavePolygon) { checkConcavePolygon = _concavePolygon; drawPolygon(); }
+ void setCornersValue(int _cornersValue) { cornersValue = _cornersValue; drawPolygon(); }
+ void setSharpnessValue(int _sharpnessValue) { sharpnessValue = _sharpnessValue; drawPolygon(); }
+ bool getCheckConcavePolygon() const { return checkConcavePolygon; }
+ int getCornersValue() const { return cornersValue; }
+ int getSharpnessValue() const { return sharpnessValue; }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+
+ virtual double load( const QDomElement &element );
+ virtual void loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info );
+
+ virtual void flip( bool horizontal );
+ virtual KoSize getRealSize() const;
+ virtual KoPoint getRealOrig() const;
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+
+ virtual void paint( QPainter *_painter,KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour );
+
+ void updatePoints( double _fx, double _fy );
+
+ void drawPolygon();
+
+ KoPointArray points;
+ bool checkConcavePolygon;
+ int cornersValue;
+ int sharpnessValue;
+};
+
+#endif
diff --git a/kpresenter/KPrPolygonObjectIface.cpp b/kpresenter/KPrPolygonObjectIface.cpp
new file mode 100644
index 000000000..fa9c13274
--- /dev/null
+++ b/kpresenter/KPrPolygonObjectIface.cpp
@@ -0,0 +1,62 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPolygonObjectIface.h"
+#include "KPrPolygonObject.h"
+#include "KPrObject.h"
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrPolygonObjectIface::KPrPolygonObjectIface( KPrPolygonObject *_obj )
+ : KPrObject2DIface(_obj)
+{
+ obj = _obj;
+}
+
+void KPrPolygonObjectIface::setCheckConcavePolygon(bool _concavePolygon)
+{
+ obj->setCheckConcavePolygon(_concavePolygon);
+}
+
+void KPrPolygonObjectIface::setCornersValue(int _cornersValue)
+{
+ obj->setCheckConcavePolygon(_cornersValue);
+}
+
+void KPrPolygonObjectIface::setSharpnessValue(int _sharpnessValue)
+{
+ obj->setSharpnessValue(_sharpnessValue);
+}
+
+int KPrPolygonObjectIface::cornersValue()const
+{
+ return obj->getCornersValue();
+}
+
+int KPrPolygonObjectIface::sharpnessValue()const
+{
+ return obj->getSharpnessValue();
+}
+
+bool KPrPolygonObjectIface::checkConcavePolygon()const
+{
+ return obj->getCheckConcavePolygon();
+}
diff --git a/kpresenter/KPrPolygonObjectIface.h b/kpresenter/KPrPolygonObjectIface.h
new file mode 100644
index 000000000..ae0697e56
--- /dev/null
+++ b/kpresenter/KPrPolygonObjectIface.h
@@ -0,0 +1,49 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPPOLYGON_OBJECT_IFACE_H
+#define KPPOLYGON_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObject2DIface.h"
+
+class KPrPolygonObject;
+
+class KPrPolygonObjectIface : public KPrObject2DIface
+{
+ K_DCOP
+public:
+ KPrPolygonObjectIface( KPrPolygonObject *obj_ );
+
+k_dcop:
+ void setCheckConcavePolygon(bool _concavePolygon);
+ void setCornersValue(int _cornersValue);
+ void setSharpnessValue(int _sharpnessValue);
+
+ int cornersValue()const;
+ int sharpnessValue()const;
+ bool checkConcavePolygon()const;
+
+private:
+ KPrPolygonObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrPolygonPreview.cpp b/kpresenter/KPrPolygonPreview.cpp
new file mode 100644
index 000000000..985c1eef8
--- /dev/null
+++ b/kpresenter/KPrPolygonPreview.cpp
@@ -0,0 +1,120 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+ Base code from Kontour.
+ Copyright (C) 1998 Kai-Uwe Sattler (kus@iti.cs.uni-magdeburg.de)
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPolygonPreview.h"
+
+#include <qpainter.h>
+
+#include <math.h>
+
+KPrPolygonPreview::KPrPolygonPreview( QWidget* parent, const char* name)
+ : QFrame( parent, name )
+{
+ setFrameStyle( WinPanel | Sunken );
+ setBackgroundColor( white );
+
+ setMinimumSize( 200, 100 );
+}
+
+
+void KPrPolygonPreview::drawContents( QPainter *painter )
+{
+ double angle = 2 * M_PI / nCorners;
+ double diameter = static_cast<double>( QMAX( width(), height() ) - 10 );
+ double radius = diameter * 0.5;
+
+ painter->setWindow( qRound( -radius ), qRound( -radius ), qRound( diameter ), qRound( diameter ) );
+ painter->setViewport( 5, 5, width() - 10, height() - 10 );
+ painter->setPen( pen );
+ painter->setBrush( brush );
+
+ QPointArray points( isConcave ? nCorners * 2 : nCorners );
+ points.setPoint( 0, 0, qRound( -radius ) );
+
+ if ( isConcave ) {
+ angle = angle / 2.0;
+ double a = angle;
+ double r = radius - ( sharpness / 100.0 * radius );
+ for ( int i = 1; i < nCorners * 2; ++i ) {
+ double xp, yp;
+ if ( i % 2 ) {
+ xp = r * sin( a );
+ yp = -r * cos( a );
+ }
+ else {
+ xp = radius * sin( a );
+ yp = -radius * cos( a );
+ }
+ a += angle;
+ points.setPoint( i, (int)xp, (int)yp );
+ }
+ }
+ else {
+ double a = angle;
+ for ( int i = 1; i < nCorners; ++i ) {
+ double xp = radius * sin( a );
+ double yp = -radius * cos( a );
+ a += angle;
+ points.setPoint( i, (int)xp, (int)yp );
+ }
+ }
+ painter->drawPolygon( points );
+}
+
+
+void KPrPolygonPreview::slotConvexConcave( bool convexConcave )
+{
+ isConcave = convexConcave;
+ repaint();
+}
+
+
+void KPrPolygonPreview::slotConvexPolygon()
+{
+ isConcave = false;
+ repaint();
+}
+
+
+void KPrPolygonPreview::slotConcavePolygon()
+{
+ isConcave = true;
+ repaint();
+}
+
+
+void KPrPolygonPreview::slotCornersValue( int value )
+{
+ nCorners = value;
+ repaint();
+}
+
+
+void KPrPolygonPreview::slotSharpnessValue( int value )
+{
+ sharpness = value;
+ repaint();
+}
+
+
+#include "KPrPolygonPreview.moc"
diff --git a/kpresenter/KPrPolygonPreview.h b/kpresenter/KPrPolygonPreview.h
new file mode 100644
index 000000000..64ffda4dc
--- /dev/null
+++ b/kpresenter/KPrPolygonPreview.h
@@ -0,0 +1,61 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+ Base code from Kontour.
+ Copyright (C) 1998 Kai-Uwe Sattler (kus@iti.cs.uni-magdeburg.de)
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef POLYGONPREVIEW_H
+#define POLYGONPREVIEW_H
+
+#include <qframe.h>
+#include <qpen.h>
+#include <qbrush.h>
+
+class QPainter;
+
+class KPrPolygonPreview : public QFrame
+{
+ Q_OBJECT
+
+public:
+ KPrPolygonPreview( QWidget* parent, const char*);
+ ~KPrPolygonPreview() {}
+
+ void setPenBrush( const QPen &_pen, const QBrush &_brush )
+ { pen = _pen; brush = _brush; repaint( true ); }
+
+public slots:
+ void slotConvexConcave( bool convexConcave );
+ void slotConvexPolygon();
+ void slotConcavePolygon();
+ void slotCornersValue( int value );
+ void slotSharpnessValue( int value );
+
+protected:
+ void drawContents( QPainter* );
+
+ int nCorners;
+ int sharpness;
+ bool isConcave;
+ QPen pen;
+ QBrush brush;
+};
+
+#endif /* POLYGONPREVIEW_H */
diff --git a/kpresenter/KPrPolygonProperty.cpp b/kpresenter/KPrPolygonProperty.cpp
new file mode 100644
index 000000000..e7188de45
--- /dev/null
+++ b/kpresenter/KPrPolygonProperty.cpp
@@ -0,0 +1,134 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPolygonProperty.h"
+
+#include <qlayout.h>
+
+#include <kcombobox.h>
+#include <klocale.h>
+#include <knuminput.h>
+
+#include "polygonpropertyui.h"
+#include "KPrPolygonPreview.h"
+
+KPrPolygonProperty::KPrPolygonProperty( QWidget *parent, const char *name, KPrPolygonSettingCmd::PolygonSettings &polygonSettings )
+: QWidget( parent, name )
+, m_polygonSettings( polygonSettings )
+{
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->addWidget( m_ui = new PolygonPropertyUI( this ) );
+
+ m_ui->typeCombo->insertItem( i18n( "Polygon" ) );
+ m_ui->typeCombo->insertItem( i18n( "Convex/Concave" ) );
+
+ connect( m_ui->typeCombo, SIGNAL( activated( int ) ),
+ this, SLOT(slotTypeChanged( int ) ) );
+
+ connect( m_ui->cornersInput, SIGNAL( valueChanged( int ) ),
+ m_ui->polygonPreview, SLOT( slotCornersValue( int ) ) );
+ connect( m_ui->sharpnessInput, SIGNAL( valueChanged( int ) ),
+ m_ui->polygonPreview, SLOT( slotSharpnessValue( int ) ) );
+
+ slotReset();
+}
+
+
+KPrPolygonProperty::~KPrPolygonProperty()
+{
+}
+
+
+int KPrPolygonProperty::getPolygonPropertyChange() const
+{
+ int flags = 0;
+
+ if ( isConvexConcave() != m_polygonSettings.checkConcavePolygon )
+ flags |= KPrPolygonSettingCmd::ConcaveConvex;
+
+ if ( m_ui->cornersInput->value() != m_polygonSettings.cornersValue )
+ flags |= KPrPolygonSettingCmd::Corners;
+
+ if ( m_ui->sharpnessInput->value() != m_polygonSettings.sharpnessValue )
+ flags |= KPrPolygonSettingCmd::Sharpness;
+
+ return flags;
+}
+
+
+KPrPolygonSettingCmd::PolygonSettings KPrPolygonProperty::getPolygonSettings() const
+{
+ KPrPolygonSettingCmd::PolygonSettings polygonSettings;
+ polygonSettings.checkConcavePolygon = isConvexConcave();
+ polygonSettings.cornersValue = m_ui->cornersInput->value();;
+ polygonSettings.sharpnessValue = m_ui->sharpnessInput->value();;
+ return polygonSettings;
+}
+
+
+void KPrPolygonProperty::setPolygonSettings( const KPrPolygonSettingCmd::PolygonSettings &polygonSettings )
+{
+ m_polygonSettings = polygonSettings;
+ slotReset();
+}
+
+
+void KPrPolygonProperty::apply()
+{
+ int flags = getPolygonPropertyChange();
+
+ if ( flags & KPrPolygonSettingCmd::ConcaveConvex )
+ m_polygonSettings.checkConcavePolygon = isConvexConcave();
+
+ if ( flags & KPrPolygonSettingCmd::Corners )
+ m_polygonSettings.cornersValue = m_ui->cornersInput->value();
+
+ if ( flags & KPrPolygonSettingCmd::Sharpness )
+ m_polygonSettings.sharpnessValue = m_ui->sharpnessInput->value();
+}
+
+
+bool KPrPolygonProperty::isConvexConcave() const
+{
+ return m_ui->typeCombo->currentItem() == 1;
+}
+
+
+void KPrPolygonProperty::slotTypeChanged( int pos )
+{
+ m_ui->polygonPreview->slotConvexConcave( pos == 1 );
+
+ m_ui->sharpnessInput->setEnabled( pos == 1 );
+}
+
+
+void KPrPolygonProperty::slotReset()
+{
+ m_ui->typeCombo->setCurrentItem( m_polygonSettings.checkConcavePolygon ? 1 : 0 );
+ m_ui->polygonPreview->slotConvexConcave( m_polygonSettings.checkConcavePolygon );
+ m_ui->sharpnessInput->setEnabled( m_polygonSettings.checkConcavePolygon );
+ m_ui->cornersInput->setValue( m_polygonSettings.cornersValue );
+ m_ui->polygonPreview->slotCornersValue( m_polygonSettings.cornersValue );
+ m_ui->sharpnessInput->setValue( m_polygonSettings.sharpnessValue );
+ m_ui->polygonPreview->slotSharpnessValue( m_polygonSettings.sharpnessValue );
+}
+
+
+#include "KPrPolygonProperty.moc"
diff --git a/kpresenter/KPrPolygonProperty.h b/kpresenter/KPrPolygonProperty.h
new file mode 100644
index 000000000..8d5af6c2b
--- /dev/null
+++ b/kpresenter/KPrPolygonProperty.h
@@ -0,0 +1,55 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#ifndef POLYGONPROPERTY_H
+#define POLYGONPROPERTY_H
+
+#include <qwidget.h>
+
+#include "KPrCommand.h"
+
+class PolygonPropertyUI;
+
+class KPrPolygonProperty : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrPolygonProperty( QWidget *parent, const char *name, KPrPolygonSettingCmd::PolygonSettings &polygonSettings );
+ ~KPrPolygonProperty();
+
+ int getPolygonPropertyChange() const;
+ KPrPolygonSettingCmd::PolygonSettings getPolygonSettings() const;
+
+ void setPolygonSettings( const KPrPolygonSettingCmd::PolygonSettings &polygonSettings );
+ void apply();
+
+protected:
+ bool isConvexConcave() const;
+
+ PolygonPropertyUI *m_ui;
+
+ KPrPolygonSettingCmd::PolygonSettings m_polygonSettings;
+
+protected slots:
+ void slotReset();
+ void slotTypeChanged( int pos );
+};
+
+#endif // POLYGONPROPERTY_H
+
diff --git a/kpresenter/KPrPolylineObject.cpp b/kpresenter/KPrPolylineObject.cpp
new file mode 100644
index 000000000..b9268201b
--- /dev/null
+++ b/kpresenter/KPrPolylineObject.cpp
@@ -0,0 +1,91 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPolylineObject.h"
+#include "KPrUtils.h"
+#include "KPrPolyLineObjectIface.h"
+
+#include <qpainter.h>
+#include <qwmatrix.h>
+#include <qdom.h>
+
+#include <kdebug.h>
+#include <KoTextZoomHandler.h>
+#include <KoOasisContext.h>
+#include <KoUnit.h>
+
+#include <math.h>
+using namespace std;
+
+KPrPolylineObject::KPrPolylineObject()
+ : KPrPointObject()
+{
+}
+
+DCOPObject* KPrPolylineObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrPolyLineObjectIface( this );
+ return dcop;
+}
+
+KPrPolylineObject::KPrPolylineObject( const KoPointArray &_points, const KoSize &_size,
+ const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd )
+ : KPrPointObject( _pen, _lineBegin, _lineEnd )
+{
+ points = KoPointArray( _points );
+ ext = _size;
+}
+
+KPrPolylineObject &KPrPolylineObject::operator=( const KPrPolylineObject & )
+{
+ return *this;
+}
+
+QDomDocumentFragment KPrPolylineObject::save( QDomDocument& doc, double offset )
+{
+ return KPrPointObject::save( doc, offset );
+}
+
+double KPrPolylineObject::load(const QDomElement &element)
+{
+ return KPrPointObject::load( element );
+}
+
+bool KPrPolylineObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ KPrShadowObject::saveOasisDrawPoints( points, sc );
+ return true;
+}
+
+const char * KPrPolylineObject::getOasisElementName() const
+{
+ return "draw:polyline";
+}
+
+
+void KPrPolylineObject::loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info)
+{
+ kdDebug()<<"void KPrPolylineObject::loadOasis(const QDomElement &element)************\n";
+ KPrShadowObject::loadOasis( element, context, info );
+ KPrShadowObject::loadOasisDrawPoints( points, element, context, info );
+ loadOasisMarker( context );
+}
diff --git a/kpresenter/KPrPolylineObject.h b/kpresenter/KPrPolylineObject.h
new file mode 100644
index 000000000..1d25aeb01
--- /dev/null
+++ b/kpresenter/KPrPolylineObject.h
@@ -0,0 +1,56 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kppolylineobject_h
+#define kppolylineobject_h
+
+#include "KPrPointObject.h"
+#include <KoStyleStack.h>
+
+#define RAD_FACTOR 180.0 / M_PI
+
+class QPainter;
+class DCOPObject;
+
+class KPrPolylineObject : public KPrPointObject
+{
+public:
+ KPrPolylineObject();
+ KPrPolylineObject( const KoPointArray &_points, const KoSize &_size,
+ const KoPen &_pen, LineEnd _lineBegin, LineEnd _lineEnd );
+ virtual ~KPrPolylineObject() {}
+
+ virtual DCOPObject* dcopObject();
+
+ KPrPolylineObject &operator=( const KPrPolylineObject & );
+
+ virtual ObjType getType() const { return OT_POLYLINE; }
+ virtual QString getTypeString() const { return i18n("Polyline"); }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+ virtual double load( const QDomElement &element );
+ virtual void loadOasis(const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info);
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+};
+
+#endif
diff --git a/kpresenter/KPrPresDurationDia.cpp b/kpresenter/KPrPresDurationDia.cpp
new file mode 100644
index 000000000..7feb5bcf3
--- /dev/null
+++ b/kpresenter/KPrPresDurationDia.cpp
@@ -0,0 +1,81 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Toshitaka Fujioka <fujioka@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrPresDurationDia.h"
+#include "KPrCanvas.h"
+#include "KPrPage.h"
+#include "KPrDocument.h"
+#include <qlabel.h>
+#include <qheader.h>
+#include <qvbox.h>
+#include <qlayout.h>
+#include <klistview.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+KPrPresDurationDia::KPrPresDurationDia( QWidget *parent, const char *name,
+ KPrDocument *_doc, QStringList _durationListString,
+ const QString &_durationString )
+ : KDialogBase( parent, name, false, "", KDialogBase::Close ),
+ doc( _doc )
+{
+ m_durationListString = _durationListString;
+ m_durationString = _durationString;
+
+ QWidget *page = new QWidget( this );
+ setMainWidget( page );
+ QVBoxLayout *topLayout = new QVBoxLayout( page, 2 );
+
+ setupSlideList( page );
+ topLayout->addWidget( slides );
+ slides->setSelected( slides->firstChild(), true );
+
+ label = new QLabel( i18n( "Presentation duration: " ) + _durationString, page );
+ label->setAlignment( AlignVCenter );
+ topLayout->addWidget( label );
+
+ setMinimumSize( 600, 400 );
+ connect( this, SIGNAL( closeClicked() ), this, SLOT( slotCloseDialog() ) );
+}
+
+
+void KPrPresDurationDia::setupSlideList( QWidget *_page )
+{
+ slides = new KListView( _page );
+ slides->addColumn( i18n( "No." ) );
+ slides->addColumn( i18n( "Display Duration" ) );
+ slides->addColumn( i18n( "Slide Title" ) );
+ slides->header()->setMovingEnabled( false );
+ slides->setAllColumnsShowFocus( true );
+ slides->setRootIsDecorated( false );
+ slides->setSorting( -1 );
+
+ for ( int i = doc->getPageNums() - 1; i >= 0; --i ) {
+ if ( doc->pageList().at( i )->isSlideSelected() ) {
+ KListViewItem *item = new KListViewItem( slides );
+ item->setPixmap( 0, KPBarIcon( "slide" ) );
+ item->setText( 0, QString( "%1" ).arg( i + 1 ) );
+ item->setText( 1, *m_durationListString.at( i ) );
+ item->setText( 2, doc->pageList().at( i )->pageTitle() );
+ }
+ }
+}
+
+#include "KPrPresDurationDia.moc"
diff --git a/kpresenter/KPrPresDurationDia.h b/kpresenter/KPrPresDurationDia.h
new file mode 100644
index 000000000..b58d3f4d7
--- /dev/null
+++ b/kpresenter/KPrPresDurationDia.h
@@ -0,0 +1,59 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Toshitaka Fujioka <fujioka@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef presdurationdia_h
+#define presdurationdia_h
+
+#include <kdialogbase.h>
+
+class KPrDocument;
+class KListView;
+class QLabel;
+
+class KPrPresDurationDia : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KPrPresDurationDia( QWidget *parent, const char *name,
+ KPrDocument *_doc,
+ QStringList _durationListString,
+ const QString &_durationString );
+
+protected:
+ void setupSlideList( QWidget *_page );
+
+private:
+ KPrDocument *doc;
+ KListView *slides;
+ QLabel *label;
+
+ QStringList m_durationListString;
+ QString m_durationString;
+
+protected slots:
+ void slotCloseDialog() { emit presDurationDiaClosed(); }
+
+signals:
+ void presDurationDiaClosed();
+
+};
+
+#endif
diff --git a/kpresenter/KPrPrinterDlg.cpp b/kpresenter/KPrPrinterDlg.cpp
new file mode 100644
index 000000000..68fc4d798
--- /dev/null
+++ b/kpresenter/KPrPrinterDlg.cpp
@@ -0,0 +1,114 @@
+/*
+*
+* Copyright (C) 2005 Fredrik Edemar
+* f_edemar@linux.se
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*
+*/
+
+// Qt includes
+#include <qlayout.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <kdialog.h>
+#include <klocale.h>
+#include <qtooltip.h>
+
+// local includes
+#include "KPrPrinterDlg.h"
+
+ KPrPrinterDlg::KPrPrinterDlg( QWidget *parent, const char *name )
+ : KPrintDialogPage( parent, name )
+{
+ setTitle( i18n( "KPresenter Options" ) );
+ QGridLayout *layout = new QGridLayout( this, 2, 1, 11, 6 );
+ txtRows = new KIntNumInput(this );
+ txtRows->setMinValue(1);
+ txtRows->setMaxValue(5);
+ txtRows->setValue(1);
+ txtColumns = new KIntNumInput(this );
+ txtColumns->setMinValue(1);
+ txtColumns->setMaxValue(5);
+ txtColumns->setValue(1);
+ connect( txtRows, SIGNAL( valueChanged( int ) ), this, SLOT( txtRows_valueChanged( int ) ) );
+ connect( txtColumns, SIGNAL( valueChanged( int ) ), this, SLOT( txtColumns_valueChanged( int ) ) );
+
+ QLabel *caption = new QLabel(i18n("Slides in the pages:"), this );
+ QToolTip::add( caption, i18n("Choose how many rows and columns with slides you want to have on all pages") );
+ layout->addMultiCellWidget( caption, 0, 0, 0, 1 );
+ QVBoxLayout *l2 = new QVBoxLayout( 0, 0, 6 );
+ l2->addWidget( new QLabel(i18n("Rows: "), this) );
+ l2->addWidget( new QLabel(i18n("Columns: "), this) );
+ layout->addLayout( l2, 1, 0 );
+
+ QVBoxLayout *l3 = new QVBoxLayout( 0, 0, 6 );
+ l3->addWidget( txtRows );
+ l3->addWidget( txtColumns );
+ layout->addLayout( l3, 1, 1 );
+
+ drawBorder = new QCheckBox(i18n("Draw border around the slides"), this );
+ drawBorder->setChecked( true );
+ drawBorder->setEnabled( false );
+ layout->addMultiCellWidget( drawBorder, 2, 2, 0, 1 );
+}
+
+void KPrPrinterDlg::getOptions( QMap<QString, QString>& opts, bool )
+{
+ opts["kde-kpresenter-printrows"] = QString::number(txtRows->value());
+ opts["kde-kpresenter-printcolumns"] = QString::number(txtColumns->value());
+ opts["kde-kpresenter-printslideborders"] = QString::number(drawBorder->isEnabled() && drawBorder->isChecked());
+}
+
+void KPrPrinterDlg::setOptions( const QMap<QString, QString>& opts )
+{
+ if ( opts["kde-kpresenter-printrows"].isEmpty() )
+ txtRows->setValue(1);
+ else
+ txtRows->setValue((opts["kde-kpresenter-printrows"]).toInt());
+ if ( opts["kde-kpresenter-printcolumns"].isEmpty() )
+ txtColumns->setValue(1);
+ else
+ txtColumns->setValue((opts["kde-kpresenter-printcolumns"]).toInt());
+
+ if ( opts["kde-kpresenter-printslideborders"].isEmpty() )
+ drawBorder->setChecked(true);
+ else
+ drawBorder->setChecked((opts["kde-kpresenter-printslideborders"]).toInt());
+}
+
+bool KPrPrinterDlg::isValid( const QString& )
+{
+ return true;
+}
+
+void KPrPrinterDlg::txtRows_valueChanged( int new_value)
+{
+ if ( new_value == 1 && txtColumns->value() == 1 )
+ drawBorder->setEnabled( false );
+ else
+ drawBorder->setEnabled( true );
+}
+void KPrPrinterDlg::txtColumns_valueChanged( int new_value )
+{
+ if ( new_value == 1 && txtRows->value() == 1 )
+ drawBorder->setEnabled( false );
+ else
+ drawBorder->setEnabled( true );
+}
+
+#include "KPrPrinterDlg.moc"
diff --git a/kpresenter/KPrPrinterDlg.h b/kpresenter/KPrPrinterDlg.h
new file mode 100644
index 000000000..5c081cc3a
--- /dev/null
+++ b/kpresenter/KPrPrinterDlg.h
@@ -0,0 +1,56 @@
+/*
+*
+* Copyright (C) 2005 Fredrik Edemar
+* f_edemar@linux.se
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*
+*/
+
+#ifndef kpresenterprintdlg_included
+#define kpresenterprintdlg_included
+
+#include <kdeprint/kprintdialogpage.h>
+#include <knuminput.h>
+
+#include <qcheckbox.h>
+#include <qlabel.h>
+
+class KPrPrinterDlg : public KPrintDialogPage
+{
+ Q_OBJECT
+ public:
+ /// Getting the common arguments.
+ KPrPrinterDlg( QWidget *parent = 0, const char *name = 0 );
+
+ /// Reimplemented.
+ void getOptions( QMap<QString, QString>& opts, bool include_def = false );
+ /// Reimplemented
+ void setOptions( const QMap<QString, QString>& opts );
+ /// Reimplemented.
+ bool isValid( const QString& msg );
+
+ private slots:
+ void txtRows_valueChanged( int );
+ void txtColumns_valueChanged( int );
+
+ private:
+ KIntNumInput *txtRows;
+ KIntNumInput *txtColumns;
+ QCheckBox *drawBorder;
+};
+
+#endif //kpresenterprinterdlg_included
diff --git a/kpresenter/KPrPropertyEditor.cpp b/kpresenter/KPrPropertyEditor.cpp
new file mode 100644
index 000000000..3fe64f054
--- /dev/null
+++ b/kpresenter/KPrPropertyEditor.cpp
@@ -0,0 +1,499 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#include "KPrPropertyEditor.h"
+
+#include "KPrObject.h"
+#include "KPrPage.h"
+#include "KPrDocument.h"
+#include "KPrUtils.h"
+#include "KPrCommand.h"
+#include "KPrPenStyleWidget.h"
+#include "KPrBrushProperty.h"
+#include "KPrRectProperty.h"
+#include "KPrPolygonProperty.h"
+#include "KPrPieProperty.h"
+#include "KPrPictureProperty.h"
+#include "KPrTextProperty.h"
+#include "KPrObjectProperties.h"
+
+#include <klocale.h>
+#include <kstdguiitem.h>
+
+KPrPropertyEditor::KPrPropertyEditor( QWidget *parent, const char *name, KPrPage *page, KPrDocument *doc )
+ : QTabDialog( parent, name, true )
+ , m_page( page )
+ , m_doc( doc )
+ , m_objects( page->getSelectedObjects() )
+ , m_penProperty( 0 )
+ , m_brushProperty( 0 )
+ , m_rectProperty( 0 )
+ , m_polygonProperty( 0 )
+ , m_pieProperty( 0 )
+ , m_pictureProperty( 0 )
+ , m_textProperty( 0 )
+ , m_generalProperty( 0 )
+ , m_objectProperties( 0 )
+{
+ setCancelButton( KStdGuiItem::cancel().text() );
+ setOkButton( KStdGuiItem::ok().text() );
+ setApplyButton( KStdGuiItem::apply().text() );
+
+ connect( this, SIGNAL( applyButtonPressed() ), this, SLOT( slotDone() ) );
+
+ m_objectProperties = new KPrObjectProperties( m_objects );
+
+ setupTabs();
+}
+
+
+KPrPropertyEditor::~KPrPropertyEditor()
+{
+ delete m_objectProperties;
+}
+
+
+KCommand * KPrPropertyEditor::getCommand()
+{
+ KMacroCommand *macro = 0;
+
+ if ( m_penProperty )
+ {
+ int change = m_penProperty->getPenConfigChange();
+ if ( change )
+ {
+ KoPenCmd::Pen pen( m_penProperty->getPen() );
+
+ KoPenCmd *cmd = new KoPenCmd( i18n( "Apply Styles" ), m_objects, pen, m_doc, m_page, change );
+
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+ }
+
+ if ( m_brushProperty )
+ {
+ int change = m_brushProperty->getBrushPropertyChange();
+ if ( change )
+ {
+ KPrBrushCmd::Brush brush( m_brushProperty->getBrush() );
+
+ KPrBrushCmd *cmd = new KPrBrushCmd( i18n( "Apply Styles" ), m_objects, brush, m_doc, m_page, change );
+
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+ }
+
+ if ( m_rectProperty )
+ {
+ int change = m_rectProperty->getRectPropertyChange();
+
+ if ( change )
+ {
+ KPrRectValueCmd::RectValues rectValue( m_rectProperty->getRectValues() );
+
+ KPrRectValueCmd *cmd = new KPrRectValueCmd( i18n( "Apply Styles" ), m_objects, rectValue, m_doc, m_page, change );
+
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+ }
+
+ if ( m_polygonProperty )
+ {
+ int change = m_polygonProperty->getPolygonPropertyChange();
+
+ if ( change )
+ {
+ KPrPolygonSettingCmd::PolygonSettings polygonSettings( m_polygonProperty->getPolygonSettings() );
+
+ KPrPolygonSettingCmd *cmd = new KPrPolygonSettingCmd( i18n("Apply Styles"), polygonSettings,
+ m_objects, m_doc, m_page, change );
+
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+ }
+
+ if ( m_pieProperty )
+ {
+ int change = m_pieProperty->getPiePropertyChange();
+
+ if ( change )
+ {
+ KPrPieValueCmd *cmd = new KPrPieValueCmd( i18n("Apply Styles"), m_pieProperty->getPieValues(),
+ m_objects, m_doc, m_page, change );
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+ }
+
+ if ( m_pictureProperty )
+ {
+ int change = m_pictureProperty->getPicturePropertyChange();
+
+ if ( change )
+ {
+ KPrPictureSettingCmd *cmd = new KPrPictureSettingCmd( i18n("Apply Styles"), m_pictureProperty->getPictureSettings(),
+ m_objects, m_doc, m_page, change );
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+ }
+
+ if ( m_textProperty )
+ {
+ int change = m_textProperty->getTextPropertyChange();
+
+ if ( change )
+ {
+ if ( change & KPrTextProperty::ProtectContent )
+ {
+ KPrProtectContentCommand * cmd = new KPrProtectContentCommand( i18n( "Apply Styles" ), m_objects,
+ m_textProperty->getProtectContent(),
+ m_doc );
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+
+ if ( change & KPrTextProperty::Margins )
+ {
+ KPrChangeMarginCommand *cmd = new KPrChangeMarginCommand( i18n( "Apply Styles" ), m_objects,
+ m_textProperty->getMarginsStruct(),
+ m_doc, m_page );
+
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+ }
+ }
+
+ if ( m_generalProperty )
+ {
+ int change = m_generalProperty->getGeneralPropertyChange();
+
+ if ( change )
+ {
+ KPrGeneralProperty::GeneralValue generalValue( m_generalProperty->getGeneralValue() );
+
+ if ( change & KPrGeneralProperty::Name )
+ {
+ KCommand *cmd = new KPrNameObjectCommand( i18n( "Name Object" ), generalValue.m_name,
+ m_objects.at( 0 ), m_doc );
+
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+
+ if ( change & KPrGeneralProperty::Protect )
+ {
+ KCommand *cmd= new KPrGeometryPropertiesCommand( i18n( "Protect Object" ), m_objects,
+ generalValue.m_protect == STATE_ON,
+ KPrGeometryPropertiesCommand::ProtectSize,m_doc );
+
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+
+ if ( change & KPrGeneralProperty::KeepRatio )
+ {
+ KCommand *cmd= new KPrGeometryPropertiesCommand( i18n( "Keep Ratio" ), m_objects,
+ generalValue.m_keepRatio == STATE_ON,
+ KPrGeometryPropertiesCommand::KeepRatio,m_doc );
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ macro->addCommand( cmd );
+ }
+
+ if ( change & KPrGeneralProperty::Left
+ || change & KPrGeneralProperty::Top
+ || change & KPrGeneralProperty::Width
+ || change & KPrGeneralProperty::Height )
+ {
+ if ( !macro )
+ {
+ macro = new KMacroCommand( i18n( "Apply Properties" ) );
+ }
+
+ QPtrListIterator<KPrObject> it( m_objects );
+ for ( ; it.current(); ++it )
+ {
+ KoRect oldRect = it.current()->getRect();
+ KoRect newRect = oldRect;
+ if ( change & KPrGeneralProperty::Left )
+ newRect.moveTopLeft( KoPoint( generalValue.m_rect.left(), newRect.top() ) );
+
+ if ( change & KPrGeneralProperty::Top )
+ newRect.moveTopLeft( KoPoint( newRect.left(), generalValue.m_rect.top() ) );
+
+ if ( change & KPrGeneralProperty::Width )
+ newRect.setWidth( generalValue.m_rect.width() );
+
+ if ( change & KPrGeneralProperty::Height )
+ newRect.setHeight( generalValue.m_rect.height() );
+
+ KCommand *cmd = new KPrResizeCmd( i18n( "Change Size" ),
+ newRect.topLeft() - oldRect.topLeft(),
+ newRect.size() - oldRect.size(),
+ it.current(), m_doc );
+
+ macro->addCommand( cmd );
+ }
+ }
+ }
+ }
+
+ return macro;
+}
+
+
+void KPrPropertyEditor::setupTabs()
+{
+ setupTabGeneral();
+
+ int flags = m_objectProperties->getPropertyFlags();
+
+ if ( flags & KPrObjectProperties::PtPen )
+ setupTabPen( flags & KPrObjectProperties::PtLineEnds );
+
+ if ( flags & KPrObjectProperties::PtBrush )
+ setupTabBrush();
+
+ if ( flags & KPrObjectProperties::PtRectangle )
+ setupTabRect();
+
+ if ( flags & KPrObjectProperties::PtPolygon )
+ setupTabPolygon();
+
+ if ( flags & KPrObjectProperties::PtPie )
+ setupTabPie();
+
+ if ( flags & KPrObjectProperties::PtPicture )
+ setupTabPicture();
+
+ if ( flags & KPrObjectProperties::PtText )
+ setupTabText();
+}
+
+
+void KPrPropertyEditor::setupTabPen( bool configureLineEnds )
+{
+ if ( m_penProperty == 0 )
+ {
+ KoPenCmd::Pen pen( m_objectProperties->getPen() );
+
+ m_penProperty = new KPrPenStyleWidget( this, 0, pen, configureLineEnds );
+ addTab( m_penProperty, i18n( "Outl&ine" ) );
+ }
+}
+
+
+void KPrPropertyEditor::setupTabBrush()
+{
+ if ( m_brushProperty == 0 )
+ {
+ KPrBrushCmd::Brush brush( m_objectProperties->getBrush() );
+
+ m_brushProperty = new KPrBrushProperty( this, 0, brush );
+ addTab( m_brushProperty, i18n( "&Fill" ) );
+ }
+}
+
+
+void KPrPropertyEditor::setupTabRect()
+{
+ if ( m_rectProperty == 0 )
+ {
+ KPrRectValueCmd::RectValues rectValues = m_objectProperties->getRectValues();
+ m_rectProperty = new KPrRectProperty( this, 0, rectValues );
+ addTab( m_rectProperty, i18n( "&Rectangle" ) );
+ }
+}
+
+
+void KPrPropertyEditor::setupTabPolygon()
+{
+ if ( m_polygonProperty == 0 )
+ {
+ KPrPolygonSettingCmd::PolygonSettings polygonSettings = m_objectProperties->getPolygonSettings();
+ m_polygonProperty = new KPrPolygonProperty( this, 0, polygonSettings );
+ addTab( m_polygonProperty, i18n("Polygo&n" ) );
+ }
+}
+
+
+void KPrPropertyEditor::setupTabPie()
+{
+ if ( m_pieProperty == 0 )
+ {
+ m_pieProperty = new KPrPieProperty( this, 0, m_objectProperties->getPieValues() );
+ addTab( m_pieProperty, i18n("&Pie" ) );
+ }
+}
+
+
+void KPrPropertyEditor::setupTabPicture()
+{
+ if ( m_pictureProperty == 0 )
+ {
+ m_pictureProperty = new KPrPictureProperty( this, 0, m_objectProperties->getPixmap(), m_objectProperties->getPictureSettings() );
+ addTab( m_pictureProperty, i18n("Pict&ure" ) );
+ }
+}
+
+
+void KPrPropertyEditor::setupTabText()
+{
+ if ( m_textProperty == 0 )
+ {
+ m_textProperty = new KPrTextProperty( this, 0, m_objectProperties->getMarginsStruct(),
+ m_doc->unit(), m_objectProperties->getProtectContent() );
+ addTab( m_textProperty, i18n("Te&xt" ) );
+ }
+}
+
+
+void KPrPropertyEditor::setupTabGeneral()
+{
+ if ( m_generalProperty == 0 )
+ {
+ KPrGeneralProperty::GeneralValue generalValue = getGeneralValue();
+ m_generalProperty = new KPrGeneralProperty( this, 0, generalValue, m_doc->unit() );
+ addTab( m_generalProperty, i18n( "&General" ) );
+ }
+}
+
+
+KPrGeneralProperty::GeneralValue KPrPropertyEditor::getGeneralValue()
+{
+ KPrGeneralProperty::GeneralValue generalValue;
+
+ if ( m_objects.count() == 1 )
+ {
+ generalValue.m_name = m_objects.at( 0 )->getObjectName();
+ }
+
+ bool protect = false;
+ generalValue.m_protect = STATE_OFF;
+ bool keepRatio = false;
+ generalValue.m_keepRatio = STATE_OFF;
+
+ QPtrListIterator<KPrObject> it( m_objects );
+ if ( it.current() )
+ {
+ protect = it.current()->isProtect();
+ generalValue.m_protect = protect ? STATE_ON : STATE_OFF;
+ keepRatio = it.current()->isKeepRatio();
+ generalValue.m_keepRatio = keepRatio ? STATE_ON : STATE_OFF;
+ generalValue.m_rect = it.current()->getRect();
+ ++it;
+ }
+
+ for ( ; it.current(); ++it )
+ {
+ if ( protect != it.current()->isProtect() )
+ {
+ generalValue.m_protect = STATE_UNDEF;
+ if ( generalValue.m_keepRatio == STATE_UNDEF )
+ {
+ break;
+ }
+ }
+
+ if ( keepRatio != it.current()->isKeepRatio() )
+ {
+ generalValue.m_keepRatio = STATE_UNDEF;
+ if ( generalValue.m_protect == STATE_UNDEF )
+ {
+ break;
+ }
+ }
+ }
+
+ return generalValue;
+}
+
+
+void KPrPropertyEditor::slotDone()
+{
+ emit propertiesOk();
+
+ if ( m_penProperty )
+ m_penProperty->apply();
+ if ( m_brushProperty )
+ m_brushProperty->apply();
+ if ( m_rectProperty )
+ m_rectProperty->apply();
+ if ( m_polygonProperty )
+ m_polygonProperty->apply();
+ if ( m_pieProperty )
+ m_pieProperty->apply();
+ if ( m_pictureProperty )
+ m_pictureProperty->apply();
+ if ( m_textProperty )
+ m_textProperty->apply();
+ if ( m_generalProperty )
+ m_generalProperty->apply();
+}
+
+#include "KPrPropertyEditor.moc"
diff --git a/kpresenter/KPrPropertyEditor.h b/kpresenter/KPrPropertyEditor.h
new file mode 100644
index 000000000..71d1dc3fe
--- /dev/null
+++ b/kpresenter/KPrPropertyEditor.h
@@ -0,0 +1,84 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#ifndef PROPERTYEDITOR_H
+#define PROPERTYEDITOR_H
+
+#include <qtabdialog.h>
+#include <KPrGeneralProperty.h>
+
+class KCommand;
+class KPrObject;
+class KPrPage;
+class KPrDocument;
+class KPrPenStyleWidget;
+class KPrBrushProperty;
+class KPrRectProperty;
+class KPrPolygonProperty;
+class KPrPieProperty;
+class KPrPictureProperty;
+class KPrTextProperty;
+class KPrObjectProperties;
+
+class KPrPropertyEditor : public QTabDialog
+{
+ Q_OBJECT
+
+public:
+ KPrPropertyEditor( QWidget *parent = 0, const char *name = 0, KPrPage *page = 0, KPrDocument *doc = 0 );
+ ~KPrPropertyEditor();
+
+ KCommand * getCommand();
+
+private slots:
+ void slotDone();
+
+private:
+ void setupTabs();
+ void setupTabPen( bool configureLineEnds );
+ void setupTabBrush();
+ void setupTabRect();
+ void setupTabPolygon();
+ void setupTabPie();
+ void setupTabPicture();
+ void setupTabText();
+ void setupTabGeneral();
+
+ KPrGeneralProperty::GeneralValue getGeneralValue();
+
+ KPrPage *m_page;
+ KPrDocument *m_doc;
+ QPtrList<KPrObject> m_objects;
+
+ KPrPenStyleWidget *m_penProperty;
+ KPrBrushProperty *m_brushProperty;
+ KPrRectProperty *m_rectProperty;
+ KPrPolygonProperty *m_polygonProperty;
+ KPrPieProperty *m_pieProperty;
+ KPrPictureProperty *m_pictureProperty;
+ KPrTextProperty *m_textProperty;
+ KPrGeneralProperty *m_generalProperty;
+
+ KPrObjectProperties *m_objectProperties;
+
+signals:
+ void propertiesOk();
+};
+
+#endif /* PROPERTYEDITOR_H */
diff --git a/kpresenter/KPrQuadricBezierCurveObjectIface.cpp b/kpresenter/KPrQuadricBezierCurveObjectIface.cpp
new file mode 100644
index 000000000..5db58acd3
--- /dev/null
+++ b/kpresenter/KPrQuadricBezierCurveObjectIface.cpp
@@ -0,0 +1,66 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrQuadricBezierCurveObjectIface.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrUtils.h"
+#include "KPrObject.h"
+#include <kdebug.h>
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrQuadricBezierCurveObjectIface::KPrQuadricBezierCurveObjectIface( KPrQuadricBezierCurveObject *_obj )
+ : KPrObjectIface(_obj)
+{
+ obj = _obj;
+}
+
+void KPrQuadricBezierCurveObjectIface::setLineBegin( const QString & type)
+{
+ obj->setLineBegin(lineEndBeginFromString( type ));
+}
+
+void KPrQuadricBezierCurveObjectIface::setLineEnd( const QString & type)
+{
+ obj->setLineEnd(lineEndBeginFromString( type ));
+}
+
+QString KPrQuadricBezierCurveObjectIface::lineBegin()const
+{
+ LineEnd type=obj->getLineBegin();
+ return lineEndBeginName( type );
+}
+
+QString KPrQuadricBezierCurveObjectIface::lineEnd() const
+{
+ LineEnd type=obj->getLineEnd();
+ return lineEndBeginName( type );
+}
+
+void KPrQuadricBezierCurveObjectIface::horizontalFlip()
+{
+ obj->flip( true );
+}
+
+void KPrQuadricBezierCurveObjectIface::verticalFlip()
+{
+ obj->flip( false );
+}
diff --git a/kpresenter/KPrQuadricBezierCurveObjectIface.h b/kpresenter/KPrQuadricBezierCurveObjectIface.h
new file mode 100644
index 000000000..ed13a75fe
--- /dev/null
+++ b/kpresenter/KPrQuadricBezierCurveObjectIface.h
@@ -0,0 +1,50 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPQUADRI_OBJECT_IFACE_H
+#define KPQUADRI_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObjectIface.h"
+#include <qstring.h>
+
+class KPrQuadricBezierCurveObject;
+
+class KPrQuadricBezierCurveObjectIface : public KPrObjectIface
+{
+ K_DCOP
+public:
+ KPrQuadricBezierCurveObjectIface( KPrQuadricBezierCurveObject *obj_ );
+
+k_dcop:
+
+ virtual void setLineBegin( const QString & );
+ virtual void setLineEnd( const QString & );
+ QString lineBegin()const;
+ QString lineEnd() const;
+ void horizontalFlip();
+ void verticalFlip();
+
+private:
+ KPrQuadricBezierCurveObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrRectObject.cpp b/kpresenter/KPrRectObject.cpp
new file mode 100644
index 000000000..b7dc7bcf6
--- /dev/null
+++ b/kpresenter/KPrRectObject.cpp
@@ -0,0 +1,219 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrRectObject.h"
+#include "KPrGradient.h"
+#include "KPrRectObjectIface.h"
+
+#include <KoTextZoomHandler.h>
+#include <KoUnit.h>
+#include <KoOasisContext.h>
+#include <KoXmlNS.h>
+
+#include <kdebug.h>
+#include <qregion.h>
+#include <qbitmap.h>
+#include <qdom.h>
+#include <qpainter.h>
+
+KPrRectObject::KPrRectObject()
+ : KPr2DObject()
+{
+ xRnd = 0;
+ yRnd = 0;
+}
+
+DCOPObject* KPrRectObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrRectObjectIface( this );
+ return dcop;
+}
+
+KPrRectObject::KPrRectObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType,
+ const QColor &_gColor1, const QColor &_gColor2,
+ BCType _gType, int _xRnd, int _yRnd,
+ bool _unbalanced, int _xfactor, int _yfactor)
+ : KPr2DObject( _pen, _brush, _fillType, _gColor1, _gColor2, _gType,
+ _unbalanced, _xfactor, _yfactor )
+{
+ xRnd = _xRnd;
+ yRnd = _yRnd;
+}
+
+KPrRectObject &KPrRectObject::operator=( const KPrRectObject & )
+{
+ return *this;
+}
+
+QDomDocumentFragment KPrRectObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment=KPr2DObject::save(doc, offset);
+ if (xRnd!=0 || yRnd!=0) {
+ QDomElement elem=doc.createElement("RNDS");
+ elem.setAttribute("x", xRnd);
+ elem.setAttribute("y", yRnd);
+ fragment.appendChild(elem);
+ }
+ return fragment;
+}
+
+bool KPrRectObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ if ( xRnd > 0 && yRnd > 0 )
+ {
+ double cornerRadiusX = ext.width() / 200.0 * xRnd;
+ double cornerRadiusY = ext.height() / 200.0 * yRnd;
+ double cornerRadius = QMIN( cornerRadiusX, cornerRadiusY );
+ sc.xmlWriter.addAttributePt( "draw:corner-radius", cornerRadius );
+ if ( cornerRadiusX != cornerRadiusY )
+ {
+ sc.xmlWriter.addAttributePt( "koffice:corner-radius-x", cornerRadiusX );
+ sc.xmlWriter.addAttributePt( "koffice:corner-radius-y", cornerRadiusY );
+ }
+ }
+ return true;
+}
+
+
+const char * KPrRectObject::getOasisElementName() const
+{
+ return "draw:rect";
+}
+
+
+void KPrRectObject::loadOasis(const QDomElement &element, KoOasisContext&context, KPrLoadingInfo *info)
+{
+ KPr2DObject::loadOasis(element, context, info);
+ if ( element.hasAttributeNS( KoXmlNS::koffice, "corner-radius-x" ) &&
+ element.hasAttributeNS( KoXmlNS::koffice, "corner-radius-y" ) )
+ {
+ xRnd = int( KoUnit::parseValue(
+ element.attributeNS( KoXmlNS::koffice, "corner-radius-x", QString::null )
+ ) * 200.0 / ext.width() );
+ yRnd = int( KoUnit::parseValue(
+ element.attributeNS( KoXmlNS::koffice, "corner-radius-y", QString::null )
+ ) * 200.0 / ext.height() );
+ }
+ else if ( element.hasAttributeNS( KoXmlNS::draw, "corner-radius" ) )
+ {
+ xRnd = int( KoUnit::parseValue(
+ element.attributeNS( KoXmlNS::draw, "corner-radius", QString::null )
+ ) * 200.0 / ext.width() );
+ yRnd = xRnd;
+ }
+ kdDebug(33001) << " KPrRectObject : radius xRnd :" << xRnd << " yRnd :" << yRnd <<endl;
+}
+
+double KPrRectObject::load(const QDomElement &element)
+{
+ double offset=KPr2DObject::load(element);
+ QDomElement e=element.namedItem("RNDS").toElement();
+ if(!e.isNull()) {
+ int tmp=0;
+ if(e.hasAttribute("x"))
+ tmp=e.attribute("x").toInt();
+ xRnd=tmp;
+ tmp=0;
+ if(e.hasAttribute("y"))
+ tmp=e.attribute("y").toInt();
+ yRnd=tmp;
+ }
+ return offset;
+}
+
+QPointArray KPrRectObject::boundingRegion( int x, int y, int w, int h, int _xRnd, int _yRnd) const
+{
+ w--;
+ h--;
+ int rxx = (_xRnd==0)?1: (w*_xRnd/200);
+ int ryy = (_yRnd==0)?1: (h*_yRnd/200);
+ // were there overflows?
+ if ( rxx < 0 )
+ rxx = w/200*_xRnd;
+ if ( ryy < 0 )
+ ryy = h/200*_yRnd;
+ int rxx2 = 2*rxx;
+ int ryy2 = 2*ryy;
+ QPointArray a[4];
+ a[0].makeArc( x, y, rxx2, ryy2, 1440, 1440); // ..., 1*16*90, 16*90);
+ a[1].makeArc( x, y+h-ryy2, rxx2, ryy2, 2880, 1440); // ..., 2*16*90, 16*90);
+ a[2].makeArc( x+w-rxx2, y+h-ryy2, rxx2, ryy2, 4320, 1440); // ..., 3*16*90, 16*90);
+ a[3].makeArc( x+w-rxx2, y, rxx2, ryy2, 0, 1440); // ..., 0*16*90, 16*90);
+ QPointArray aa;
+ aa.resize( a[0].size() + a[1].size() + a[2].size() + a[3].size() );
+ uint j = 0;
+ for ( int k=0; k<4; k++ ) {
+ for ( uint i=0; i<a[k].size(); i++ ) {
+ aa.setPoint( j, a[k].point(i) );
+ j++;
+ }
+ }
+ return aa;
+}
+
+void KPrRectObject::paint( QPainter* _painter, KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour )
+{
+ int ow = _zoomHandler->zoomItX( ext.width() );
+ int oh = _zoomHandler->zoomItY( ext.height() );
+
+ if ( drawContour ) {
+ QPen pen3( Qt::black, 1, Qt::DotLine );
+ _painter->setPen( pen3 );
+ _painter->setRasterOp( Qt::NotXorROP );
+
+ _painter->drawRoundRect( 0, 0, ow, oh, xRnd, yRnd );
+ return;
+ }
+
+ QPen pen2 = pen.zoomedPen( _zoomHandler );
+ int pw = ( pen2.style() == Qt::NoPen ) ? 1 : pen2.width();
+ _painter->setPen( pen2 );
+
+ if ( drawingShadow || getFillType() == FT_BRUSH || !gradient ) { //plain fill
+ _painter->setPen( pen2 );
+ _painter->setBrush( getBrush() );
+ }
+ else { //gradient
+ QSize size( _zoomHandler->zoomSize( ext ) );
+ if ( m_redrawGradientPix || gradient->size() != size ) {
+ m_redrawGradientPix = false;
+ gradient->setSize( size );
+ QPointArray arr = boundingRegion( 0, 0, ow - pw + 1, oh - pw + 1, xRnd, yRnd );
+ QRegion clipregion(arr);
+ m_gradientPix.resize ( ow, oh );
+ m_gradientPix.fill( Qt::white );
+ QPainter p;
+ p.begin( &m_gradientPix );
+ p.setClipRegion( clipregion );
+ p.drawPixmap( 0, 0, gradient->pixmap() );
+ p.end();
+
+ m_gradientPix.setMask( m_gradientPix.createHeuristicMask() );
+ }
+ _painter->drawPixmap( pw / 2, pw / 2, m_gradientPix, 0, 0, ow - pw + 1, oh - pw + 1 );
+
+ _painter->setBrush( Qt::NoBrush );
+ }
+
+ _painter->drawRoundRect( pw / 2, pw / 2, ow - pw + 1, oh - pw + 1, xRnd, yRnd );
+}
diff --git a/kpresenter/KPrRectObject.h b/kpresenter/KPrRectObject.h
new file mode 100644
index 000000000..e803a1331
--- /dev/null
+++ b/kpresenter/KPrRectObject.h
@@ -0,0 +1,75 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kprectobject_h
+#define kprectobject_h
+
+#include <KoBrush.h>
+
+#include "KPrObject.h"
+
+class KPrGradient;
+class DCOPObject;
+
+class KPrRectObject : public KPr2DObject
+{
+public:
+ KPrRectObject();
+ KPrRectObject( const KoPen &_pen, const QBrush &_brush, FillType _fillType,
+ const QColor &_gColor1, const QColor &_gColor2,
+ BCType _gType, int _xRnd, int _yRnd,
+ bool _unbalanced, int _xfactor, int _yfactor );
+ virtual ~KPrRectObject() {}
+ virtual DCOPObject* dcopObject();
+
+ KPrRectObject &operator=( const KPrRectObject & );
+
+ virtual void setRnds( int _xRnd, int _yRnd )
+ { xRnd = _xRnd; yRnd = _yRnd; m_redrawGradientPix = true; }
+
+ virtual ObjType getType() const
+ { return OT_RECT; }
+ virtual QString getTypeString() const
+ { return i18n("Rectangle"); }
+ virtual void getRnds( int &_xRnd, int &_yRnd ) const
+ { _xRnd = xRnd; _yRnd = yRnd; }
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+ virtual double load(const QDomElement &element);
+ virtual void loadOasis(const QDomElement &element, KoOasisContext &context, KPrLoadingInfo *info);
+
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+
+ virtual void paint( QPainter *_painter,KoTextZoomHandler*_zoomHandler,
+ int /* pageNum */, bool drawingShadow, bool drawContour );
+
+ int xRnd, yRnd;
+private:
+ /**
+ Returns a bounding region for a rounded-corners rectangle. Useful for setting
+ further clipping (e.g. to draw a pixmap on such a rectangle).
+ */
+ QPointArray boundingRegion( int x, int y, int w, int h, int _xRnd, int _yRnd) const;
+};
+
+#endif
diff --git a/kpresenter/KPrRectObjectIface.cpp b/kpresenter/KPrRectObjectIface.cpp
new file mode 100644
index 000000000..a9e5b3e7d
--- /dev/null
+++ b/kpresenter/KPrRectObjectIface.cpp
@@ -0,0 +1,52 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrRectObjectIface.h"
+#include "KPrRectObject.h"
+#include "KPrObject.h"
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrRectObjectIface::KPrRectObjectIface( KPrRectObject *_obj )
+ : KPrObject2DIface(_obj)
+
+{
+ obj = _obj;
+}
+
+void KPrRectObjectIface::setRnds( int _xRnd, int _yRnd )
+{
+ obj->setRnds( _xRnd, _yRnd );
+}
+
+int KPrRectObjectIface::xRnd() const
+{
+ int _xRnd,_yRnd;
+ obj->getRnds( _xRnd, _yRnd );
+ return _xRnd;
+}
+
+int KPrRectObjectIface::yRnd() const
+{
+ int _xRnd,_yRnd;
+ obj->getRnds( _xRnd, _yRnd );
+ return _yRnd;
+}
diff --git a/kpresenter/KPrRectObjectIface.h b/kpresenter/KPrRectObjectIface.h
new file mode 100644
index 000000000..6259d2495
--- /dev/null
+++ b/kpresenter/KPrRectObjectIface.h
@@ -0,0 +1,44 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRECT_OBJECT_IFACE_H
+#define KPRECT_OBJECT_IFACE_H
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include "KPrObject2DIface.h"
+
+class KPrRectObject;
+
+class KPrRectObjectIface : public KPrObject2DIface
+{
+ K_DCOP
+public:
+ KPrRectObjectIface( KPrRectObject *obj_ );
+
+k_dcop:
+ void setRnds( int _xRnd, int _yRnd );
+ int xRnd() const;
+ int yRnd() const;
+private:
+ KPrRectObject *obj;
+};
+
+#endif
diff --git a/kpresenter/KPrRectPreview.cpp b/kpresenter/KPrRectPreview.cpp
new file mode 100644
index 000000000..754dadf97
--- /dev/null
+++ b/kpresenter/KPrRectPreview.cpp
@@ -0,0 +1,50 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+ based on work by
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#include "KPrRectPreview.h"
+
+#include <qpainter.h>
+
+KPrRectPreview::KPrRectPreview( QWidget* parent, const char* name )
+ : QFrame( parent, name )
+{
+ setFrameStyle( WinPanel | Sunken );
+ setBackgroundColor( white );
+ xRnd = 0;
+ yRnd = 0;
+
+ setMinimumSize( 200, 100 );
+}
+
+void KPrRectPreview::drawContents( QPainter* painter )
+{
+ int ow = width();
+ int oh = height();
+
+ painter->setPen( pen );
+ painter->setBrush( brush );
+
+ painter->save();
+ painter->drawRoundRect( 10, 10, ow - 20, oh - 20, xRnd, yRnd );
+ painter->restore();
+}
+
+#include "KPrRectPreview.moc"
diff --git a/kpresenter/KPrRectPreview.h b/kpresenter/KPrRectPreview.h
new file mode 100644
index 000000000..2983c94a9
--- /dev/null
+++ b/kpresenter/KPrRectPreview.h
@@ -0,0 +1,51 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+ based on work by
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RECTPREVIEW_H
+#define RECTPREVIEW_H
+
+#include <qframe.h>
+#include <qpen.h>
+#include <qbrush.h>
+
+class KPrRectPreview : public QFrame
+{
+ Q_OBJECT
+
+public:
+ KPrRectPreview( QWidget* parent, const char* );
+ ~KPrRectPreview() {}
+
+ void setRnds( int _rx, int _ry )
+ { xRnd = _rx; yRnd = _ry; repaint( contentsRect(), true ); }
+ void setPenBrush( const QPen &_pen, const QBrush &_brush )
+ { pen = _pen; brush = _brush; repaint( true ); }
+
+protected:
+ void drawContents( QPainter* );
+
+ int xRnd, yRnd;
+ QPen pen;
+ QBrush brush;
+};
+
+#endif /* RECTPREVIEW_H */
diff --git a/kpresenter/KPrRectProperty.cpp b/kpresenter/KPrRectProperty.cpp
new file mode 100644
index 000000000..f17324763
--- /dev/null
+++ b/kpresenter/KPrRectProperty.cpp
@@ -0,0 +1,147 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrRectProperty.h"
+
+#include "rectpropertyui.h"
+#include "KPrRectPreview.h"
+
+#include <KoImageResource.h>
+
+#include <qspinbox.h>
+#include <qtoolbutton.h>
+#include <qlayout.h>
+
+KPrRectProperty::KPrRectProperty( QWidget *parent, const char *name, KPrRectValueCmd::RectValues &rectValue )
+: QWidget( parent, name )
+, m_rectValue( rectValue )
+{
+ formerVerticalValue = 0;
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->addWidget( m_ui = new RectPropertyUI( this ) );
+ KoImageResource kir;
+ m_ui->combineButton->setPixmap(kir.chain());
+
+ connect( m_ui->xRndInput, SIGNAL( valueChanged( int ) ), this, SLOT( slotRndChanged() ) );
+ connect( m_ui->yRndInput, SIGNAL( valueChanged( int ) ), this, SLOT( slotRndChanged() ) );
+ connect( m_ui->combineButton, SIGNAL( toggled( bool ) ), this, SLOT( combineToggled( bool ) ) );
+
+ slotReset();
+}
+
+KPrRectProperty::~KPrRectProperty()
+{
+}
+
+
+int KPrRectProperty::getRectPropertyChange() const
+{
+ int flags = 0;
+
+ if ( getXRnd() != m_rectValue.xRnd )
+ flags |= KPrRectValueCmd::XRnd;
+
+ if ( getYRnd() != m_rectValue.yRnd )
+ flags |= KPrRectValueCmd::YRnd;
+
+ return flags;
+}
+
+
+KPrRectValueCmd::RectValues KPrRectProperty::getRectValues() const
+{
+ KPrRectValueCmd::RectValues rectValue;
+ rectValue.xRnd = getXRnd();
+ rectValue.yRnd = getYRnd();
+
+ return rectValue;
+}
+
+
+void KPrRectProperty::setRectValues( const KPrRectValueCmd::RectValues &rectValues )
+{
+ m_rectValue = rectValues;
+ slotReset();
+}
+
+
+void KPrRectProperty::apply()
+{
+ int flags = getRectPropertyChange();
+
+ if ( flags & KPrRectValueCmd::XRnd )
+ m_rectValue.xRnd = getXRnd();
+
+ if ( flags & KPrRectValueCmd::YRnd )
+ m_rectValue.yRnd = getYRnd();
+}
+
+
+int KPrRectProperty::getXRnd() const
+{
+ return m_ui->xRndInput->value();
+}
+
+
+int KPrRectProperty::getYRnd() const
+{
+ return m_ui->yRndInput->value();
+}
+
+
+void KPrRectProperty::slotRndChanged()
+{
+ m_ui->rectPreview->setRnds( getXRnd(), getYRnd() );
+}
+
+void KPrRectProperty::slotReset()
+{
+ m_ui->xRndInput->setValue( m_rectValue.xRnd );
+ m_ui->yRndInput->setValue( m_rectValue.yRnd );
+ if(m_rectValue.xRnd == m_rectValue.yRnd)
+ combineToggled(true);
+
+ m_ui->rectPreview->setRnds( getXRnd(), getYRnd() );
+}
+
+void KPrRectProperty::combineToggled( bool on)
+{
+ KoImageResource kir;
+ if( on ) {
+ formerVerticalValue = getYRnd();
+ m_ui->yRndInput->setValue( getXRnd() );
+ connect(m_ui->yRndInput, SIGNAL( valueChanged ( int ) ),
+ m_ui->xRndInput, SLOT( setValue ( int ) ));
+ connect(m_ui->xRndInput, SIGNAL( valueChanged ( int ) ),
+ m_ui->yRndInput, SLOT( setValue ( int ) ));
+ m_ui->combineButton->setPixmap(kir.chain());
+ }
+ else {
+ disconnect(m_ui->yRndInput, SIGNAL( valueChanged ( int ) ),
+ m_ui->xRndInput, SLOT( setValue ( int ) ));
+ disconnect(m_ui->xRndInput, SIGNAL( valueChanged ( int ) ),
+ m_ui->yRndInput, SLOT( setValue ( int ) ));
+ if(formerVerticalValue != 0)
+ m_ui->yRndInput->setValue( formerVerticalValue );
+ m_ui->combineButton->setPixmap(kir.chainBroken());
+ }
+}
+
+#include "KPrRectProperty.moc"
diff --git a/kpresenter/KPrRectProperty.h b/kpresenter/KPrRectProperty.h
new file mode 100644
index 000000000..53b20f0e8
--- /dev/null
+++ b/kpresenter/KPrRectProperty.h
@@ -0,0 +1,60 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RECTPROPERTY_H
+#define RECTPROPERTY_H
+
+#include <qwidget.h>
+
+#include "KPrCommand.h"
+
+class RectPropertyUI;
+
+class KPrRectProperty : public QWidget
+{
+ Q_OBJECT
+public:
+ KPrRectProperty( QWidget *parent, const char *name, KPrRectValueCmd::RectValues &rectValue );
+ ~KPrRectProperty();
+
+ int getRectPropertyChange() const;
+ KPrRectValueCmd::RectValues getRectValues() const;
+
+ void setRectValues( const KPrRectValueCmd::RectValues &rectValues );
+ void apply();
+
+protected:
+ int getXRnd() const;
+ int getYRnd() const;
+
+ RectPropertyUI *m_ui;
+
+ KPrRectValueCmd::RectValues m_rectValue;
+
+protected slots:
+ void slotReset();
+ void slotRndChanged();
+ void combineToggled( bool on);
+
+private:
+ int formerVerticalValue;
+};
+
+#endif /* RECTPROPERTY_H */
diff --git a/kpresenter/KPrRotationDialogImpl.cpp b/kpresenter/KPrRotationDialogImpl.cpp
new file mode 100644
index 000000000..f6463e50f
--- /dev/null
+++ b/kpresenter/KPrRotationDialogImpl.cpp
@@ -0,0 +1,174 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thomas Zander <zander@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; version 2.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#include <qtoolbutton.h>
+#include <qslider.h>
+#include <qgroupbox.h>
+#include <qlayout.h>
+#include <qbuttongroup.h>
+#include <qobject.h>
+#include <qevent.h>
+
+#include <kiconloader.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <knuminput.h>
+
+#include "KPrRotationDialogImpl.h"
+#include "rotationpropertyui.h"
+#include "KPrTextPreview.h"
+
+KPrRotationDialogImpl::KPrRotationDialogImpl( QWidget *parent, const char* name )
+: KDialogBase( parent, name, true, i18n( "Rotation"), Ok|Cancel|Apply, Ok, true )
+, m_dialog( new RotationPropertyUI( this, name ) )
+{
+ noSignals = false;
+ m_preview = new KPrTextPreview( m_dialog->previewPanel );
+ QHBoxLayout *lay = new QHBoxLayout( m_dialog->previewPanel, m_dialog->previewPanel->lineWidth(), 0 );
+ lay->addWidget( m_preview );
+
+ QHBoxLayout *hbox = new QHBoxLayout(m_dialog->angleFrame);
+ m_angleGroup = new KPrCircleGroup(m_dialog->angleFrame);
+ hbox->addWidget(m_angleGroup);
+
+ // Draw the circle of checkboxes.
+ QGridLayout *circleLayout = new QGridLayout(m_angleGroup, 4, 5);
+ circleLayout->addItem(new QSpacerItem ( 1, 1 , QSizePolicy::MinimumExpanding ), 0, 0);
+ circleLayout->addItem(new QSpacerItem ( 1, 1 , QSizePolicy::MinimumExpanding ), 0, 5);
+ KPrCircleToggle *r0 = new KPrCircleToggle(m_angleGroup, "tm", 0);
+ KPrCircleToggle *r45 = new KPrCircleToggle(m_angleGroup, "tr", 45);
+ KPrCircleToggle *r90 = new KPrCircleToggle(m_angleGroup, "mr", 90);
+ KPrCircleToggle *r135 = new KPrCircleToggle(m_angleGroup, "br", 135);
+ KPrCircleToggle *r180 = new KPrCircleToggle(m_angleGroup, "bm", 180);
+ KPrCircleToggle *r225 = new KPrCircleToggle(m_angleGroup, "bl", -135);
+ KPrCircleToggle *r270 = new KPrCircleToggle(m_angleGroup, "ml", -90);
+ KPrCircleToggle *r315 = new KPrCircleToggle(m_angleGroup, "tl", -45);
+ circleLayout->addWidget(r0, 0, 2);
+ circleLayout->addWidget(r180, 2, 2);
+ circleLayout->addWidget(r45, 0, 3);
+ circleLayout->addWidget(r135, 2, 3);
+ circleLayout->addWidget(r315, 0, 1);
+ circleLayout->addWidget(r225, 2, 1);
+ circleLayout->addWidget(r90, 1, 3);
+ circleLayout->addWidget(r270, 1, 1);
+
+ connect( m_angleGroup, SIGNAL (clicked (int)),
+ this, SLOT( angleMode( int ) ) );
+ connect (m_dialog->angleSlider, SIGNAL( valueChanged (int ) ),
+ this, SLOT( angleMode( int ) ) );
+ connect (m_dialog->angleSpinbox, SIGNAL (valueChanged (double) ),
+ this, SLOT( angleChanged( double ) ) );
+ connect( this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) );
+
+ setMainWidget( m_dialog );
+}
+
+void KPrRotationDialogImpl::slotOk()
+{
+ emit apply();
+ accept();
+}
+
+void KPrRotationDialogImpl::setAngle( double angle )
+{
+ if(noSignals) return;
+ noSignals = true;
+ int roundedAngle = (int) (angle + (angle >=0 ? 0.5:-0.5));
+ m_dialog->angleSlider->setValue( roundedAngle );
+ if(roundedAngle == -180)
+ roundedAngle = 180;
+ m_angleGroup->setAngle(roundedAngle);
+ m_dialog->angleSpinbox->setValue( angle );
+ m_preview->setAngle( angle );
+ noSignals = false;
+}
+
+double KPrRotationDialogImpl::angle()
+{
+ return m_dialog->angleSpinbox->value();
+}
+
+void KPrRotationDialogImpl::angleChanged( double angle )
+{
+ setAngle( angle );
+}
+
+void KPrRotationDialogImpl::angleMode( int angle )
+{
+ setAngle( angle );
+}
+
+
+KPrCircleToggle::KPrCircleToggle( QWidget *parent, const QString &image, int id )
+ : QLabel( parent )
+{
+ KIconLoader il("kpresenter");
+ m_off = il.loadIcon("rotate/" + image, KIcon::NoGroup, 28);
+ m_on = il.loadIcon("rotate/" + image + "dn", KIcon::NoGroup, 28);
+
+ m_selected = false;
+ m_id = id;
+ setMouseTracking(true);
+ setPixmap( m_off );
+ KPrCircleGroup *cg = dynamic_cast<KPrCircleGroup*> (parent);
+ if(cg != 0)
+ cg->add(this);
+}
+
+void KPrCircleToggle::mousePressEvent ( QMouseEvent * e ) {
+ if(e->button() != Qt:: LeftButton)
+ return;
+ setChecked(!m_selected);
+}
+
+void KPrCircleToggle::setChecked(bool on) {
+ if(on == m_selected) return;
+ m_selected = on;
+ setPixmap( m_selected?m_on:m_off );
+ emit clicked(m_id);
+}
+
+KPrCircleGroup::KPrCircleGroup(QWidget *parent)
+ : QFrame(parent), m_buttons()
+{
+ noSignals=false;
+}
+
+void KPrCircleGroup::setAngle(int angle) {
+ noSignals = true;
+ KPrCircleToggle *button;
+ for ( button = m_buttons.first(); button; button = m_buttons.next() )
+ button->setChecked(angle == button->id());
+ noSignals = false;
+}
+
+void KPrCircleGroup::add(KPrCircleToggle *button) {
+ connect (button, SIGNAL(clicked (int)), this, SLOT (selectionChanged (int)) );
+ m_buttons.append(button);
+}
+
+void KPrCircleGroup::selectionChanged(int buttonId) {
+ if(noSignals)
+ return;
+ KPrCircleToggle *button;
+ for ( button = m_buttons.first(); button; button = m_buttons.next() )
+ button->setChecked(buttonId == button->id());
+ emit clicked(buttonId);
+}
+
+#include "KPrRotationDialogImpl.moc"
diff --git a/kpresenter/KPrRotationDialogImpl.h b/kpresenter/KPrRotationDialogImpl.h
new file mode 100644
index 000000000..2eb2586b8
--- /dev/null
+++ b/kpresenter/KPrRotationDialogImpl.h
@@ -0,0 +1,136 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thomas Zander <zander@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; version 2.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#ifndef __rotationdialogimpl_h__
+#define __rotationdialogimpl_h__
+
+#include <qlabel.h>
+#include <kdialogbase.h>
+
+class KPrTextPreview;
+class RotationPropertyUI;
+class QObject;
+class QEvent;
+class KPrCircleGroup;
+
+/**
+ * A dialog that lets the user interactively choose an angle for rotation.
+ */
+class KPrRotationDialogImpl : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KPrRotationDialogImpl( QWidget *parent, const char* name = 0 );
+ ~KPrRotationDialogImpl() {}
+
+ void setAngle( double angle );
+ double angle();
+
+protected slots:
+ void angleChanged( double );
+ void angleMode( int );
+ void slotOk();
+
+protected:
+ KPrTextPreview *m_preview;
+ RotationPropertyUI *m_dialog;
+ KPrCircleGroup *m_angleGroup;
+
+private:
+ bool noSignals;
+};
+
+/**
+ * A toggle-button like widget that shows one pixmap when it is checked,
+ * and another when it is unselected.
+ */
+class KPrCircleToggle : public QLabel
+{
+ Q_OBJECT
+public:
+ /**
+ * Constructor.
+ * @param parent the parent widget, as required by Qt.
+ * @param image the named image that we will use. "rotate/" is
+ * prepended and "dn" is appended for the checked state.
+ * @param id the id that will be used in the clicked signal
+ */
+ KPrCircleToggle(QWidget *parent, const QString &image, int id);
+ /// return the id which is passed in the constructor
+ int id() { return m_id; }
+
+signals:
+ /// this signal will be emitted whenever the button becomes checked
+ void clicked(int id);
+
+public slots:
+ /**
+ * Check or uncheck the button. On change the toggle will emit the clicked signal.
+ * @param on the new state of the button.
+ */
+ void setChecked(bool on);
+
+protected:
+ /// overwritten method from QWidget.
+ void mousePressEvent ( QMouseEvent * e );
+
+private:
+ QPixmap m_on, m_off;
+ bool m_selected;
+ int m_id;
+};
+
+/**
+ * A button-group equivalent for a set of KPrCircleToggle classes.
+ */
+class KPrCircleGroup : public QFrame
+{
+ Q_OBJECT
+public:
+ /**
+ * Constructor.
+ * @param parent the parent widget, as required by Qt.
+ */
+ KPrCircleGroup(QWidget *parent);
+ /**
+ * Set the angle the group is currently representing. If there is a child button
+ * that registred itself (using add()) with an ID that matches the argument angle
+ * that button will be checked. All other buttons will be disabled.
+ * @param angle the new angle to be represented by this circle
+ */
+ void setAngle(int angle);
+ /**
+ * Add a KPrCircleToggle button as one of the representers of this circle.
+ * @param button the button
+ */
+ void add(KPrCircleToggle *button);
+
+signals:
+ /// clicked will be emitted when one of the child buttons is clicked.
+ void clicked(int id);
+
+private slots:
+ void selectionChanged(int buttonId);
+
+private:
+ QPtrList<KPrCircleToggle> m_buttons;
+ bool noSignals;
+};
+
+#endif
diff --git a/kpresenter/KPrSVGPathParser.cpp b/kpresenter/KPrSVGPathParser.cpp
new file mode 100644
index 000000000..b2fd853fa
--- /dev/null
+++ b/kpresenter/KPrSVGPathParser.cpp
@@ -0,0 +1,179 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrSVGPathParser.h"
+
+
+ObjType KPrSVGPathParser::getType( QString &d )
+{
+ m_type = true;
+ m_pathType = 0;
+ ObjType objType = OT_UNDEFINED;
+ parseSVG( d, true );
+ if ( m_pathType & UNSUPPORTED )
+ {
+ objType = OT_UNDEFINED;
+ }
+ else if ( m_pathType & SEEN_CLOSE )
+ {
+ objType = OT_CLOSED_LINE;
+ }
+ else if ( m_pathType & NO_BEZIER )
+ {
+ objType = OT_FREEHAND;
+ }
+ else if ( ( m_pathType & SEEN_QUADRIC ) && ! ( m_pathType & SEEN_CUBIC ) )
+ {
+ objType = OT_QUADRICBEZIERCURVE;
+ }
+ else if ( m_pathType & SEEN_CUBIC )
+ {
+ objType = OT_CUBICBEZIERCURVE;
+ }
+ return objType;
+}
+
+
+KoPointArray KPrSVGPathParser::getPoints( QString &d, bool convert2lines )
+{
+ m_type = false;
+ m_pointIdx = 0;
+ m_convert2lines = convert2lines;
+ parseSVG( d, true );
+ return m_points;
+}
+
+
+void KPrSVGPathParser::svgMoveTo( double x1, double y1, bool /*abs*/ )
+{
+ if ( m_type )
+ {
+ if ( m_pathType != 0 )
+ {
+ m_pathType |= UNSUPPORTED;
+ }
+ else
+ {
+ m_pathType |= SEEN_MOVE;
+ }
+ }
+ else
+ {
+ m_curPoint = KoPoint( x1, y1 );
+ }
+}
+
+
+void KPrSVGPathParser::svgLineTo( double x1, double y1, bool /*abs*/ )
+{
+ if ( m_type )
+ {
+ if ( m_pathType & SEEN_MOVE )
+ {
+ if ( m_pathType & SEEN_LINE )
+ {
+ m_pathType |= NO_BEZIER;
+ }
+ m_pathType |= SEEN_LINE;
+ }
+ else
+ {
+ m_pathType |= UNSUPPORTED;
+ }
+ }
+ else
+ {
+ m_points.putPoints( m_pointIdx, 2, m_curPoint.x(), m_curPoint.y(), x1, y1 );
+ m_curPoint = KoPoint( x1, y1 );
+ m_pointIdx += 2;
+ }
+}
+
+
+void KPrSVGPathParser::svgCurveToCubic( double x1, double y1, double x2, double y2, double x, double y, bool /*abs*/ )
+{
+ if ( m_type )
+ {
+ if ( m_pathType & SEEN_MOVE )
+ {
+ if ( m_pathType & SEEN_LINE )
+ {
+ m_pathType |= NO_BEZIER;
+ }
+
+ if ( x1 == x2 && y1 == y2 )
+ {
+ m_pathType |= SEEN_QUADRIC;
+ }
+ else
+ {
+ m_pathType |= SEEN_CUBIC;
+ }
+ }
+ else
+ {
+ m_pathType |= UNSUPPORTED;
+ }
+ }
+ else
+ {
+ if ( m_convert2lines )
+ {
+ KoPointArray bezierPoints;
+ bezierPoints.putPoints( 0, 4, m_curPoint.x(), m_curPoint.y(), x1, y1, x2, y2, x, y );
+
+ bezierPoints = bezierPoints.cubicBezier();
+ KoPointArray::ConstIterator it;
+ for ( it = bezierPoints.begin(); it != bezierPoints.end(); ++it )
+ {
+ KoPoint point = (*it);
+ m_points.putPoints( m_pointIdx, 1, point.x(), point.y() );
+ ++m_pointIdx;
+ }
+ }
+ else
+ {
+ m_points.putPoints( m_pointIdx, 4, m_curPoint.x(), m_curPoint.y(), x, y, x1, y1, x2, y2 );
+ m_pointIdx += 4;
+ }
+ m_curPoint = KoPoint( x, y );
+ }
+}
+
+
+// TODO
+void KPrSVGPathParser::svgClosePath()
+{
+ if ( m_type )
+ {
+ if ( m_pathType & SEEN_CLOSE )
+ {
+ m_pathType |= UNSUPPORTED;
+ }
+ else
+ {
+ m_pathType |= SEEN_CLOSE;
+ }
+ }
+ else
+ {
+ }
+}
+
+
diff --git a/kpresenter/KPrSVGPathParser.h b/kpresenter/KPrSVGPathParser.h
new file mode 100644
index 000000000..064616cdd
--- /dev/null
+++ b/kpresenter/KPrSVGPathParser.h
@@ -0,0 +1,92 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRSVGPATHPARSER_H
+#define KPRSVGPATHPARSER_H
+
+#include <svgpathparser.h>
+#include "global.h"
+#include "KoPointArray.h"
+
+class KPrSVGPathParser : public SVGPathParser
+{
+public:
+ /**
+ * @brief Destructor
+ */
+ virtual ~KPrSVGPathParser() {};
+
+ /**
+ * @brief Get the type of object which can handle the path.
+ *
+ * @param d the svg:d attribute of the draw:path object
+ *
+ * @return The object type. This can be:
+ * OT_FREEHAND
+ * OT_CLOSED_LINE
+ * OT_QUADRICBEZIERCURVE
+ * OT_CUBICBEZIERCURVE
+ * or
+ * OT_UNDEFINED if path is not supported
+ */
+ ObjType getType( QString &d );
+
+ /**
+ * @brief Get the points of the path
+ *
+ * @param d the svg:d attribute of the draw:path object
+ * @param convert2lines true if curves should be replaced by lines.
+ *
+ * @return points of the path
+ */
+ KoPointArray getPoints( QString &d, bool convert2lines = false );
+
+protected:
+ virtual void svgMoveTo( double x1, double y1, bool abs = true );
+ virtual void svgLineTo( double x1, double y1, bool abs = true );
+ virtual void svgCurveToCubic( double x1, double y1, double x2, double y2, double x, double y, bool abs = true );
+ virtual void svgClosePath();
+
+private:
+ /// if the type or the points should be analysed
+ bool m_type;
+ enum PathType
+ {
+ SEEN_MOVE = 1,
+ SEEN_LINE = 2,
+ SEEN_CUBIC = 4,
+ SEEN_QUADRIC = 8,
+ SEEN_CLOSE = 16,
+ NO_BEZIER = 32,
+ UNSUPPORTED = 64
+ };
+ /// the flags of the path
+ int m_pathType;
+
+ /// the points of the path
+ KoPointArray m_points;
+ /// the current point in the path
+ KoPoint m_curPoint;
+ /// the index of the points in m_points
+ int m_pointIdx;
+ /// if true curves are converted to lines
+ bool m_convert2lines;
+};
+
+#endif /* KPRSVGPATHPARSER_H */
diff --git a/kpresenter/KPrShadowDialogImpl.cpp b/kpresenter/KPrShadowDialogImpl.cpp
new file mode 100644
index 000000000..c97a5068b
--- /dev/null
+++ b/kpresenter/KPrShadowDialogImpl.cpp
@@ -0,0 +1,91 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+#include <qspinbox.h>
+#include <qgroupbox.h>
+#include <qlayout.h>
+#include <qbuttongroup.h>
+
+#include <kcolorbutton.h>
+#include <klocale.h>
+
+#include "KPrShadowDialogImpl.h"
+#include "KPrTextPreview.h"
+
+KPrShadowDialogImpl::KPrShadowDialogImpl( QWidget *parent, const char* name )
+ : ShadowDialogBase( parent, name )
+{
+ _preview = new KPrTextPreview( previewPanel );
+ QHBoxLayout *lay = new QHBoxLayout( previewPanel, previewPanel->lineWidth(), 0 );
+ lay->addWidget( _preview );
+ distanceSpinBox->setSuffix(i18n("pt"));
+ ltButton->setPixmap( BarIcon( "shadowLU" ) );
+ tButton->setPixmap( BarIcon( "shadowU" ) );
+ rtButton->setPixmap( BarIcon( "shadowRU" ) );
+ rButton->setPixmap( BarIcon( "shadowR" ) );
+ rbButton->setPixmap( BarIcon( "shadowRB" ) );
+ bButton->setPixmap( BarIcon( "shadowB" ) );
+ lbButton->setPixmap( BarIcon( "shadowLB" ) );
+ lButton->setPixmap( BarIcon( "shadowL" ) );
+
+ connect( colorButton, SIGNAL( changed( const QColor& ) ),
+ SLOT( colorChanged( const QColor& ) ) );
+}
+
+void KPrShadowDialogImpl::setShadowDirection( ShadowDirection d )
+{
+ _preview->setShadowDirection( d );
+ directionGroup->setButton( d );
+}
+
+void KPrShadowDialogImpl::setShadowDistance( int d )
+{
+ _preview->setShadowDistance( d );
+ distanceSpinBox->setValue( d );
+}
+
+void KPrShadowDialogImpl::setShadowColor( const QColor &c )
+{
+ _preview->setShadowColor( c );
+ colorButton->setColor( c );
+}
+
+void KPrShadowDialogImpl::colorChanged( const QColor& c )
+{
+ _preview->setShadowColor( c );
+}
+
+void KPrShadowDialogImpl::directionChanged( int d )
+{
+ _preview->setShadowDirection( (ShadowDirection)d );
+}
+
+void KPrShadowDialogImpl::distanceChanged( int d )
+{
+ _preview->setShadowDistance( d );
+}
+
+void KPrShadowDialogImpl::applyClicked()
+{
+ emit apply();
+}
+
+void KPrShadowDialogImpl::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+ShadowDirection KPrShadowDialogImpl::shadowDirection()
+{
+ return (ShadowDirection) ( directionGroup->id( directionGroup->selected() ) );
+}
+
+int KPrShadowDialogImpl::shadowDistance()
+{
+ return distanceSpinBox->value();
+}
+
+QColor KPrShadowDialogImpl::shadowColor()
+{
+ return colorButton->color();
+}
+#include "KPrShadowDialogImpl.moc"
diff --git a/kpresenter/KPrShadowDialogImpl.h b/kpresenter/KPrShadowDialogImpl.h
new file mode 100644
index 000000000..ad536f5f5
--- /dev/null
+++ b/kpresenter/KPrShadowDialogImpl.h
@@ -0,0 +1,41 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+#ifndef __shadowdialogimpl_h__
+#define __shadowdialogimpl_h__
+
+#include "shadowdialog.h"
+#include "global.h"
+
+class KPrTextPreview;
+
+class KPrShadowDialogImpl : public ShadowDialogBase
+{
+ Q_OBJECT
+
+public:
+ KPrShadowDialogImpl( QWidget *parent, const char* name = 0 );
+ ~KPrShadowDialogImpl() {}
+
+ void setShadowDirection( ShadowDirection sd );
+ void setShadowDistance( int sd );
+ void setShadowColor( const QColor &sc );
+
+ ShadowDirection shadowDirection();
+ int shadowDistance();
+ QColor shadowColor();
+
+signals:
+ void apply();
+
+protected slots:
+ void colorChanged( const QColor& );
+ void directionChanged( int );
+ void distanceChanged( int );
+ void applyClicked();
+ void okClicked();
+
+protected:
+ KPrTextPreview *_preview;
+};
+
+
+#endif
diff --git a/kpresenter/KPrSideBar.cpp b/kpresenter/KPrSideBar.cpp
new file mode 100644
index 000000000..281c7929c
--- /dev/null
+++ b/kpresenter/KPrSideBar.cpp
@@ -0,0 +1,1111 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2001 Lukas Tinkl <lukas@kde.org>
+ Copyright (C) 2002 Ariya Hidayat <ariya@kde.org>
+ Copyright (C) 2005 Laurent Montel <montel@kde.org>
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <qheader.h>
+#include <qtimer.h>
+#include <qpopupmenu.h>
+#include <qimage.h>
+#include <qtabwidget.h>
+#include <qtooltip.h>
+
+#include <kwordwrap.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kinputdialog.h>
+#include <knotifyclient.h>
+#include <kiconview.h>
+#include <kdebug.h>
+
+#include "KPrSideBar.h"
+#include "KPrView.h"
+#include "KPrDocument.h"
+#include "KPrCanvas.h"
+#include "KPrPage.h"
+#include "KPrObject.h"
+#include <qapplication.h>
+#include "KPrCommand.h"
+#include <qvalidator.h>
+#include "KPrFreehandObject.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrTextObject.h"
+#include "KPrPolylineObject.h"
+#include "KPrClosedLineObject.h"
+#include "KPrGroupObject.h"
+
+
+QValidator::State KPrRenamePageValidator::validate( QString & input, int& ) const
+{
+ QString str = input.stripWhiteSpace();
+ if ( str.isEmpty() ) // we want to allow empty titles. Empty == automatic.
+ return Acceptable;
+
+ if ( mStringList.find( str ) == mStringList.end() )
+ return Acceptable;
+ else
+ return Intermediate;
+}
+
+class ThumbToolTip : public QToolTip
+{
+public:
+ ThumbToolTip( KPrThumbBar *parent )
+ : QToolTip( parent->viewport() )
+ , m_thumbBar( parent )
+ {}
+
+protected:
+ void maybeTip(const QPoint &pos)
+ {
+ QString title;
+ QRect r( m_thumbBar->tip( pos, title ) );
+ if (!r.isValid())
+ return;
+
+ tip(r, title);
+ }
+private:
+ KPrThumbBar *m_thumbBar;
+};
+
+
+class OutlineSlideItem: public KListViewItem
+{
+public:
+ OutlineSlideItem( KListView * parent, KPrPage* page, bool _masterPage );
+ OutlineSlideItem( KListView * parent, OutlineSlideItem *after, KPrPage* page, bool _masterPage );
+
+ KPrPage* page() const { return m_page; }
+
+ void setPage( KPrPage* p );
+
+ void update();
+ void updateTitle();
+
+private:
+ KPrPage* m_page;
+ bool m_masterPage;
+};
+
+class OutlineObjectItem: public KListViewItem
+{
+public:
+ OutlineObjectItem( OutlineSlideItem * parent, KPrObject* object,
+ const QString& name = QString::null );
+
+ KPrObject* object() const { return m_object; }
+
+ void setObject( KPrObject* o );
+
+private:
+ KPrObject* m_object;
+};
+
+class ThumbItem : public QIconViewItem
+{
+public:
+ ThumbItem( QIconView *parent, const QString & text, const QPixmap & icon )
+ : QIconViewItem( parent, text, icon )
+ { uptodate = true; }
+ ThumbItem( QIconView *parent, QIconViewItem *after, const QString & text, const QPixmap & icon )
+ : QIconViewItem( parent, after, text, icon )
+ { uptodate = true; }
+
+ virtual bool isUptodate() { return uptodate; };
+ virtual void setUptodate( bool _uptodate) { uptodate = _uptodate; };
+
+private:
+ bool uptodate;
+};
+
+KPrSideBar::KPrSideBar(QWidget *parent, KPrDocument *d, KPrView *v)
+ :QTabWidget(parent), m_doc(d), m_view(v)
+{
+ setTabPosition(QTabWidget::Top);
+ setTabShape(QTabWidget::Triangular);
+
+ m_outline = new KPrOutline(this, m_doc, m_view);
+ addTab(m_outline, i18n("Structure of the presentation", "Outline"));
+
+ m_thb = new KPrThumbBar(this, m_doc, m_view);
+ addTab(m_thb,i18n("Preview"));
+
+
+ //TODO find a better way
+ connect(m_outline, SIGNAL(showPage(int)),
+ this, SIGNAL(showPage(int)));
+
+ connect(m_thb, SIGNAL(showPage(int)),
+ this, SIGNAL(showPage(int)));
+
+ connect(m_outline, SIGNAL(movePage(int,int)),
+ this, SIGNAL(movePage(int,int)));
+
+ connect(m_outline, SIGNAL(selectPage(int,bool)),
+ this, SIGNAL(selectPage(int,bool)));
+
+ connect(this, SIGNAL(currentChanged(QWidget *)),
+ this, SLOT(currentChanged(QWidget *)));
+
+}
+
+void KPrSideBar::currentChanged(QWidget *tab)
+{
+ if (tab == m_thb) {
+ if (!m_thb->uptodate && m_thb->isVisible())
+ m_thb->rebuildItems();
+ else
+ m_thb->refreshItems();
+ }
+}
+
+void KPrSideBar::addItem( int pos )
+{
+ m_outline->addItem( pos );
+ m_thb->addItem( pos );
+}
+
+void KPrSideBar::moveItem( int oldPos, int newPos )
+{
+ m_outline->moveItem( oldPos, newPos );
+ m_thb->moveItem( oldPos, newPos );
+}
+
+void KPrSideBar::removeItem( int pos )
+{
+ m_outline->removeItem( pos );
+ m_thb->removeItem( pos );
+}
+
+void KPrSideBar::updateItem( KPrPage *page )
+{
+ bool sticky = false;
+ int pos = 0;
+ if ( page == m_doc->masterPage() )
+ {
+ pos = -1;
+ sticky = true;
+ }
+ else
+ {
+ pos = m_doc->pageList().findRef( page );
+ }
+
+ m_outline->updateItem( pos, sticky );
+ m_thb->updateItem( pos, sticky );
+}
+
+void KPrSideBar::setViewMasterPage( bool _masterPage )
+{
+ m_outline->setViewMasterPage( _masterPage );
+ m_thb->setViewMasterPage( _masterPage );
+ m_outline->rebuildItems();
+ m_thb->rebuildItems();
+}
+
+KPrSideBarBase::KPrSideBarBase(KPrDocument *_doc, KPrView *_view)
+ : m_doc( _doc ), m_view( _view ), m_viewMasterPage( false )
+{
+}
+
+void KPrSideBarBase::setViewMasterPage( bool _b )
+{
+ m_viewMasterPage = _b;
+}
+
+KPrThumbBar::KPrThumbBar(QWidget *parent, KPrDocument *d, KPrView *v)
+ :KIconView(parent), KPrSideBarBase( d,v)
+{
+ uptodate = false;
+ m_offsetX = 0;
+ m_offsetY = 0;
+
+ setArrangement(QIconView::LeftToRight);
+ setAutoArrange(true);
+ setSorting(false);
+ setItemsMovable(false);
+ setResizeMode(QIconView::Adjust);
+
+ m_thumbTip = new ThumbToolTip(this);
+
+ connect(this, SIGNAL(currentChanged(QIconViewItem *)),
+ this, SLOT(itemClicked(QIconViewItem *)));
+ connect(this, SIGNAL(contentsMoving(int, int)),
+ this, SLOT(slotContentsMoving(int, int)));
+}
+
+KPrThumbBar::~KPrThumbBar()
+{
+ delete m_thumbTip;
+}
+
+void KPrThumbBar::setCurrentPage( int pg )
+{
+ for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() )
+ {
+ if ( it->text().toInt() - 1 == pg ) {
+ blockSignals( true );
+ setCurrentItem( it );
+ setSelected( it, FALSE ); // to avoid the blue "selected"-mark
+ ensureItemVisible(it);
+ refreshItems();
+ blockSignals( false );
+ return;
+ }
+ }
+}
+
+QRect KPrThumbBar::tip(const QPoint &pos, QString &title)
+{
+ QIconViewItem *item = findItem(viewportToContents(pos));
+ if (!item)
+ return QRect(0, 0, -1, -1);
+
+ int pagenr = item->index();
+ title = m_doc->pageList().at(pagenr)->pageTitle();
+
+ QRect r = item->pixmapRect(FALSE);
+ r = QRect(contentsToViewport(QPoint(r.x(), r.y())), QSize(r.width(), r.height()));
+ return r;
+}
+
+void KPrThumbBar::rebuildItems()
+{
+ kdDebug()<<" void KPrThumbBar::rebuildItems() beofre \n";
+ if( !isVisible())
+ return;
+ kdDebug(33001) << "KPrThumbBar::rebuildItems" << endl;
+
+ QApplication::setOverrideCursor( Qt::waitCursor );
+
+ clear();
+ if ( m_viewMasterPage )
+ {
+ }
+ else
+ {
+ for ( unsigned int i = 0; i < m_doc->getPageNums(); i++ ) {
+ // calculate the size of the thumb
+ QRect rect = m_doc->pageList().at(i)->getZoomPageRect( );
+
+ int w = rect.width();
+ int h = rect.height();
+ if ( w > h ) {
+ w = 130;
+ float diff = (float)rect.width() / (float)w;
+ h = (int) (rect.height() / diff);
+ if ( h > 120 ) {
+ h = 120;
+ float diff = (float)rect.height() / (float)h;
+ w = (int) (rect.width() / diff);
+ }
+ }
+ else if ( w < h ) {
+ h = 130;
+ float diff = (float)rect.height() / (float)h;
+ w = (int) (rect.width() / diff);
+ if ( w > 120 ) {
+ w = 120;
+ float diff = (float)rect.width() / (float)w;
+ h = (int) (rect.height() / diff);
+ }
+ }
+ else if ( w == h ) {
+ w = 130;
+ h = 130;
+ }
+
+ // draw an empty thumb
+ QPixmap pix(w, h);
+ pix.fill( Qt::white );
+
+ QPainter p(&pix);
+ p.setPen(Qt::black);
+ p.drawRect(pix.rect());
+
+ ThumbItem *item = new ThumbItem(static_cast<QIconView *>(this), QString::number(i+1), pix);
+ item->setUptodate( false );
+ item->setDragEnabled(false); //no dragging for now
+ }
+
+ QTimer::singleShot( 10, this, SLOT( slotRefreshItems() ) );
+ }
+ uptodate = true;
+
+ QApplication::restoreOverrideCursor();
+}
+
+void KPrThumbBar::refreshItems(bool offset)
+{
+ QRect vRect = visibleRect();
+ if ( offset )
+ vRect.moveBy( m_offsetX, m_offsetY );
+ else
+ vRect.moveBy( contentsX(), contentsY() );
+
+ QIconViewItem *it = findFirstVisibleItem( vRect );
+ while ( it )
+ {
+ kdDebug(33001) << "visible page = " << it->text().toInt() << endl;
+ if ( ! dynamic_cast<ThumbItem *>(it)->isUptodate( ) ){
+ //todo refresh picture
+ it->setPixmap( getSlideThumb( it->text().toInt() - 1 ) );
+ static_cast<ThumbItem *>(it)->setUptodate( true );
+ }
+
+ if ( it == findLastVisibleItem( vRect ) )
+ break;
+ it = it->nextItem();
+ }
+
+ m_offsetX = 0;
+ m_offsetY = 0;
+}
+
+void KPrThumbBar::updateItem( int pagenr /* 0-based */, bool sticky )
+{
+ if ( m_viewMasterPage )
+ return;
+ if ( !uptodate )
+ return;
+ int pagecnt = 0;
+ // calculate rect of visible objects
+ QRect vRect = visibleRect();
+ vRect.moveBy( contentsX(), contentsY() );
+
+ // Find icon
+ QIconViewItem *it = firstItem();
+ do
+ {
+ if ( it == findFirstVisibleItem( vRect ) ) {
+ do
+ {
+ if ( sticky || it->text().toInt() == pagenr + 1 ) {
+ it->setPixmap(getSlideThumb( pagecnt ));
+ static_cast<ThumbItem *>(it)->setUptodate( true );
+
+ if ( !sticky )
+ return;
+ }
+ if ( it == findLastVisibleItem( vRect ) )
+ break;
+ pagecnt++;
+ it = it->nextItem();
+ } while ( true );
+ }
+ else if ( sticky || it->text().toInt() == pagenr + 1 ) {
+ static_cast<ThumbItem *>(it)->setUptodate( false );
+ if ( !sticky )
+ return;
+ }
+ pagecnt++;
+ it = it->nextItem();
+ } while ( it );
+
+ if ( ! sticky )
+ kdWarning(33001) << "Item for page " << pagenr << " not found" << endl;
+}
+
+// add a thumb item without recreating all thumbs
+void KPrThumbBar::addItem( int pos )
+{
+ kdDebug(33001)<< "KPrThumbBar::addItem" << endl;
+ int page = 0;
+ for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) {
+ // find page which should move
+ // do stuff because a item can not be insert at the beginning
+ if ( pos == 0 && page == pos ){
+ ThumbItem *item = new ThumbItem(static_cast<QIconView *>(this), it, QString::number(2), getSlideThumb(1));
+ item->setDragEnabled(false); //no dragging for now
+ it->setPixmap(getSlideThumb( 0 ));
+ // move on to next item as we have inserted one
+ it = it->nextItem();
+ }
+ else if ( (page + 1) == pos ) {
+ ThumbItem *item = new ThumbItem(static_cast<QIconView *>(this), it, QString::number(pos+1), getSlideThumb(pos));
+ item->setDragEnabled(false); //no dragging for now
+ it = it->nextItem();
+ }
+ // update page numbers
+ if ( page >= pos )
+ it->setText( QString::number(page+2) );
+ page++;
+ }
+}
+
+// moves a item without recreating all pages
+void KPrThumbBar::moveItem( int oldPos, int newPos )
+{
+ kdDebug(33001)<< "KPrThumbBar::moveItem " << oldPos << " to " << newPos << endl;
+ int page = 0;
+ QIconViewItem *after = 0;
+ QIconViewItem *take = 0;
+ for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) {
+ // find page which should move
+ if ( page == oldPos )
+ take = it;
+ // find position where page should be insert
+ // as a page can not be insert at the beginning get the first one
+ // the page to get depends on if a page is moved forward / backwards
+ if ( page == newPos )
+ after = page == 0 ? it : newPos > oldPos ? it : it->prevItem();
+ page++;
+ }
+
+ if ( ! take )
+ return;
+
+ // workaround for a bug in qt 3.1.1 insertItem dose not work.
+ // TODO remove workaround when qt 3.1.2 comes out tz
+ //takeItem( take );
+ //insertItem( take, after);
+ ThumbItem *item = new ThumbItem( static_cast<QIconView *>(this), after, QString::number( newPos ), *(take->pixmap()) );
+ item->setDragEnabled(false); //no dragging for now
+ delete take;
+ // update the thumbs if new pos was 0
+ // because it was insert after the first one
+ if ( newPos == 0 ) {
+ //todo do not recreate the pics
+ after->setPixmap(getSlideThumb( 0 ));
+ //take->setPixmap(getSlideThumb( 1 ));
+ item->setPixmap(getSlideThumb( 1 ));
+ }
+
+ //write the new page numbers
+ int lowPage = oldPos > newPos ? newPos : oldPos;
+ int highPage = oldPos < newPos ? newPos : oldPos;
+ page = 0;
+ for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) {
+ if ( page >= lowPage && page <= highPage)
+ it->setText( QString::number(page+1) );
+ page++;
+ }
+}
+
+void KPrThumbBar::removeItem( int pos )
+{
+ kdDebug(33001)<< "KPrThumbBar::removeItem" << endl;
+ int page = 0;
+ bool change = false;
+ QIconViewItem *itemToDelete = 0;
+
+ for ( QIconViewItem *it = firstItem(); it; it = it->nextItem() ) {
+ if ( page == pos ) {
+ itemToDelete = it;
+ if ( it->nextItem() )
+ it = it->nextItem();
+ change = true;
+ }
+ if ( change )
+ it->setText( QString::number( page + 1 ) );
+ page++;
+ }
+ delete itemToDelete;
+}
+
+QPixmap KPrThumbBar::getSlideThumb(int slideNr) const
+{
+ //kdDebug(33001) << "KPrThumbBar::getSlideThumb: " << slideNr << endl;
+ QPixmap pix( 10, 10 );
+
+ m_view->getCanvas()->drawPageInPix( pix, slideNr, 60 );
+
+ int w = pix.width();
+ int h = pix.height();
+
+ if ( w > h ) {
+ w = 130;
+ h = 120;
+ }
+ else if ( w < h ) {
+ w = 120;
+ h = 130;
+ }
+ else if ( w == h ) {
+ w = 130;
+ h = 130;
+ }
+
+ const QImage img(pix.convertToImage().smoothScale( w, h, QImage::ScaleMin ));
+ pix.convertFromImage(img);
+
+ // draw a frame around the thumb to show its size
+ QPainter p(&pix);
+ p.setPen(Qt::black);
+ p.drawRect(pix.rect());
+
+ return pix;
+}
+
+void KPrThumbBar::itemClicked(QIconViewItem *i)
+{
+ if ( !i )
+ return;
+ emit showPage( i->index() );
+}
+
+void KPrThumbBar::slotContentsMoving(int x, int y)
+{
+ m_offsetX = x;
+ m_offsetY = y;
+ kdDebug(33001) << "offset x,y = " << x << ", " << y << endl;
+ refreshItems( true );
+}
+
+void KPrThumbBar::slotRefreshItems()
+{
+ refreshItems();
+}
+
+OutlineSlideItem::OutlineSlideItem( KListView* parent, KPrPage* _page, bool _masterPage )
+ : KListViewItem( parent ), m_page( _page ), m_masterPage( _masterPage )
+{
+ setDragEnabled(true);
+ setPage( _page );
+ setPixmap( 0, KPBarIcon( "slide" ) );
+}
+
+OutlineSlideItem::OutlineSlideItem( KListView* parent, OutlineSlideItem * after, KPrPage* _page, bool _masterPage )
+ : KListViewItem( parent, after ), m_page( _page ), m_masterPage( _masterPage )
+{
+ setDragEnabled(true);
+ setPage( _page );
+ setPixmap( 0, KPBarIcon( "slide" ) );
+}
+
+void OutlineSlideItem::setPage( KPrPage* p )
+{
+ if( !p ) return;
+ m_page = p;
+ update();
+}
+
+void OutlineSlideItem::update()
+{
+ if( !m_page ) return;
+ KPrDocument *doc = m_page->kPresenterDoc();
+ updateTitle();
+
+ // add all objects
+ OutlineObjectItem *ooi = 0;
+ while ( ( ooi = dynamic_cast<OutlineObjectItem*>( this->firstChild() ) ) )
+ delete ooi;
+
+ // keep selected object
+ ooi = 0;
+
+ QPtrListIterator<KPrObject> it( m_page->objectList() );
+
+ if ( !m_masterPage )
+ {
+ for ( ; it.current(); ++it ) {
+ OutlineObjectItem *item = new OutlineObjectItem( this, it.current() );
+ item->setDragEnabled( false );
+ if ( it.current()->isSelected() )
+ ooi = item;
+ }
+ }
+ else
+ {
+ KPrObject* header = 0;
+ KPrObject* footer = 0;
+
+ // add sticky objects, exclude header and footer
+ it = doc->masterPage()->objectList();
+ for ( ; it.current() ; ++it )
+ {
+ KPrObject* object = it.current();
+
+ if( m_page->hasHeader() && doc->isHeader( object ) )
+ header = object;
+ else if( m_page->hasFooter() && doc->isFooter( object ) )
+ footer = object;
+ else if( !doc->isHeader( object ) && !doc->isFooter( object ) ) {
+ OutlineObjectItem *item = new OutlineObjectItem( this, object );
+ if ( object->isSelected() )
+ ooi = item;
+ }
+
+ }
+
+ // add header and footer (if any)
+ if ( footer ) {
+ OutlineObjectItem *item = new OutlineObjectItem( this, footer, i18n("Footer") );
+ if ( footer->isSelected() )
+ ooi = item;
+ }
+
+ if ( header ) {
+ OutlineObjectItem *item = new OutlineObjectItem( this, header, i18n("Header") );
+ if ( header->isSelected() )
+ ooi = item;
+ }
+ }
+
+ // select selected object the page is necessary that a
+ // sticky object is selected on the active page
+ if ( ooi && doc->activePage() == m_page )
+ (ooi->listView())->setSelected( ooi, true );
+}
+
+void OutlineSlideItem::updateTitle()
+{
+ QString title = m_page->pageTitle();
+ if ( ! m_page->isSlideSelected() )
+ title = i18n( "(%1)" ).arg( title );
+ setText( 0, title );
+}
+
+OutlineObjectItem::OutlineObjectItem( OutlineSlideItem* parent, KPrObject* _object,
+ const QString& name )
+ : KListViewItem( parent ), m_object( _object )
+{
+ setObject( m_object );
+ setDragEnabled( false );
+
+ QString objectName = name.isEmpty() ? m_object->getObjectName() : name;
+ //if( sticky ) objectName += i18n(" (Sticky)" );
+ setText( 0, objectName );
+}
+
+void OutlineObjectItem::setObject( KPrObject* object )
+{
+ if( !object ) return;
+ m_object = object;
+
+ switch ( m_object->getType() ) {
+ case OT_PICTURE:
+ setPixmap( 0, KPBarIcon( "frame_image" ) );
+ break;
+ case OT_LINE:
+ setPixmap( 0, KPBarIcon( "mini_line" ) );
+ break;
+ case OT_RECT:
+ setPixmap( 0, KPBarIcon( "mini_rect" ) );
+ break;
+ case OT_ELLIPSE:
+ setPixmap( 0, KPBarIcon( "mini_circle" ) );
+ break;
+ case OT_TEXT:
+ setPixmap( 0, KPBarIcon( "frame_text" ) );
+ break;
+ case OT_AUTOFORM:
+ setPixmap( 0, KPBarIcon( "mini_autoform" ) );
+ break;
+ case OT_CLIPART:
+ setPixmap( 0, KPBarIcon( "mini_clipart" ) );
+ break;
+ case OT_PIE:
+ setPixmap( 0, KPBarIcon( "mini_pie" ) );
+ break;
+ case OT_PART:
+ setPixmap( 0, KPBarIcon( "frame_query" ) );
+ break;
+ case OT_FREEHAND:
+ setPixmap( 0, KPBarIcon( "freehand" ) );
+ break;
+ case OT_POLYLINE:
+ setPixmap( 0, KPBarIcon( "polyline" ) );
+ break;
+ case OT_QUADRICBEZIERCURVE:
+ setPixmap( 0, KPBarIcon( "quadricbeziercurve" ) );
+ break;
+ case OT_CUBICBEZIERCURVE:
+ setPixmap( 0, KPBarIcon( "cubicbeziercurve" ) );
+ break;
+ case OT_POLYGON:
+ setPixmap( 0, KPBarIcon( "mini_polygon" ) );
+ break;
+ case OT_CLOSED_LINE: {
+ QString name = m_object->getTypeString();
+ if ( name == i18n( "Closed Freehand" ) )
+ setPixmap( 0, KPBarIcon( "closed_freehand" ) );
+ else if ( name == i18n( "Closed Polyline" ) )
+ setPixmap( 0, KPBarIcon( "closed_polyline" ) );
+ else if ( name == i18n( "Closed Quadric Bezier Curve" ) )
+ setPixmap( 0, KPBarIcon( "closed_quadricbeziercurve" ) );
+ else if ( name == i18n( "Closed Cubic Bezier Curve" ) )
+ setPixmap( 0, KPBarIcon( "closed_cubicbeziercurve" ) );
+ } break;
+ case OT_GROUP:
+ setPixmap( 0, KPBarIcon( "group" ) );
+ break;
+ default:
+ break;
+ }
+}
+
+KPrOutline::KPrOutline( QWidget *parent, KPrDocument *d, KPrView *v )
+ : KListView( parent ), KPrSideBarBase( d, v)
+{
+ rebuildItems();
+ setSorting( -1 );
+ header()->hide();
+ addColumn( i18n( "Slide" ) );
+ setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
+
+ connect( this, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) );
+ connect( this, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ),
+ this, SLOT( rightButtonPressed( QListViewItem *, const QPoint &, int ) ) );
+ connect( this, SIGNAL( contextMenu( KListView*, QListViewItem*, const QPoint& ) ),
+ this, SLOT( slotContextMenu( KListView*, QListViewItem*, const QPoint&) ) );
+
+ connect( this, SIGNAL( doubleClicked ( QListViewItem * )),
+ this, SLOT(renamePageTitle()));
+ connect( this, SIGNAL( dropped( QDropEvent*, QListViewItem*, QListViewItem* ) ),
+ this, SLOT( slotDropped( QDropEvent*, QListViewItem*, QListViewItem* ) ));
+
+ setItemsMovable( false );
+ setDragEnabled( true );
+ setAcceptDrops( true );
+ setDropVisualizer( true );
+ setFullWidth( true );
+ this->setRootIsDecorated( true );
+}
+
+KPrOutline::~KPrOutline()
+{
+}
+
+void KPrOutline::rebuildItems()
+{
+ clear();
+ if ( m_viewMasterPage )
+ {
+ KPrPage *page=m_doc->masterPage();
+ new OutlineSlideItem( this, page, true );
+ }
+ else
+ {
+ // Rebuild all the items
+ for ( int i = m_doc->getPageNums() - 1; i >= 0; --i ) {
+ KPrPage *page=m_doc->pageList().at( i );
+ new OutlineSlideItem( this, page, false );
+ }
+ }
+}
+
+// given the page number (0-based), find associated slide item
+// returns 0 upon stupid things (e.g. invalid page number)
+OutlineSlideItem* KPrOutline::slideItem( int pageNumber )
+{
+ QListViewItem* item = firstChild();
+ for( int index = 0; item; ++index, item = item->nextSibling() ) {
+ if( index == pageNumber )
+ return dynamic_cast<OutlineSlideItem*>( item );
+ }
+
+ return 0;
+}
+
+
+// update the KPrOutline item, the title may have changed
+void KPrOutline::updateItem( int pagenr /* 0-based */, bool sticky )
+{
+ if ( ! sticky ) {
+ OutlineSlideItem *item = slideItem( pagenr );
+ if( item ) {
+ blockSignals(true);
+ item->update();
+ blockSignals(false);
+ }
+ } else {
+ blockSignals(true);
+ for( QListViewItem *item = this->firstChild(); item; item = item->nextSibling() )
+ dynamic_cast<OutlineSlideItem*>(item)->update();
+ blockSignals(false);
+ }
+}
+
+void KPrOutline::addItem( int pos )
+{
+ kdDebug(33001)<< "KPrOutline::addItem" << endl;
+
+ KPrPage *page=m_doc->pageList().at( pos );
+ OutlineSlideItem *item;
+ if ( pos == 0 ) {
+ item = new OutlineSlideItem( this, page,m_viewMasterPage );
+ }
+ else {
+ OutlineSlideItem *after = slideItem( pos - 1 );
+ item = new OutlineSlideItem( this, after, page,m_viewMasterPage );
+ }
+
+ item = dynamic_cast<OutlineSlideItem*>( item->nextSibling() );
+ // update title
+ for( ; item; item = dynamic_cast<OutlineSlideItem*>( item->nextSibling() ) )
+ item->updateTitle();
+}
+
+// move an KPrOutline Item so that not the hole list has to be recreated
+void KPrOutline::moveItem( int oldPos, int newPos )
+{
+ kdDebug(33001)<< "KPrOutline::moveItem " << oldPos << " to " << newPos << endl;
+
+ int lowPage = oldPos > newPos ? newPos : oldPos;
+ int highPage = oldPos < newPos ? newPos : oldPos;
+
+ OutlineSlideItem *item = dynamic_cast<OutlineSlideItem*>( firstChild() );
+ QListViewItem *itemToMove = 0;
+ QListViewItem *itemAfter = 0;
+
+ // moving backwards
+ if ( newPos < oldPos )
+ newPos--;
+
+ for ( int index = 0; item; ++index, item = dynamic_cast<OutlineSlideItem*>( item->nextSibling() ) )
+ {
+ if ( index == oldPos )
+ itemToMove = item;
+ if ( index == newPos )
+ itemAfter = item;
+ if ( index >= lowPage && index <= highPage )
+ item->updateTitle();
+ }
+
+ KListView::moveItem( itemToMove, 0, itemAfter );
+}
+
+void KPrOutline::removeItem( int pos )
+{
+ kdDebug(33001)<< "KPrOutline::removeItem" << endl;
+
+ OutlineSlideItem* item = slideItem( pos );
+ if( !item ) return;
+ OutlineSlideItem* temp = dynamic_cast<OutlineSlideItem*>(item->nextSibling());
+
+ delete item;
+
+ for ( item = temp; item; item = dynamic_cast<OutlineSlideItem*>( item->nextSibling() ) )
+ item->updateTitle();
+}
+
+void KPrOutline::itemClicked( QListViewItem *item )
+{
+ if( !item ) return;
+
+ // check if we need to show chosen slide
+ OutlineSlideItem* slideItem = dynamic_cast<OutlineSlideItem*>(item);
+ if( slideItem )
+ {
+ KPrPage* page = slideItem->page();
+ if( !page ) return;
+ if ( !m_viewMasterPage )
+ emit showPage( m_doc->pageList().findRef( page ) );
+ }
+
+ // check if we need to show chosen object
+ OutlineObjectItem* objectItem = dynamic_cast<OutlineObjectItem*>(item);
+ if( objectItem )
+ {
+ KPrObject *object = objectItem->object();
+ if( !object ) return;
+
+ // ensure the owner slide is shown first
+ OutlineSlideItem* slideItem = dynamic_cast<OutlineSlideItem*>(objectItem->parent());
+ if( slideItem && m_doc->activePage() != slideItem->page() )
+ {
+ KPrPage* page = slideItem->page();
+ if( !page ) return;
+ if ( !m_viewMasterPage )
+ emit showPage( m_doc->pageList().findRef( page ) );
+ }
+
+ // select the object, make sure it's visible
+ m_doc->deSelectAllObj();
+ m_view->getCanvas()->selectObj( object );
+ m_view->showObjectRect( object );
+ m_doc->repaint( false );
+ }
+}
+
+/**
+ * The listview no longer moves the item by itself. It just calls m_doc->movePage
+ * which then moves the item. At the moment the method only works as long as
+ * only one object is moves.
+ * When an item is about to move (using drag-and-drop), it makes shure that
+ * it's not moved right after an object.
+ */
+void KPrOutline::slotDropped( QDropEvent * /* e */, QListViewItem *parent, QListViewItem *target )
+{
+ kdDebug(33001) << "slotDropped" << endl;
+ /* slide doesn't have parent (always 0)
+ * Only slides can move at the moment, objects can't. */
+ if ( parent )
+ return;
+
+ // This code is taken from KListView
+ for (QListViewItem *i = firstChild(), *iNext = 0; i != 0; i = iNext)
+ {
+ iNext = i->itemBelow();
+ if ( !i->isSelected() )
+ continue;
+
+ // don't drop an item after itself, or else
+ // it moves to the top of the list
+ if ( i == target )
+ continue;
+
+ i->setSelected( false );
+
+ // don't move the item as it is allready
+ moveItem(i, parent, target );
+
+ // Only one item can be moved
+ break;
+ }
+}
+
+// We have to overwrite this method as it checks if an item is movable
+// and we have disabled it.
+bool KPrOutline::acceptDrag( QDropEvent* e ) const
+{
+ return acceptDrops() && (e->source()==viewport());
+}
+
+
+void KPrOutline::setCurrentPage( int pg )
+{
+ OutlineSlideItem *item = slideItem( pg );
+ if( item && ( item!=currentItem()->parent() ) )
+ {
+ blockSignals( true );
+ setCurrentItem( item );
+ setSelected( item, true );
+ ensureItemVisible( item );
+ blockSignals( false );
+ }
+}
+
+void KPrOutline::contentsDropEvent( QDropEvent *e )
+{
+ disconnect( this, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) );
+ KListView::contentsDropEvent( e );
+ connect( this, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) );
+}
+
+void KPrOutline::moveItem( QListViewItem *i, QListViewItem *, QListViewItem *newAfter )
+{
+ OutlineSlideItem* srcItem = dynamic_cast<OutlineSlideItem*>( i );
+ if ( !srcItem )
+ return;
+
+ int num = m_doc->pageList().findRef( srcItem->page() );
+
+ int numNow = 0;
+ if ( newAfter )
+ {
+ OutlineSlideItem* dstItem = dynamic_cast<OutlineSlideItem*>( newAfter );
+ if( !dstItem )
+ return;
+
+ numNow = m_doc->pageList().findRef( dstItem->page() );
+ if ( numNow < num )
+ numNow++;
+ }
+
+ if ( num!=numNow )
+ m_doc->movePage( num, numNow );
+}
+
+void KPrOutline::rightButtonPressed( QListViewItem *, const QPoint &pnt, int )
+{
+ if ( !m_doc->isReadWrite() || m_viewMasterPage ) return;
+
+ QListViewItem *item = QListView::selectedItem();
+ if( !item ) return;
+
+ OutlineSlideItem* slideItem = dynamic_cast<OutlineSlideItem*>(item);
+
+ if( slideItem ) {
+ m_view->openPopupMenuSideBar(pnt);
+ } else {
+ OutlineObjectItem* objectItem = dynamic_cast<OutlineObjectItem*>(item);
+ if( objectItem )
+ {
+ KPrObject * kpobject = objectItem->object();
+
+ if( !kpobject ) {
+ return;
+ }
+
+ KPrCanvas* canvas = static_cast<KPrCanvas*>(m_view->canvas());
+ canvas->deSelectAllObj();
+ canvas->selectObj( kpobject );
+
+ canvas->objectPopup( kpobject, pnt );
+ }
+ }
+}
+
+void KPrOutline::slotContextMenu( KListView*, QListViewItem* item, const QPoint& p )
+{
+ rightButtonPressed( item, p, 0 );
+}
+
+void KPrOutline::renamePageTitle()
+{
+ QListViewItem *item = QListView::selectedItem();
+ if( !item || m_viewMasterPage) return;
+
+ OutlineSlideItem* slideItem = dynamic_cast<OutlineSlideItem*>(item);
+ if( !slideItem ) return;
+
+ KPrPage* page = slideItem->page();
+ if( !page ) return;
+
+ bool ok = false;
+ QString activeTitle = item->text( 0 );
+
+ QStringList page_titles;
+ KPrPage *it;
+ for ( it = m_doc->pageList().first(); it; it = m_doc->pageList().next() )
+ if ( it->pageTitle() != activeTitle )
+ page_titles.append( it->pageTitle() );
+
+ KPrRenamePageValidator validator( page_titles );
+ QString newTitle = KInputDialog::getText( i18n("Rename Slide"),
+ i18n("Slide title:"), activeTitle, &ok, this, 0,
+ &validator );
+
+ // Have a different name ?
+ if ( ok ) { // User pushed an OK button.
+ if ( newTitle != activeTitle ) { // Title changed.
+ KPrChangeTitlePageNameCommand *cmd=new KPrChangeTitlePageNameCommand( i18n("Rename Slide"),
+ m_doc, activeTitle, newTitle.stripWhiteSpace(), page );
+ cmd->execute();
+ m_doc->addCommand(cmd);
+ }
+ }
+}
+
+QDragObject* KPrOutline::dragObject()
+{
+ if( !selectedItem()->dragEnabled() ) {
+ return 0;
+ }
+
+ return KListView::dragObject();
+}
+
+#include "KPrSideBar.moc"
diff --git a/kpresenter/KPrSideBar.h b/kpresenter/KPrSideBar.h
new file mode 100644
index 000000000..b11b8d5a3
--- /dev/null
+++ b/kpresenter/KPrSideBar.h
@@ -0,0 +1,182 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef SIDEBAR_H
+#define SIDEBAR_H
+
+#include <qrect.h>
+#include <qstringlist.h>
+#include <qtabwidget.h>
+#include <qvalidator.h>
+
+#include <kiconview.h>
+#include <klistview.h>
+
+class QListViewItem;
+class KPrDocument;
+class KPrView;
+class QDropEvent;
+class QPopupMenu;
+class KPrOutline;
+class OutlineSlideItem;
+class KPrThumbBar;
+class ThumbToolTip;
+class KPrPage;
+
+
+class KPrRenamePageValidator : public QValidator
+{
+ public:
+ KPrRenamePageValidator( const QStringList & list=QStringList() )
+ : QValidator( 0, 0 ), mStringList( list ) {}
+ virtual State validate( QString & input, int & pos ) const;
+
+ protected:
+ QStringList mStringList;
+};
+
+class KPrSideBarBase
+{
+public:
+ KPrSideBarBase(KPrDocument *_doc, KPrView *_view);
+ void setViewMasterPage( bool _b );
+protected:
+ KPrDocument *m_doc;
+ KPrView *m_view;
+ bool m_viewMasterPage;
+};
+
+class KPrThumbBar : public KIconView, public KPrSideBarBase
+{
+ Q_OBJECT
+
+public:
+ KPrThumbBar(QWidget *parent, KPrDocument *d, KPrView *v);
+ ~KPrThumbBar();
+ void setCurrentPage( int pg );
+ void updateItem( int pagenr, bool sticky = false );
+ void addItem( int pos );
+ void moveItem( int oldPos, int newPos );
+ void removeItem( int pos );
+ void refreshItems ( bool offset = false );
+ QRect tip(const QPoint &pos, QString &title);
+
+ bool uptodate;
+
+signals:
+ void showPage( int i );
+
+public slots:
+ void rebuildItems();
+
+private slots:
+ void itemClicked(QIconViewItem *i);
+ void slotContentsMoving(int x, int y);
+ void slotRefreshItems();
+
+private:
+ QPixmap getSlideThumb(int slideNr) const;
+
+ ThumbToolTip *m_thumbTip;
+ int m_offsetX;
+ int m_offsetY;
+};
+
+class KPrOutline: public KListView, public KPrSideBarBase
+{
+ Q_OBJECT
+
+public:
+ KPrOutline( QWidget *parent, KPrDocument *d, KPrView *v );
+ ~KPrOutline();
+ void setCurrentPage( int pg );
+ QSize sizeHint() const { return QSize( 145, KListView::sizeHint().height() ); }
+ void updateItem( int pagenr, bool sticky = false);
+ void addItem( int pos );
+ void moveItem( int oldPos, int newPos );
+ void removeItem( int pos );
+
+protected:
+ void contentsDropEvent( QDropEvent *e );
+ void moveItem( QListViewItem *i, QListViewItem *firstAfter, QListViewItem *newAfter );
+ OutlineSlideItem* slideItem( int pageNumber );
+ bool acceptDrag( QDropEvent* e ) const;
+
+ virtual QDragObject* dragObject();
+
+signals: // all page numbers 0-based
+ void showPage( int i );
+ void movePage( int from, int to );
+ void selectPage( int i, bool );
+
+public slots:
+ void rebuildItems();
+ void renamePageTitle();
+
+private slots:
+ void itemClicked( QListViewItem *i );
+ void slotDropped( QDropEvent *e, QListViewItem *parent, QListViewItem *target );
+ void rightButtonPressed( QListViewItem *i, const QPoint &pnt, int c );
+ void slotContextMenu( KListView*, QListViewItem *item, const QPoint &p );
+
+private:
+ QListViewItem *m_movedItem, *m_movedAfter;
+};
+
+class KPrSideBar: public QTabWidget
+{
+ Q_OBJECT
+
+public:
+ KPrSideBar(QWidget *parent, KPrDocument *d, KPrView *v);
+ void setCurrentPage( int pg ) {
+ m_outline->setCurrentPage(pg);
+ m_thb->setCurrentPage(pg);
+ };
+ void setOn( int , bool ) { };
+ //QSize sizeHint() const { return QSize( 120, QTabWidget::sizeHint().height() ); };
+ void updateItem( KPrPage *page );
+ void addItem( int pos );
+ void moveItem( int oldPos, int newPos );
+ void removeItem( int pos );
+
+ KPrOutline *outline() const { return m_outline; };
+ KPrThumbBar *thumbBar() const { return m_thb; };
+
+ void setViewMasterPage( bool _masterPage );
+signals: // all page numbers 0-based
+ void showPage( int i );
+ void movePage( int from, int to );
+ void selectPage( int i, bool );
+
+public slots:
+ //void rebuildItems() { m_outline->rebuildItems(); m_thb->rebuildItems();};
+ void renamePageTitle() { m_outline->renamePageTitle(); };
+ void currentChanged(QWidget *tab);
+
+private:
+ KPrOutline *m_outline;
+ KPrThumbBar *m_thb;
+
+ KPrDocument *m_doc;
+ KPrView *m_view;
+};
+
+#endif
diff --git a/kpresenter/KPrSlideTransitionDia.cpp b/kpresenter/KPrSlideTransitionDia.cpp
new file mode 100644
index 000000000..ba15c4fb1
--- /dev/null
+++ b/kpresenter/KPrSlideTransitionDia.cpp
@@ -0,0 +1,413 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Ariya Hidayat <ariya@kde.org>
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrSlideTransitionDia.h"
+
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <knuminput.h>
+#include <kstandarddirs.h>
+#include <kurlrequester.h>
+
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qimage.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+
+#include "KPrBackground.h"
+#include "KPrCanvas.h"
+#include "KPrCommand.h"
+#include "KPrDocument.h"
+#include "KPrSoundPlayer.h"
+#include "KPrView.h"
+#include "KPrPage.h"
+#include "KPrPageEffects.h"
+#include "slidetransitionwidget.h"
+
+KPrSlideTransitionDia::KPrSlideTransitionDia( QWidget *parent, const char *name, KPrView *view )
+: KDialogBase( parent, name, true, i18n( "Slide Transition" ), User1|Ok|Cancel, Ok, true )
+, m_dialog( new SlideTransitionWidget( this ) ), m_view( view ), m_soundPlayer(0), m_pageEffect( 0 )
+{
+ int pgnum = m_view->getCurrPgNum() - 1;
+ KPrPage *page = m_view->kPresenterDoc()->pageList().at( pgnum );
+ m_effect = page->getPageEffect();
+ m_effectSpeed = page->getPageEffectSpeed();
+ m_soundEffect = page->getPageSoundEffect();
+ m_soundFileName = page->getPageSoundFileName();
+ m_slideTime = page->getPageTimer();
+
+ // draw preview pix
+ m_view->getCanvas()->drawPageInPix( m_pixmap, pgnum, 60 );
+ int w = m_pixmap.width();
+ int h = m_pixmap.height();
+
+ if ( w > h )
+ {
+ h = 300 * h / w;
+ w = 300;
+ }
+ else
+ {
+ w = 300 * w / h;
+ h = 300;
+ }
+
+ const QImage img(m_pixmap.convertToImage().smoothScale( w, h ));
+ m_pixmap.convertFromImage(img);
+
+ m_dialog->previewPixmap->setPixmap( m_pixmap );
+ m_dialog->previewPixmap->setFixedSize( w, h );
+ m_target.resize( m_pixmap.size() );
+ m_target.fill( Qt::black );
+
+ // fill effect combo
+ m_dialog->effectCombo->insertItem( i18n( "No Effect" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Close Horizontal" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Close Vertical" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Close From All Directions" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Open Horizontal" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Open Vertical" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Open From All Directions" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Interlocking Horizontal 1" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Interlocking Horizontal 2" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Interlocking Vertical 1" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Interlocking Vertical 2" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Surround 1" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Fly Away 1" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Blinds Horizontal" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Blinds Vertical" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Box In" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Box Out" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Checkerboard Across" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Checkerboard Down" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Cover Down" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Uncover Down" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Cover Up" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Uncover Up" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Cover Left" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Uncover Left" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Cover Right" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Uncover Right" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Cover Left-Up" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Uncover Left-Up" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Cover Left-Down" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Uncover Left-Down" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Cover Right-Up" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Uncover Right-Up" ) );
+ //TODO change the strings to use Down instead of Bottome to make them consistent
+ m_dialog->effectCombo->insertItem( i18n( "Cover Right-Bottom" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Uncover Right-Bottom" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Dissolve" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Strips Left-Up" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Strips Left-Down" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Strips Right-Up" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Strips Right-Down" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Melting" ) );
+ m_dialog->effectCombo->insertItem( i18n( "Random Transition" ) );
+ m_dialog->effectCombo->setCurrentItem( static_cast<int>( m_effect ) );
+
+ // workaround, because Random Effect is always negative
+ if( m_effect == PEF_RANDOM )
+ m_dialog->effectCombo->setCurrentItem( m_dialog->effectCombo->count()-1 );
+
+ connect( m_dialog->effectCombo, SIGNAL( activated( int ) ), this, SLOT( effectChanged( int ) ) );
+
+ // setup speed combo
+ m_dialog->speedCombo->insertItem( i18n("Slow") );
+ m_dialog->speedCombo->insertItem( i18n("Medium") );
+ m_dialog->speedCombo->insertItem( i18n("Fast") );
+
+ m_dialog->speedCombo->setCurrentItem( m_effectSpeed );
+
+ connect( m_dialog->speedCombo, SIGNAL( activated( int ) ), this, SLOT( effectChanged( int ) ) );
+
+ // set up sound
+ m_dialog->soundCheckBox->setChecked( m_soundEffect );
+ m_dialog->soundRequester->setURL( m_soundFileName );
+ soundEffectChanged();
+ m_dialog->playButton->setIconSet( SmallIconSet( "player_play" ) );
+ m_dialog->stopButton->setIconSet( SmallIconSet( "player_stop" ) );
+ connect( m_dialog->playButton, SIGNAL( clicked() ), this, SLOT( playSound() ) );
+ connect( m_dialog->stopButton, SIGNAL( clicked() ), this, SLOT( stopSound() ) );
+
+ connect( m_dialog->soundCheckBox, SIGNAL( clicked()), this, SLOT( soundEffectChanged() ) );
+ connect( m_dialog->soundRequester, SIGNAL( openFileDialog( KURLRequester * ) ), this, SLOT( slotRequesterClicked( KURLRequester * ) ) );
+ connect( m_dialog->soundRequester, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotSoundFileChanged( const QString& ) ) );
+
+ // set up automatic tansition
+ m_dialog->automaticTransitionInput->setRange( 1, 600, 1 );
+ m_dialog->automaticTransitionInput->setValue( m_slideTime );
+
+ // set up preview button
+ connect( m_dialog->previewButton, SIGNAL( clicked() ), this, SLOT( preview() ) );
+
+ setButtonText(KDialogBase::User1,i18n( "Apply &Global" ));
+
+ connect( this, SIGNAL( okClicked() ), this, SLOT( slotOk() ) );
+ connect( this, SIGNAL( user1Clicked() ), this, SLOT( slotUser1() ) );
+
+ setMainWidget( m_dialog );
+}
+
+
+KPrSlideTransitionDia::~KPrSlideTransitionDia()
+{
+ delete m_dialog;
+}
+
+
+void KPrSlideTransitionDia::effectChanged( int )
+{
+ preview();
+}
+
+
+void KPrSlideTransitionDia::preview()
+{
+ PageEffect effect = static_cast<PageEffect>( m_dialog->effectCombo->currentItem() );
+ if ( m_dialog->effectCombo->currentText() == i18n( "Random Transition" ) )
+ effect = PEF_RANDOM;
+
+ EffectSpeed effectSpeed = static_cast<EffectSpeed>( m_dialog->speedCombo->currentItem() );
+
+ if ( m_pageEffect )
+ {
+ m_pageEffectTimer.stop();
+ QObject::disconnect( &m_pageEffectTimer, SIGNAL( timeout() ), this, SLOT( slotDoPageEffect() ) );
+
+ m_pageEffect->finish();
+
+ delete m_pageEffect;
+ m_pageEffect = 0;
+ m_dialog->previewPixmap->repaint();
+ }
+
+ m_pageEffect = new KPrPageEffects( m_dialog->previewPixmap, m_target, effect, effectSpeed );
+ if ( m_pageEffect->doEffect() )
+ {
+ delete m_pageEffect;
+ m_pageEffect = 0;
+ m_dialog->previewPixmap->update();
+ }
+ else
+ {
+ connect( &m_pageEffectTimer, SIGNAL( timeout() ), SLOT( slotDoPageEffect() ) );
+ m_pageEffectTimer.start( 50, true );
+ }
+}
+
+
+void KPrSlideTransitionDia::slotDoPageEffect()
+{
+ if ( m_pageEffect->doEffect() )
+ {
+ m_pageEffectTimer.stop();
+ QObject::disconnect( &m_pageEffectTimer, SIGNAL( timeout() ), this, SLOT( slotDoPageEffect() ) );
+ delete m_pageEffect;
+ m_pageEffect = 0;
+ m_dialog->previewPixmap->update();
+ }
+ else
+ {
+ m_pageEffectTimer.start( 50, true );
+ }
+}
+
+
+void KPrSlideTransitionDia::slotRequesterClicked( KURLRequester * )
+{
+ QString filter( getSoundFileFilter() );
+ m_dialog->soundRequester->fileDialog()->setFilter( filter );
+
+ // find the first "sound"-resource that contains files
+ QStringList soundDirs = KGlobal::dirs()->resourceDirs( "sound" );
+ if ( !soundDirs.isEmpty() ) {
+ KURL soundURL;
+ QDir dir;
+ dir.setFilter( QDir::Files | QDir::Readable );
+ QStringList::ConstIterator it = soundDirs.begin();
+ while ( it != soundDirs.end() ) {
+ dir = *it;
+ if ( dir.isReadable() && dir.count() > 2 ) {
+ soundURL.setPath( *it );
+ m_dialog->soundRequester->fileDialog()->setURL( soundURL );
+ break;
+ }
+ ++it;
+ }
+ }
+}
+
+
+QString KPrSlideTransitionDia::getSoundFileFilter()
+{
+ QStringList fileList;
+ fileList << "wav" << "au" << "mp3" << "mp1" << "mp2" << "mpg" << "dat"
+ << "mpeg" << "ogg" << "cdda" << "cda " << "vcd" << "null";
+ fileList.sort();
+
+ bool comma = false;
+ QString full, str;
+ for ( QStringList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it ) {
+ if ( comma )
+ str += '\n';
+ comma = true;
+ str += QString( i18n( "*.%1|%2 Files" ) ).arg( *it ).arg( (*it).upper() );
+
+ full += QString( "*.") + (*it) + ' ';
+ }
+
+ str = full + '|' + i18n( "All Supported Files" ) + '\n' + str;
+ str += "\n*|" + i18n( "All Files" );
+
+ return str;
+}
+
+
+void KPrSlideTransitionDia::soundEffectChanged()
+{
+ bool soundEffect = m_dialog->soundCheckBox->isChecked();
+
+ m_dialog->soundLabel->setEnabled( soundEffect );
+ m_dialog->soundRequester->setEnabled( soundEffect );
+
+ if ( !m_dialog->soundRequester->url().isEmpty() ) {
+ m_dialog->playButton->setEnabled( soundEffect );
+ m_dialog->stopButton->setEnabled( soundEffect );
+ }
+ else {
+ m_dialog->playButton->setEnabled( false );
+ m_dialog->stopButton->setEnabled( false );
+ }
+}
+
+
+void KPrSlideTransitionDia::slotSoundFileChanged( const QString& text )
+{
+ m_dialog->playButton->setEnabled( !text.isEmpty() );
+ m_dialog->stopButton->setEnabled( !text.isEmpty() );
+}
+
+
+void KPrSlideTransitionDia::slotOk()
+{
+ apply( false );
+}
+
+
+void KPrSlideTransitionDia::slotUser1()
+{
+ apply( true );
+}
+
+
+void KPrSlideTransitionDia::apply( bool global )
+{
+ PageEffect effect = static_cast<PageEffect>( m_dialog->effectCombo->currentItem() );
+ if ( m_dialog->effectCombo->currentText() == i18n( "Random Transition" ) )
+ effect = PEF_RANDOM;
+
+ EffectSpeed effectSpeed = static_cast<EffectSpeed>( m_dialog->speedCombo->currentItem() );
+ bool soundEffect = m_dialog->soundCheckBox->isChecked();
+ QString soundFileName = m_dialog->soundRequester->url();
+ int slideTime = m_dialog->automaticTransitionInput->value();
+
+ if ( effect != m_effect ||
+ effectSpeed != m_effectSpeed ||
+ soundEffect != m_soundEffect ||
+ soundFileName != m_soundFileName ||
+ slideTime != m_slideTime )
+ {
+ KPrTransEffectCmd::PageEffectSettings newSettings;
+
+ newSettings.pageEffect = effect;
+ newSettings.effectSpeed = effectSpeed;
+ newSettings.soundEffect = soundEffect;
+ newSettings.soundFileName = soundFileName;
+ newSettings.autoAdvance = /*TODO */ false;
+ newSettings.slideTime = slideTime;
+
+ // Collect info about current settings
+ QValueVector<KPrTransEffectCmd::PageEffectSettings> oldSettings;
+ KPrPage *page = 0;
+ if ( global )
+ {
+ oldSettings.resize( m_view->kPresenterDoc()->getPageList().count() );
+ int i = 0;
+ for( QPtrListIterator<KPrPage> it( m_view->kPresenterDoc()->getPageList() ); *it; ++it, ++i )
+ {
+ oldSettings[i].pageEffect = it.current()->getPageEffect();
+ oldSettings[i].effectSpeed = it.current()->getPageEffectSpeed();
+ oldSettings[i].soundEffect = it.current()->getPageSoundEffect();
+ oldSettings[i].soundFileName = it.current()->getPageSoundFileName();
+ oldSettings[i].autoAdvance = /*TODO it.current()->getAutoAdvance() */ false;
+ oldSettings[i].slideTime = it.current()->getPageTimer();
+ }
+ }
+ else
+ {
+ int pgnum = m_view->getCurrPgNum() - 1;
+ page = m_view->kPresenterDoc()->pageList().at( pgnum );
+ oldSettings.resize( 1 );
+ oldSettings[0].pageEffect = page->getPageEffect();
+ oldSettings[0].effectSpeed = page->getPageEffectSpeed();
+ oldSettings[0].soundEffect = page->getPageSoundEffect();
+ oldSettings[0].soundFileName = page->getPageSoundFileName();
+ oldSettings[0].autoAdvance = /*TODO page->getAutoAdvance() */ false;
+ oldSettings[0].slideTime = page->getPageTimer();
+ }
+ KPrTransEffectCmd *transEffectCmd = new KPrTransEffectCmd( oldSettings, newSettings,
+ global ? 0 : page, m_view->kPresenterDoc() );
+ transEffectCmd->execute();
+ m_view->kPresenterDoc()->addCommand( transEffectCmd );
+ }
+
+ accept();
+}
+
+
+void KPrSlideTransitionDia::playSound()
+{
+ delete m_soundPlayer;
+
+ m_soundPlayer = new KPrSoundPlayer( m_dialog->soundRequester->url() );
+ m_soundPlayer->play();
+
+ m_dialog->playButton->setEnabled( false );
+ m_dialog->stopButton->setEnabled( true );
+}
+
+
+void KPrSlideTransitionDia::stopSound()
+{
+ if ( m_soundPlayer ) {
+ m_soundPlayer->stop();
+ delete m_soundPlayer;
+ m_soundPlayer = 0;
+
+ m_dialog->playButton->setEnabled( true );
+ m_dialog->stopButton->setEnabled( false );
+ }
+}
+
+
+#include "KPrSlideTransitionDia.moc"
diff --git a/kpresenter/KPrSlideTransitionDia.h b/kpresenter/KPrSlideTransitionDia.h
new file mode 100644
index 000000000..df1c0b376
--- /dev/null
+++ b/kpresenter/KPrSlideTransitionDia.h
@@ -0,0 +1,79 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Ariya Hidayat <ariya@kde.org>
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef SLIDETRANSITIONDIA_H
+#define SLIDETRANSITIONDIA_H
+
+#include <qtimer.h>
+#include <qwidget.h>
+
+#include <kdialogbase.h>
+
+#include "global.h"
+
+class KPrPageEffects;
+class KPrView;
+class KPrSoundPlayer;
+class KURLRequester;
+class SlideTransitionWidget;
+
+class KPrSlideTransitionDia : public KDialogBase
+{
+ Q_OBJECT
+public:
+ KPrSlideTransitionDia( QWidget *parent, const char *name, KPrView *view );
+ ~KPrSlideTransitionDia();
+
+protected:
+ void apply( bool global );
+ // TODO reuse
+ QString getSoundFileFilter();
+
+ SlideTransitionWidget *m_dialog;
+ KPrView *m_view;
+ KPrSoundPlayer *m_soundPlayer;
+
+ PageEffect m_effect;
+ EffectSpeed m_effectSpeed;
+ bool m_soundEffect;
+ QString m_soundFileName;
+ int m_slideTime;
+
+ KPrPageEffects *m_pageEffect;
+ QTimer m_pageEffectTimer;
+ QPixmap m_pixmap;
+ QPixmap m_target;
+
+protected slots:
+ void effectChanged( int );
+ void playSound();
+ void stopSound();
+ void preview();
+ void slotDoPageEffect();
+ void slotOk();
+ void slotRequesterClicked( KURLRequester * );
+ void slotSoundFileChanged( const QString& text );
+ void slotUser1();
+ void soundEffectChanged();
+};
+
+
+#endif /* SLIDETRANSITIONDIA_H */
diff --git a/kpresenter/KPrSoundPlayer.cpp b/kpresenter/KPrSoundPlayer.cpp
new file mode 100644
index 000000000..f35d6d3fa
--- /dev/null
+++ b/kpresenter/KPrSoundPlayer.cpp
@@ -0,0 +1,111 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+
+base code from kaudioplayer.h, kaudioplayer.cpp
+Copyright (C) 2000 Stefan Westerfeld
+stefan@space.twc.de
+
+and konq_sound.h konq_sound.cc
+Copyright (c) 2001 Malte Starostik <malte@kde.org>
+
+This file's authors :
+Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public License
+along with this library; see the file COPYING.LIB. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <config.h>
+
+#ifndef WITHOUT_ARTS
+#include <kartsdispatcher.h>
+#include <kplayobjectfactory.h>
+#include <soundserver.h>
+#endif
+
+#include <kdebug.h>
+
+#include "KPrSoundPlayer.h"
+
+using namespace std;
+
+class KPresenterSoundPlayerPrivate {
+public:
+ QString fileName;
+
+ KPresenterSoundPlayerPrivate( QString fileName ) : fileName( fileName ) {};
+
+#ifndef WITHOUT_ARTS
+ KArtsDispatcher m_dispatche;
+ Arts::SoundServerV2 m_soundServer;
+ KPlayObjectFactory *m_factory;
+ KPlayObject *m_player;
+#endif
+};
+
+KPrSoundPlayer::KPrSoundPlayer( const QString &fileName, QObject *parent, const char *name )
+ : QObject( parent, name )
+{
+ d = new KPresenterSoundPlayerPrivate( fileName );
+
+#ifndef WITHOUT_ARTS
+ d->m_soundServer = Arts::Reference( "global:Arts_SoundServerV2" );
+ d->m_factory = new KPlayObjectFactory( d->m_soundServer );
+ d->m_player = 0;
+#endif
+}
+
+KPrSoundPlayer::~KPrSoundPlayer()
+{
+#ifndef WITHOUT_ARTS
+ delete d->m_player;
+ delete d->m_factory;
+#endif
+ delete d;
+}
+
+void KPrSoundPlayer::play( const QString &fileName )
+{
+ KPrSoundPlayer sp( fileName );
+ sp.play();
+}
+
+void KPrSoundPlayer::stop()
+{
+#ifndef WITHOUT_ARTS
+ delete d->m_player;
+ d->m_player = 0;
+#endif
+}
+
+void KPrSoundPlayer::play()
+{
+#ifndef WITHOUT_ARTS
+ if ( d->m_soundServer.isNull() )
+ return;
+
+ delete d->m_player;
+
+ d->m_player = d->m_factory->createPlayObject( d->fileName, true );
+ if ( d->m_player ) {
+ if ( d->m_player->object().isNull() )
+ stop();
+ else
+ d->m_player->play();
+ }
+#endif
+}
+
+#include "KPrSoundPlayer.moc"
diff --git a/kpresenter/KPrSoundPlayer.h b/kpresenter/KPrSoundPlayer.h
new file mode 100644
index 000000000..59d5d0847
--- /dev/null
+++ b/kpresenter/KPrSoundPlayer.h
@@ -0,0 +1,63 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+
+base code from kaudioplayer.h, kaudioplayer.cpp
+Copyright (C) 2000 Stefan Westerfeld
+stefan@space.twc.de
+
+and konq_sound.h konq_sound.cc
+Copyright (c) 2001 Malte Starostik <malte@kde.org>
+
+This file's authors :
+Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public License
+along with this library; see the file COPYING.LIB. If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpresenter_sound_player_h
+#define kpresenter_sound_player_h
+
+#include <qobject.h>
+
+
+/*
+ namespace Arts
+ {
+ class SoundServerV2;
+ class KArtsDispatcher;
+ calss KPlayObjectFactory;
+ calss KPlayObject;
+ }
+*/
+class KPrSoundPlayer : public QObject
+{
+ Q_OBJECT
+public:
+ KPrSoundPlayer( const QString &fileName, QObject *parent = 0, const char *name = 0 );
+
+ ~KPrSoundPlayer();
+
+ void play( const QString &fileName );
+ void stop();
+
+public slots:
+ void play();
+
+private:
+ class KPresenterSoundPlayerPrivate *d;
+};
+
+#endif // kpresenter_sound_player_h
diff --git a/kpresenter/KPrStyleManager.cpp b/kpresenter/KPrStyleManager.cpp
new file mode 100644
index 000000000..376353883
--- /dev/null
+++ b/kpresenter/KPrStyleManager.cpp
@@ -0,0 +1,61 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent Montel <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrDocument.h"
+#include "KPrStyleManager.h"
+#include "KPrStyleManager.moc"
+#include <KoUnit.h>
+#include <kdebug.h>
+#include <KoStyleManager.h>
+#include <KoStyleCollection.h>
+
+KPrStyleManager::KPrStyleManager( QWidget *_parent, KoUnit::Unit unit,KPrDocument *_doc,
+ const KoStyleCollection& styleCollection, const QString & activeStyleName)
+ : KoStyleManager(_parent,unit,styleCollection,activeStyleName)
+{
+ m_doc = _doc;
+}
+
+KoParagStyle* KPrStyleManager::addStyleTemplate(KoParagStyle *style)
+{
+ m_doc->setModified( true );
+ return m_doc->styleCollection()->addStyle(style);
+}
+
+void KPrStyleManager::applyStyleChange( KoStyleChangeDefMap changed )
+{
+ m_doc->applyStyleChange( changed );
+}
+
+void KPrStyleManager::removeStyleTemplate( KoParagStyle *style )
+{
+ m_doc->setModified( true );
+ m_doc->styleCollection()->removeStyle(style);
+}
+
+void KPrStyleManager::updateAllStyleLists()
+{
+ m_doc->updateAllStyleLists();
+}
+
+void KPrStyleManager::updateStyleListOrder( const QStringList & list)
+{
+ m_doc->updateStyleListOrder( list );
+}
diff --git a/kpresenter/KPrStyleManager.h b/kpresenter/KPrStyleManager.h
new file mode 100644
index 000000000..953f2a8c9
--- /dev/null
+++ b/kpresenter/KPrStyleManager.h
@@ -0,0 +1,49 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent Montel <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kprstylemanager_h
+#define kprstylemanager_h
+
+#include <kdialogbase.h>
+#include <qstringlist.h>
+#include <KoStyleManager.h>
+
+class KPrDocument;
+class KoParagStyle;
+class KoUnit;
+
+class KPrStyleManager : public KoStyleManager
+{
+ Q_OBJECT
+
+public:
+ KPrStyleManager( QWidget *_parent, KoUnit::Unit unit,KPrDocument *_doc,
+ const KoStyleCollection & styleCollection, const QString & activeStyleName );
+
+ virtual KoParagStyle* addStyleTemplate(KoParagStyle *style);
+ virtual void applyStyleChange( KoStyleChangeDefMap changed );
+ virtual void removeStyleTemplate( KoParagStyle *style );
+ virtual void updateAllStyleLists();
+ virtual void updateStyleListOrder( const QStringList & list);
+protected:
+ KPrDocument *m_doc;
+};
+
+#endif
diff --git a/kpresenter/KPrTextDocument.cpp b/kpresenter/KPrTextDocument.cpp
new file mode 100644
index 000000000..51a5be7fe
--- /dev/null
+++ b/kpresenter/KPrTextDocument.cpp
@@ -0,0 +1,103 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Laurent Montel <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrTextDocument.h"
+
+#include "KPrDocument.h"
+#include "KPrTextObject.h"
+#include <KoTextParag.h>
+#include <kdebug.h>
+
+#include "KPrVariableCollection.h"
+
+#include <KoOasisContext.h>
+#include <KoDom.h>
+#include <KoXmlNS.h>
+
+KPrTextDocument::KPrTextDocument( KPrTextObject * textobj, KoTextFormatCollection *fc, KoTextFormatter *formatter )
+ : KoTextDocument( textobj->kPresenterDocument()->zoomHandler(), fc, formatter, true ), m_textobj( textobj )
+{
+ //kdDebug(33001) << "KPrTextDocument constructed " << this << " KPrTextObject:" << textobj << endl;
+}
+
+KPrTextDocument::~KPrTextDocument()
+{
+}
+
+
+bool KPrTextDocument::loadSpanTag( const QDomElement& tag, KoOasisContext& context,
+ KoTextParag* parag, uint pos,
+ QString& textData, KoTextCustomItem* & customItem )
+{
+ const QString localName( tag.localName() );
+ const bool isTextNS = tag.namespaceURI() == KoXmlNS::text;
+ kdDebug( 32500 ) << "KPrTextDocument::loadSpanTag: " << localName << endl;
+
+ if ( isTextNS )
+ {
+ if ( localName == "a" )
+ {
+ QString href( tag.attributeNS( KoXmlNS::xlink, "href", QString::null ) );
+ if ( href.startsWith( "#" ) )
+ {
+ context.styleStack().save();
+ // We have a reference to a bookmark (### TODO)
+ // As we do not support it now, treat it as a <span> without formatting
+ parag->loadOasisSpan( tag, context, pos ); // recurse
+ context.styleStack().restore();
+ }
+ else
+ {
+ // The text is contained in a <span> inside the <a> element. In theory
+ // we could have multiple spans there, but OO ensures that there is always only one,
+ // splitting the hyperlink if necessary (at format changes).
+ // Note that we ignore the formatting of the span.
+ QDomElement spanElem = KoDom::namedItemNS( tag, KoXmlNS::text, "span" );
+ QString text;
+ if ( spanElem.isNull() )
+ text = tag.text();
+ if ( spanElem.isNull() )
+ text = tag.text();
+ else {
+ // The save/restore of the stack is done by the caller (KoTextParag::loadOasisSpan)
+ // This allows to use the span's format for the variable.
+ //kdDebug(32500) << "filling stack with " << spanElem.attributeNS( KoXmlNS::text, "style-name", QString::null ) << endl;
+ context.fillStyleStack( spanElem, KoXmlNS::text, "style-name", "text" );
+ text = spanElem.text();
+ }
+ textData = KoTextObject::customItemChar(); // hyperlink placeholder
+ // unused tag.attributeNS( KoXmlNS::office, "name", QString::null )
+ KoVariableCollection& coll = context.variableCollection();
+ customItem = new KoLinkVariable( this, text, href,
+ coll.formatCollection()->format( "STRING" ),
+ &coll );
+ }
+ return true;
+ }
+ }
+ else // non "text:" tags
+ {
+ kdDebug()<<"Extension found tagName : "<< localName <<endl;
+ }
+ return false;
+}
+
+
+#include "KPrTextDocument.moc"
diff --git a/kpresenter/KPrTextDocument.h b/kpresenter/KPrTextDocument.h
new file mode 100644
index 000000000..a3a123c59
--- /dev/null
+++ b/kpresenter/KPrTextDocument.h
@@ -0,0 +1,55 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Laurent Montel <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kprtextdocument_h
+#define kprtextdocument_h
+
+#include <KoRichText.h>
+#include "KoTextDocument.h"
+
+class KPrTextObject;
+class KoTextFormatCollection;
+
+/**
+ * This is our KoTextDocument reimplementation, to relate it
+ * to the textobject it's in.
+ */
+class KPrTextDocument : public KoTextDocument
+{
+ Q_OBJECT
+public:
+ /** A text document inside a kptextobject */
+ KPrTextDocument( KPrTextObject * textobj, KoTextFormatCollection *fc, KoTextFormatter *formatter = 0L );
+
+ ~KPrTextDocument();
+
+ /** Return the text object in which this document is.
+ * Note that this can be 0L (e.g. for paragraphs in the paragdia preview) */
+ KPrTextObject * textObject() const { return m_textobj; }
+ /// Extensions to KoTextParag::loadOasisSpan
+ bool loadSpanTag( const QDomElement& tag, KoOasisContext& context,
+ KoTextParag* parag, uint pos,
+ QString& textData, KoTextCustomItem* & customItem );
+
+private:
+ KPrTextObject * m_textobj;
+};
+
+#endif
diff --git a/kpresenter/KPrTextObject.cpp b/kpresenter/KPrTextObject.cpp
new file mode 100644
index 000000000..74d3ee7e8
--- /dev/null
+++ b/kpresenter/KPrTextObject.cpp
@@ -0,0 +1,2586 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include "KPrTextObject.h"
+#include "KPrTextObject.moc"
+#include "KPrGradient.h"
+#include "KPrCommand.h"
+#include "KPrCanvas.h"
+#include "KPrPage.h"
+#include "KPrView.h"
+#include "KPrDocument.h"
+#include "KPrBgSpellCheck.h"
+#include "KPrVariableCollection.h"
+
+#include <KoAutoFormat.h>
+#include <KoTextParag.h>
+#include <KoTextObject.h>
+#include <KoStyleCollection.h>
+#include <KoTextFormatter.h>
+#include <KoTextZoomHandler.h>
+#include "KPrTextViewIface.h"
+#include "KPrTextObjectIface.h"
+#include <KoOasisContext.h>
+#include <KoStyleStack.h>
+#include <ktempfile.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kdeversion.h>
+#include <kmultipledrag.h>
+
+#include <qfont.h>
+#include <qfile.h>
+#include <qwidget.h>
+#include <qpicture.h>
+#include <qpainter.h>
+#include <qwmatrix.h>
+#include <qdom.h>
+#include <qapplication.h>
+#include <qfontdatabase.h>
+#include <qpopupmenu.h>
+#include <qclipboard.h>
+
+#include <KoParagCounter.h>
+#include <kaction.h>
+#include <KoVariable.h>
+#include <KoCustomVariablesDia.h>
+#include <KoRuler.h>
+#include <KoSize.h>
+#include <KoXmlNS.h>
+#include <KoDom.h>
+#include <KoStore.h>
+#include <KoStoreDrag.h>
+#include <KoOasisStore.h>
+
+#include <float.h>
+using namespace std;
+
+#undef S_NONE // Solaris defines it in sys/signal.h
+
+const QString &KPrTextObject::tagTEXTOBJ=KGlobal::staticQString("TEXTOBJ");
+const QString &KPrTextObject::attrLineSpacing=KGlobal::staticQString("lineSpacing");
+const QString &KPrTextObject::attrParagSpacing=KGlobal::staticQString("paragSpacing");
+const QString &KPrTextObject::attrMargin=KGlobal::staticQString("margin");
+const QString &KPrTextObject::attrBulletType1=KGlobal::staticQString("bulletType1");
+const QString &KPrTextObject::attrBulletType2=KGlobal::staticQString("bulletType2");
+const QString &KPrTextObject::attrBulletType3=KGlobal::staticQString("bulletType3");
+const QString &KPrTextObject::attrBulletType4=KGlobal::staticQString("bulletType4");
+const QString &KPrTextObject::attrBulletColor1=KGlobal::staticQString("bulletColor1");
+const QString &KPrTextObject::attrBulletColor2=KGlobal::staticQString("bulletColor2");
+const QString &KPrTextObject::attrBulletColor3=KGlobal::staticQString("bulletColor3");
+const QString &KPrTextObject::attrBulletColor4=KGlobal::staticQString("bulletColor4");
+const QString &KPrTextObject::tagP=KGlobal::staticQString("P");
+const QString &KPrTextObject::attrAlign=KGlobal::staticQString("align");
+const QString &KPrTextObject::attrType=KGlobal::staticQString("type");
+const QString &KPrTextObject::attrDepth=KGlobal::staticQString("depth");
+const QString &KPrTextObject::tagTEXT=KGlobal::staticQString("TEXT");
+const QString &KPrTextObject::attrFamily=KGlobal::staticQString("family");
+const QString &KPrTextObject::attrPointSize=KGlobal::staticQString("pointSize");
+const QString &KPrTextObject::attrBold=KGlobal::staticQString("bold");
+const QString &KPrTextObject::attrItalic=KGlobal::staticQString("italic");
+const QString &KPrTextObject::attrUnderline=KGlobal::staticQString("underline");
+const QString &KPrTextObject::attrStrikeOut=KGlobal::staticQString("strikeOut");
+const QString &KPrTextObject::attrColor=KGlobal::staticQString("color");
+const QString &KPrTextObject::attrWhitespace=KGlobal::staticQString("whitespace");
+const QString &KPrTextObject::attrTextBackColor=KGlobal::staticQString("textbackcolor");
+const QString &KPrTextObject::attrVertAlign=KGlobal::staticQString("VERTALIGN");
+
+
+KPrTextObject::KPrTextObject( KPrDocument *doc )
+ : KPr2DObject()
+{
+ m_doc=doc;
+ m_textVertAlign = KP_TOP;
+ // Default color should be QColor() ... but kpresenter isn't fully color-scheme-aware yet
+ KoTextFormatCollection* fc = new KoTextFormatCollection( doc->defaultFont(), Qt::black, doc->globalLanguage(), doc->globalHyphenation() );
+ KPrTextDocument * textdoc = new KPrTextDocument( this, fc );
+ if ( m_doc->tabStopValue() != -1 )
+ textdoc->setTabStops( m_doc->zoomHandler()->ptToLayoutUnitPixX( m_doc->tabStopValue() ));
+
+ m_textobj = new KoTextObject( textdoc, m_doc->styleCollection()->findStyle( "Standard" ), this );
+ textdoc->setFlow( this );
+
+ m_doc->backSpeller()->registerNewTextObject( m_textobj );
+ pen = defaultPen();
+ drawEditRect = true;
+ drawEmpty = true;
+ editingTextObj = false;
+
+ bleft = 0.0;
+ btop = 0.0;
+ bright = 0.0;
+ bbottom = 0.0;
+ alignVertical = 0.0;
+
+ connect( m_textobj, SIGNAL( newCommand( KCommand * ) ),
+ SLOT( slotNewCommand( KCommand * ) ) );
+ connect( m_textobj, SIGNAL( availableHeightNeeded() ),
+ SLOT( slotAvailableHeightNeeded() ) );
+ connect( m_textobj, SIGNAL( repaintChanged( KoTextObject* ) ),
+ SLOT( slotRepaintChanged() ) );
+
+ // Send our "repaintChanged" signals to the document.
+ connect( this, SIGNAL( repaintChanged( KPrTextObject * ) ),
+ m_doc, SLOT( slotRepaintChanged( KPrTextObject * ) ) );
+ connect(m_textobj, SIGNAL( showFormatObject(const KoTextFormat &) ),
+ SLOT( slotFormatChanged(const KoTextFormat &)) );
+ connect( m_textobj, SIGNAL( afterFormatting( int, KoTextParag*, bool* ) ),
+ SLOT( slotAfterFormatting( int, KoTextParag*, bool* ) ) );
+ connect( m_textobj, SIGNAL( paragraphDeleted( KoTextParag*) ),
+ SLOT( slotParagraphDeleted(KoTextParag*) ));
+
+}
+
+KPrTextObject::~KPrTextObject()
+{
+ textDocument()->takeFlow();
+ m_doc = 0L;
+}
+
+DCOPObject* KPrTextObject::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrTextObjectIface( this );
+ return dcop;
+}
+
+void KPrTextObject::slotParagraphDeleted(KoTextParag*_parag)
+{
+ m_doc->spellCheckParagraphDeleted( _parag, this);
+}
+
+QBrush KPrTextObject::getBrush() const
+{
+ QBrush tmpBrush( m_brush.getBrush() );
+ if(!tmpBrush.color().isValid())
+ tmpBrush.setColor(QApplication::palette().color( QPalette::Active, QColorGroup::Base ));
+ return tmpBrush;
+}
+
+void KPrTextObject::resizeTextDocument( bool widthChanged, bool heightChanged )
+{
+ if ( heightChanged )
+ {
+ // Recalc available height
+ slotAvailableHeightNeeded();
+ // Recalc the vertical centering, if enabled
+ recalcVerticalAlignment();
+ }
+ if ( widthChanged )
+ {
+ // not when simply changing the height, otherwise the auto-resize code
+ // prevents making a textobject less high than it currently is.
+ textDocument()->setWidth( m_doc->zoomHandler()->ptToLayoutUnitPixX( innerWidth() ) );
+ m_textobj->setLastFormattedParag( textDocument()->firstParag() );
+ m_textobj->formatMore( 2 );
+ }
+}
+
+void KPrTextObject::setSize( double _width, double _height )
+{
+ bool widthModified = KABS( _width - ext.width() ) > DBL_EPSILON ; // floating-point equality test
+ bool heightModified = KABS( _height - ext.height() ) > DBL_EPSILON;
+ if ( widthModified || heightModified )
+ {
+ KPrObject::setSize( _width, _height );
+ resizeTextDocument( widthModified, heightModified ); // will call formatMore() if widthModified
+ }
+}
+
+QDomDocumentFragment KPrTextObject::save( QDomDocument& doc, double offset )
+{
+ QDomDocumentFragment fragment=KPr2DObject::save(doc, offset);
+ fragment.appendChild(saveKTextObject( doc ));
+ return fragment;
+}
+
+bool KPrTextObject::saveOasisObjectAttributes( KPOasisSaveContext &sc ) const
+{
+ sc.xmlWriter.startElement( "draw:text-box" );
+ m_textobj->saveOasisContent( sc.xmlWriter, sc.context );
+ sc.xmlWriter.endElement();
+ return true;
+}
+
+const char * KPrTextObject::getOasisElementName() const
+{
+ return "draw:frame";
+}
+
+void KPrTextObject::saveOasisMarginElement( KoGenStyle &styleobjectauto ) const
+{
+ kdDebug()<<"void KPrTextObject::saveOasisMarginElement( KoGenStyle &styleobjectauto )\n";
+ if ( btop != 0.0 )
+ styleobjectauto.addPropertyPt("fo:padding-top", btop );
+ if ( bbottom != 0.0 )
+ styleobjectauto.addPropertyPt("fo:padding-bottom", bbottom );
+ if ( bleft != 0.0 )
+ styleobjectauto.addPropertyPt("fo:padding-left", bleft );
+ if ( bright != 0.0 )
+ styleobjectauto.addPropertyPt("fo:padding-right", bright );
+
+ //add vertical alignment
+ switch( m_textVertAlign )
+ {
+ case KP_TOP:
+ styleobjectauto.addProperty("draw:textarea-vertical-align", "top" );
+ break;
+ case KP_CENTER:
+ styleobjectauto.addProperty("draw:textarea-vertical-align", "middle" );
+ break;
+ case KP_BOTTOM:
+ styleobjectauto.addProperty("draw:textarea-vertical-align", "bottom" );
+ break;
+ }
+
+ // fo:padding-top="1.372cm" fo:padding-bottom="0.711cm" fo:padding-left="1.118cm" fo:padding-right="1.27cm"
+}
+
+void KPrTextObject::loadOasis(const QDomElement &element, KoOasisContext& context,
+ KPrLoadingInfo *info )
+{
+ KPr2DObject::loadOasis(element, context, info);
+ //todo other attribute
+ KoStyleStack &styleStack = context.styleStack();
+ styleStack.setTypeProperties( "graphic" );
+ if( styleStack.hasAttributeNS( KoXmlNS::fo, "padding-top" ) )
+ btop = KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::fo, "padding-top" ) );
+ if( styleStack.hasAttributeNS( KoXmlNS::fo, "padding-bottom" ) )
+ bbottom = KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::fo, "padding-bottom" ) );
+ if( styleStack.hasAttributeNS( KoXmlNS::fo, "padding-left") )
+ bleft = KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::fo, "padding-left" ) );
+ if( styleStack.hasAttributeNS( KoXmlNS::fo, "padding-right" ) )
+ bright = KoUnit::parseValue( styleStack.attributeNS( KoXmlNS::fo, "padding-right" ) );
+ kdDebug()<<" KPrTextObject::loadOasis : btp :"<<btop<<" bbottom :"<<bbottom<<" bleft :"<<bleft<<" bright :"<<bright<<endl;
+ // vertical alignment
+ if ( styleStack.hasAttributeNS( KoXmlNS::draw, "textarea-vertical-align" ) )
+ {
+ QString alignment = styleStack.attributeNS( KoXmlNS::draw, "textarea-vertical-align" );
+ if ( alignment == "top" )
+ m_textVertAlign= KP_TOP;
+ else if ( alignment == "middle" )
+ m_textVertAlign= KP_CENTER;
+ else if ( alignment == "bottom" )
+ m_textVertAlign= KP_BOTTOM;
+ }
+ kdDebug()<<" vertical Alignment :"<< ( ( m_textVertAlign== KP_TOP ) ? "top" : ( m_textVertAlign== KP_CENTER ) ? "center": "bottom" )<<endl;
+ QDomElement tmp = KoDom::namedItemNS( element, KoXmlNS::draw, "text-box");
+ m_textobj->loadOasisContent( tmp, context, m_doc->styleCollection() );
+ resizeTextDocument(); // this will to formatMore()
+}
+
+
+double KPrTextObject::load(const QDomElement &element)
+{
+ double offset=KPr2DObject::load(element);
+ QDomElement e=element.namedItem(tagTEXTOBJ).toElement();
+ if(!e.isNull()) {
+ if ( e.hasAttribute( "protectcontent"))
+ setProtectContent((bool)e.attribute( "protectcontent" ).toInt());
+ if (e.hasAttribute( "bleftpt"))
+ bleft = e.attribute( "bleftpt").toDouble();
+ if (e.hasAttribute( "brightpt"))
+ bright = e.attribute( "brightpt").toDouble();
+ if (e.hasAttribute( "btoppt"))
+ btop = e.attribute( "btoppt").toDouble();
+ if (e.hasAttribute( "bbottompt"))
+ bbottom = e.attribute( "bbottompt").toDouble();
+ if ( e.hasAttribute("verticalAlign"))
+ {
+ QString str =e.attribute("verticalAlign");
+ if ( str == "bottom" )
+ m_textVertAlign= KP_BOTTOM;
+ else if ( str == "center" )
+ m_textVertAlign= KP_CENTER;
+ else if ( str == "top" )//never
+ m_textVertAlign= KP_TOP;
+ }
+ if ( e.hasAttribute( "verticalValue" ))
+ alignVertical = e.attribute( "verticalValue" ).toDouble();
+
+ loadKTextObject( e );
+ }
+
+ shadowCompatibility();
+
+ resizeTextDocument(); // this will to formatMore()
+ return offset;
+}
+
+void KPrTextObject::shadowCompatibility()
+{
+ if ( shadowDistance != 0)
+ {
+ int sx = 0;
+ int sy = 0;
+ switch ( shadowDirection )
+ {
+ case SD_LEFT_BOTTOM:
+ case SD_LEFT:
+ case SD_LEFT_UP:
+ sx = - shadowDistance;
+ case SD_RIGHT_UP:
+ case SD_RIGHT:
+ case SD_RIGHT_BOTTOM:
+ sx = shadowDistance;
+ default:
+ break;
+ }
+ switch ( shadowDirection )
+ {
+ case SD_LEFT_UP:
+ case SD_UP:
+ case SD_RIGHT_UP:
+ sy = - shadowDistance;
+ case SD_LEFT_BOTTOM:
+ case SD_BOTTOM:
+ case SD_RIGHT_BOTTOM:
+ sy = shadowDistance;
+ default:
+ break;
+ }
+ KoTextFormat tmpFormat;
+ tmpFormat.setShadow( sx, sy, shadowColor );
+ KCommand* cmd = m_textobj->setFormatCommand( &tmpFormat, KoTextFormat::ShadowText );
+ delete cmd;
+ }
+ //force to reset shadow compatibility between koffice 1.1 and 1.2
+ shadowDirection = SD_RIGHT_BOTTOM;
+ shadowDistance = 0;
+ shadowColor = Qt::gray;
+}
+
+
+// Standard paint method for KP2DObjects.
+void KPrTextObject::paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int pageNum, bool drawingShadow, bool drawContour )
+{
+ // Never draw shadow (in text objects, it's a character property, not an object property)
+ KPrPage *p = m_doc->pageList().at( pageNum );
+ // neccessary when on masterpage
+ if ( p )
+ recalcPageNum( p );
+ if ( drawingShadow ) return;
+ paint( _painter, _zoomHandler, false, 0L, true, drawContour );
+}
+
+// Special method for drawing a text object that is being edited
+void KPrTextObject::paintEdited( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ bool onlyChanged, KoTextCursor* cursor, bool resetChanged )
+{
+ _painter->save();
+ _painter->translate( _zoomHandler->zoomItX(orig.x()), _zoomHandler->zoomItY(orig.y()) );
+
+ if ( angle != 0 )
+ rotateObject(_painter,_zoomHandler);
+ paint( _painter, _zoomHandler, onlyChanged, cursor, resetChanged, false /*not drawContour*/ );
+ _painter->restore();
+}
+
+// Common functionality for the above 2 methods
+void KPrTextObject::paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ bool onlyChanged, KoTextCursor* cursor, bool resetChanged,
+ bool drawContour )
+{
+ double ow = ext.width();
+ double oh = ext.height();
+ double pw = pen.pointWidth() / 2;
+ if ( drawContour ) {
+ QPen pen3( Qt::black, 1, Qt::DotLine );
+ _painter->setPen( pen3 );
+ _painter->setRasterOp( Qt::NotXorROP );
+ _painter->drawRect( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItY(pw),
+ _zoomHandler->zoomItX(ow), _zoomHandler->zoomItY( oh) );
+
+ return;
+ }
+
+ _painter->save();
+ QPen pen2 = pen.zoomedPen(_zoomHandler);
+ //QRect clip=QRect(_zoomHandler->zoomItX(pw), _zoomHandler->zoomItY(pw), _zoomHandler->zoomItX( ow - 2 * pw),_zoomHandler->zoomItY( oh - 2 * pw));
+ //setupClipRegion( _painter, clip );
+ //for debug
+ //_painter->fillRect( clip, Qt::blue );
+ _painter->setPen( pen2 );
+
+ if ( editingTextObj && _painter->device() && _painter->device()->devType() != QInternal::Printer) // editing text object
+ _painter->setBrush( QBrush( m_doc->txtBackCol(), Qt::SolidPattern ) );
+ else {
+ // Handle the rotation, draw the background/border, then call drawText()
+ if ( getFillType() == FT_BRUSH || !gradient ) {
+ _painter->setBrush( getBrush() );
+ }
+ else {
+ QSize size( _zoomHandler->zoomSize( ext ) );
+ gradient->setSize( size );
+ _painter->drawPixmap( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItX(pw), gradient->pixmap(), 0, 0,
+ _zoomHandler->zoomItX( ow - 2 * pw ),
+ _zoomHandler->zoomItY( oh - 2 * pw ) );
+ }
+ }
+ if ( !editingTextObj || !onlyChanged )
+ {
+ /// #### Port this to KoBorder, see e.g. kword/kwframe.cc:590
+ // (so that the border gets drawn OUTSIDE of the object area)
+ _painter->drawRect( _zoomHandler->zoomItX(pw), _zoomHandler->zoomItX(pw), _zoomHandler->zoomItX( ow - 2 * pw),
+ _zoomHandler->zoomItY( oh - 2 * pw) );
+ }
+
+ drawText( _painter, _zoomHandler, onlyChanged, cursor, resetChanged );
+ _painter->restore();
+
+
+ // And now draw the border for text objects.
+ // When they are drawn outside of the object, this can be moved to the standard paint() method,
+ // so that we don't have to do it while editing the object, maybe.
+ if ( m_doc->firstView() && m_doc->firstView()->getCanvas()->getEditMode() &&
+ getDrawEditRect() && getPen().style() == Qt::NoPen )
+ {
+ _painter->save();
+
+ _painter->setPen( QPen( Qt::gray, 1, Qt::DotLine ) );
+ _painter->setBrush( Qt::NoBrush );
+ _painter->setRasterOp( Qt::NotXorROP );
+ _painter->drawRect( 0, 0, _zoomHandler->zoomItX(ow), _zoomHandler->zoomItY( oh) );
+
+ _painter->restore();
+ }
+}
+
+// This method simply draws the paragraphs in the given painter
+// Assumes the painter is already set up correctly.
+void KPrTextObject::drawText( QPainter* _painter, KoTextZoomHandler *zoomHandler, bool onlyChanged, KoTextCursor* cursor, bool resetChanged )
+{
+ //kdDebug(33001) << "KPrTextObject::drawText onlyChanged=" << onlyChanged << " cursor=" << cursor << " resetChanged=" << resetChanged << endl;
+ recalcVerticalAlignment();
+ QColorGroup cg = QApplication::palette().active();
+ _painter->save();
+ _painter->translate( m_doc->zoomHandler()->zoomItX( bLeft()), m_doc->zoomHandler()->zoomItY( bTop()+alignVertical));
+ if ( !editingTextObj || (_painter->device() && _painter->device()->devType() == QInternal::Printer))
+ cg.setBrush( QColorGroup::Base, NoBrush );
+ else
+ cg.setColor( QColorGroup::Base, m_doc->txtBackCol() );
+
+ QRect r = zoomHandler->zoomRect( KoRect( 0, 0, innerWidth(), innerHeight() ) );
+ bool editMode = false;
+ if( m_doc->firstView() && m_doc->firstView()->getCanvas())
+ editMode = m_doc->firstView()->getCanvas()->getEditMode();
+
+ uint drawingFlags = 0;
+ if ( _painter->device() && _painter->device()->devType() != QInternal::Printer )
+ drawingFlags |= KoTextDocument::DrawSelections;
+ if ( m_doc->backgroundSpellCheckEnabled() && editMode )
+ drawingFlags |= KoTextDocument::DrawMisspelledLine;
+ if ( !editMode )
+ drawingFlags |= KoTextDocument::DontDrawNoteVariable;
+ if ( m_doc->viewFormattingChars() && editMode )
+ drawingFlags |= KoTextDocument::DrawFormattingChars;
+
+ if ( specEffects )
+ {
+ switch ( effect2 )
+ {
+ case EF2T_PARA:
+ //kdDebug(33001) << "KPrTextObject::draw onlyCurrStep=" << onlyCurrStep << " subPresStep=" << subPresStep << endl;
+ drawParags( _painter, zoomHandler, cg, ( onlyCurrStep ? subPresStep : 0 ), subPresStep );
+ break;
+ default:
+ /*KoTextParag * lastFormatted =*/ textDocument()->drawWYSIWYG(
+ _painter, r.x(), r.y(), r.width(), r.height(),
+ cg, zoomHandler,
+ onlyChanged, cursor != 0, cursor, resetChanged, drawingFlags );
+ }
+ }
+ else
+ {
+
+ //kdDebug(33001) << "KPrTextObject::drawText r=" << DEBUGRECT(r) << endl;
+ /*KoTextParag * lastFormatted = */ textDocument()->drawWYSIWYG(
+ _painter, r.x(), r.y(), r.width(), r.height(),
+ cg, zoomHandler,
+ onlyChanged, cursor != 0, cursor, resetChanged, drawingFlags );
+ }
+ _painter->restore();
+}
+
+int KPrTextObject::getSubPresSteps() const
+{
+ int paragraphs = 0;
+ KoTextParag * parag = textDocument()->firstParag();
+ for ( ; parag ; parag = parag->next() )
+ paragraphs++;
+ return paragraphs;
+}
+
+
+QDomElement KPrTextObject::saveKTextObject( QDomDocument& doc )
+{
+#if 0
+ KTextEditParag *parag = ktextobject.document()->firstParag();
+ KTextEditDocument::TextSettings textSettings = ktextobject.document()->textSettings();
+#endif
+
+ QDomElement textobj=doc.createElement(tagTEXTOBJ);
+ if ( isProtectContent() )
+ textobj.setAttribute( "protectcontent", (int)isProtectContent());
+ if (bleft !=0.0)
+ textobj.setAttribute( "bleftpt", bleft );
+ if (bright !=0.0)
+ textobj.setAttribute( "brightpt", bright );
+ if (btop !=0.0)
+ textobj.setAttribute( "btoppt", btop );
+ if (bbottom !=0.0)
+ textobj.setAttribute( "bbottompt", bbottom );
+ if ( m_textVertAlign != KP_TOP )
+ {
+ if ( m_textVertAlign == KP_BOTTOM )
+ textobj.setAttribute( "verticalAlign", "bottom" );
+ else if ( m_textVertAlign == KP_CENTER )
+ textobj.setAttribute( "verticalAlign", "center" );
+ else if ( m_textVertAlign == KP_TOP )//never
+ textobj.setAttribute( "verticalAlign", "top" );
+ textobj.setAttribute( "verticalValue",alignVertical );
+ }
+#if 0
+ textobj.setAttribute(attrLineSpacing, ktextobject.document()->lineSpacing());
+ textobj.setAttribute(attrParagSpacing, ktextobject.document()->paragSpacing());
+ textobj.setAttribute(attrMargin, ktextobject.document()->margin());
+ textobj.setAttribute(attrBulletType1, (int)textSettings.bulletType[0]);
+ textobj.setAttribute(attrBulletType2, (int)textSettings.bulletType[1]);
+ textobj.setAttribute(attrBulletType3, (int)textSettings.bulletType[2]);
+ textobj.setAttribute(attrBulletType4, (int)textSettings.bulletType[3]);
+ textobj.setAttribute(attrBulletColor1, textSettings.bulletColor[0].name());
+ textobj.setAttribute(attrBulletColor2, textSettings.bulletColor[1].name());
+ textobj.setAttribute(attrBulletColor3, textSettings.bulletColor[2].name());
+ textobj.setAttribute(attrBulletColor4, textSettings.bulletColor[3].name());
+#endif
+ KoTextParag *parag = static_cast<KoTextParag*> (textDocument()->firstParag());
+ // ### fix this loop (Werner)
+ while ( parag ) {
+ saveParagraph( doc, parag, textobj, 0, parag->length()-2 );
+ parag = static_cast<KoTextParag*>( parag->next());
+ }
+ return textobj;
+}
+
+void KPrTextObject::saveFormat( QDomElement & element, KoTextFormat*lastFormat )
+{
+ QString tmpFamily, tmpColor, tmpTextBackColor;
+ unsigned int tmpBold=false, tmpItalic=false, tmpUnderline=false,tmpStrikeOut=false;
+ int tmpVerticalAlign=-1;
+
+ tmpFamily=lastFormat->font().family();
+ tmpBold=static_cast<unsigned int>(lastFormat->font().bold());
+ tmpItalic=static_cast<unsigned int>(lastFormat->font().italic());
+ tmpUnderline=static_cast<unsigned int>(lastFormat->underline());
+ tmpStrikeOut=static_cast<unsigned int>(lastFormat->strikeOut());
+ tmpColor=lastFormat->color().name();
+ tmpVerticalAlign=static_cast<unsigned int>(lastFormat->vAlign());
+ if(lastFormat->textBackgroundColor().isValid())
+ tmpTextBackColor=lastFormat->textBackgroundColor().name();
+
+ element.setAttribute(attrFamily, tmpFamily);
+ element.setAttribute(attrPointSize, lastFormat->pointSize());
+
+ if(tmpBold)
+ element.setAttribute(attrBold, tmpBold);
+ if(tmpItalic)
+ element.setAttribute(attrItalic, tmpItalic);
+ if ( lastFormat->underlineType()!= KoTextFormat::U_NONE )
+ {
+ if(lastFormat->doubleUnderline())
+ element.setAttribute(attrUnderline, "double");
+ if(lastFormat->underlineType()==KoTextFormat::U_SIMPLE_BOLD)
+ element.setAttribute(attrUnderline, "single-bold");
+ else if( lastFormat->underlineType()==KoTextFormat::U_WAVE)
+ element.setAttribute(attrUnderline, "wave");
+ else if(tmpUnderline)
+ element.setAttribute(attrUnderline, tmpUnderline);
+ QString strLineType=KoTextFormat::underlineStyleToString( lastFormat->underlineStyle() );
+ element.setAttribute( "underlinestyleline", strLineType );
+ if ( lastFormat->textUnderlineColor().isValid() )
+ element.setAttribute( "underlinecolor", lastFormat->textUnderlineColor().name() );
+ }
+ if ( lastFormat->strikeOutType()!= KoTextFormat::S_NONE )
+ {
+ if ( lastFormat->doubleStrikeOut() )
+ element.setAttribute(attrStrikeOut, "double");
+ else if ( lastFormat->strikeOutType()== KoTextFormat::S_SIMPLE_BOLD)
+ element.setAttribute(attrStrikeOut, "single-bold");
+ else if(tmpStrikeOut)
+ element.setAttribute(attrStrikeOut, tmpStrikeOut);
+ QString strLineType=KoTextFormat::strikeOutStyleToString( lastFormat->strikeOutStyle() );
+ element.setAttribute( "strikeoutstyleline", strLineType );
+
+ }
+ element.setAttribute(attrColor, tmpColor);
+
+ if(!tmpTextBackColor.isEmpty())
+ element.setAttribute(attrTextBackColor, tmpTextBackColor);
+ if(tmpVerticalAlign!=-1)
+ {
+ element.setAttribute(attrVertAlign,tmpVerticalAlign);
+ if(lastFormat->relativeTextSize()!=0.66)
+ element.setAttribute("relativetextsize",lastFormat->relativeTextSize());
+ }
+
+ if ( lastFormat->shadowDistanceX() != 0
+ || lastFormat->shadowDistanceY() != 0)
+ element.setAttribute("text-shadow", lastFormat->shadowAsCss());
+ if ( lastFormat->offsetFromBaseLine()!=0 )
+ element.setAttribute( "offsetfrombaseline" , lastFormat->offsetFromBaseLine());
+ if ( lastFormat->wordByWord() )
+ element.setAttribute("wordbyword", true);
+ if ( lastFormat->attributeFont()!= KoTextFormat::ATT_NONE )
+ element.setAttribute("fontattribute", KoTextFormat::attributeFontToString(lastFormat->attributeFont() ));
+ if ( !lastFormat->language().isEmpty())
+ element.setAttribute("language", lastFormat->language());
+}
+
+QDomElement KPrTextObject::saveHelper(const QString &tmpText,KoTextFormat*lastFormat , QDomDocument &doc)
+{
+ QDomElement element=doc.createElement(tagTEXT);
+
+ saveFormat ( element, lastFormat );
+
+ if(tmpText.stripWhiteSpace().isEmpty())
+ // working around a bug in QDom
+ element.setAttribute(attrWhitespace, tmpText.length());
+ element.appendChild(doc.createTextNode(tmpText));
+ return element;
+}
+
+void KPrTextObject::fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const
+{
+ KPr2DObject::fillStyle( styleObjectAuto, mainStyles );
+ saveOasisMarginElement( styleObjectAuto );
+}
+
+void KPrTextObject::loadKTextObject( const QDomElement &elem )
+{
+ QDomElement e = elem.firstChild().toElement();
+ KoTextParag *lastParag = static_cast<KoTextParag *>(textDocument()->firstParag());
+ int i = 0;
+ int listNum = 0;
+ // Initialize lineSpacing and paragSpacing with the values of the object-level attributes
+ // (KOffice-1.1 file format)
+ int lineSpacing = elem.attribute( attrLineSpacing ).toInt();
+ int bottomBorder = elem.attribute( attrParagSpacing ).toInt();
+ int topBorder = 0;
+
+ while ( !e.isNull() ) {
+ QValueList<QDomElement> listVariable;
+ listVariable.clear();
+
+ if ( e.tagName() == tagP ) {
+ QDomElement n = e.firstChild().toElement();
+
+ //skip the whitespace if it's a bullet/number
+ if( e.hasAttribute( attrType ) && n.hasAttribute( attrWhitespace ) )
+ if ( e.attribute( attrType )!="0" && n.attribute( attrWhitespace )=="1" ) {
+ e = e.nextSibling().toElement();
+ continue;
+ }
+
+ KoParagLayout paragLayout = loadParagLayout(e, m_doc, true);
+
+ // compatibility (bullet/numbering depth); only a simulation thru the margins, this is how it _looked_ before
+ double depth = 0.0;
+ if( e.hasAttribute(attrDepth) ) {
+ depth = e.attribute( attrDepth ).toDouble();
+ paragLayout.margins[QStyleSheetItem::MarginLeft] = depth * MM_TO_POINT(10.0);
+ }
+
+ //kdDebug(33001) << k_funcinfo << "old bullet depth is: " << depth << endl;
+
+ // 1.1 compatibility (bullets)
+ QString type;
+ if( e.hasAttribute(attrType) )
+ type = e.attribute( attrType );
+
+ //kdDebug(33001) << k_funcinfo << "old PARAG type is: " << type << endl;
+
+ // Do not import type="2" (enum list). The enum was there in 1.1, but not the code!
+ if(type == "1")
+ {
+ if(!paragLayout.counter)
+ paragLayout.counter = new KoParagCounter;
+ paragLayout.counter->setStyle(KoParagCounter::STYLE_DISCBULLET);
+ paragLayout.counter->setNumbering(KoParagCounter::NUM_LIST);
+ paragLayout.counter->setPrefix(QString::null);
+ paragLayout.counter->setSuffix(QString::null);
+ }
+
+ // This is for very old (KOffice-1.0) documents.
+ if ( e.hasAttribute( attrLineSpacing ) )
+ lineSpacing = e.attribute( attrLineSpacing ).toInt();
+ if ( e.hasAttribute( "distBefore" ) )
+ topBorder = e.attribute( "distBefore" ).toInt();
+ if ( e.hasAttribute( "distAfter" ) )
+ bottomBorder = e.attribute( "distAfter" ).toInt();
+
+ // Apply values coming from 1.0 or 1.1 documents
+ if ( paragLayout.lineSpacingValue() == 0 )
+ paragLayout.setLineSpacingValue(lineSpacing);
+ if ( paragLayout.margins[ QStyleSheetItem::MarginTop ] == 0 )
+ paragLayout.margins[ QStyleSheetItem::MarginTop ] = topBorder;
+ if ( paragLayout.margins[ QStyleSheetItem::MarginBottom ] == 0 )
+ paragLayout.margins[ QStyleSheetItem::MarginBottom ] = bottomBorder;
+ lastParag->setParagLayout( paragLayout );
+ //lastParag->setAlign(Qt::AlignAuto);
+
+ if(e.hasAttribute(attrAlign))
+ {
+ int tmpAlign=e.attribute( attrAlign ).toInt();
+ if(tmpAlign==1 || tmpAlign==0 /* a kpresenter version I think a cvs version saved leftAlign = 0 for header/footer */)
+ lastParag->setAlign(Qt::AlignLeft);
+ else if(tmpAlign==2)
+ lastParag->setAlign(Qt::AlignRight);
+ else if(tmpAlign==4)
+ lastParag->setAlign(Qt::AlignHCenter);
+ else if(tmpAlign==8)
+ lastParag->setAlign(Qt::AlignJustify);
+ else
+ kdDebug(33001) << "Error in e.attribute( attrAlign ).toInt()" << endl;
+ }
+ // ######## TODO paragraph direction (LTR or RTL)
+
+ // TODO check/convert values
+ bool firstTextTag = true;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == tagTEXT ) {
+
+ if ( firstTextTag ) {
+ lastParag->remove( 0, 1 ); // Remove current trailing space
+ firstTextTag = false;
+ }
+ KoTextFormat fm = loadFormat( n, lastParag->paragraphFormat(), m_doc->defaultFont(), m_doc->globalLanguage(),
+ m_doc->globalHyphenation() );
+
+ QString txt = n.firstChild().toText().data();
+
+ if(n.hasAttribute(attrWhitespace)) {
+ int ws=n.attribute(attrWhitespace).toInt();
+ txt.fill(' ', ws);
+ }
+ n=n.nextSibling().toElement();
+ if ( n.isNull() )
+ txt += ' '; // trailing space at end of paragraph
+ lastParag->append( txt, true );
+ lastParag->setFormat( i, txt.length(), textDocument()->formatCollection()->format( &fm ) );
+ //kdDebug(33001)<<"setFormat :"<<txt<<" i :"<<i<<" txt.length() "<<txt.length()<<endl;
+ i += txt.length();
+ }
+ else if ( n.tagName() == "CUSTOM" )
+ {
+ listVariable.append( n );
+ n = n.nextSibling().toElement();
+ }
+ else
+ n = n.nextSibling().toElement();
+ }
+ } else if ( e.tagName() == "UNSORTEDLISTTYPE" ) {
+ if ( listNum < 4 ) {
+ //QColor c( e.attribute( "red" ).toInt(), e.attribute( "green" ).toInt(), e.attribute( "blue" ).toInt() );
+ // ## settings.bulletColor[ listNum++ ] = c;
+ }
+ }
+ e = e.nextSibling().toElement();
+ loadVariable( listVariable,lastParag );
+ if ( e.isNull() )
+ break;
+ i = 0;
+ if ( !lastParag->length() == 0 )
+ lastParag = new KoTextParag( textDocument(), lastParag, 0 );
+ }
+}
+
+void KPrTextObject::loadVariable( QValueList<QDomElement> & listVariable,KoTextParag *lastParag, int offset )
+{
+ QValueList<QDomElement>::Iterator it = listVariable.begin();
+ QValueList<QDomElement>::Iterator end = listVariable.end();
+ for ( ; it != end ; ++it )
+ {
+ QDomElement elem = *it;
+ if ( !elem.hasAttribute("pos"))
+ continue;
+ int index = elem.attribute("pos").toInt();
+ index+=offset;
+ QDomElement varElem = elem.namedItem( "VARIABLE" ).toElement();
+ if ( !varElem.isNull() )
+ {
+ QDomElement typeElem = varElem.namedItem( "TYPE" ).toElement();
+ int type = typeElem.attribute( "type" ).toInt();
+ QString key = typeElem.attribute( "key" );
+ int correct = 0;
+ if (typeElem.hasAttribute( "correct" ))
+ correct = typeElem.attribute("correct").toInt();
+ kdDebug(33001) << "loadKTextObject variable type=" << type << " key=" << key << endl;
+ KoVariableFormat * varFormat = key.isEmpty() ? 0 : m_doc->variableFormatCollection()->format( key.latin1() );
+ // If varFormat is 0 (no key specified), the default format will be used.
+ KoVariable * var =m_doc->getVariableCollection()->createVariable( type, -1, m_doc->variableFormatCollection(),
+ varFormat, lastParag->textDocument(),
+ m_doc, correct, true/* force default format for date/time*/ );
+ if ( var )
+ {
+ var->load( varElem );
+ KoTextFormat format = loadFormat( *it, lastParag->paragraphFormat(), m_doc->defaultFont(), m_doc->globalLanguage(),
+ m_doc->globalHyphenation() );
+ lastParag->setCustomItem( index, var, lastParag->document()->formatCollection()->format( &format ));
+ var->recalc();
+ }
+ }
+ }
+}
+
+KoTextFormat KPrTextObject::loadFormat( QDomElement &n, KoTextFormat * refFormat, const QFont & defaultFont,
+ const QString & defaultLanguage, bool hyphen )
+{
+ KoTextFormat format;
+ format.setHyphenation( hyphen );
+ QFont fn;
+ if ( refFormat )
+ {
+ format = *refFormat;
+ format.setCollection( 0 ); // Out of collection copy
+ fn = format.font();
+ }
+ else
+ fn = defaultFont;
+
+ if ( !n.isNull() )
+ {
+ QFontDatabase fdb;
+ QStringList families = fdb.families();
+ if ( families.findIndex( n.attribute( attrFamily ) ) != -1 )
+ fn.setFamily( n.attribute( attrFamily ) );
+ else
+ fn = defaultFont;
+ }
+ else if ( !refFormat )
+ { // No reference format and no FONT tag -> use default font
+ fn = defaultFont;
+ }
+
+
+ int size = n.attribute( attrPointSize ).toInt();
+ bool bold=false;
+ if(n.hasAttribute(attrBold))
+ bold = (bool)n.attribute( attrBold ).toInt();
+ bool italic = false;
+ if(n.hasAttribute(attrItalic))
+ italic=(bool)n.attribute( attrItalic ).toInt();
+
+ if(n.hasAttribute( attrUnderline ))
+ {
+ QString value = n.attribute( attrUnderline );
+ if ( value == "double" )
+ format.setUnderlineType ( KoTextFormat::U_DOUBLE);
+ else if ( value == "single" )
+ format.setUnderlineType ( KoTextFormat::U_SIMPLE);
+ else if ( value == "single-bold" )
+ format.setUnderlineType ( KoTextFormat::U_SIMPLE_BOLD);
+ else if( value =="wave" )
+ format.setUnderlineType( KoTextFormat::U_WAVE);
+ else
+ format.setUnderlineType ( (bool)value.toInt() ? KoTextFormat::U_SIMPLE :KoTextFormat::U_NONE);
+ }
+ if (n.hasAttribute("underlinestyleline") )
+ format.setUnderlineStyle( KoTextFormat::stringToUnderlineStyle( n.attribute("underlinestyleline") ));
+
+ if (n.hasAttribute("underlinecolor"))
+ format.setTextUnderlineColor(QColor(n.attribute("underlinecolor")));
+
+ if(n.hasAttribute(attrStrikeOut))
+ {
+ QString value = n.attribute( attrStrikeOut );
+ if ( value == "double" )
+ format.setStrikeOutType ( KoTextFormat::S_DOUBLE);
+ else if ( value == "single" )
+ format.setStrikeOutType ( KoTextFormat::S_SIMPLE);
+ else if ( value == "single-bold" )
+ format.setStrikeOutType ( KoTextFormat::S_SIMPLE_BOLD);
+ else
+ format.setStrikeOutType ( (bool)value.toInt() ? KoTextFormat::S_SIMPLE :KoTextFormat::S_NONE);
+ }
+
+ if (n.hasAttribute("strikeoutstyleline"))
+ {
+ QString strLineType = n.attribute("strikeoutstyleline");
+ format.setStrikeOutStyle( KoTextFormat::stringToStrikeOutStyle( strLineType ));
+ }
+
+ QString color = n.attribute( attrColor );
+ fn.setPointSize( size );
+ fn.setBold( bold );
+ fn.setItalic( italic );
+ //kdDebug(33001) << "KPrTextObject::loadFormat: family=" << fn.family() << " size=" << fn.pointSize() << endl;
+ QColor col( color );
+
+ format.setFont( fn );
+ format.setColor( col );
+ QString textBackColor=n.attribute(attrTextBackColor);
+ if(!textBackColor.isEmpty())
+ {
+ QColor tmpCol(textBackColor);
+ tmpCol=tmpCol.isValid() ? tmpCol : QApplication::palette().color( QPalette::Active, QColorGroup::Base );
+ format.setTextBackgroundColor(tmpCol);
+ }
+ if(n.hasAttribute(attrVertAlign))
+ format.setVAlign( static_cast<KoTextFormat::VerticalAlignment>(n.attribute(attrVertAlign).toInt() ) );
+ if ( n.hasAttribute("text-shadow") )
+ format.parseShadowFromCss( n.attribute("text-shadow") );
+ if ( n.hasAttribute("relativetextsize") )
+ format.setRelativeTextSize( n.attribute("relativetextsize").toDouble() ) ;
+ if ( n.hasAttribute("offsetfrombaseline") )
+ format.setOffsetFromBaseLine( static_cast<int>(n.attribute("offsetfrombaseline").toInt() ) );
+ if ( n.hasAttribute("wordbyword") )
+ format.setWordByWord( static_cast<int>(n.attribute("wordbyword").toInt() ) );
+
+ if ( n.hasAttribute("fontattribute") )
+ format.setAttributeFont( KoTextFormat::stringToAttributeFont(n.attribute("fontattribute") ) );
+ if ( n.hasAttribute("language"))
+ format.setLanguage( n.attribute("language"));
+ else
+ { // No reference format and no language tag -> use default font
+ format.setLanguage( defaultLanguage);
+ }
+
+ //kdDebug(33001)<<"loadFormat :"<<format.key()<<endl;
+ return format;
+}
+
+KoParagLayout KPrTextObject::loadParagLayout( QDomElement & parentElem, KPrDocument *doc, bool findStyle)
+{
+ KoParagLayout layout;
+
+ // Only when loading paragraphs, not when loading styles
+ if ( findStyle )
+ {
+ KoParagStyle *style;
+ // Name of the style. If there is no style, then we do not supply
+ // any default!
+ QDomElement element = parentElem.namedItem( "NAME" ).toElement();
+ if ( !element.isNull() )
+ {
+ QString styleName = element.attribute( "value" );
+ style = doc->styleCollection()->findStyle( styleName );
+ if (!style)
+ {
+ kdError(33001) << "Cannot find style \"" << styleName << "\" specified in paragraph LAYOUT - using Standard" << endl;
+ style = doc->styleCollection()->findStyle( "Standard" );
+ }
+ //else kdDebug(33001) << "KoParagLayout::KoParagLayout setting style to " << style << " " << style->name() << endl;
+ }
+ else
+ {
+ kdError(33001) << "Missing NAME tag in paragraph LAYOUT - using Standard" << endl;
+ style = doc->styleCollection()->findStyle( "Standard" );
+ }
+ Q_ASSERT(style);
+ layout.style = style;
+ }
+
+ QDomElement element = parentElem.namedItem( "INDENTS" ).toElement();
+ if ( !element.isNull() )
+ {
+ double val=0.0;
+ if(element.hasAttribute("first"))
+ val=element.attribute("first").toDouble();
+ layout.margins[QStyleSheetItem::MarginFirstLine] = val;
+ val=0.0;
+ if(element.hasAttribute( "left"))
+ // The GUI prevents a negative indent, so let's fixup broken docs too
+ val=QMAX(0, element.attribute( "left").toDouble());
+ layout.margins[QStyleSheetItem::MarginLeft] = val;
+ val=0.0;
+ if(element.hasAttribute("right"))
+ // The GUI prevents a negative indent, so let's fixup broken docs too
+ val=QMAX(0, element.attribute("right").toDouble());
+ layout.margins[QStyleSheetItem::MarginRight] = val;
+ }
+ element = parentElem.namedItem( "LINESPACING" ).toElement();
+ if ( !element.isNull() )
+ {
+ //compatibility with koffice 1.1
+ if ( element.hasAttribute( "value" ))
+ {
+ QString value = element.attribute( "value" );
+ if ( value == "oneandhalf" )
+ {
+ layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF;
+ layout.setLineSpacingValue(0);
+ }
+ else if ( value == "double" )
+ {
+ layout.lineSpacingType = KoParagLayout::LS_DOUBLE;
+ layout.setLineSpacingValue(0);
+ }
+ else
+ {
+ layout.lineSpacingType = KoParagLayout::LS_CUSTOM;
+ layout.setLineSpacingValue(value.toDouble());
+ }
+ }
+ else
+ {
+ QString type = element.attribute( "type" );
+ if ( type == "oneandhalf" )
+ {
+ layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF;
+ layout.setLineSpacingValue(0);
+ }
+ else if ( type == "double" )
+ {
+ layout.lineSpacingType = KoParagLayout::LS_DOUBLE;
+ layout.setLineSpacingValue(0);
+ }
+ else if ( type == "custom" )
+ {
+ layout.lineSpacingType = KoParagLayout::LS_CUSTOM;
+ layout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble());
+ }
+ else if ( type == "atleast" )
+ {
+ layout.lineSpacingType = KoParagLayout::LS_AT_LEAST;
+ layout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble());
+ }
+ else if ( type == "multiple" )
+ {
+ layout.lineSpacingType = KoParagLayout::LS_MULTIPLE;
+ layout.setLineSpacingValue(element.attribute( "spacingvalue" ).toDouble());
+ }
+ }
+ }
+
+ element = parentElem.namedItem( "OFFSETS" ).toElement();
+ if ( !element.isNull() )
+ {
+ double val =0.0;
+ if(element.hasAttribute("before"))
+ val=QMAX(0, element.attribute("before").toDouble());
+ layout.margins[QStyleSheetItem::MarginTop] = val;
+ val = 0.0;
+ if(element.hasAttribute("after"))
+ val=QMAX(0, element.attribute("after").toDouble());
+ layout.margins[QStyleSheetItem::MarginBottom] = val;
+ }
+
+
+ element = parentElem.namedItem( "LEFTBORDER" ).toElement();
+ if ( !element.isNull() )
+ layout.leftBorder = KoBorder::loadBorder( element );
+ else
+ layout.leftBorder.setPenWidth( 0);
+
+ element = parentElem.namedItem( "RIGHTBORDER" ).toElement();
+ if ( !element.isNull() )
+ layout.rightBorder = KoBorder::loadBorder( element );
+ else
+ layout.rightBorder.setPenWidth( 0);
+
+ element = parentElem.namedItem( "TOPBORDER" ).toElement();
+ if ( !element.isNull() )
+ layout.topBorder = KoBorder::loadBorder( element );
+ else
+ layout.topBorder.setPenWidth(0);
+
+ element = parentElem.namedItem( "BOTTOMBORDER" ).toElement();
+ if ( !element.isNull() )
+ layout.bottomBorder = KoBorder::loadBorder( element );
+ else
+ layout.bottomBorder.setPenWidth(0);
+
+ element = parentElem.namedItem( "COUNTER" ).toElement();
+ if ( !element.isNull() )
+ {
+ layout.counter = new KoParagCounter;
+ layout.counter->load( element );
+ }
+
+ KoTabulatorList tabList;
+ element = parentElem.firstChild().toElement();
+ for ( ; !element.isNull() ; element = element.nextSibling().toElement() )
+ {
+ if ( element.tagName() == "TABULATOR" )
+ {
+ KoTabulator tab;
+ tab.type=T_LEFT;
+ if(element.hasAttribute("type"))
+ tab.type = static_cast<KoTabulators>( element.attribute("type").toInt());
+ tab.ptPos=0.0;
+ if(element.hasAttribute("ptpos"))
+ tab.ptPos=element.attribute("ptpos").toDouble();
+ tab.filling=TF_BLANK;
+ if(element.hasAttribute("filling"))
+ tab.filling = static_cast<KoTabulatorFilling>( element.attribute("filling").toInt());
+ tab.ptWidth=0.5;
+ if(element.hasAttribute("width"))
+ tab.ptWidth=element.attribute("width").toDouble();
+ tabList.append( tab );
+ }
+ }
+ layout.setTabList( tabList );
+
+
+ return layout;
+}
+
+void KPrTextObject::saveParagLayout( const KoParagLayout& layout, QDomElement & parentElem )
+{
+ QDomDocument doc = parentElem.ownerDocument();
+ QDomElement element = doc.createElement( "NAME" );
+ parentElem.appendChild( element );
+ if ( layout.style )
+ element.setAttribute( "value", layout.style->name() );
+ else
+ kdWarning() << "KWTextParag::saveParagLayout: style==0L!" << endl;
+
+
+ if ( layout.margins[QStyleSheetItem::MarginFirstLine] != 0 ||
+ layout.margins[QStyleSheetItem::MarginLeft] != 0 ||
+ layout.margins[QStyleSheetItem::MarginRight] != 0 )
+ {
+ element = doc.createElement( "INDENTS" );
+ parentElem.appendChild( element );
+ if ( layout.margins[QStyleSheetItem::MarginFirstLine] != 0 )
+ element.setAttribute( "first", layout.margins[QStyleSheetItem::MarginFirstLine] );
+ if ( layout.margins[QStyleSheetItem::MarginLeft] != 0 )
+ element.setAttribute( "left", layout.margins[QStyleSheetItem::MarginLeft] );
+ if ( layout.margins[QStyleSheetItem::MarginRight] != 0 )
+ element.setAttribute( "right", layout.margins[QStyleSheetItem::MarginRight] );
+ }
+
+
+ if ( layout.margins[QStyleSheetItem::MarginTop] != 0 ||
+ layout.margins[QStyleSheetItem::MarginBottom] != 0 )
+ {
+ element = doc.createElement( "OFFSETS" );
+ parentElem.appendChild( element );
+ if ( layout.margins[QStyleSheetItem::MarginTop] != 0 )
+ element.setAttribute( "before", layout.margins[QStyleSheetItem::MarginTop] );
+ if ( layout.margins[QStyleSheetItem::MarginBottom] != 0 )
+ element.setAttribute( "after", layout.margins[QStyleSheetItem::MarginBottom] );
+ }
+
+ if ( layout.lineSpacingType != KoParagLayout::LS_SINGLE )
+ {
+ element = doc.createElement( "LINESPACING" );
+ parentElem.appendChild( element );
+ if ( layout.lineSpacingType == KoParagLayout::LS_ONEANDHALF )
+ element.setAttribute( "type", "oneandhalf" );
+ else if ( layout.lineSpacingType == KoParagLayout::LS_DOUBLE )
+ element.setAttribute( "type", "double" );
+ else if ( layout.lineSpacingType == KoParagLayout::LS_CUSTOM )
+ {
+ element.setAttribute( "type", "custom" );
+ element.setAttribute( "spacingvalue", layout.lineSpacingValue());
+ }
+ else if ( layout.lineSpacingType == KoParagLayout::LS_AT_LEAST )
+ {
+ element.setAttribute( "type", "atleast" );
+ element.setAttribute( "spacingvalue", layout.lineSpacingValue());
+ }
+ else if ( layout.lineSpacingType == KoParagLayout::LS_MULTIPLE )
+ {
+ element.setAttribute( "type", "multiple" );
+ element.setAttribute( "spacingvalue", layout.lineSpacingValue());
+ }
+ else
+ kdDebug(33001) << " error in lineSpacing Type" << endl;
+ }
+
+ if ( layout.leftBorder.penWidth() > 0 )
+ {
+ element = doc.createElement( "LEFTBORDER" );
+ parentElem.appendChild( element );
+ layout.leftBorder.save( element );
+ }
+ if ( layout.rightBorder.penWidth() > 0 )
+ {
+ element = doc.createElement( "RIGHTBORDER" );
+ parentElem.appendChild( element );
+ layout.rightBorder.save( element );
+ }
+ if ( layout.topBorder.penWidth() > 0 )
+ {
+ element = doc.createElement( "TOPBORDER" );
+ parentElem.appendChild( element );
+ layout.topBorder.save( element );
+ }
+ if ( layout.bottomBorder.penWidth() > 0 )
+ {
+ element = doc.createElement( "BOTTOMBORDER" );
+ parentElem.appendChild( element );
+ layout.bottomBorder.save( element );
+ }
+
+ if ( layout.counter && layout.counter->numbering() != KoParagCounter::NUM_NONE )
+ {
+ element = doc.createElement( "COUNTER" );
+ parentElem.appendChild( element );
+ if (layout.counter )
+ layout.counter->save( element );
+ }
+
+ KoTabulatorList tabList = layout.tabList();
+ KoTabulatorList::ConstIterator it = tabList.begin();
+ for ( ; it != tabList.end() ; it++ )
+ {
+ element = doc.createElement( "TABULATOR" );
+ parentElem.appendChild( element );
+ element.setAttribute( "type", (*it).type );
+ element.setAttribute( "ptpos", (*it).ptPos );
+ element.setAttribute( "filling", (*it).filling );
+ element.setAttribute( "width", (*it).ptWidth );
+ }
+}
+
+void KPrTextObject::recalcPageNum( KPrPage *page )
+{
+ int pgnum=m_doc->pageList().findRef(page);
+
+ pgnum+=1;
+ QPtrListIterator<KoTextCustomItem> cit( textDocument()->allCustomItems() );
+ for ( ; cit.current() ; ++cit )
+ {
+ KPrPgNumVariable * var = dynamic_cast<KPrPgNumVariable *>( cit.current() );
+ if ( var && !var->isDeleted() )
+ {
+ switch ( var->subType() ) {
+ case KPrPgNumVariable::VST_PGNUM_CURRENT:
+ var->setPgNum( pgnum + kPresenterDocument()->getVariableCollection()->variableSetting()->startingPageNumber()-1);
+ break;
+ case KPrPgNumVariable::VST_CURRENT_SECTION:
+ var->setSectionTitle( page->pageTitle() );
+ break;
+ case KPrPgNumVariable::VST_PGNUM_PREVIOUS:
+ var->setPgNum( QMAX( pgnum -1 , 0) +
+ kPresenterDocument()->getVariableCollection()->variableSetting()->startingPageNumber());
+ break;
+ case KPrPgNumVariable::VST_PGNUM_NEXT:
+ var->setPgNum( QMIN( (int)m_doc->getPageNums(), pgnum+1 ) +
+ kPresenterDocument()->getVariableCollection()->variableSetting()->startingPageNumber());
+ break;
+ default:
+ break;
+ }
+
+ var->resize();
+ var->paragraph()->invalidate( 0 ); // size may have changed -> need reformatting !
+ var->paragraph()->setChanged( true );
+ }
+ }
+}
+
+void KPrTextObject::layout()
+{
+ invalidate();
+ // Get the thing going though, repainting doesn't call formatMore
+ m_textobj->formatMore( 2 );
+}
+
+void KPrTextObject::invalidate()
+{
+ //kdDebug(33001) << "KWTextFrameSet::invalidate " << getName() << endl;
+ m_textobj->setLastFormattedParag( textDocument()->firstParag() );
+ textDocument()->formatter()->setViewFormattingChars( m_doc->viewFormattingChars() );
+ textDocument()->invalidate(); // lazy layout, real update follows upon next repaint
+}
+
+// For the "paragraph after paragraph" effect
+void KPrTextObject::drawParags( QPainter *painter, KoTextZoomHandler* zoomHandler, const QColorGroup& cg, int from, int to )
+{
+ // The fast and difficult way would be to call drawParagWYSIWYG
+ // only on the paragraphs to be drawn. Then we have duplicate quite some code
+ // (or lose double-buffering).
+ // Easy (and not so slow) way:
+ // we call KoTextDocument::drawWYSIWYG with a cliprect.
+ Q_ASSERT( from <= to );
+ int i = 0;
+ bool editMode=false;
+ if( m_doc->firstView() && m_doc->firstView()->getCanvas())
+ editMode = m_doc->firstView()->getCanvas()->getEditMode();
+
+ QRect r = zoomHandler->zoomRect( KoRect( 0, 0, innerWidth(), innerHeight() ) );
+ KoTextParag *parag = textDocument()->firstParag();
+ while ( parag ) {
+ if ( !parag->isValid() )
+ parag->format();
+ if ( i == from )
+ r.setTop( m_doc->zoomHandler()->layoutUnitToPixelY( parag->rect().top() ) );
+ if ( i == to ) {
+ r.setBottom( m_doc->zoomHandler()->layoutUnitToPixelY( parag->rect().bottom() ) );
+ break;
+ }
+ ++i;
+ parag = parag->next();
+ }
+
+ uint drawingFlags = 0; // don't draw selections
+ if ( m_doc->backgroundSpellCheckEnabled() && editMode )
+ drawingFlags |= KoTextDocument::DrawMisspelledLine;
+ textDocument()->drawWYSIWYG(
+ painter, r.x(), r.y(), r.width(), r.height(),
+ cg, m_doc->zoomHandler(), // TODO (long term) the view's zoomHandler
+ false /*onlyChanged*/, false /*cursor != 0*/, 0 /*cursor*/,
+ true /*resetChanged*/, drawingFlags );
+}
+
+void KPrTextObject::drawCursor( QPainter *p, KoTextCursor *cursor, bool cursorVisible, KPrCanvas* canvas )
+{
+ // The implementation is very related to KWord's KWTextFrameSet::drawCursor
+ KoTextZoomHandler *zh = m_doc->zoomHandler();
+ QPoint origPix = zh->zoomPoint( orig+KoPoint(bLeft(), bTop()+alignVertical) );
+ // Painter is already translated for diffx/diffy, but not for the object yet
+ p->translate( origPix.x(), origPix.y() );
+ if ( angle != 0 )
+ rotateObject( p, zh );
+
+ KoTextParag* parag = cursor->parag();
+ QPoint topLeft = parag->rect().topLeft(); // in QRT coords
+ int lineY;
+ // Cursor height, in pixels
+ int cursorHeight = zh->layoutUnitToPixelY( topLeft.y(), parag->lineHeightOfChar( cursor->index(), 0, &lineY ) );
+ QPoint iPoint( topLeft.x() + cursor->x(),
+ topLeft.y() + lineY );
+ // from now on, iPoint will be in pixels
+ iPoint = zh->layoutUnitToPixel( iPoint );
+
+ QPoint vPoint = iPoint; // vPoint and iPoint are the same currently
+ // do not simplify this, will be useful with viewmodes.
+ //int xadj = parag->at( cursor->index() )->pixelxadj;
+ //iPoint.rx() += xadj;
+ //vPoint.rx() += xadj;
+ // very small clipping around the cursor
+ QRect clip( vPoint.x() - 5, vPoint.y() , 10, cursorHeight );
+ setupClipRegion( p, clip );
+
+ // for debug only!
+ //p->fillRect( clip, Qt::blue );
+
+ QPixmap *pix = 0;
+ QColorGroup cg = QApplication::palette().active();
+ cg.setColor( QColorGroup::Base, m_doc->txtBackCol() );
+
+ uint drawingFlags = KoTextDocument::DrawSelections;
+ if ( m_doc->backgroundSpellCheckEnabled() )
+ drawingFlags |= KoTextDocument::DrawMisspelledLine;
+ if ( m_doc->viewFormattingChars() )
+ drawingFlags |= KoTextDocument::DrawFormattingChars;
+
+ // To force the drawing to happen:
+ bool wasChanged = parag->hasChanged();
+ int oldLineChanged = parag->lineChanged();
+ int line; // line number
+ parag->lineStartOfChar( cursor->index(), 0, &line );
+ parag->setChanged( false ); // not all changed, only from a given line
+ parag->setLineChanged( line );
+ //kdDebug(33001) << "KPrTextObject::drawCursor cursorVisible=" << cursorVisible << " line=" << line << endl;
+
+ textDocument()->drawParagWYSIWYG(
+ p, parag,
+ QMAX(0, iPoint.x() - 5), // negative values create problems
+ iPoint.y(), clip.width(), clip.height(),
+ pix, cg, m_doc->zoomHandler(),
+ cursorVisible, cursor, FALSE /*resetChanged*/, drawingFlags );
+
+ if ( wasChanged ) // Maybe we have more changes to draw, than those in the small cliprect
+ cursor->parag()->setLineChanged( oldLineChanged ); // -1 = all
+ else
+ cursor->parag()->setChanged( false );
+
+ // XIM Position
+ QPoint ximPoint = vPoint;
+ QFont f = parag->at( cursor->index() )->format()->font();
+ canvas->setXimPosition( ximPoint.x() + origPix.x(), ximPoint.y() + origPix.y(),
+ 0, cursorHeight - parag->lineSpacing( line ), &f );
+}
+
+KPrTextDocument * KPrTextObject::textDocument() const
+{
+ return static_cast<KPrTextDocument*>(m_textobj->textDocument());
+}
+
+void KPrTextObject::slotNewCommand( KCommand * cmd)
+{
+ m_doc->addCommand(cmd);
+}
+
+int KPrTextObject::availableHeight() const
+{
+ return m_textobj->availableHeight();
+}
+
+void KPrTextObject::slotAvailableHeightNeeded()
+{
+ int ah = m_doc->zoomHandler()->ptToLayoutUnitPixY( innerHeight() );
+ m_textobj->setAvailableHeight( ah );
+ //kdDebug(33001)<<"slotAvailableHeightNeeded: height=:"<<ah<<endl;
+}
+
+void KPrTextObject::slotRepaintChanged()
+{
+ emit repaintChanged( this );
+}
+
+KPrTextView * KPrTextObject::createKPTextView( KPrCanvas * _canvas, bool temp )
+{
+ return new KPrTextView( this, _canvas, temp );
+}
+
+void KPrTextObject::removeHighlight ()
+{
+ m_textobj->removeHighlight( true /*repaint*/ );
+}
+
+void KPrTextObject::highlightPortion( KoTextParag * parag, int index, int length, KPrCanvas* canvas, bool repaint, KDialogBase* dialog )
+{
+ m_textobj->highlightPortion( parag, index, length, repaint );
+ if ( repaint )
+ {
+ KPrDocument* doc = canvas->getView()->kPresenterDoc();
+
+ // Is this object in the current active page?
+ if ( canvas->activePage()->findTextObject( this ) )
+ {
+ kdDebug(33001) << k_funcinfo << "object in current page" << endl;
+ }
+ else
+ {
+ // No -> find the right page and activate it
+ // ** slow method **
+ KPrPage* page = doc->findPage( this );
+ if ( page ) {
+ int pageNum = doc->pageList().findRef( page );
+ // if the pageNum is -1 the object is located on the master slide
+ if ( pageNum > -1 )
+ {
+ canvas->getView()->skipToPage( pageNum );
+ }
+ } else
+ kdWarning(33001) << "object " << this << " not found in any page!?" << endl;
+ }
+ // Now ensure text is fully visible
+ QRect rect = m_doc->zoomHandler()->zoomRect( getRect() );
+ QRect expose = m_doc->zoomHandler()->layoutUnitToPixel( parag->rect() );
+ expose.moveBy( rect.x(), rect.y() );
+ canvas->ensureVisible( (expose.left()+expose.right()) / 2, // point = center of the rect
+ (expose.top()+expose.bottom()) / 2,
+ (expose.right()-expose.left()) / 2, // margin = half-width of the rect
+ (expose.bottom()-expose.top()) / 2);
+#if KDE_IS_VERSION(3,1,90)
+ if ( dialog ) {
+ QRect globalRect( expose );
+ globalRect.moveTopLeft( canvas->mapToGlobal( globalRect.topLeft() ) );
+ KDialog::avoidArea( dialog, globalRect );
+ }
+#endif
+ }
+}
+
+KCommand * KPrTextObject::pasteOasis( KoTextCursor * cursor, const QByteArray & data, bool removeSelected )
+{
+ //kdDebug(33001) << "KPrTextObject::pasteOasis" << endl;
+ KMacroCommand * macroCmd = new KMacroCommand( i18n("Paste Text") );
+ if ( removeSelected && textDocument()->hasSelection( KoTextDocument::Standard ) )
+ macroCmd->addCommand( m_textobj->removeSelectedTextCommand( cursor, KoTextDocument::Standard ) );
+ m_textobj->emitHideCursor();
+ m_textobj->setLastFormattedParag( cursor->parag()->prev() ?
+ cursor->parag()->prev() : cursor->parag() );
+
+ // We have our own command for this.
+ // Using insert() wouldn't help storing the parag stuff for redo
+ KPrOasisPasteTextCommand * cmd = new KPrOasisPasteTextCommand( textDocument(), cursor->parag()->paragId(), cursor->index(), data );
+ textDocument()->addCommand( cmd );
+
+ macroCmd->addCommand( new KoTextCommand( m_textobj, /*cmd, */QString::null ) );
+ *cursor = *( cmd->execute( cursor ) );
+
+ m_textobj->formatMore( 2 );
+ emit repaintChanged( this );
+ m_textobj->emitEnsureCursorVisible();
+ m_textobj->emitUpdateUI( true );
+ m_textobj->emitShowCursor();
+ m_textobj->selectionChangedNotify();
+ return macroCmd;
+}
+
+
+void KPrTextObject::setShadowParameter(int _distance,ShadowDirection _direction,const QColor &_color)
+{
+ int sx = 0;
+ int sy = 0;
+ switch ( _direction )
+ {
+ case SD_LEFT_BOTTOM:
+ case SD_LEFT:
+ case SD_LEFT_UP:
+ sx = - _distance;
+ case SD_RIGHT_UP:
+ case SD_RIGHT:
+ case SD_RIGHT_BOTTOM:
+ sx = _distance;
+ default:
+ break;
+ }
+ switch ( _direction )
+ {
+ case SD_LEFT_UP:
+ case SD_UP:
+ case SD_RIGHT_UP:
+ sy = - _distance;
+ case SD_LEFT_BOTTOM:
+ case SD_BOTTOM:
+ case SD_RIGHT_BOTTOM:
+ sy = _distance;
+ default:
+ break;
+ }
+ KoTextFormat tmpFormat;
+ tmpFormat.setShadow( sx, sy, _color );
+ KCommand* cmd = m_textobj->setFormatCommand( &tmpFormat, KoTextFormat::ShadowText );
+ if ( cmd )
+ m_doc->addCommand(cmd);
+}
+
+void KPrTextObject::slotFormatChanged(const KoTextFormat &_format)
+{
+ if(m_doc && m_doc->firstView())
+ m_doc->firstView()->showFormat( _format );
+}
+
+void KPrTextObject::applyStyleChange( KoStyleChangeDefMap changed )
+{
+ m_textobj->applyStyleChange( changed );
+}
+
+void KPrTextObject::slotAfterFormatting( int bottom, KoTextParag* lastFormatted, bool* abort)
+{
+ recalcVerticalAlignment();
+ int availHeight = availableHeight() - m_doc->zoomHandler()->ptToLayoutUnitPixY(alignmentValue());
+ if ( ( bottom > availHeight ) || // this parag is already below the avail height
+ ( lastFormatted && (bottom + lastFormatted->rect().height() > availHeight) ) ) // or next parag will be below it
+ {
+ int difference = ( bottom + 2 ) - availHeight; // in layout unit pixels
+ if( lastFormatted && bottom + lastFormatted->rect().height() > availHeight )
+ {
+ difference += lastFormatted->rect().height();
+ }
+#if 0
+ if(lastFormatted)
+ kdDebug(33001) << "slotAfterFormatting We need more space in " << this
+ << " bottom=" << bottom + lastFormatted->rect().height()
+ << " availHeight=" << availHeight
+ << " ->difference=" << difference << endl;
+ else
+ kdDebug(33001) << "slotAfterFormatting We need more space in " << this
+ << " bottom2=" << bottom << " availHeight=" << availHeight
+ << " ->difference=" << difference << endl;
+#endif
+ // We only auto-grow. We don't auto-shrink.
+ if(difference > 0 && !isProtect())
+ {
+ double wantedPosition = m_doc->zoomHandler()->layoutUnitPtToPt( m_doc->zoomHandler()->pixelYToPt( difference ) )
+ + getRect().bottom();
+ const KoPageLayout& p = m_doc->pageLayout();
+ double pageBottom = p.ptHeight - p.ptBottom;
+ double newBottom = QMIN( wantedPosition, pageBottom ); // don't grow bigger than the page
+ newBottom = QMAX( newBottom, getOrig().y() ); // avoid negative heights
+ //kdDebug(33001) << k_funcinfo << " current bottom=" << getRect().bottom() << " newBottom=" << newBottom << endl;
+ if ( getRect().bottom() != newBottom )
+ {
+ // We resize the text object, but skipping the KPrTextObject::setSize code
+ // (which invalidates everything etc.)
+ KPrObject::setSize( getSize().width(), newBottom - getOrig().y() );
+ // Do recalculate the new available height though
+ slotAvailableHeightNeeded();
+ m_doc->updateRuler();
+ m_doc->repaint( true );
+ *abort = false;
+ }
+ }
+ else if ( isProtect() )
+ m_textobj->setLastFormattedParag( 0 );
+ }
+}
+
+// "Extend Contents to Object Height"
+KCommand * KPrTextObject::textContentsToHeight()
+{
+ if (isProtect() )
+ return 0L;
+
+ // Count total number of lines and sum up their height (linespacing excluded)
+ KoTextParag * parag = textDocument()->firstParag();
+ int numLines = 0;
+ int textHeightLU = 0;
+ bool lineSpacingEqual = false;
+ int oldLineSpacing = 0;
+ for ( ; parag ; parag = parag->next() )
+ {
+ int lines = parag->lines();
+ numLines += lines;
+ for ( int line = 0 ; line < lines ; ++line )
+ {
+ int y, h, baseLine;
+ parag->lineInfo( line, y, h, baseLine );
+ int ls = parag->lineSpacing( line );
+ lineSpacingEqual = (oldLineSpacing == ls);
+ oldLineSpacing = ls;
+ textHeightLU += h - ls;
+ }
+ }
+
+ double textHeight = m_doc->zoomHandler()->layoutUnitPtToPt( textHeightLU );
+ double lineSpacing = ( innerHeight() - textHeight ) / numLines; // this gives the linespacing diff to apply, in pt
+ //kdDebug(33001) << k_funcinfo << "lineSpacing=" << lineSpacing << endl;
+
+ if ( KABS( innerHeight() - textHeight ) < DBL_EPSILON ) // floating-point equality test
+ return 0L; // nothing to do
+ bool oneLine =(textDocument()->firstParag() == textDocument()->lastParag() && numLines == 1);
+ if ( lineSpacing < 0 || oneLine) // text object is too small
+ lineSpacing = 0; // we can't do smaller linespacing than that, but we do need to apply it
+ // (in case there's some bigger linespacing in use)
+ if ( (oneLine || lineSpacingEqual) && (textDocument()->firstParag()->kwLineSpacing() == lineSpacing))
+ return 0L;
+ // Apply the new linespacing to the whole object
+ textDocument()->selectAll( KoTextDocument::Temp );
+ KCommand* cmd = m_textobj->setLineSpacingCommand( 0L, lineSpacing, KoParagLayout::LS_CUSTOM, KoTextDocument::Temp );
+ textDocument()->removeSelection( KoTextDocument::Temp );
+ return cmd;
+}
+
+// "Resize Object to fit Contents"
+KCommand * KPrTextObject::textObjectToContents()
+{
+ if ( isProtect() )
+ return 0L;
+ // Calculate max parag width (in case all parags are short, otherwise - with wrapping -
+ // the width is more or less the current object's width anyway).
+ KoTextParag * parag = textDocument()->firstParag();
+ double txtWidth = 10;
+ for ( ; parag ; parag = parag->next() )
+ txtWidth = QMAX( txtWidth, m_doc->zoomHandler()->layoutUnitPtToPt( parag->widthUsed() ));
+
+ // Calculate text height
+ int heightLU = textDocument()->height();
+ double txtHeight = m_doc->zoomHandler()->layoutUnitPtToPt( heightLU );
+
+ // Compare with current object's size
+ KoSize sizeDiff = KoSize( txtWidth, txtHeight ) - innerRect().size();
+ if( !sizeDiff.isNull() )
+ {
+ // The command isn't named since it's always put into a macro command.
+ return new KPrResizeCmd( QString::null, KoPoint( 0, 0 ), sizeDiff, this, m_doc);
+ }
+ return 0L;
+}
+
+void KPrTextObject::setTextMargins( double _left, double _top, double _right, double _bottom)
+{
+ bleft = _left;
+ btop = _top;
+ bright = _right;
+ bbottom = _bottom;
+}
+
+KoRect KPrTextObject::innerRect() const
+{
+ KoRect inner( getRect());
+ inner.moveBy( bLeft(), bTop());
+ inner.setWidth( inner.width() - bLeft() - bRight() );
+ inner.setHeight( inner.height() - bTop() - bBottom() );
+ return inner;
+}
+
+double KPrTextObject::innerWidth() const
+{
+ return getSize().width() - bLeft() - bRight();
+}
+
+double KPrTextObject::innerHeight() const
+{
+ return getSize().height() - bTop() - bBottom();
+}
+
+void KPrTextObject::setVerticalAligment( VerticalAlignmentType _type)
+{
+ m_textVertAlign = _type;
+ recalcVerticalAlignment();
+}
+
+void KPrTextObject::recalcVerticalAlignment()
+{
+ double txtHeight = m_doc->zoomHandler()->layoutUnitPtToPt( m_doc->zoomHandler()->pixelYToPt( textDocument()->height() ) ) + btop + bbottom;
+ double diffy = getSize().height() - txtHeight;
+
+ //kdDebug(33001) << k_funcinfo << "txtHeight: " << txtHeight << " rectHeight:" << getSize().height() << " -> diffy=" << diffy << endl;
+
+ if ( diffy <= 0.0 ) {
+ alignVertical = 0.0;
+ return;
+ }
+ switch( m_textVertAlign )
+ {
+ case KP_CENTER:
+ alignVertical = diffy/2.0;
+ break;
+ case KP_TOP:
+ alignVertical = 0.0;
+ break;
+ case KP_BOTTOM:
+ alignVertical = diffy;
+ break;
+ }
+}
+
+QPoint KPrTextObject::cursorPos(KPrCanvas *canvas, KoTextCursor *cursor) const
+{
+ KoTextZoomHandler *zh = m_doc->zoomHandler();
+ QPoint origPix = zh->zoomPoint( orig+KoPoint(bLeft(), bTop()+alignVertical) );
+ KoTextParag* parag = cursor->parag();
+ QPoint topLeft = parag->rect().topLeft(); // in QRT coords
+ int lineY = 0;
+ // Cursor height, in pixels
+ //int cursorHeight = zh->layoutUnitToPixelY( topLeft.y(), parag->lineHeightOfChar( cursor->index(), 0, &lineY ) );
+ QPoint iPoint( topLeft.x() + cursor->x(), topLeft.y() + lineY );
+ iPoint = zh->layoutUnitToPixel( iPoint );
+ iPoint.rx() -= canvas->diffx();
+ iPoint.ry() -= canvas->diffy();
+ return origPix+iPoint;
+}
+
+KPrTextView::KPrTextView( KPrTextObject * txtObj, KPrCanvas *_canvas, bool temp )
+ : KoTextView( txtObj->textObject() )
+{
+ setBackSpeller( txtObj->kPresenterDocument()->backSpeller() );
+ m_canvas=_canvas;
+ m_kptextobj=txtObj;
+ if (temp)
+ return;
+ connect( txtObj->textObject(), SIGNAL( selectionChanged(bool) ),
+ m_canvas, SIGNAL( selectionChanged(bool) ) );
+ KoTextView::setReadWrite( txtObj->kPresenterDocument()->isReadWrite() );
+ connect( textView(), SIGNAL( cut() ), SLOT( cut() ) );
+ connect( textView(), SIGNAL( copy() ), SLOT( copy() ) );
+ connect( textView(), SIGNAL( paste() ), SLOT( paste() ) );
+ updateUI( true, true );
+
+ txtObj->setEditingTextObj( true );
+}
+
+KPrTextView::~KPrTextView()
+{
+}
+
+KoTextViewIface* KPrTextView::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrTextViewIface( this );
+
+ return dcop;
+}
+
+void KPrTextView::terminate(bool removeSelection)
+{
+ disconnect( textView()->textObject(), SIGNAL( selectionChanged(bool) ),
+ m_canvas, SIGNAL( selectionChanged(bool) ) );
+ textView()->terminate(removeSelection);
+}
+
+void KPrTextView::cut()
+{
+ if ( textDocument()->hasSelection( KoTextDocument::Standard ) ) {
+ copy();
+ textObject()->removeSelectedText( cursor() );
+ }
+}
+
+void KPrTextView::copy()
+{
+ //kdDebug(33001)<<"void KPrTextView::copy() "<<endl;
+ if ( textDocument()->hasSelection( KoTextDocument::Standard ) ) {
+ QDragObject *drag = newDrag( 0 );
+ QApplication::clipboard()->setData( drag );
+ }
+}
+
+void KPrTextView::paste()
+{
+ //kdDebug(33001) << "KPrTextView::paste()" << endl;
+
+ QMimeSource *data = QApplication::clipboard()->data();
+ QCString returnedMimeType = KoTextObject::providesOasis( data );
+ if ( !returnedMimeType.isEmpty() )
+ {
+ QByteArray arr = data->encodedData( returnedMimeType );
+ if ( arr.size() )
+ {
+#if 0
+ QFile paste( "/tmp/oasis.tmp" );
+ paste.open( IO_WriteOnly );
+ paste.writeBlock( arr );
+ paste.close();
+#endif
+ KCommand *cmd = kpTextObject()->pasteOasis( cursor(), arr, true );
+ if ( cmd )
+ kpTextObject()->kPresenterDocument()->addCommand(cmd);
+ }
+ }
+ else
+ {
+ // Note: QClipboard::text() seems to do a better job than encodedData( "text/plain" )
+ // In particular it handles charsets (in the mimetype).
+ QString text = QApplication::clipboard()->text();
+ if ( !text.isEmpty() )
+ textObject()->pasteText( cursor(), text, currentFormat(), true /*removeSelected*/ );
+ }
+ kpTextObject()->layout();
+}
+
+void KPrTextView::updateUI( bool updateFormat, bool force )
+{
+ KoTextView::updateUI( updateFormat, force );
+ // Paragraph settings
+ KoTextParag * parag = static_cast<KoTextParag*>( cursor()->parag());
+ if ( m_paragLayout.alignment != parag->resolveAlignment() || force ) {
+ m_paragLayout.alignment = parag->resolveAlignment();
+ m_canvas->getView()->alignChanged( m_paragLayout.alignment );
+ }
+
+ // Counter
+ if ( !m_paragLayout.counter )
+ m_paragLayout.counter = new KoParagCounter; // we can afford to always have one here
+ KoParagCounter::Style cstyle = m_paragLayout.counter->style();
+ if ( parag->counter() )
+ *m_paragLayout.counter = *parag->counter();
+ else
+ {
+ m_paragLayout.counter->setNumbering( KoParagCounter::NUM_NONE );
+ m_paragLayout.counter->setStyle( KoParagCounter::STYLE_NONE );
+ }
+
+ if ( m_paragLayout.counter->style() != cstyle || force )
+ m_canvas->getView()->showCounter( * m_paragLayout.counter );
+
+ if(m_paragLayout.leftBorder!=parag->leftBorder() ||
+ m_paragLayout.rightBorder!=parag->rightBorder() ||
+ m_paragLayout.topBorder!=parag->topBorder() ||
+ m_paragLayout.bottomBorder!=parag->bottomBorder() || force )
+ {
+ m_paragLayout.leftBorder = parag->leftBorder();
+ m_paragLayout.rightBorder = parag->rightBorder();
+ m_paragLayout.topBorder = parag->topBorder();
+ m_paragLayout.bottomBorder = parag->bottomBorder();
+ //todo
+ //m_canvas->gui()->getView()->showParagBorders( m_paragLayout.leftBorder, m_paragLayout.rightBorder, m_paragLayout.topBorder, m_paragLayout.bottomBorder );
+ }
+
+ if ( !parag->style() )
+ kdWarning(33001) << "Paragraph " << parag->paragId() << " has no style" << endl;
+ else if ( m_paragLayout.style != parag->style() || force )
+ {
+ m_paragLayout.style = parag->style();
+ m_canvas->getView()->showStyle( m_paragLayout.style->name() );
+ }
+
+ if( m_paragLayout.margins[QStyleSheetItem::MarginLeft] != parag->margin(QStyleSheetItem::MarginLeft)
+ || m_paragLayout.margins[QStyleSheetItem::MarginFirstLine] != parag->margin(QStyleSheetItem::MarginFirstLine)
+ || m_paragLayout.margins[QStyleSheetItem::MarginRight] != parag->margin(QStyleSheetItem::MarginRight)
+ || force )
+ {
+ m_paragLayout.margins[QStyleSheetItem::MarginFirstLine] = parag->margin(QStyleSheetItem::MarginFirstLine);
+ m_paragLayout.margins[QStyleSheetItem::MarginLeft] = parag->margin(QStyleSheetItem::MarginLeft);
+ m_paragLayout.margins[QStyleSheetItem::MarginRight] = parag->margin(QStyleSheetItem::MarginRight);
+ m_canvas->getView()->showRulerIndent( m_paragLayout.margins[QStyleSheetItem::MarginLeft],
+ m_paragLayout.margins[QStyleSheetItem::MarginFirstLine],
+ m_paragLayout.margins[QStyleSheetItem::MarginRight],
+ parag->string()->isRightToLeft() );
+ }
+
+ if( m_paragLayout.tabList() != parag->tabList() || force )
+ {
+ m_paragLayout.setTabList( parag->tabList() );
+ KoRuler * hr = m_canvas->getView()->getHRuler();
+ if ( hr )
+ hr->setTabList( parag->tabList() );
+ }
+}
+
+void KPrTextView::ensureCursorVisible()
+{
+ //kdDebug(33001) << "KWTextFrameSetEdit::ensureCursorVisible paragId=" << cursor()->parag()->paragId() << endl;
+ KoTextParag * parag = cursor()->parag();
+ kpTextObject()->textObject()->ensureFormatted( parag );
+ KoTextStringChar *chr = parag->at( cursor()->index() );
+ int h = parag->lineHeightOfChar( cursor()->index() );
+ int x = parag->rect().x() + chr->x;
+ int y = 0; int dummy;
+
+ parag->lineHeightOfChar( cursor()->index(), &dummy, &y );
+ y += parag->rect().y();
+ int w = 1;
+ KPrDocument *doc= m_kptextobj->kPresenterDocument();
+ KoPoint pt= kpTextObject()->getOrig();
+ pt.setX( doc->zoomHandler()->layoutUnitPtToPt( doc->zoomHandler()->pixelXToPt( x) ) +pt.x());
+ pt.setY( doc->zoomHandler()->layoutUnitPtToPt( doc->zoomHandler()->pixelYToPt( y ))+pt.y() );
+
+ QPoint p = m_kptextobj->kPresenterDocument()->zoomHandler()->zoomPoint( pt );
+ w = m_kptextobj->kPresenterDocument()->zoomHandler()->layoutUnitToPixelX( w );
+ h = m_kptextobj->kPresenterDocument()->zoomHandler()->layoutUnitToPixelY( h );
+ m_canvas->ensureVisible( p.x(), p.y() + h / 2, w, h / 2 + 2 );
+}
+
+bool KPrTextView::doCompletion( KoTextCursor* cursor, KoTextParag *parag, int index )
+{
+ if( m_kptextobj->kPresenterDocument()->allowAutoFormat() )
+ {
+ KoAutoFormat * autoFormat = m_kptextobj->kPresenterDocument()->getAutoFormat();
+ if( autoFormat )
+ return autoFormat->doCompletion( cursor, parag, index, textObject());
+ }
+ return false;
+}
+
+bool KPrTextView::doToolTipCompletion( KoTextCursor* cursor, KoTextParag *parag, int index,int keyPress )
+{
+ if( m_kptextobj->kPresenterDocument()->allowAutoFormat() )
+ {
+ KoAutoFormat * autoFormat = m_kptextobj->kPresenterDocument()->getAutoFormat();
+ if( autoFormat )
+ return autoFormat->doToolTipCompletion( cursor, parag, index, textObject(), keyPress);
+ }
+ return false;
+}
+void KPrTextView::showToolTipBox(KoTextParag *parag, int index, QWidget *widget, const QPoint &pos)
+{
+ if( m_kptextobj->kPresenterDocument()->allowAutoFormat() )
+ {
+ KoAutoFormat * autoFormat = m_kptextobj->kPresenterDocument()->getAutoFormat();
+ if( autoFormat )
+ autoFormat->showToolTipBox(parag, index, widget, pos);
+ }
+}
+
+void KPrTextView::removeToolTipCompletion()
+{
+ if( m_kptextobj->kPresenterDocument()->allowAutoFormat() )
+ {
+ KoAutoFormat * autoFormat = m_kptextobj->kPresenterDocument()->getAutoFormat();
+ if( autoFormat )
+ autoFormat->removeToolTipCompletion();
+ }
+}
+void KPrTextView::textIncreaseIndent()
+{
+ m_canvas->setTextDepthPlus();
+}
+
+bool KPrTextView::textDecreaseIndent()
+{
+ if (m_paragLayout.margins[QStyleSheetItem::MarginLeft]>0)
+ {
+ m_canvas->setTextDepthMinus();
+ return true;
+ }
+ else
+ return false;
+}
+
+void KPrTextView::doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, QChar ch )
+{
+ if( m_kptextobj->kPresenterDocument()->allowAutoFormat())
+ {
+ KoAutoFormat * autoFormat = m_kptextobj->kPresenterDocument()->getAutoFormat();
+ if ( autoFormat )
+ autoFormat->doAutoFormat( cursor, parag, index, ch, textObject());
+ }
+}
+
+bool KPrTextView::doIgnoreDoubleSpace(KoTextParag * parag, int index,QChar ch )
+{
+ if( m_kptextobj->kPresenterDocument()->allowAutoFormat())
+ {
+
+ KoAutoFormat * autoFormat = m_kptextobj->kPresenterDocument()->getAutoFormat();
+ if( autoFormat )
+ return autoFormat->doIgnoreDoubleSpace( parag, index,ch );
+ }
+ return false;
+}
+
+void KPrTextView::startDrag()
+{
+ textView()->dragStarted();
+ m_canvas->dragStarted();
+ QDragObject *drag = newDrag( m_canvas );
+ if ( !kpTextObject()->kPresenterDocument()->isReadWrite() )
+ drag->dragCopy();
+ else
+ {
+ if ( drag->drag() && QDragObject::target() != m_canvas )
+ textObject()->removeSelectedText( cursor() );
+ }
+}
+
+void KPrTextView::showFormat( KoTextFormat *format )
+{
+ m_canvas->getView()->showFormat( *format );
+}
+
+bool KPrTextView::pgUpKeyPressed()
+{
+ KoTextCursor *cursor = textView()->cursor();
+ KoTextParag *s = cursor->parag();
+ s = textDocument()->firstParag();
+
+ textView()->cursor()->setParag( s );
+ textView()->cursor()->setIndex( 0 );
+ return true;
+}
+
+bool KPrTextView::pgDownKeyPressed()
+{
+ KoTextCursor *cursor = textView()->cursor();
+ KoTextParag *s = cursor->parag();
+ s = textDocument()->lastParag();
+ cursor->setParag( s );
+ cursor->setIndex( s->length() - 1 );
+ return true;
+}
+
+void KPrTextView::keyPressEvent( QKeyEvent *e )
+{
+ //Calculate position of tooltip for autocompletion
+ const QPoint pos = kpTextObject()->cursorPos(m_canvas, cursor());
+ textView()->handleKeyPressEvent( e, m_canvas, pos );
+}
+
+void KPrTextView::keyReleaseEvent( QKeyEvent *e )
+{
+ handleKeyReleaseEvent(e);
+}
+
+void KPrTextView::imStartEvent( QIMEvent *e )
+{
+ handleImStartEvent(e);
+}
+
+void KPrTextView::imComposeEvent( QIMEvent *e )
+{
+ handleImComposeEvent(e);
+}
+
+void KPrTextView::imEndEvent( QIMEvent *e )
+{
+ handleImEndEvent(e);
+}
+
+void KPrTextView::clearSelection()
+{
+ if ( textDocument()->hasSelection( KoTextDocument::Standard ) )
+ textDocument()->removeSelection(KoTextDocument::Standard );
+}
+
+void KPrTextView::selectAll(bool select)
+{
+ textObject()->selectAll( select );
+}
+
+void KPrTextView::drawCursor( bool b )
+{
+ KoTextView::drawCursor( b );
+ if ( !cursor()->parag() )
+ return;
+ if ( !kpTextObject()->kPresenterDocument()->isReadWrite() )
+ return;
+
+ QPainter painter( m_canvas );
+ painter.translate( -m_canvas->diffx(), -m_canvas->diffy() );
+ painter.setBrushOrigin( -m_canvas->diffx(), -m_canvas->diffy() );
+
+ kpTextObject()->drawCursor( &painter, cursor(), b, m_canvas );
+}
+
+// Convert a mouse position into a QRT document position
+QPoint KPrTextView::viewToInternal( const QPoint & pos ) const
+{
+#if 0
+ KoTextZoomHandler* zh = kpTextObject()->kPresenterDocument()->zoomHandler();
+ QPoint tmp(pos);
+ QWMatrix m;
+ m.translate( zh->zoomItX(kpTextObject()->getSize().width() / 2.0),
+ zh->zoomItY(kpTextObject()->getSize().height() / 2.0) );
+ m.rotate( kpTextObject()->getAngle() );
+
+
+
+ m.translate( zh->zoomItX(kpTextObject()->getOrig().x()),
+ zh->zoomItY(kpTextObject()->getOrig().y()) );
+ //m = m.invert();
+ tmp = m * pos;
+
+ kdDebug(33001)<<" tmp.x() :"<<tmp.x()<<" tmp.y() "<<tmp.y()<<endl;
+
+ KoRect br = KoRect( 0, 0, kpTextObject()->getSize().width(), kpTextObject()->getSize().height() );
+ double pw = br.width();
+ double ph = br.height();
+ KoRect rr = br;
+ double yPos = -rr.y();
+ double xPos = -rr.x();
+ rr.moveTopLeft( KoPoint( -rr.width() / 2.0, -rr.height() / 2.0 ) );
+
+ m.translate( zh->zoomItX(pw / 2.0),
+ zh->zoomItY(ph / 2.0 ));
+ m.rotate( kpTextObject()->getAngle() );
+ m.translate( zh->zoomItX(rr.left() + xPos),
+ zh->zoomItY(rr.top() + yPos) );
+
+ m = m.invert();
+
+ tmp = m * pos;
+
+ kdDebug(33001)<<" tmp.x() :"<<tmp.x()<<" tmp.y() "<<tmp.y()<<endl;
+#endif
+
+ return kpTextObject()->viewToInternal( pos, m_canvas );
+}
+
+void KPrTextView::mousePressEvent( QMouseEvent *e, const QPoint &/*_pos*/)
+{
+ bool addParag = handleMousePressEvent( e, viewToInternal( e->pos() ),true /*bool canStartDrag*/,
+ kpTextObject()->kPresenterDocument()->insertDirectCursor() );
+
+ if ( addParag )
+ kpTextObject()->kPresenterDocument()->setModified( true );
+}
+
+void KPrTextView::mouseDoubleClickEvent( QMouseEvent *e, const QPoint &pos)
+{
+ handleMouseDoubleClickEvent( e, pos );
+}
+
+void KPrTextView::mouseMoveEvent( QMouseEvent *e, const QPoint &_pos )
+{
+ if ( textView()->maybeStartDrag( e ) )
+ return;
+ if ( _pos.y() > 0 )
+ textView()->handleMouseMoveEvent( e,viewToInternal( e->pos() ) );
+}
+
+bool KPrTextView::isLinkVariable( const QPoint & pos )
+{
+ const QPoint iPoint = viewToInternal( pos );
+ KoLinkVariable* linkVariable = dynamic_cast<KoLinkVariable *>( textObject()->variableAtPoint( iPoint ) );
+ return linkVariable != 0;
+}
+
+void KPrTextView::openLink()
+{
+ KPrDocument * doc = kpTextObject()->kPresenterDocument();
+ if ( doc->getVariableCollection()->variableSetting()->displayLink() ) {
+ KoLinkVariable* v = linkVariable();
+ if ( v )
+ KoTextView::openLink( v );
+ }
+}
+
+void KPrTextView::mouseReleaseEvent( QMouseEvent *, const QPoint & )
+{
+ handleMouseReleaseEvent();
+}
+
+void KPrTextView::showPopup( KPrView *view, const QPoint &point, QPtrList<KAction>& actionList )
+{
+ QString word = wordUnderCursor( *cursor() );
+ view->unplugActionList( "datatools" );
+ view->unplugActionList( "datatools_link" );
+ view->unplugActionList( "spell_result_action" );
+ view->unplugActionList( "variable_action" );
+ QPtrList<KAction> &variableList = view->variableActionList();
+ variableList.clear();
+ actionList.clear();
+
+ view->kPresenterDoc()->getVariableCollection()->setVariableSelected(variable());
+ KoVariable* var = variable();
+ if ( var )
+ {
+ variableList = view->kPresenterDoc()->getVariableCollection()->popupActionList();
+ }
+
+ if( variableList.count()>0)
+ {
+ view->plugActionList( "variable_action", variableList );
+ QPopupMenu * popup = view->popupMenu("variable_popup");
+ Q_ASSERT(popup);
+ if (popup)
+ popup->popup( point ); // using exec() here breaks the spellcheck tool (event loop pb)
+
+ }
+ else
+ {
+ bool singleWord= false;
+ actionList = dataToolActionList(view->kPresenterDoc()->instance(), word, singleWord);
+ //kdDebug(33001) << "KWView::openPopupMenuInsideFrame plugging actionlist with " << actionList.count() << " actions" << endl;
+ KoLinkVariable* linkVar = dynamic_cast<KoLinkVariable *>( var );
+ QPopupMenu * popup;
+ if ( !linkVar )
+ {
+ view->plugActionList( "datatools", actionList );
+
+ KoNoteVariable * noteVar = dynamic_cast<KoNoteVariable *>( var );
+ KoCustomVariable * customVar = dynamic_cast<KoCustomVariable *>( var );
+ if( noteVar )
+ popup = view->popupMenu("note_popup");
+ else if( customVar )
+ popup = view->popupMenu("custom_var_popup");
+ else
+ {
+ if ( singleWord )
+ {
+ QPtrList<KAction> actionCheckSpellList =view->listOfResultOfCheckWord( word );
+ if ( actionCheckSpellList.count()>0)
+ {
+ view->plugActionList( "spell_result_action", actionCheckSpellList );
+ popup = view->popupMenu("text_popup_spell_with_result");
+ }
+ else
+ popup = view->popupMenu("text_popup_spell");
+ }
+ else
+ popup = view->popupMenu("text_popup");
+ }
+ }
+ else
+ {
+ view->plugActionList( "datatools_link", actionList );
+ popup = view->popupMenu("text_popup_link");
+ }
+ Q_ASSERT(popup);
+ if (popup)
+ popup->popup( point ); // using exec() here breaks the spellcheck tool (event loop pb)
+ }
+}
+
+void KPrTextView::insertCustomVariable( const QString &name)
+{
+ KPrDocument * doc = kpTextObject()->kPresenterDocument();
+ KoVariable * var = new KoCustomVariable( textDocument(), name, doc->variableFormatCollection()->format( "STRING" ),
+ doc->getVariableCollection());
+ insertVariable( var );
+}
+
+void KPrTextView::insertLink(const QString &_linkName, const QString & hrefName)
+{
+ KPrDocument * doc = kpTextObject()->kPresenterDocument();
+ KoVariable * var = new KoLinkVariable( textDocument(), _linkName, hrefName,
+ doc->variableFormatCollection()->format( "STRING" ),
+ doc->getVariableCollection());
+ insertVariable( var );
+}
+
+void KPrTextView::insertComment(const QString &_comment)
+{
+ KPrDocument * doc = kpTextObject()->kPresenterDocument();
+
+ KoVariable * var = new KoNoteVariable( textDocument(), _comment,
+ doc->variableFormatCollection()->format( "STRING" ),
+ doc->getVariableCollection());
+ insertVariable( var );
+}
+
+void KPrTextView::insertVariable( int type, int subtype )
+{
+ KPrDocument * doc = kpTextObject()->kPresenterDocument();
+ bool refreshCustomMenu = false;
+ KoVariable * var = 0L;
+ if ( type == VT_CUSTOM )
+ {
+ KoCustomVarDialog dia( m_canvas );
+ if ( dia.exec() == QDialog::Accepted )
+ {
+ KoCustomVariable *v = new KoCustomVariable( textDocument(), dia.name(),
+ doc->variableFormatCollection()->format( "STRING" ),
+ doc->getVariableCollection() );
+ v->setValue( dia.value() );
+ var = v;
+ refreshCustomMenu = true;
+ }
+ }
+ else
+ var = doc->getVariableCollection()->createVariable( type, subtype, doc->variableFormatCollection(), 0L, textDocument(),doc, 0);
+ if ( var )
+ {
+ insertVariable( var, 0, refreshCustomMenu);
+ doc->recalcPageNum();
+ }
+}
+
+void KPrTextView::insertVariable( KoVariable *var, KoTextFormat *format, bool refreshCustomMenu )
+{
+ if ( var )
+ {
+ CustomItemsMap customItemsMap;
+ customItemsMap.insert( 0, var );
+ if (!format)
+ format = currentFormat();
+ //kdDebug(33001) << "KPrTextView::insertVariable inserting into paragraph" << endl;
+#ifdef DEBUG_FORMATS
+ kdDebug(33001) << "KPrTextView::insertVariable currentFormat=" << currentFormat() << endl;
+#endif
+ textObject()->insert( cursor(), format, KoTextObject::customItemChar(),
+ i18n("Insert Variable"),
+ KoTextDocument::Standard,
+ KoTextObject::DoNotRemoveSelected,
+ customItemsMap );
+ if ( refreshCustomMenu && var->type() == VT_CUSTOM )
+ kpTextObject()->kPresenterDocument()->refreshMenuCustomVariable();
+ kpTextObject()->kPresenterDocument()->repaint( kpTextObject() );
+ }
+}
+
+bool KPrTextView::canDecode( QMimeSource *e )
+{
+ return kpTextObject()->kPresenterDocument()->isReadWrite() && ( KoTextObject::providesOasis( e ) || QTextDrag::canDecode( e ) );
+}
+
+QDragObject * KPrTextView::newDrag( QWidget * parent )
+{
+ QBuffer buffer;
+ const QCString mimeType = "application/vnd.oasis.opendocument.text";
+ KoStore * store = KoStore::createStore( &buffer, KoStore::Write, mimeType );
+ Q_ASSERT( store );
+ Q_ASSERT( !store->bad() );
+
+ KoOasisStore oasisStore( store );
+
+ //KoXmlWriter* manifestWriter = oasisStore.manifestWriter( mimeType );
+
+ KPrDocument * doc = kpTextObject()->kPresenterDocument();
+
+ doc->getVariableCollection()->variableSetting()->setModificationDate( QDateTime::currentDateTime() );
+ doc->recalcVariables( VT_DATE );
+ doc->recalcVariables( VT_TIME );
+ doc->recalcVariables( VT_STATISTIC );
+
+ KoGenStyles mainStyles;
+ KoSavingContext savingContext( mainStyles, 0, false, KoSavingContext::Store );
+
+ doc->styleCollection()->saveOasis( mainStyles, KoGenStyle::STYLE_USER, savingContext );
+
+ KoXmlWriter* bodyWriter = oasisStore.bodyWriter();
+ bodyWriter->startElement( "office:body" );
+ bodyWriter->startElement( "office:text" );
+
+ const QString plainText = textDocument()->copySelection( *bodyWriter, savingContext, KoTextDocument::Standard );
+
+ bodyWriter->endElement(); // office:text
+ bodyWriter->endElement(); // office:body
+
+ KoXmlWriter* contentWriter = oasisStore.contentWriter();
+ Q_ASSERT( contentWriter );
+
+ //KPrDocument * doc = kpTextObject()->kPresenterDocument();
+ doc->writeAutomaticStyles( *contentWriter, mainStyles, savingContext, false );
+
+ oasisStore.closeContentWriter();
+
+ if ( !store->open( "styles.xml" ) )
+ return false;
+ //manifestWriter->addManifestEntry( "styles.xml", "text/xml" );
+ doc->saveOasisDocumentStyles( store, mainStyles, 0, savingContext, KPrDocument::SaveSelected /* simply means not SaveAll */ );
+ if ( !store->close() ) // done with styles.xml
+ return false;
+
+ delete store;
+
+ KMultipleDrag* multiDrag = new KMultipleDrag( parent );
+ if ( !plainText.isEmpty() )
+ multiDrag->addDragObject( new QTextDrag( plainText, 0 ) );
+ KoStoreDrag* storeDrag = new KoStoreDrag( mimeType, 0 );
+ kdDebug() << k_funcinfo << "setting zip data: " << buffer.buffer().size() << " bytes." << endl;
+ storeDrag->setEncodedData( buffer.buffer() );
+ multiDrag->addDragObject( storeDrag );
+ return multiDrag;
+}
+
+void KPrTextView::dragEnterEvent( QDragEnterEvent *e )
+{
+ if ( !canDecode( e ) )
+ {
+ e->ignore();
+ return;
+ }
+ e->acceptAction();
+}
+
+void KPrTextView::dragMoveEvent( QDragMoveEvent *e, const QPoint & )
+{
+ if ( !canDecode( e ) )
+ {
+ e->ignore();
+ return;
+ }
+ QPoint iPoint = viewToInternal( e->pos() );
+
+ textObject()->emitHideCursor();
+ placeCursor( iPoint );
+ textObject()->emitShowCursor();
+ e->acceptAction(); // here or out of the if ?
+}
+
+void KPrTextView::dropEvent( QDropEvent * e )
+{
+ if ( canDecode( e ) )
+ {
+ KPrDocument *doc = kpTextObject()->kPresenterDocument();
+ e->acceptAction();
+ KoTextCursor dropCursor( textDocument() );
+ QPoint dropPoint = viewToInternal( e->pos() );
+ KMacroCommand *macroCmd=new KMacroCommand(i18n("Paste Text"));
+ bool addMacroCmd = false;
+ dropCursor.place( dropPoint, textDocument()->firstParag() );
+ kdDebug(33001) << "KPrTextView::dropEvent dropCursor at parag=" << dropCursor.parag()->paragId() << " index=" << dropCursor.index() << endl;
+
+ if ( ( e->source() == m_canvas ) &&
+ e->action() == QDropEvent::Move &&
+ // this is the indicator that the source and dest text objects are the same
+ textDocument()->hasSelection( KoTextDocument::Standard )
+ ) {
+ //kdDebug(33001)<<"decodeFrameSetNumber( QMimeSource *e ) :"<<numberFrameSet<<endl;
+ KCommand *cmd = textView()->prepareDropMove( dropCursor );
+ if(cmd)
+ {
+ kpTextObject()->layout();
+ macroCmd->addCommand(cmd);
+ addMacroCmd = true;
+ }
+ else
+ {
+ delete macroCmd;
+ return;
+ }
+ }
+ else
+ { // drop coming from outside -> forget about current selection
+ textDocument()->removeSelection( KoTextDocument::Standard );
+ textObject()->selectionChangedNotify();
+ }
+ QCString returnedTypeMime = KoTextObject::providesOasis( e );
+ if ( !returnedTypeMime.isEmpty() )
+ {
+ QByteArray arr = e->encodedData( returnedTypeMime );
+ if ( arr.size() )
+ {
+ KCommand *cmd = kpTextObject()->pasteOasis( cursor(), arr, false );
+ if ( cmd )
+ {
+ macroCmd->addCommand(cmd);
+ addMacroCmd = true;
+ }
+ }
+ }
+ else
+ {
+ QString text;
+ if ( QTextDrag::decode( e, text ) )
+ textObject()->pasteText( cursor(), text, currentFormat(),
+ false /*do not remove selected text*/ );
+ }
+ if ( addMacroCmd )
+ doc->addCommand(macroCmd);
+ else
+ delete macroCmd;
+ }
+}
+
+void KPrTextObject::saveParagraph( QDomDocument& doc,KoTextParag * parag,QDomElement &parentElem,
+ int from /* default 0 */,
+ int to /* default length()-2 */ )
+{
+ if(!parag)
+ return;
+ QDomElement paragraph=doc.createElement(tagP);
+ int tmpAlign=0;
+ switch(parag->resolveAlignment())
+ {
+ case Qt::AlignLeft:
+ tmpAlign=1;
+ break;
+ case Qt::AlignRight:
+ tmpAlign=2;
+ break;
+ case Qt::AlignHCenter:
+ tmpAlign=4;
+ break;
+ case Qt::AlignJustify:
+ tmpAlign=8;
+ }
+ if(tmpAlign!=1)
+ paragraph.setAttribute(attrAlign, tmpAlign);
+
+ saveParagLayout( parag->paragLayout(), paragraph );
+ KoTextFormat *lastFormat = 0;
+ QString tmpText;
+ for ( int i = from; i <= to; ++i ) {
+ KoTextStringChar &c = parag->string()->at(i);
+ if ( c.isCustom() )
+ {
+ QDomElement variable = doc.createElement("CUSTOM");
+ variable.setAttribute("pos", (i-from));
+ saveFormat( variable, c.format() );
+ paragraph.appendChild( variable );
+ static_cast<KoTextCustomItem *>( c.customItem() )->save(variable );
+ }
+ if ( !lastFormat || c.format()->key() != lastFormat->key() ) {
+ if ( lastFormat )
+ paragraph.appendChild(saveHelper(tmpText, lastFormat, doc));
+ lastFormat = static_cast<KoTextFormat*> (c.format());
+ tmpText=QString::null;
+ }
+ tmpText+=QString(c.c);
+ }
+ if ( lastFormat )
+ paragraph.appendChild(saveHelper(tmpText, lastFormat, doc));
+ else
+ paragraph.appendChild(saveHelper(tmpText, parag->string()->at(0).format(), doc));
+
+ parentElem.appendChild(paragraph);
+}
+
+KoPen KPrTextObject::defaultPen() const
+{
+ return KoPen( Qt::black, 1.0, Qt::NoPen );
+}
+
+QPoint KPrTextObject::viewToInternal( const QPoint & pos, KPrCanvas* canvas ) const
+{
+ KoTextZoomHandler* zh = kPresenterDocument()->zoomHandler();
+ QPoint iPoint = pos - zh->zoomPoint(
+ getOrig() + KoPoint( bLeft(),
+ bTop() + alignmentValue()) );
+ iPoint = zh->pixelToLayoutUnit(
+ QPoint( iPoint.x() + canvas->diffx(), iPoint.y() + canvas->diffy() ) );
+ return iPoint;
+}
diff --git a/kpresenter/KPrTextObject.h b/kpresenter/KPrTextObject.h
new file mode 100644
index 000000000..b30754c77
--- /dev/null
+++ b/kpresenter/KPrTextObject.h
@@ -0,0 +1,312 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kptextobject_h
+#define kptextobject_h
+
+#include "KPrObject.h"
+#include "KoRichText.h"
+#include <KoTextView.h>
+#include <KoStyleCollection.h> // for KoStyleChangeDefMap
+#include <KoStyleStack.h>
+
+class QDragObject;
+
+class KoSavingContext;
+class KPrView;
+class KPrDocument;
+class QDomElement;
+class TextCmd;
+class KPrGradient;
+
+class KoTextView;
+class KoTextObject;
+class KPrTextView;
+class KCommand;
+class KPrCanvas;
+class KoPoint;
+class KoVariable;
+class KPrTextDocument;
+class DCOPObject;
+class KPrPage;
+class KoParagStyle;
+
+class KPrTextObject : public QObject, public KPr2DObject, public KoTextFlow
+{
+ Q_OBJECT
+public:
+ KPrTextObject( KPrDocument *doc );
+ virtual ~KPrTextObject();
+
+ virtual DCOPObject* dcopObject();
+
+ virtual void setSize( double _width, double _height );
+
+ virtual void setDrawEditRect( bool b )
+ { drawEditRect = b; }
+ virtual void setDrawEmpty( bool b )
+ { drawEmpty = b; }
+
+ virtual ObjType getType() const
+ { return OT_TEXT; }
+ virtual QString getTypeString() const
+ { return i18n("Text"); }
+
+ virtual bool getDrawEditRect() const
+ { return drawEditRect; }
+ virtual bool getDrawEmpty() const
+ { return drawEmpty; }
+ virtual int getSubPresSteps() const;
+
+ virtual QBrush getBrush() const;
+
+ virtual void setShadowParameter(int _distance,ShadowDirection _direction,const QColor &_color);
+
+ virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
+ virtual double load(const QDomElement &element);
+ virtual void loadOasis(const QDomElement &element, KoOasisContext& context, KPrLoadingInfo *info);
+ virtual void saveOasisMarginElement( KoGenStyle &styleobjectauto ) const;
+
+ virtual void paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ int pageNum, bool drawingShadow, bool drawContour );
+ void paint( QPainter *_painter, KoTextZoomHandler*_zoomHandler, bool onlyChanged, KoTextCursor* cursor,
+ bool resetChanged, bool drawContour );
+ void paintEdited( QPainter *_painter, KoTextZoomHandler*_zoomHandler,
+ bool onlyChanged, KoTextCursor* cursor, bool resetChanged );
+
+ void drawCursor( QPainter *p, KoTextCursor *cursor, bool cursorVisible, KPrCanvas* /*canvas*/ );
+
+ void recalcPageNum( KPrPage *page );
+ /// Return the current text cursor position
+ QPoint cursorPos(KPrCanvas*, KoTextCursor *) const;
+
+
+ /** Return the contained text object */
+ KoTextObject * textObject() const { return m_textobj; }
+ virtual void addTextObjects( QPtrList<KoTextObject> &lst ) const {
+ if ( !isProtectContent() )
+ lst.append( m_textobj );
+ }
+
+ KPrTextDocument *textDocument() const;
+
+ KPrDocument* kPresenterDocument() const { return m_doc; }
+
+ KPrTextView * createKPTextView( KPrCanvas *,bool temp=false );
+ void applyStyleChange( KoStyleChangeDefMap changed );
+
+ void removeHighlight();
+ void highlightPortion( KoTextParag * parag, int index, int length, KPrCanvas *canvas, bool repaint, KDialogBase* dialog = 0 );
+
+ KCommand * pasteOasis( KoTextCursor * cursor, const QByteArray & data, bool removeSelected );
+
+ void saveParagraph( QDomDocument& doc,
+ KoTextParag * parag,
+ QDomElement &parentElem,
+ int from /* default 0 */,
+ int to /* default length()-2 */ );
+ KoParagLayout loadParagLayout( QDomElement & parentElem, KPrDocument *doc, bool useRefStyle);
+
+ static KoTextFormat loadFormat( QDomElement &n, KoTextFormat * refFormat, const QFont & defaultFont,
+ const QString & defaultLanguage, bool hyphen );
+
+ void setEditingTextObj( bool _edit ) { editingTextObj = _edit; }
+
+ KCommand *textContentsToHeight();
+ KCommand *textObjectToContents();
+ void setProtectContent ( bool _protect ) { textObject()->setProtectContent(_protect);}
+ bool isProtectContent() const { return textObject()->protectContent();}
+ void loadVariable( QValueList<QDomElement> & listVariable,KoTextParag *lastParag, int offset=0 );
+
+ void layout();
+
+ /** Reimplemented from KoTextFlow */
+ int availableHeight() const;
+
+ /** set left margin size */
+ void setBLeft( double b ) { bleft = b; }
+ /** set right margin size */
+ void setBRight( double b ) { bright = b; }
+ /** set top margin size */
+ void setBTop( double b ) { btop = b; }
+ /** set bottom margin size */
+ void setBBottom( double b ) { bbottom = b; }
+
+ /** get left margin size */
+ double bLeft()const { return bleft; }
+ /** get right margin size */
+ double bRight()const { return bright; }
+ /** get top margin size */
+ double bTop()const { return btop; }
+ /** get bottom margin size */
+ double bBottom()const { return bbottom; }
+
+ void setTextMargins( double _left, double _top, double right, double bottom);
+
+ KoRect innerRect() const;
+ double innerWidth() const;
+ double innerHeight() const;
+ void resizeTextDocument( bool widthChanged = true, bool heightChanged = true );
+
+ VerticalAlignmentType verticalAlignment() const { return m_textVertAlign; }
+ void setVerticalAligment( VerticalAlignmentType _type) ;
+ double alignmentValue() const { return alignVertical; }
+ virtual KPrTextObject *nextTextObject() { return this;}
+ static void saveFormat( QDomElement & element, KoTextFormat*lastFormat );
+
+ QPoint viewToInternal( const QPoint & pos, KPrCanvas* canvas ) const;
+
+signals:
+ void repaintChanged( KPrTextObject* );
+
+protected slots:
+ void slotFormatChanged(const KoTextFormat &);
+ void slotAfterFormatting( int, KoTextParag*, bool* );
+ void slotParagraphDeleted(KoTextParag*_parag);
+protected:
+ virtual const char * getOasisElementName() const;
+ virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
+
+ virtual QDomElement saveKTextObject( QDomDocument& doc );
+ QDomElement saveHelper(const QString &tmpText,KoTextFormat*lastFormat ,QDomDocument &doc);
+
+ virtual void fillStyle( KoGenStyle& styleObjectAuto, KoGenStyles& mainStyles ) const;
+
+ virtual void loadKTextObject( const QDomElement &e );
+ void drawText( QPainter* _painter, KoTextZoomHandler* zoomHandler, bool onlyChanged, KoTextCursor* cursor, bool resetChanged );
+ void drawParags( QPainter *p, KoTextZoomHandler* zoomHandler, const QColorGroup& cg, int from, int to );
+ void saveParagLayout( const KoParagLayout& layout, QDomElement & parentElem );
+ void invalidate();
+ void recalcVerticalAlignment();
+ virtual KoPen defaultPen() const;
+protected slots:
+ void slotNewCommand( KCommand *cmd );
+ void slotAvailableHeightNeeded();
+ void slotRepaintChanged();
+private:
+ KPrTextObject &operator=( const KPrTextObject & );
+ void shadowCompatibility();
+ static const QString &tagTEXTOBJ, &attrLineSpacing, &attrParagSpacing,
+ &attrMargin, &attrBulletType1, &attrBulletType2,
+ &attrBulletType3, &attrBulletType4, &attrBulletColor1,
+ &attrBulletColor2, &attrBulletColor3, &attrBulletColor4,
+ &attrObjType, &tagP, &attrAlign, &attrType,
+ &attrDepth, &tagTEXT, &attrFamily, &attrPointSize,
+ &attrBold, &attrItalic, & attrUnderline,& attrStrikeOut,
+ &attrColor, &attrWhitespace, &attrTextBackColor,
+ &attrVertAlign, &attrLinkName, &attrHrefName;
+
+ /** The contained text object */
+ KoTextObject *m_textobj;
+ KPrDocument *m_doc;
+ KoParagLayout m_paragLayout;
+ VerticalAlignmentType m_textVertAlign;
+ double bleft, bright, btop, bbottom; // margins
+ double alignVertical;
+ bool drawEditRect, drawEmpty;
+ bool editingTextObj;
+};
+
+
+class KPrTextView : public KoTextView
+{
+ Q_OBJECT
+public:
+ KPrTextView( KPrTextObject * txtObj, KPrCanvas *_canvas, bool temp=false );
+ virtual ~KPrTextView();
+
+ virtual KoTextViewIface* dcopObject();
+
+ KoTextView * textView() { return this; }
+ KPrTextObject * kpTextObject() const { return m_kptextobj; }
+
+ void keyPressEvent( QKeyEvent * );
+ void keyReleaseEvent( QKeyEvent * );
+ void imStartEvent( QIMEvent * );
+ void imComposeEvent( QIMEvent * );
+ void imEndEvent( QIMEvent * );
+ void mousePressEvent( QMouseEvent *, const QPoint &);
+ void mouseMoveEvent( QMouseEvent *, const QPoint & );
+ void mouseReleaseEvent( QMouseEvent *, const QPoint & );
+ void mouseDoubleClickEvent( QMouseEvent *, const QPoint &);
+ void dragEnterEvent( QDragEnterEvent * );
+ void dragMoveEvent( QDragMoveEvent *, const QPoint & );
+ void dropEvent( QDropEvent * );
+
+ void clearSelection();
+ void selectAll(bool select = true);
+ virtual void drawCursor( bool b );
+
+ const KoParagLayout & currentParagLayout() const { return m_paragLayout; }
+ void showPopup( KPrView *view, const QPoint &point, QPtrList<KAction> &actionList );
+ void insertVariable( int type, int subtype = 0 );
+ void insertCustomVariable( const QString &name);
+ void insertLink(const QString &_linkName, const QString & hrefName);
+ void insertVariable( KoVariable *var, KoTextFormat *format =0,
+ bool refreshCustomMenu =false /*don't refresh variable custom menu all the time */);
+
+ void terminate(bool removeSelection=true);
+ void insertComment(const QString &_note);
+
+ /** return true if some text is selected */
+ bool hasSelection() const;
+
+ virtual void removeToolTipCompletion();
+ bool isLinkVariable(const QPoint &);
+ void openLink();
+ QPoint viewToInternal( const QPoint & pos ) const;
+
+public slots:
+ void cut();
+ void copy();
+ void paste();
+ // Reimplemented from KoTextView
+ virtual void updateUI( bool updateFormat, bool force = false );
+ virtual void ensureCursorVisible();
+
+
+protected slots:
+ virtual void startDrag();
+
+protected:
+ bool canDecode( QMimeSource *e );
+ QDragObject * newDrag( QWidget * parent );
+ // Reimplemented from KoTextView
+ virtual void doAutoFormat( KoTextCursor* cursor, KoTextParag *parag, int index, QChar ch );
+ virtual bool doIgnoreDoubleSpace(KoTextParag * parag, int index,QChar ch );
+ virtual bool doCompletion( KoTextCursor* cursor, KoTextParag *parag, int index );
+ virtual bool doToolTipCompletion( KoTextCursor* , KoTextParag *, int, int );
+ virtual void showToolTipBox(KoTextParag *parag, int index, QWidget *widget, const QPoint &pos);
+ virtual void textIncreaseIndent();
+ virtual bool textDecreaseIndent();
+ virtual void showFormat( KoTextFormat *format ) ;
+
+ virtual bool pgUpKeyPressed();
+ virtual bool pgDownKeyPressed();
+
+ KPrTextObject *m_kptextobj;
+ KPrCanvas *m_canvas;
+ KoParagLayout m_paragLayout;
+ QPtrList<KAction> m_actionList; // for the kodatatools
+};
+
+
+#endif
diff --git a/kpresenter/KPrTextObjectIface.cpp b/kpresenter/KPrTextObjectIface.cpp
new file mode 100644
index 000000000..2b53aaf42
--- /dev/null
+++ b/kpresenter/KPrTextObjectIface.cpp
@@ -0,0 +1,366 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrTextObjectIface.h"
+#include "KPrTextObject.h"
+#include <KoTextViewIface.h>
+#include "KPrDocument.h"
+#include "KPrView.h"
+#include <KoTextObject.h>
+#include <kapplication.h>
+#include <dcopclient.h>
+#include "KPrCanvas.h"
+#include <kdebug.h>
+#include <kcommand.h>
+
+KPrTextObjectIface::KPrTextObjectIface( KPrTextObject *_textobject )
+ : KPrObject2DIface(_textobject)
+{
+ m_textobject = _textobject;
+}
+
+DCOPRef KPrTextObjectIface::startEditing()
+{
+ KPrDocument *doc=m_textobject->kPresenterDocument();
+ KPrView *view=doc->firstView();
+ view->getCanvas()->createEditing( m_textobject);
+ return DCOPRef( kapp->dcopClient()->appId(),
+ view->getCanvas()->currentTextObjectView()->dcopObject()->objId() );
+}
+
+bool KPrTextObjectIface::hasSelection() const
+{
+ return m_textobject->textObject()->hasSelection();
+}
+
+QString KPrTextObjectIface::selectedText() const
+{
+ return m_textobject->textObject()->selectedText();
+}
+
+void KPrTextObjectIface::selectAll( bool select )
+{
+ m_textobject->textObject()->selectAll(select);
+}
+
+void KPrTextObjectIface::recalcPageNum( )
+{
+ //FIXME
+ //m_textobject->recalcPageNum(m_textobject->kPresenterDocument());
+}
+
+void KPrTextObjectIface::setBoldText( bool b )
+{
+ KCommand *cmd=m_textobject->textObject()->setBoldCommand( b );
+ delete cmd;
+}
+
+void KPrTextObjectIface::setItalicText( bool b )
+{
+ KCommand *cmd=m_textobject->textObject()->setItalicCommand(b);
+ delete cmd;
+}
+
+void KPrTextObjectIface::setUnderlineText( bool b )
+{
+ KCommand *cmd=m_textobject->textObject()->setUnderlineCommand(b);
+ delete cmd;
+}
+
+void KPrTextObjectIface::setDoubleUnderlineText(bool b)
+{
+ KCommand *cmd=m_textobject->textObject()->setDoubleUnderlineCommand(b);
+ delete cmd;
+}
+
+void KPrTextObjectIface::setUnderlineColor( const QColor & color )
+{
+ KCommand *cmd=m_textobject->textObject()->setUnderlineColorCommand( color );
+ delete cmd;
+}
+
+void KPrTextObjectIface::setStrikeOutText( bool b )
+{
+ KCommand *cmd=m_textobject->textObject()->setStrikeOutCommand(b);
+ delete cmd;
+}
+
+void KPrTextObjectIface::setTextColor( const QColor &col )
+{
+ KCommand *cmd=m_textobject->textObject()->setTextColorCommand(col);
+ delete cmd;
+}
+
+void KPrTextObjectIface::setTextPointSize( int s )
+{
+ KCommand *cmd=m_textobject->textObject()->setPointSizeCommand( s );
+ delete cmd;
+}
+
+void KPrTextObjectIface::setTextSubScript( bool b )
+{
+ KCommand *cmd=m_textobject->textObject()->setTextSubScriptCommand( b );
+ delete cmd;
+}
+
+void KPrTextObjectIface::setTextSuperScript( bool b )
+{
+ KCommand *cmd=m_textobject->textObject()->setTextSuperScriptCommand( b );
+ delete cmd;
+}
+
+void KPrTextObjectIface::setTextDefaultFormat()
+{
+ KCommand *cmd=m_textobject->textObject()->setDefaultFormatCommand();
+ delete cmd;
+}
+
+void KPrTextObjectIface::setTextBackgroundColor(const QColor & col)
+{
+ KCommand *cmd=m_textobject->textObject()->setTextBackgroundColorCommand(col);
+ delete cmd;
+}
+
+bool KPrTextObjectIface::textDoubleUnderline()const
+{
+ return m_textobject->textObject()->textDoubleUnderline();
+}
+
+QColor KPrTextObjectIface::textUnderlineColor() const
+{
+ return m_textobject->textObject()->textUnderlineColor();
+}
+
+QColor KPrTextObjectIface::textColor() const
+{
+ return m_textobject->textObject()->textColor();
+}
+
+QFont KPrTextObjectIface::textFont() const
+{
+ return m_textobject->textObject()->textFont();
+}
+
+QString KPrTextObjectIface::textFontFamily()const
+{
+ return m_textobject->textObject()->textFontFamily();
+}
+
+QColor KPrTextObjectIface::textBackgroundColor() const
+{
+ return m_textobject->textObject()->textBackgroundColor();
+}
+
+bool KPrTextObjectIface::textItalic() const
+{
+ return m_textobject->textObject()->textItalic();
+}
+
+bool KPrTextObjectIface::textBold() const
+{
+ return m_textobject->textObject()->textBold();
+}
+
+bool KPrTextObjectIface::textUnderline()const
+{
+ return m_textobject->textObject()->textUnderline();
+}
+
+bool KPrTextObjectIface::textStrikeOut()const
+{
+ return m_textobject->textObject()->textStrikeOut();
+}
+
+bool KPrTextObjectIface::textSubScript() const
+{
+ return m_textobject->textObject()->textSubScript();
+}
+
+bool KPrTextObjectIface::textSuperScript() const
+{
+ return m_textobject->textObject()->textSuperScript();
+}
+
+void KPrTextObjectIface::setTextFamilyFont(const QString &font)
+{
+ KCommand *cmd=m_textobject->textObject()->setFamilyCommand(font);
+ delete cmd;
+}
+
+void KPrTextObjectIface::changeCaseOfText( const QString & caseType)
+{
+ KCommand *cmd = 0L;
+ if( caseType.lower() == "uppercase" )
+ cmd=m_textobject->textObject()->setChangeCaseOfTextCommand( KoChangeCaseDia::UpperCase );
+ else if( caseType.lower() =="lowercase" )
+ cmd=m_textobject->textObject()->setChangeCaseOfTextCommand( KoChangeCaseDia::LowerCase );
+ else if( caseType.lower() =="titlecase" )
+ cmd=m_textobject->textObject()->setChangeCaseOfTextCommand( KoChangeCaseDia::TitleCase );
+ else if( caseType.lower() =="togglecase" )
+ cmd=m_textobject->textObject()->setChangeCaseOfTextCommand( KoChangeCaseDia::ToggleCase );
+ else if( caseType.lower() =="sentencecase" )
+ cmd = m_textobject->textObject()->setChangeCaseOfTextCommand( KoChangeCaseDia::SentenceCase );
+ else
+ kdDebug(33001)<<"Error in void KWordTextFrameSetIface::changeCaseOfText( const QString & caseType) parameter\n";
+ delete cmd;
+}
+
+void KPrTextObjectIface::extendTextContentsToHeight()
+{
+ KCommand *cmd=m_textobject->textContentsToHeight();
+ delete cmd;
+}
+
+void KPrTextObjectIface::extendTextObjectToContents()
+{
+ KCommand *cmd= m_textobject->textObjectToContents();
+ delete cmd;
+}
+
+void KPrTextObjectIface::setProtectContent ( bool _protect )
+{
+ m_textobject->setProtectContent( _protect );
+}
+
+bool KPrTextObjectIface::isProtectContent() const
+{
+ return m_textobject->isProtectContent();
+}
+
+void KPrTextObjectIface::setPtMarginLeft(double val)
+{
+ m_textobject->setBLeft(val);
+ m_textobject->kPresenterDocument()->layout( m_textobject );
+}
+
+void KPrTextObjectIface::setPtMarginRight(double val)
+{
+ m_textobject->setBRight(val);
+ m_textobject->kPresenterDocument()->layout( m_textobject );
+}
+
+void KPrTextObjectIface::setPtMarginTop(double val)
+{
+ m_textobject->setBTop(val);
+ m_textobject->kPresenterDocument()->layout( m_textobject );
+}
+
+void KPrTextObjectIface::setPtMarginBottom(double val)
+{
+ m_textobject->setBBottom(val);
+ m_textobject->kPresenterDocument()->layout( m_textobject );
+}
+
+double KPrTextObjectIface::ptMarginLeft()const
+{
+ return m_textobject->bLeft();
+}
+
+double KPrTextObjectIface::ptMarginRight()const
+{
+ return m_textobject->bRight();
+}
+
+double KPrTextObjectIface::ptMarginTop()const
+{
+ return m_textobject->bTop();
+}
+
+double KPrTextObjectIface::ptMarginBottom()const
+{
+ return m_textobject->bBottom();
+}
+
+void KPrTextObjectIface::setVerticalAligment( const QString & type)
+{
+ if ( type.lower() =="center" )
+ m_textobject->setVerticalAligment( KP_CENTER );
+ else if ( type.lower() =="top" )
+ m_textobject->setVerticalAligment( KP_TOP );
+ else if ( type.lower() =="bottom" )
+ m_textobject->setVerticalAligment( KP_BOTTOM );
+}
+
+QString KPrTextObjectIface::verticalAlignment() const
+{
+ switch( m_textobject->verticalAlignment() )
+ {
+ case KP_CENTER:
+ return QString("center");
+ break;
+ case KP_TOP:
+ return QString("top");
+ break;
+ case KP_BOTTOM:
+ return QString("bottom");
+ break;
+ default:
+ break;
+ }
+ return QString::null;
+}
+
+//bool KPrTextObjectIface::textShadow() const
+//{
+ //return m_textobject->textObject()->textShadow();
+//}
+
+//void KPrTextObjectIface::setTextShadow( bool b )
+//{
+ //KCommand *cmd=m_textobject->textObject()->setShadowTextCommand( b );
+ //delete cmd;
+//}
+
+double KPrTextObjectIface::relativeTextSize() const
+{
+ return m_textobject->textObject()->relativeTextSize();
+}
+
+void KPrTextObjectIface::setRelativeTextSize( double _size )
+{
+ KCommand *cmd=m_textobject->textObject()->setRelativeTextSizeCommand(_size );
+ delete cmd;
+}
+
+bool KPrTextObjectIface::wordByWord() const
+{
+ return m_textobject->textObject()->wordByWord();
+}
+
+void KPrTextObjectIface::setWordByWord( bool _b )
+{
+ KCommand *cmd=m_textobject->textObject()->setWordByWordCommand(_b );
+ delete cmd;
+}
+
+QString KPrTextObjectIface::fontAttribute()const
+{
+ return KoTextFormat::attributeFontToString( m_textobject->textObject()->fontAttribute() );
+}
+
+QString KPrTextObjectIface::underlineLineStyle() const
+{
+ return KoTextFormat::underlineStyleToString( m_textobject->textObject()->underlineStyle() );
+}
+
+QString KPrTextObjectIface::strikeOutLineStyle()const
+{
+ return KoTextFormat::strikeOutStyleToString( m_textobject->textObject()->strikeOutStyle() );
+}
diff --git a/kpresenter/KPrTextObjectIface.h b/kpresenter/KPrTextObjectIface.h
new file mode 100644
index 000000000..1626b3a85
--- /dev/null
+++ b/kpresenter/KPrTextObjectIface.h
@@ -0,0 +1,110 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002, Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRESENTER_TEXTOBJECT_IFACE_H
+#define KPRESENTER_TEXTOBJECT_IFACE_H
+
+#include <KoDocumentIface.h>
+#include <dcopref.h>
+#include "KPrObject2DIface.h"
+#include <qstring.h>
+#include <qcolor.h>
+#include <qfont.h>
+class KPrTextObject;
+
+class KPrTextObjectIface : public KPrObject2DIface
+{
+ K_DCOP
+public:
+ KPrTextObjectIface( KPrTextObject *_textobject );
+
+k_dcop:
+ DCOPRef startEditing();
+ bool hasSelection() const;
+ QString selectedText() const;
+ void selectAll( bool select );
+ void recalcPageNum( );
+
+ void setBoldText( bool b );
+ void setItalicText( bool b );
+ void setUnderlineText( bool b );
+ void setStrikeOutText( bool b );
+ void setTextColor( const QColor &col );
+ void setTextPointSize( int s );
+ void setTextSubScript( bool b );
+ void setTextSuperScript( bool b );
+ void setTextDefaultFormat();
+ void setTextBackgroundColor(const QColor & col);
+ void setTextFamilyFont(const QString &font);
+ void changeCaseOfText( const QString & caseType);
+ void setDoubleUnderlineText(bool on);
+ void setUnderlineColor( const QColor & color );
+
+ QColor textColor() const;
+ QFont textFont() const;
+ QString textFontFamily()const;
+ QColor textBackgroundColor()const;
+ QColor textUnderlineColor() const;
+
+ bool textItalic() const;
+ bool textBold() const;
+ bool textUnderline()const;
+ bool textStrikeOut()const;
+ bool textSubScript() const;
+ bool textSuperScript() const;
+
+ void extendTextContentsToHeight();
+ void extendTextObjectToContents();
+ void setProtectContent ( bool _protect );
+ bool isProtectContent() const;
+ bool textDoubleUnderline()const;
+
+ double ptMarginLeft()const;
+ double ptMarginRight()const;
+ double ptMarginTop()const;
+ double ptMarginBottom()const;
+
+ void setPtMarginLeft(double val);
+ void setPtMarginRight(double val);
+ void setPtMarginTop(double val);
+ void setPtMarginBottom(double val);
+
+ void setVerticalAligment( const QString & type);
+ QString verticalAlignment() const;
+
+ //bool textShadow() const;
+ //void setTextShadow( bool b );
+
+ double relativeTextSize() const;
+ void setRelativeTextSize( double _size );
+
+ bool wordByWord() const;
+ void setWordByWord( bool _b );
+
+ QString fontAttribute()const;
+ QString underlineLineStyle() const;
+ QString strikeOutLineStyle()const;
+
+
+private:
+ KPrTextObject *m_textobject;
+};
+
+#endif
diff --git a/kpresenter/KPrTextPreview.cpp b/kpresenter/KPrTextPreview.cpp
new file mode 100644
index 000000000..b77e067ea
--- /dev/null
+++ b/kpresenter/KPrTextPreview.cpp
@@ -0,0 +1,101 @@
+#include "KPrTextPreview.h"
+
+#include <KoGlobal.h>
+
+#include <qpainter.h>
+#include <qfont.h>
+
+KPrTextPreview::KPrTextPreview( QWidget* parent, const char* name )
+ : QFrame( parent, name ),
+ shadowDirection( SD_LEFT_BOTTOM ),
+ shadowDistance( 0 ),
+ angle( 0 )
+{
+ setBackgroundColor( white );
+ setFrameStyle( NoFrame );
+}
+
+void KPrTextPreview::drawContents( QPainter* painter )
+{
+ QFont font(KoGlobal::defaultFont().family(), 30, QFont::Bold);
+ QFontMetrics fm( font );
+
+ QRect br = fm.boundingRect( "KOffice" );
+ int pw = br.width();
+ int ph = br.height();
+ QRect r = br;
+ int textYPos = -r.y();
+ int textXPos = -r.x();
+ br.moveTopLeft( QPoint( -br.width() / 2, -br.height() / 2 ) );
+ r.moveTopLeft( QPoint( -r.width() / 2, -r.height() / 2 ) );
+
+ int x = r.left() + textXPos;
+ int y = r.top() + textYPos;
+ int sx = 0, sy = 0;
+
+ switch ( shadowDirection )
+ {
+ case SD_LEFT_UP:
+ {
+ sx = x - shadowDistance;
+ sy = y - shadowDistance;
+ } break;
+ case SD_UP:
+ {
+ sx = x;
+ sy = y - shadowDistance;
+ } break;
+ case SD_RIGHT_UP:
+ {
+ sx = x + shadowDistance;
+ sy = y - shadowDistance;
+ } break;
+ case SD_RIGHT:
+ {
+ sx = x + shadowDistance;
+ sy = y;
+ } break;
+ case SD_RIGHT_BOTTOM:
+ {
+ sx = x + shadowDistance;
+ sy = y + shadowDistance;
+ } break;
+ case SD_BOTTOM:
+ {
+ sx = x;
+ sy = y + shadowDistance;
+ } break;
+ case SD_LEFT_BOTTOM:
+ {
+ sx = x - shadowDistance;
+ sy = y + shadowDistance;
+ } break;
+ case SD_LEFT:
+ {
+ sx = x - shadowDistance;
+ sy = y;
+ } break;
+ }
+
+ painter->save();
+
+ painter->setViewport( ( width() - pw ) / 2, ( height() - ph ) / 2, width(), height() );
+
+ QWMatrix m, mtx;
+ mtx.rotate( angle );
+ m.translate( pw / 2, ph / 2 );
+ m = mtx * m;
+
+ painter->setWorldMatrix( m );
+ painter->setFont( font );
+
+ if ( shadowDistance > 0 ) {
+ painter->setPen( shadowColor );
+ painter->drawText( sx, sy, "KOffice" );
+ }
+ painter->setPen( blue );
+ painter->drawText( x, y, "KOffice" );
+
+ painter->restore();
+}
+#include "KPrTextPreview.moc"
diff --git a/kpresenter/KPrTextPreview.h b/kpresenter/KPrTextPreview.h
new file mode 100644
index 000000000..e9d91616d
--- /dev/null
+++ b/kpresenter/KPrTextPreview.h
@@ -0,0 +1,30 @@
+#ifndef __textpreview_h__
+#define __textpreview_h__
+
+#include <qframe.h>
+#include "global.h"
+
+class KPrTextPreview : public QFrame
+{
+ Q_OBJECT
+
+public:
+ KPrTextPreview( QWidget* parent, const char* name = 0 );
+ ~KPrTextPreview() {}
+
+ void setShadowDirection( ShadowDirection sd ) { shadowDirection = sd; repaint( true ); }
+ void setShadowDistance( int sd ) { shadowDistance = sd; repaint( true ); }
+ void setShadowColor( const QColor &sc ) { shadowColor = sc; repaint( true ); }
+ void setAngle( double a ) { angle = a; repaint( true ); }
+
+protected:
+ void drawContents( QPainter* );
+
+ ShadowDirection shadowDirection;
+ int shadowDistance;
+ QColor shadowColor;
+ double angle;
+};
+
+#endif
+
diff --git a/kpresenter/KPrTextProperty.cpp b/kpresenter/KPrTextProperty.cpp
new file mode 100644
index 000000000..1f610538e
--- /dev/null
+++ b/kpresenter/KPrTextProperty.cpp
@@ -0,0 +1,139 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ The code is mostly a copy from kword/framedia.cc
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrTextProperty.h"
+
+#include <qcheckbox.h>
+#include <qlayout.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+
+#include "KPrMarginWidget.h"
+
+
+KPrTextProperty::KPrTextProperty( QWidget *parent, const char *name, const MarginsStruct &marginsStruct,
+ const KoUnit::Unit unit, PropValue protectContent )
+: QWidget( parent, name )
+, m_unit( unit )
+, m_protectContent( protectContent )
+{
+ QGridLayout *layout = new QGridLayout( this, 1, 1, 11, 6 );
+
+ layout->addWidget( m_protectContentCheck = new QCheckBox( i18n( "Protect content" ), this ), 0, 0 );
+ layout->addWidget( m_margins = new KPrMarginWidget( this, name, m_unit ), 1, 0 );
+
+ connect( m_protectContentCheck, SIGNAL( toggled ( bool ) ),
+ this, SLOT( slotProtectContentChanged( bool ) ) );
+
+ resize( QSize( 301, 217 ).expandedTo( minimumSizeHint() ) );
+
+ m_margins->setValues( marginsStruct.leftMargin, marginsStruct.rightMargin,
+ marginsStruct.topMargin, marginsStruct.bottomMargin );
+
+ slotReset();
+}
+
+
+KPrTextProperty::~KPrTextProperty()
+{
+}
+
+
+int KPrTextProperty::getTextPropertyChange() const
+{
+ int flags = 0;
+
+ if ( m_protectContentCheck->state() != QButton::NoChange )
+ {
+ if ( ( m_protectContentCheck->isOn() ? STATE_ON : STATE_OFF ) != m_protectContent )
+ {
+ flags |= ProtectContent;
+ }
+
+ if ( ! m_protectContentCheck->isOn() && m_margins->changed() )
+ {
+ flags |= Margins;
+ }
+ }
+
+ return flags;
+}
+
+
+MarginsStruct KPrTextProperty::getMarginsStruct() const
+{
+ MarginsStruct marginsStruct;
+ marginsStruct.leftMargin = m_margins->leftValue();
+ marginsStruct.rightMargin = m_margins->rightValue();
+ marginsStruct.topMargin = m_margins->topValue();
+ marginsStruct.bottomMargin = m_margins->bottomValue();
+ return marginsStruct;
+}
+
+
+bool KPrTextProperty::getProtectContent() const
+{
+ return m_protectContentCheck->isOn();
+}
+
+
+void KPrTextProperty::apply()
+{
+ int flags = getTextPropertyChange();
+
+ if ( flags & ProtectContent )
+ m_protectContent = m_protectContentCheck->isOn() ? STATE_ON : STATE_OFF;
+
+ if ( flags & Margins )
+ m_margins->resetChanged();
+}
+
+
+void KPrTextProperty::slotProtectContentChanged( bool b )
+{
+ m_margins->setEnabled( !b );
+}
+
+
+void KPrTextProperty::slotReset()
+{
+ switch ( m_protectContent )
+ {
+ case STATE_ON:
+ m_protectContentCheck->setChecked( true );
+ break;
+ case STATE_OFF:
+ m_protectContentCheck->setChecked( false );
+ break;
+ case STATE_UNDEF:
+ m_protectContentCheck->setTristate( true );
+ m_protectContentCheck->setNoChange();
+ break;
+ default:
+ m_protectContentCheck->setChecked( false );
+ break;
+ }
+}
+
+
+#include "KPrTextProperty.moc"
diff --git a/kpresenter/KPrTextProperty.h b/kpresenter/KPrTextProperty.h
new file mode 100644
index 000000000..5e7e5cbe6
--- /dev/null
+++ b/kpresenter/KPrTextProperty.h
@@ -0,0 +1,67 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
+
+ The code is mostly a copy from kword/framedia.cc
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef TEXTPROPERTY_H
+#define TEXTPROPERTY_H
+
+#include <qwidget.h>
+
+#include <KoUnit.h>
+
+#include "KPrCommand.h"
+
+class KPrMarginWidget;
+class QCheckBox;
+
+class KPrTextProperty : public QWidget
+{
+ Q_OBJECT
+public:
+ enum TextValueChange
+ {
+ ProtectContent = 1,
+ Margins = 2
+ };
+
+ KPrTextProperty( QWidget *parent, const char *name, const MarginsStruct &marginsStruct,
+ const KoUnit::Unit unit, PropValue protectContent );
+ ~KPrTextProperty();
+
+ int getTextPropertyChange() const;
+ MarginsStruct getMarginsStruct() const;
+ bool getProtectContent() const;
+
+ void apply();
+
+private:
+ KPrMarginWidget *m_margins;
+ QCheckBox *m_protectContentCheck;
+ KoUnit::Unit m_unit;
+
+ PropValue m_protectContent;
+
+protected slots:
+ void slotReset();
+ void slotProtectContentChanged( bool b );
+};
+
+#endif /* TEXTPROPERTY_H */
diff --git a/kpresenter/KPrTextViewIface.cpp b/kpresenter/KPrTextViewIface.cpp
new file mode 100644
index 000000000..25346274d
--- /dev/null
+++ b/kpresenter/KPrTextViewIface.cpp
@@ -0,0 +1,122 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrTextViewIface.h"
+
+#include "KPrTextObject.h"
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrTextViewIface::KPrTextViewIface( KPrTextView *_textview )
+ :KoTextViewIface(_textview)
+{
+ m_textview = _textview;
+}
+
+void KPrTextViewIface::insertVariable( int type, int subtype )
+{
+ m_textview->insertVariable(type,subtype);
+}
+
+void KPrTextViewIface::insertCustomVariable( const QString &name)
+{
+ m_textview->insertCustomVariable(name);
+}
+
+void KPrTextViewIface::insertLink(const QString &_linkName, const QString & hrefName)
+{
+ m_textview->insertLink(_linkName,hrefName);
+}
+
+void KPrTextViewIface::clearSelection()
+{
+ m_textview->clearSelection();
+}
+
+void KPrTextViewIface::selectAll()
+{
+ m_textview->selectAll();
+}
+
+void KPrTextViewIface::cut()
+{
+ m_textview->cut();
+}
+
+void KPrTextViewIface::copy()
+{
+ m_textview->copy();
+}
+
+void KPrTextViewIface::paste()
+{
+ m_textview->paste();
+}
+
+void KPrTextViewIface::insertVariable( const QString & var)
+{
+ if( var=="DATE")
+ m_textview->insertVariable(0,1);
+ else if (var=="FIXED-DATE")
+ m_textview->insertVariable(0,0);
+ else if (var=="TIME")
+ m_textview->insertVariable(2,1);
+ else if (var=="FIXED-TIME")
+ m_textview->insertVariable(2,0);
+ else if (var=="FILENAME")
+ m_textview->insertVariable(8,0);
+ else if (var=="AUTHORNAME")
+ m_textview->insertVariable(8,2);
+ else if (var=="EMAIL")
+ m_textview->insertVariable(8,3);
+ else if (var=="TITLE")
+ m_textview->insertVariable(8,10);
+ else if (var=="ABSTRACT")
+ m_textview->insertVariable(8,11);
+ else if (var=="DIRECTORYNAME")
+ m_textview->insertVariable(8,1);
+ else if (var=="COMPANYNAME")
+ m_textview->insertVariable(8,4);
+ else if (var=="PATHFILENAME")
+ m_textview->insertVariable(8,5);
+ else if (var=="FILENAMEWITHOUTEXTENSION")
+ m_textview->insertVariable(8,6);
+ else if (var=="CURRENTPAGE")
+ m_textview->insertVariable(4,0);
+ else if (var=="TOTALPAGE")
+ m_textview->insertVariable(4,1);
+ else if (var=="TELEPHONE")
+ m_textview->insertVariable(8,7);
+ else if (var=="FAX")
+ m_textview->insertVariable(8,8);
+ else if (var=="COUNTRY")
+ m_textview->insertVariable(8,9);
+ else if (var=="POSTAL_CODE")
+ m_textview->insertVariable(8,12);
+ else if (var=="CITY")
+ m_textview->insertVariable(8,13);
+ else if (var=="STREET")
+ m_textview->insertVariable(8,14);
+}
+
+void KPrTextViewIface::insertNote(const QString &_note)
+{
+ m_textview->insertComment(_note);
+}
diff --git a/kpresenter/KPrTextViewIface.h b/kpresenter/KPrTextViewIface.h
new file mode 100644
index 000000000..827e31565
--- /dev/null
+++ b/kpresenter/KPrTextViewIface.h
@@ -0,0 +1,56 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002, Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRESENTER_TEXTVIEW_IFACE_H
+#define KPRESENTER_TEXTVIEW_IFACE_H
+
+#include <KoDocumentIface.h>
+#include <dcopref.h>
+#include <KoTextViewIface.h>
+
+class KPrTextView;
+class QString;
+
+class KPrTextViewIface : public KoTextViewIface
+{
+ K_DCOP
+public:
+ KPrTextViewIface( KPrTextView *_textview );
+
+k_dcop:
+ void insertVariable( int type, int subtype = 0 );
+ void insertCustomVariable( const QString &name);
+ void insertLink(const QString &_linkName, const QString & hrefName);
+ void insertVariable( const QString & var);
+ void insertNote(const QString &_note);
+
+ void clearSelection();
+ void selectAll();
+
+ void cut();
+ void copy();
+ void paste();
+
+private:
+ KPrTextView *m_textview;
+
+};
+
+#endif
diff --git a/kpresenter/KPrTransEffectDia.cpp b/kpresenter/KPrTransEffectDia.cpp
new file mode 100644
index 000000000..120b9bfc3
--- /dev/null
+++ b/kpresenter/KPrTransEffectDia.cpp
@@ -0,0 +1,466 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Ariya Hidayat <ariya@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrTransEffectDia.h"
+
+#include "global.h"
+#include "KPrBackground.h"
+#include "KPrObject.h"
+#include "KPrTextObject.h"
+#include "KPrView.h"
+#include "KPrDocument.h"
+#include "KPrCanvas.h"
+#include "KPrPage.h"
+#include "KPrPageEffects.h"
+#include "KPrSoundPlayer.h"
+
+#include <qsplitter.h>
+#include <qheader.h>
+#include <qwmatrix.h>
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qimage.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qslider.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qframe.h>
+#include <qlabel.h>
+#include <qcombobox.h>
+
+#include <kdebug.h>
+#include <kurlrequester.h>
+#include <klocale.h>
+#include <knuminput.h>
+#include <kiconloader.h>
+#include <kurl.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+
+
+KPrEffectPreview::KPrEffectPreview( QWidget *parent, KPrDocument *_doc, KPrView *_view )
+ : QLabel( parent ), doc( _doc ), view( _view ), m_pageEffect( 0 )
+{
+ setFrameStyle( StyledPanel | Sunken );
+}
+
+void KPrEffectPreview::setPixmap( const QPixmap& pixmap )
+{
+ // find the right size
+ QRect rect = pixmap.rect();
+ int w = rect.width();
+ int h = rect.height();
+ if ( w > h ) {
+ w = 297;
+ h = 210;
+ }
+ else if ( w < h ) {
+ w = 210;
+ h = 297;
+ }
+ else if ( w == h ) {
+ w = 297;
+ h = 297;
+ }
+
+ setMinimumSize( w, h );
+
+ // create smaller pixmap for preview
+ const QImage img( pixmap.convertToImage().smoothScale( w, h, QImage::ScaleFree ) );
+ m_pixmap.convertFromImage( img );
+
+ QLabel::setPixmap( m_pixmap );
+}
+
+void KPrEffectPreview::run( PageEffect effect, EffectSpeed speed )
+{
+ QRect rect = m_pixmap.rect();
+ m_target.resize( rect.size() );
+ m_target.fill( Qt::black );
+
+ //kPchangePages( this, m_pixmap, m_target, effect, speed );
+ if ( m_pageEffect )
+ {
+ m_pageEffectTimer.stop();
+ QObject::disconnect( &m_pageEffectTimer, SIGNAL( timeout() ), this, SLOT( slotDoPageEffect() ) );
+
+ m_pageEffect->finish();
+
+ delete m_pageEffect;
+ m_pageEffect = 0;
+ QLabel::repaint();
+ }
+
+ m_pageEffect = new KPrPageEffects( this, m_target, effect, speed );
+ if ( m_pageEffect->doEffect() )
+ {
+ delete m_pageEffect;
+ m_pageEffect = 0;
+ QLabel::update();
+ }
+ else
+ {
+ connect( &m_pageEffectTimer, SIGNAL( timeout() ), SLOT( slotDoPageEffect() ) );
+ m_pageEffectTimer.start( 50, true );
+ }
+
+ //QLabel::update();
+}
+
+
+void KPrEffectPreview::slotDoPageEffect()
+{
+ if ( m_pageEffect->doEffect() )
+ {
+ m_pageEffectTimer.stop();
+ QObject::disconnect( &m_pageEffectTimer, SIGNAL( timeout() ), this, SLOT( slotDoPageEffect() ) );
+ delete m_pageEffect;
+ m_pageEffect = 0;
+ QLabel::update();
+ }
+ else
+ {
+ m_pageEffectTimer.start( 50, true );
+ }
+}
+
+
+KPrTransEffectDia::KPrTransEffectDia( QWidget *parent, const char *name,
+ KPrDocument *_doc, KPrView *_view )
+ : KDialogBase( parent, name, true, "", KDialogBase::User1|Ok|Cancel ),
+ doc( _doc ), view( _view ), soundPlayer( 0 )
+{
+ enableButtonSeparator( true );
+
+ QWidget *page = new QWidget( this );
+ setMainWidget(page);
+
+ QBoxLayout *topLayout = new QHBoxLayout( page, KDialog::marginHint(), KDialog::spacingHint() );
+ QWidget* leftpart = new QWidget( page );
+ topLayout->addWidget( leftpart );
+ QWidget* rightpart = new QWidget( page );
+ topLayout->addWidget( rightpart );
+
+ // right-side of the dialog, for showing effect preview
+
+ QVBoxLayout *rightlayout = new QVBoxLayout( rightpart, KDialog::marginHint(), KDialog::spacingHint() );
+ rightlayout->setAutoAdd( true );
+
+ effectPreview = new KPrEffectPreview( rightpart, doc, view );
+
+ int pgnum = view->getCurrPgNum() - 1; // getCurrPgNum() is 1-based
+ KPrPage* pg = doc->pageList().at( pgnum );
+
+ // pixmap for effect preview
+ QRect rect= pg->getZoomPageRect();
+ QPixmap pix( rect.size() );
+ pix.fill( Qt::white );
+ view->getCanvas()->drawPageInPix( pix, pgnum, 100 );
+ effectPreview->setPixmap( pix );
+
+ pageEffect = pg->getPageEffect();
+ speed = pg->getPageEffectSpeed();
+
+ QVBoxLayout *leftlayout = new QVBoxLayout( leftpart, KDialog::marginHint(), KDialog::spacingHint() );
+ leftlayout->setAutoAdd( true );
+
+ new QLabel( i18n("Effect:"), leftpart );
+
+ effectList = new QListBox( leftpart );
+ effectList->insertItem( i18n( "No Effect" ) );
+ effectList->insertItem( i18n( "Close Horizontal" ) );
+ effectList->insertItem( i18n( "Close Vertical" ) );
+ effectList->insertItem( i18n( "Close From All Directions" ) );
+ effectList->insertItem( i18n( "Open Horizontal" ) );
+ effectList->insertItem( i18n( "Open Vertical" ) );
+ effectList->insertItem( i18n( "Open From All Directions" ) );
+ effectList->insertItem( i18n( "Interlocking Horizontal 1" ) );
+ effectList->insertItem( i18n( "Interlocking Horizontal 2" ) );
+ effectList->insertItem( i18n( "Interlocking Vertical 1" ) );
+ effectList->insertItem( i18n( "Interlocking Vertical 2" ) );
+ effectList->insertItem( i18n( "Surround 1" ) );
+ effectList->insertItem( i18n( "Fly Away 1" ) );
+ effectList->insertItem( i18n( "Blinds Horizontal" ) );
+ effectList->insertItem( i18n( "Blinds Vertical" ) );
+ effectList->insertItem( i18n( "Box In" ) );
+ effectList->insertItem( i18n( "Box Out" ) );
+ effectList->insertItem( i18n( "Checkerboard Across" ) );
+ effectList->insertItem( i18n( "Checkerboard Down" ) );
+ effectList->insertItem( i18n( "Cover Down" ) );
+ effectList->insertItem( i18n( "Uncover Down" ) );
+ effectList->insertItem( i18n( "Cover Up" ) );
+ effectList->insertItem( i18n( "Uncover Up" ) );
+ effectList->insertItem( i18n( "Cover Left" ) );
+ effectList->insertItem( i18n( "Uncover Left" ) );
+ effectList->insertItem( i18n( "Cover Right" ) );
+ effectList->insertItem( i18n( "Uncover Right" ) );
+ effectList->insertItem( i18n( "Cover Left-Up" ) );
+ effectList->insertItem( i18n( "Uncover Left-Up" ) );
+ effectList->insertItem( i18n( "Cover Left-Down" ) );
+ effectList->insertItem( i18n( "Uncover Left-Down" ) );
+ effectList->insertItem( i18n( "Cover Right-Up" ) );
+ effectList->insertItem( i18n( "Uncover Right-Up" ) );
+ effectList->insertItem( i18n( "Cover Right-Bottom" ) );
+ effectList->insertItem( i18n( "Uncover Right-Bottom" ) );
+ effectList->insertItem( i18n( "Dissolve" ) );
+ effectList->insertItem( i18n( "Strips Left-Up" ) );
+ effectList->insertItem( i18n( "Strips Left-Down" ) );
+ effectList->insertItem( i18n( "Strips Right-Up" ) );
+ effectList->insertItem( i18n( "Strips Right-Down" ) );
+ effectList->insertItem( i18n( "Melting" ) );
+ effectList->insertItem( i18n( "Random Transition" ) );
+ effectList->setCurrentItem( static_cast<int>( pageEffect ) );
+
+ // workaround, because Random Effect is always negative
+ if( pageEffect == PEF_RANDOM )
+ effectList->setCurrentItem( effectList->count()-1 );
+
+ connect( effectList, SIGNAL(highlighted(int)), this, SLOT(effectChanged(int)) );
+ connect( effectList, SIGNAL( doubleClicked ( QListBoxItem *) ), this, SLOT( effectChanged()) );
+
+ new QLabel( i18n("Speed:"), leftpart );
+
+ QWidget* sp = new QWidget( leftpart );
+ QBoxLayout* speedLayout = new QHBoxLayout( sp, KDialog::marginHint(), KDialog::spacingHint() );
+ speedLayout->setAutoAdd( true );
+
+ speedCombo = new QComboBox( sp );
+ speedCombo->insertItem(i18n("Slow") );
+ speedCombo->insertItem(i18n("Medium") );
+ speedCombo->insertItem(i18n("Fast") );
+
+
+ speedCombo->setCurrentItem( speed );
+
+ connect( speedCombo, SIGNAL(activated(int)), this, SLOT(speedChanged(int)) );
+
+
+ QWidget* previewgrp = new QWidget( leftpart );
+ QBoxLayout* previewLayout = new QHBoxLayout( previewgrp, KDialog::marginHint(), KDialog::spacingHint() );
+ previewLayout->setAutoAdd( true );
+
+ automaticPreview = new QCheckBox( i18n( "Automatic preview" ), previewgrp );
+ automaticPreview->setChecked( true );
+
+ QWidget* previewspacer = new QWidget( previewgrp );
+ previewspacer->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,
+ QSizePolicy::Expanding ) );
+
+ previewButton = new QPushButton( previewgrp );
+ previewButton->setText( i18n("Preview") );
+ connect( previewButton, SIGNAL(clicked()), this, SLOT(preview()) );
+
+ QFrame* line = new QFrame( leftpart );
+ line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+
+ soundFileName = pg->getPageSoundFileName();
+ soundEffect = pg->getPageSoundEffect();
+
+ checkSoundEffect = new QCheckBox( i18n( "Sound effect" ), leftpart );
+ checkSoundEffect->setChecked( soundEffect );
+ connect( checkSoundEffect, SIGNAL( clicked() ), this, SLOT( soundEffectChanged() ) );
+
+ QWidget* soundgrp = new QWidget( leftpart );
+ QBoxLayout* soundLayout = new QHBoxLayout( soundgrp, KDialog::marginHint(), KDialog::spacingHint() );
+ soundLayout->setAutoAdd( true );
+
+ lSoundEffect = new QLabel( i18n( "File name:" ), soundgrp );
+ requester = new KURLRequester( soundgrp );
+ requester->setURL( soundFileName );
+ connect( requester, SIGNAL( openFileDialog( KURLRequester * ) ),
+ this, SLOT( slotRequesterClicked( KURLRequester * ) ) );
+ connect( requester, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( slotSoundFileChanged( const QString& ) ) );
+
+ buttonTestPlaySoundEffect = new QPushButton( soundgrp );
+ buttonTestPlaySoundEffect->setPixmap( BarIcon("1rightarrow", KIcon::SizeSmall) );
+ QToolTip::add( buttonTestPlaySoundEffect, i18n("Play") );
+
+ connect( buttonTestPlaySoundEffect, SIGNAL( clicked() ), this, SLOT( playSound() ) );
+
+ buttonTestStopSoundEffect = new QPushButton( soundgrp );
+ buttonTestStopSoundEffect->setPixmap( BarIcon("player_stop", KIcon::SizeSmall) );
+ QToolTip::add( buttonTestStopSoundEffect, i18n("Stop") );
+
+ connect( buttonTestStopSoundEffect, SIGNAL( clicked() ), this, SLOT( stopSound() ) );
+
+ soundEffect = pg->getPageSoundEffect();
+ setButtonText(KDialogBase::User1,i18n( "Apply &Global" ));
+
+ slideTime = pg->getPageTimer();
+
+ new QLabel( i18n("Automatically advance to the next slide after:"), rightpart );
+
+ timeSlider = new KIntNumInput( slideTime, rightpart );
+ timeSlider->setRange( 1, 600, 1 );
+ timeSlider->setSuffix( i18n( " seconds" ) );
+ connect( timeSlider, SIGNAL(valueChanged(int)), this, SLOT(timeChanged(int)) );
+
+ QWidget* rspacer = new QWidget( rightpart );
+ rspacer->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
+
+ QWidget* lspacer = new QWidget( leftpart );
+ lspacer->setMinimumSize( 10, spacingHint() );
+
+ soundEffectChanged();
+}
+
+void KPrTransEffectDia::preview()
+{
+ if( pageEffect==PEF_NONE)
+ return;
+ effectPreview->run( pageEffect, speed );
+}
+
+void KPrTransEffectDia::effectChanged()
+{
+ effectChanged( effectList->currentItem() );
+}
+
+void KPrTransEffectDia::effectChanged( int index )
+{
+ if( effectList->currentText() == i18n( "Random Transition" ) )
+ pageEffect = PEF_RANDOM;
+ else
+ pageEffect = static_cast<PageEffect>( index );
+
+ if( automaticPreview->isChecked() ) preview();
+}
+
+void KPrTransEffectDia::speedChanged( int value )
+{
+ speed = static_cast<EffectSpeed>(value);
+}
+
+void KPrTransEffectDia::timeChanged( int value )
+{
+ if( value <= 0 ) value = 1;
+ slideTime = value;
+}
+
+void KPrTransEffectDia::soundEffectChanged()
+{
+ soundEffect = checkSoundEffect->isChecked();
+
+ lSoundEffect->setEnabled( checkSoundEffect->isChecked() );
+ requester->setEnabled( checkSoundEffect->isChecked() );
+
+ if ( !requester->url().isEmpty() ) {
+ buttonTestPlaySoundEffect->setEnabled( checkSoundEffect->isChecked() );
+ buttonTestStopSoundEffect->setEnabled( checkSoundEffect->isChecked() );
+ }
+ else {
+ buttonTestPlaySoundEffect->setEnabled( false );
+ buttonTestStopSoundEffect->setEnabled( false );
+ }
+}
+
+static QString getSoundFileFilter()
+{
+ QStringList fileList;
+ fileList << "wav" << "au" << "mp3" << "mp1" << "mp2" << "mpg" << "dat"
+ << "mpeg" << "ogg" << "cdda" << "cda " << "vcd" << "null";
+ fileList.sort();
+
+ bool comma = false;
+ QString full, str;
+ QStringList::ConstIterator end( fileList.end() );
+ for ( QStringList::ConstIterator it = fileList.begin(); it != end; ++it ) {
+ if ( comma )
+ str += '\n';
+ comma = true;
+ str += QString( i18n( "*.%1|%2 Files" ) ).arg( *it ).arg( (*it).upper() );
+
+ full += QString( "*.") + (*it) + ' ';
+ }
+
+ str = full + '|' + i18n( "All Supported Files" ) + '\n' + str;
+ str += "\n*|" + i18n( "All Files" );
+
+ return str;
+}
+
+void KPrTransEffectDia::slotRequesterClicked( KURLRequester * )
+{
+ QString filter = getSoundFileFilter();
+ requester->fileDialog()->setFilter( filter );
+
+ // find the first "sound"-resource that contains files
+ QStringList soundDirs = KGlobal::dirs()->resourceDirs( "sound" );
+ if ( !soundDirs.isEmpty() ) {
+ KURL soundURL;
+ QDir dir;
+ dir.setFilter( QDir::Files | QDir::Readable );
+ QStringList::ConstIterator it = soundDirs.begin();
+ while ( it != soundDirs.end() ) {
+ dir = *it;
+ if ( dir.isReadable() && dir.count() > 2 ) {
+ soundURL.setPath( *it );
+ requester->fileDialog()->setURL( soundURL );
+ break;
+ }
+ ++it;
+ }
+ }
+}
+
+void KPrTransEffectDia::slotSoundFileChanged( const QString& text )
+{
+ soundFileName = text;
+
+ buttonTestPlaySoundEffect->setEnabled( !text.isEmpty() );
+ buttonTestStopSoundEffect->setEnabled( !text.isEmpty() );
+}
+
+void KPrTransEffectDia::playSound()
+{
+ delete soundPlayer;
+ soundPlayer = new KPrSoundPlayer( requester->url() );
+ soundPlayer->play();
+
+ buttonTestPlaySoundEffect->setEnabled( false );
+ buttonTestStopSoundEffect->setEnabled( true );
+}
+
+void KPrTransEffectDia::stopSound()
+{
+ if ( soundPlayer ) {
+ soundPlayer->stop();
+ delete soundPlayer;
+ soundPlayer = 0;
+
+ buttonTestPlaySoundEffect->setEnabled( true );
+ buttonTestStopSoundEffect->setEnabled( false );
+ }
+}
+
+void KPrTransEffectDia::slotOk()
+{
+ // TODO: only if changed. And pass flags for which settings changed
+ emit apply( false );
+}
+
+void KPrTransEffectDia::slotUser1()
+{
+ // TODO: only if changed. And pass flags for which settings changed
+ emit apply( true );
+}
+
+#include "KPrTransEffectDia.moc"
diff --git a/kpresenter/KPrTransEffectDia.h b/kpresenter/KPrTransEffectDia.h
new file mode 100644
index 000000000..17d8f0ce5
--- /dev/null
+++ b/kpresenter/KPrTransEffectDia.h
@@ -0,0 +1,138 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2002 Ariya Hidayat <ariya@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+// Slide Transition Effect dialog box
+
+#ifndef __TRANSEFFECTDIA_H
+#define __TRANSEFFECTDIA_H
+
+#include <kdialogbase.h>
+#include <qlabel.h>
+#include <qtimer.h>
+#include "global.h"
+
+class KPrDocument;
+class KPrView;
+class QCheckBox;
+class QSplitter;
+class QLabel;
+class QPushButton;
+class QCheckBox;
+class QSlider;
+class QString;
+class QComboBox;
+class KPrBackGround;
+class KPrObject;
+class KPPresStructObjectItem;
+class KURLRequester;
+class KIntNumInput;
+class KPrSoundPlayer;
+class KPrPageEffects;
+
+class KPrEffectPreview : public QLabel
+{
+ Q_OBJECT
+
+public:
+ KPrEffectPreview( QWidget *parent, KPrDocument *_doc, KPrView *_view );
+
+public slots:
+ void setPixmap( const QPixmap& pixmap );
+ void run( PageEffect effect, EffectSpeed speed );
+
+protected:
+ KPrDocument *doc;
+ KPrView *view;
+ QPixmap m_pixmap;
+ QPixmap m_target;
+
+ QTimer m_pageEffectTimer;
+ KPrPageEffects *m_pageEffect;
+
+protected slots:
+ void slotDoPageEffect();
+};
+
+
+class KPrTransEffectDia: public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KPrTransEffectDia( QWidget *parent, const char *name,
+ KPrDocument *_doc, KPrView *_view );
+
+ PageEffect getPageEffect() const { return pageEffect; }
+ EffectSpeed getPageEffectSpeed() const { return speed; }
+ bool getSoundEffect() const { return soundEffect; }
+ QString getSoundFileName() const { return soundFileName; }
+ bool getAutoAdvance() const { return false; } // FIXME !
+ int getSlideTime() const { return slideTime; }
+
+signals:
+ void apply( bool global );
+
+protected:
+ virtual void slotOk();
+ virtual void slotUser1();
+
+ KPrDocument *doc;
+ KPrView *view;
+
+ PageEffect pageEffect;
+ EffectSpeed speed;
+ bool soundEffect;
+ QString soundFileName;
+
+ KPrEffectPreview *effectPreview;
+
+ QListBox *effectList;
+ QComboBox *speedCombo;
+
+ QCheckBox *automaticPreview;
+ QPushButton *previewButton;
+
+ QCheckBox *checkSoundEffect;
+ QLabel *lSoundEffect;
+ KURLRequester *requester;
+ QPushButton *buttonTestPlaySoundEffect, *buttonTestStopSoundEffect;
+
+ KIntNumInput* timeSlider;
+ int slideTime;
+
+ KPrSoundPlayer *soundPlayer;
+
+protected slots:
+
+ void preview();
+ void effectChanged( int );
+ void effectChanged();
+
+ void speedChanged( int );
+ void timeChanged( int );
+
+ void soundEffectChanged();
+ void slotRequesterClicked( KURLRequester * );
+ void slotSoundFileChanged( const QString& );
+ void playSound();
+ void stopSound();
+};
+
+#endif // __TRANSEFFECTDIA_H
diff --git a/kpresenter/KPrUtils.cpp b/kpresenter/KPrUtils.cpp
new file mode 100644
index 000000000..0387de48a
--- /dev/null
+++ b/kpresenter/KPrUtils.cpp
@@ -0,0 +1,448 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrUtils.h"
+
+#include "KPrObject.h"
+#include "KPrGroupObject.h"
+#include "KPrFreehandObject.h"
+#include "KPrPolylineObject.h"
+#include "KPrBezierCurveObject.h"
+#include "KPrPieObject.h"
+
+#include <KoXmlNS.h>
+#include <KoTextZoomHandler.h>
+#include <KoPoint.h>
+
+#include <qpainter.h>
+#include <qpointarray.h>
+#include <qpoint.h>
+#include <qcolor.h>
+#include <qsize.h>
+#include <qbitmap.h>
+#include <qcursor.h>
+#include <qdatetime.h>
+#include <qdom.h>
+
+void drawFigure( LineEnd figure, QPainter* painter, const KoPoint &coord, const QColor &color,
+ int _w, float angle, KoZoomHandler* _zoomHandler)
+{
+ painter->save();
+ painter->setPen( Qt::NoPen );
+ painter->setBrush( Qt::NoBrush );
+
+ switch ( figure )
+ {
+ case L_SQUARE:
+ {
+ int _h = _w;
+ if ( _h % 2 == 0 ) _h--;
+ painter->translate( _zoomHandler->zoomItX(coord.x()), _zoomHandler->zoomItY( coord.y()) );
+ painter->rotate( angle );
+ painter->scale( 1, 1 );
+ painter->fillRect( _zoomHandler->zoomItX( -6 - _w ),
+ _zoomHandler->zoomItY( -3 - _h / 2),
+ _zoomHandler->zoomItX( 6 + _w),
+ _zoomHandler->zoomItY( 6 + _h), color );
+ } break;
+ case L_CIRCLE:
+ {
+ painter->translate( _zoomHandler->zoomItX(coord.x()), _zoomHandler->zoomItY(coord.y()) );
+ painter->rotate( angle );
+ painter->setBrush( color );
+ painter->drawEllipse( _zoomHandler->zoomItX( -6 - _w ),
+ _zoomHandler->zoomItY( -3 - _w / 2 ),
+ _zoomHandler->zoomItX( 6 + _w),
+ _zoomHandler->zoomItY(6 + _w) );
+ } break;
+ case L_ARROW:
+ {
+ KoPoint p1( -10 - _w, -3 - _w / 2 );
+ KoPoint p2( 0 , 0 );
+ KoPoint p3( -10 - _w, 3 + _w / 2 );
+ QPointArray pArray( 3 );
+ pArray.setPoint( 0, _zoomHandler->zoomPoint(p1) );
+ pArray.setPoint( 1, _zoomHandler->zoomPoint(p2) );
+ pArray.setPoint( 2, _zoomHandler->zoomPoint(p3) );
+
+ painter->translate( _zoomHandler->zoomItX(coord.x()),_zoomHandler->zoomItY( coord.y()) );
+ painter->rotate( angle );
+ painter->scale( 1, 1 );
+ painter->setBrush( color );
+ painter->drawPolygon( pArray );
+ } break;
+ case L_LINE_ARROW:
+ {
+ painter->translate( _zoomHandler->zoomItX(coord.x()),_zoomHandler->zoomItY( coord.y()) );
+ painter->setPen( QPen(color , _zoomHandler->zoomItX( _w )) );
+ painter->rotate( angle );
+ painter->scale( 1, 1 );
+ QPoint p1( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(-3 - _w / 2) );
+ QPoint p2( _zoomHandler->zoomItX(0), _zoomHandler->zoomItY(0) );
+ QPoint p3( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(3 + _w / 2) );
+ painter->drawLine( p2, p1);
+ painter->drawLine( p2, p3);
+ }break;
+ case L_DIMENSION_LINE:
+ {
+ painter->translate( _zoomHandler->zoomItX(coord.x()),_zoomHandler->zoomItY( coord.y()) );
+ painter->setPen( QPen(color , _zoomHandler->zoomItX( _w )) );
+ painter->rotate( angle );
+ painter->scale( 1, 1 );
+ QPoint p1( _zoomHandler->zoomItX(- _w / 2), _zoomHandler->zoomItY(-5 - _w / 2) );
+ QPoint p2( _zoomHandler->zoomItX(- _w / 2), _zoomHandler->zoomItY(5 + _w / 2 ) );
+ painter->drawLine( p1, p2);
+ }break;
+ case L_DOUBLE_ARROW:
+ {
+ painter->translate( _zoomHandler->zoomItX(coord.x()),_zoomHandler->zoomItY( coord.y()) );
+ painter->rotate( angle );
+ painter->scale( 1, 1 );
+ painter->setBrush( color );
+
+ KoPoint p1( -10 - _w , -3 - _w / 2 );
+ KoPoint p2( 0, 0 );
+ KoPoint p3( -10 - _w, 3 + _w / 2 );
+
+ KoPoint p4( -20 - _w, -3 - _w / 2 );
+ KoPoint p5( -10, 0 );
+ KoPoint p6( -20 - _w, 3 + _w / 2 );
+
+ QPointArray pArray( 3 );
+ pArray.setPoint( 0, _zoomHandler->zoomPoint(p1) );
+ pArray.setPoint( 1, _zoomHandler->zoomPoint(p2) );
+ pArray.setPoint( 2, _zoomHandler->zoomPoint(p3) );
+ painter->drawPolygon( pArray );
+ pArray.setPoint( 0, _zoomHandler->zoomPoint(p4) );
+ pArray.setPoint( 1, _zoomHandler->zoomPoint(p5) );
+ pArray.setPoint( 2, _zoomHandler->zoomPoint(p6) );
+ painter->drawPolygon( pArray );
+
+ }break;
+ case L_DOUBLE_LINE_ARROW:
+ {
+ painter->translate( _zoomHandler->zoomItX(coord.x()),_zoomHandler->zoomItY( coord.y()) );
+ painter->setPen( QPen(color , _zoomHandler->zoomItX( _w )) );
+ painter->rotate( angle );
+ painter->scale( 1, 1 );
+ QPoint p1( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(-3 - _w / 2) );
+ QPoint p2( _zoomHandler->zoomItX(0), _zoomHandler->zoomItY(0) );
+ QPoint p3( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(3 + _w / 2) );
+ painter->drawLine( p2, p1);
+ painter->drawLine( p2, p3);
+
+ p1.setX( _zoomHandler->zoomItX(-20 - _w));
+ p2.setX( _zoomHandler->zoomItX(-10));
+ p3.setX( _zoomHandler->zoomItX(-20 - _w));
+ painter->drawLine( p2, p1);
+ painter->drawLine( p2, p3);
+ }break;
+ default: break;
+ }
+ painter->restore();
+}
+
+void drawFigureWithOffset( LineEnd figure, QPainter* painter, const QPoint &coord, const QColor &color,
+ int _w, float angle, KoZoomHandler*_zoomHandler)
+{
+ KoSize diff = getOffset( figure, _w, angle );
+ KoPoint offsetPoint(diff.width(), diff.height());
+ offsetPoint += _zoomHandler->unzoomPoint( coord );
+ drawFigure( figure, painter, offsetPoint, color, _w, angle,_zoomHandler );
+}
+
+void drawFigureWithOffset( LineEnd figure, QPainter* painter, const KoPoint &coord, const QColor &color,
+ int w, float angle, KoZoomHandler*_zoomHandler, bool begin )
+{
+ KoSize diff = getOffset( figure, w, angle );
+ KoPoint offsetPoint(diff.width(), diff.height());
+ double offsetAngle = angle + ( begin ? 90.0 : -90.0 );
+ KoPoint lineOffset( w * cos( offsetAngle * M_PI / 180.0 ) / 2,
+ w * sin( offsetAngle * M_PI / 180.0 ) / 2 );
+ offsetPoint += coord + lineOffset;
+ drawFigure( figure, painter, offsetPoint, color, w, angle,_zoomHandler );
+}
+
+KoSize getBoundingSize( LineEnd figure, int _w, const KoZoomHandler*_zoomHandler )
+{
+ switch ( figure )
+ {
+ case L_SQUARE:
+ {
+ int _h = (int)_w;
+ if ( _h % 2 == 0 ) _h--;
+ return KoSize( _zoomHandler->zoomItX( 10 + _w), _zoomHandler->zoomItY( 10 + _h) );
+ } break;
+ case L_CIRCLE:
+ return KoSize( _zoomHandler->zoomItX(10 + _w), _zoomHandler->zoomItY(10 + _w) );
+ break;
+ case L_ARROW:
+ return KoSize( _zoomHandler->zoomItX( 14 + _w),_zoomHandler->zoomItY( 14 + _w) );
+ break;
+ case L_LINE_ARROW:
+ return KoSize( _zoomHandler->zoomItX( 14 + _w),_zoomHandler->zoomItY( 14 + _w) );
+ break;
+ case L_DIMENSION_LINE:
+ return KoSize( _zoomHandler->zoomItX( 14 +_w),_zoomHandler->zoomItY( 14 + _w) );
+ break;
+ case L_DOUBLE_ARROW:
+ return KoSize( _zoomHandler->zoomItX( 28 + _w),_zoomHandler->zoomItY( 14 + _w) );
+ break;
+ case L_DOUBLE_LINE_ARROW:
+ return KoSize( _zoomHandler->zoomItX( 28 + _w),_zoomHandler->zoomItY( 14 + _w) );
+ break;
+ default: break;
+ }
+
+ return KoSize( 0, 0 );
+}
+
+KoSize getOffset( LineEnd figure, int _w, float angle )
+{
+ double x = 0;
+ double y = 0;
+ switch ( figure )
+ {
+ case L_ARROW:
+ case L_DOUBLE_ARROW:
+ {
+ x = _w * 2;
+ y = _w * 2;
+ break;
+ }
+ case L_SQUARE:
+ case L_CIRCLE:
+ {
+ x = _w + 3;
+ y = _w + 3;
+ break;
+ }
+ case L_LINE_ARROW:
+ case L_DOUBLE_LINE_ARROW:
+ {
+ x = _w + 1;
+ y = _w + 1;
+ break;
+ }
+ case L_DIMENSION_LINE:
+ {
+ x = _w / 2;
+ y = _w / 2;
+ break;
+ }
+ default: break;
+ }
+
+ return KoSize( x * cos( angle * M_PI / 180.0 ), y * sin( angle * M_PI / 180 ) );
+}
+
+QString lineEndBeginName( LineEnd type )
+{
+ switch(type)
+ {
+ case L_NORMAL:
+ return QString("NORMAL");
+ case L_ARROW:
+ return QString("ARROW");
+ case L_SQUARE:
+ return QString("SQUARE");
+ case L_CIRCLE:
+ return QString("CIRCLE");
+ case L_LINE_ARROW:
+ return QString("LINE_ARROW");
+ case L_DIMENSION_LINE:
+ return QString("DIMENSION_LINE");
+ case L_DOUBLE_ARROW:
+ return QString("DOUBLE_ARROW");
+ case L_DOUBLE_LINE_ARROW:
+ return QString("DOUBLE_LINE_ARROW");
+ }
+ return QString::null;
+}
+
+LineEnd lineEndBeginFromString( const QString & type )
+{
+ if(type=="NORMAL")
+ return L_NORMAL;
+ else if(type=="ARROW")
+ return L_ARROW;
+ else if(type=="SQUARE")
+ return L_SQUARE;
+ else if(type=="CIRCLE")
+ return L_CIRCLE;
+ else if(type=="LINE_ARROW")
+ return L_LINE_ARROW;
+ else if (type=="DIMENSION_LINE")
+ return L_DIMENSION_LINE;
+ else if (type=="DOUBLE_ARROW")
+ return L_DOUBLE_ARROW;
+ else if (type=="DOUBLE_LINE_ARROW")
+ return L_DOUBLE_LINE_ARROW;
+ else
+ kdDebug(33001)<<"Error in LineEnd lineEndBeginFromString( const QString & name )\n";
+ return L_NORMAL;
+}
+
+QString lineEndBeginSvg( LineEnd element )
+{
+ QString str;
+ switch( element )
+ {
+ case L_NORMAL:
+ //nothing
+ break;
+ case L_ARROW:
+ str = "m10 0-10 30h20z";
+ break;
+ case L_SQUARE:
+ str = "m0 0h10v10h-10z";
+ break;
+ case L_CIRCLE:
+ str = "m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z";
+ break;
+ case L_LINE_ARROW:
+ str = "m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z";
+ break;
+ case L_DIMENSION_LINE:
+ str = "m0 0h278 278 280v36 36 38h-278-278-280v-36-36z";
+ break;
+ case L_DOUBLE_ARROW:
+ str = "m737 1131h394l-564-1131-567 1131h398l-398 787h1131z";
+ break;
+ case L_DOUBLE_LINE_ARROW:
+ //this define is not good I don't know how to define it.
+ str = "m0 11h312 312h122z";
+ break;
+ }
+ return str;
+}
+
+QCursor KPrUtils::penCursor()
+{
+ static unsigned char pen_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x7d,
+ 0x00, 0x80, 0x7e, 0x00, 0x40, 0x7f, 0x00, 0xa0, 0x3f, 0x00, 0xd0, 0x1f,
+ 0x00, 0xe8, 0x0f, 0x00, 0xf4, 0x07, 0x00, 0xfa, 0x03, 0x00, 0xfd, 0x01,
+ 0x80, 0xfe, 0x00, 0x40, 0x7f, 0x00, 0xa0, 0x3f, 0x00, 0xf0, 0x1f, 0x00,
+ 0xd0, 0x0f, 0x00, 0x88, 0x07, 0x00, 0x88, 0x03, 0x00, 0xe4, 0x01, 0x00,
+ 0x7c, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+ QBitmap pen_bitmap( 24, 24, pen_bits, true );
+ QBitmap pen_mask( 24, 24 );
+ QPixmap pix( pen_bitmap );
+ pen_mask = pix.createHeuristicMask( false );
+ pix.setMask( pen_mask );
+
+ return QCursor( pix, 1, 22 );
+}
+
+QCursor KPrUtils::rotateCursor()
+{
+ static unsigned char rotate_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0xc0, 0xf3, 0x00, 0xe0, 0xff, 0x01,
+ 0xf0, 0xe1, 0x03, 0x70, 0x80, 0x03, 0x78, 0x80, 0x07, 0x38, 0x00, 0x07,
+ 0x38, 0x00, 0x07, 0xff, 0xe1, 0x3f, 0xfa, 0xc4, 0x17, 0x74, 0x8c, 0x0b,
+ 0x28, 0x3a, 0x05, 0x10, 0x1f, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x08, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+ QBitmap rotate_bitmap( 22, 22, rotate_bits, true );
+ QBitmap rotate_mask( 22, 22 );
+ QPixmap pix( rotate_bitmap );
+ rotate_mask = pix.createHeuristicMask( false );
+ pix.setMask( rotate_mask );
+
+ return QCursor( pix, 11, 13 );
+}
+
+QString saveOasisTimer( int second )
+{
+ QTime time;
+ time = time.addSecs( second );
+ QString hours( QString::number( time.hour() ).rightJustify( 2, '0' ) );
+ QString ms( QString::number( time.minute() ).rightJustify( 2, '0' ) );
+ QString sec( QString::number( time.second() ).rightJustify( 2, '0' ) );
+
+
+ //ISO8601 chapter 5.5.3.2
+ //QDate doesn't encode it as this format.
+ QString timeIso = QString( "PT%1H%2M%3S" ).arg( hours ).arg( ms ).arg( sec );
+ return timeIso;
+}
+
+int loadOasisTimer( const QString & timer )
+{
+ QString str( timer );
+ //convert date duration
+ int hour( str.mid( 2, 2 ).toInt() );
+ int minute( str.mid( 5, 2 ).toInt() );
+ int second( str.mid( 8, 2 ).toInt() );
+
+ return ( second + minute*60 + hour*60*60 );
+}
+
+
+int readOasisSettingsInt( const QDomElement & element )
+{
+ if ( element.hasAttributeNS( KoXmlNS::config, "type" ) )
+ {
+ QString type = element.attributeNS( KoXmlNS::config, "type", QString::null );
+ QString str = element.text();
+ bool b;
+ int value = str.toInt( &b );
+ return ( b ? value : 0 );
+ }
+ return 0;
+}
+
+double readOasisSettingsDouble( const QDomElement & element )
+{
+ if ( element.hasAttributeNS( KoXmlNS::config, "type" ) )
+ {
+ QString type = element.attributeNS( KoXmlNS::config, "type", QString::null );
+ QString str = element.text();
+ bool b;
+ double value = str.toDouble( &b );
+ return ( b ? value : 0 );
+ }
+ return 0.0;
+}
+
+bool readOasisSettingsBool( const QDomElement & element )
+{
+ if ( element.hasAttributeNS( KoXmlNS::config, "type" ) )
+ {
+ QString type = element.attributeNS( KoXmlNS::config, "type", QString::null );
+ QString str = element.text();
+ return ( str == "true" ? true : false );
+ }
+ return false;
+}
+
+QString readOasisSettingsString( const QDomElement & element )
+{
+ if ( element.hasAttributeNS( KoXmlNS::config, "type" ) )
+ {
+ QString type = element.attributeNS( KoXmlNS::config, "type", QString::null );
+ QString str = element.text();
+ return str;
+ }
+ return QString::null;
+}
diff --git a/kpresenter/KPrUtils.h b/kpresenter/KPrUtils.h
new file mode 100644
index 000000000..560fa75ff
--- /dev/null
+++ b/kpresenter/KPrUtils.h
@@ -0,0 +1,62 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _kpresenter_utils_h__
+#define _kpresenter_utils_h__
+
+#include "global.h"
+#include "KoPointArray.h"
+#include <qcursor.h>
+class QPoint;
+class QColor;
+class QPainter;
+class KoZoomHandler;
+class KoSize;
+class KoPoint;
+class QDomElement;
+class KPrObject;
+
+void drawFigure( LineEnd figure, QPainter* painter, const KoPoint &coord, const QColor & color,
+ int _w, float angle, KoZoomHandler*_zoomHandler );
+void drawFigureWithOffset( LineEnd figure, QPainter* painter, const QPoint &coord, const QColor & color,
+ int _w, float angle, KoZoomHandler*_zoomHandler );
+void drawFigureWithOffset( LineEnd figure, QPainter* painter, const KoPoint &coord, const QColor &color,
+ int w, float angle, KoZoomHandler*_zoomHandler, bool begin);
+KoSize getBoundingSize( LineEnd figure, int _w, const KoZoomHandler*_zoomHandler );
+KoSize getOffset( LineEnd figure, int _w, float angle );
+QString lineEndBeginName( LineEnd type );
+LineEnd lineEndBeginFromString( const QString & name );
+QString lineEndBeginSvg( LineEnd element );
+QString saveOasisTimer( int second );
+int loadOasisTimer( const QString & timer );
+
+class KPrUtils
+{
+public:
+ static QCursor penCursor(); // pen tool cursors
+ static QCursor rotateCursor(); // rotate tool cursor
+};
+
+int readOasisSettingsInt( const QDomElement & element );
+double readOasisSettingsDouble( const QDomElement & element );
+bool readOasisSettingsBool( const QDomElement & element );
+QString readOasisSettingsString( const QDomElement & element );
+
+#endif
diff --git a/kpresenter/KPrVariableCollection.cpp b/kpresenter/KPrVariableCollection.cpp
new file mode 100644
index 000000000..2c436a527
--- /dev/null
+++ b/kpresenter/KPrVariableCollection.cpp
@@ -0,0 +1,200 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrVariableCollection.h"
+#include <KoVariable.h>
+#include "KPrDocument.h"
+#include "KPrCommand.h"
+#include <klocale.h>
+#include <kdebug.h>
+#include <KoXmlNS.h>
+#include <KoDom.h>
+#include "KPrTextObject.h"
+#include "KPrPage.h"
+
+KPrVariableCollection::KPrVariableCollection(KoVariableSettings *_setting, KoVariableFormatCollection* coll)
+ : KoVariableCollection(_setting, coll)
+{
+}
+
+KoVariable* KPrVariableCollection::loadOasisField( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context )
+{
+ const QString localName( tag.localName() );
+ const bool isTextNS = tag.namespaceURI() == KoXmlNS::text;
+ if ( isTextNS )
+ {
+ if ( localName == "object-count" ||
+ localName == "picture-count" ||
+ localName == "paragraph-count" ||
+ localName == "word-count" ||
+ localName == "character-count" ||
+ localName == "sentence-count" ||
+ localName == "line-count" ||
+ localName == "frame-count" ||
+ localName == "non-whitespace-character-count" ||
+ localName == "syllable-count" )
+ {
+ QString key = "NUMBER";
+ int type = VT_STATISTIC;
+ return loadOasisFieldCreateVariable( textdoc, tag, context, key, type );
+ }
+ else
+ return KoVariableCollection::loadOasisField( textdoc, tag, context );
+ }
+ else
+ return KoVariableCollection::loadOasisField( textdoc, tag, context );
+}
+
+KoVariable *KPrVariableCollection::createVariable( int type, short int subtype, KoVariableFormatCollection * coll,
+ KoVariableFormat *varFormat,KoTextDocument *textdoc,
+ KoDocument * doc, int _correct, bool _forceDefaultFormat, bool /*loadFootNote*/ )
+{
+ KPrDocument*m_doc=static_cast<KPrDocument*>(doc);
+ KoVariable * var = 0L;
+ switch(type) {
+ case VT_PGNUM:
+ {
+ kdDebug(33001)<<" subtype == KoPageVariable::VST_CURRENT_SECTION :"<<(subtype == KPrPgNumVariable::VST_CURRENT_SECTION)<<endl;
+ kdDebug(33001)<<" varFormat :"<<varFormat<<endl;
+ if ( !varFormat )
+ varFormat = (subtype == KPrPgNumVariable::VST_CURRENT_SECTION) ? coll->format("STRING") : coll->format("NUMBER");
+ var = new KPrPgNumVariable( textdoc,subtype, varFormat,this,m_doc );
+ break;
+ }
+ case VT_STATISTIC:
+ if ( !varFormat )
+ varFormat = coll->format("NUMBER");
+ var = new KPrStatisticVariable( textdoc, subtype, varFormat, this, m_doc );
+ break;
+ default:
+ return KoVariableCollection::createVariable( type, subtype, coll, varFormat, textdoc,
+ doc, _correct, _forceDefaultFormat);
+ }
+ return var;
+}
+
+
+KPrPgNumVariable::KPrPgNumVariable( KoTextDocument *textdoc, short int subtype, KoVariableFormat *varFormat,
+ KoVariableCollection *_varColl, KPrDocument *doc )
+ : KoPageVariable( textdoc, subtype, varFormat ,_varColl ),m_doc(doc)
+{
+}
+
+void KPrPgNumVariable::recalc()
+{
+ if ( m_subtype == VST_PGNUM_TOTAL )
+ {
+ m_varValue = QVariant( (int)(m_doc->getPageNums()+m_varColl->variableSetting()->startingPageNumber()-1));
+ resize();
+ }
+ // But we don't want to keep a width of -1 ...
+ if ( width == -1 )
+ width = 0;
+}
+
+KPrStatisticVariable::KPrStatisticVariable( KoTextDocument *textdoc, int subtype, KoVariableFormat *varFormat,KoVariableCollection *_varColl, KPrDocument *doc )
+ : KoStatisticVariable( textdoc, subtype, varFormat, _varColl ),
+ m_doc(doc)
+{
+}
+
+void KPrStatisticVariable::recalc()
+{
+ int nb = 0;
+ ulong charsWithSpace = 0L;
+ ulong charsWithoutSpace = 0L;
+ ulong words = 0L;
+ ulong sentences = 0L;
+ ulong lines = 0L;
+ ulong syllables = 0L;
+ bool frameInfo = ( m_subtype == VST_STATISTIC_NB_WORD ||
+ m_subtype == VST_STATISTIC_NB_SENTENCE ||
+ m_subtype == VST_STATISTIC_NB_LINES ||
+ m_subtype == VST_STATISTIC_NB_CHARACTERE);
+ KPrPage *page = m_doc->activePage();
+ if( !page) //When we load activePage is null
+ return;
+ QPtrListIterator<KPrObject> objIt( page->objectList() );
+
+ for ( objIt.toFirst(); objIt.current(); ++objIt )
+ {
+ KPrObject *obj = objIt.current();
+ if ( m_subtype == VST_STATISTIC_NB_FRAME )
+ ++nb;
+ else if( m_subtype == VST_STATISTIC_NB_PICTURE && obj->getType() == OT_PICTURE)
+ {
+ ++nb;
+ }
+ else if( m_subtype == VST_STATISTIC_NB_EMBEDDED && obj->getType() == OT_PART )
+ {
+ ++nb;
+ }
+ if ( frameInfo )
+ {
+ KPrTextObject *textObj = dynamic_cast<KPrTextObject *>( obj );
+ if ( textObj )
+ textObj->textObject()->statistics( 0L, charsWithSpace, charsWithoutSpace, words, sentences, syllables, lines, false );
+ }
+ }
+ if ( frameInfo )
+ {
+ if( m_subtype == VST_STATISTIC_NB_WORD )
+ {
+ nb = words;
+ }
+ else if( m_subtype == VST_STATISTIC_NB_SENTENCE )
+ {
+ nb = sentences;
+ }
+ else if( m_subtype == VST_STATISTIC_NB_LINES )
+ {
+ nb = lines;
+ }
+ else if ( m_subtype == VST_STATISTIC_NB_CHARACTERE )
+ {
+ nb = charsWithSpace;
+ }
+ else if ( m_subtype ==VST_STATISTIC_NB_NON_WHITESPACE_CHARACTERE )
+ {
+ nb = charsWithoutSpace;
+ }
+ else if ( m_subtype ==VST_STATISTIC_NB_SYLLABLE )
+ {
+ nb = syllables;
+ }
+ else
+ nb = 0;
+ }
+
+ m_varValue = QVariant(nb);
+ resize();
+ if ( width == -1 )
+ width = 0;
+}
+
+QString KPrStatisticVariable::text(bool realValue)
+{
+ if (m_varColl->variableSetting()->displayFieldCode()&& !realValue)
+ return fieldCode();
+ else
+ return m_varFormat->convert( m_varValue );
+}
+
+
diff --git a/kpresenter/KPrVariableCollection.h b/kpresenter/KPrVariableCollection.h
new file mode 100644
index 000000000..060e5747d
--- /dev/null
+++ b/kpresenter/KPrVariableCollection.h
@@ -0,0 +1,71 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kprvariable_h
+#define kprvariable_h
+
+#include <qstring.h>
+#include <qasciidict.h>
+#include <KoVariable.h>
+
+#include "KPrTextDocument.h"
+class KPrDocument;
+class KoVariable;
+class KoPageVariable;
+class KoTextFormat;
+class KoVariableSettings;
+
+class KPrVariableCollection : public KoVariableCollection
+{
+public:
+ KPrVariableCollection(KoVariableSettings *_setting, KoVariableFormatCollection* coll);
+ virtual KoVariable *createVariable( int type, short int subtype, KoVariableFormatCollection * coll,
+ KoVariableFormat *varFormat,KoTextDocument *textdoc, KoDocument * doc,
+ int _correct, bool _forceDefaultFormat=false , bool loadFootNote= true);
+ virtual KoVariable* loadOasisField( KoTextDocument* textdoc, const QDomElement& tag, KoOasisContext& context );
+};
+
+/**
+ * "current page number" and "number of pages" variables
+ */
+class KPrPgNumVariable : public KoPageVariable
+{
+public:
+ KPrPgNumVariable( KoTextDocument *textdoc, short int subtype, KoVariableFormat *varFormat,
+ KoVariableCollection *_varColl, KPrDocument *doc );
+
+ virtual void recalc();
+
+private:
+ KPrDocument *m_doc;
+};
+
+
+class KPrStatisticVariable : public KoStatisticVariable
+{
+public:
+ KPrStatisticVariable( KoTextDocument *textdoc, int subtype, KoVariableFormat *varFormat,KoVariableCollection *_varColl, KPrDocument *doc );
+ virtual void recalc();
+ virtual QString text(bool realValue=false);
+
+protected:
+ KPrDocument *m_doc;
+};
+#endif
diff --git a/kpresenter/KPrView.cpp b/kpresenter/KPrView.cpp
new file mode 100644
index 000000000..7e7e52cfe
--- /dev/null
+++ b/kpresenter/KPrView.cpp
@@ -0,0 +1,6480 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include <kprinter.h>
+#include <kaccel.h>
+#include <kglobalsettings.h>
+#include <qpainter.h>
+#include <qscrollbar.h>
+#include <qpopupmenu.h>
+#include <qcursor.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <assert.h>
+#include <qtoolbutton.h>
+#include <qtooltip.h>
+#include <qdir.h>
+#include <qclipboard.h>
+#include <qradiobutton.h>
+#include <qdragobject.h>
+#include <qfile.h>
+
+#include "KPrPage.h"
+#include "KPrBackDia.h"
+#include "autoformEdit/AFChoose.h"
+#include "KPrPropertyEditor.h"
+#include "KPrPgConfDia.h"
+#include "KPrEffectDia.h"
+#include "KPrRotationDialogImpl.h"
+#include "KPrShadowDialogImpl.h"
+#include "KPrImageEffectDia.h"
+#include "KPrBackground.h"
+#include "KPrPenStyleWidget.h"
+#include "KPrObjectProperties.h"
+
+#include <KoAutoFormat.h>
+
+#include "KPrSlideTransitionDia.h"
+
+#include "KPrPresDurationDia.h"
+#include "KPrPartObject.h"
+#include "KPrSideBar.h"
+#include "KPrNoteBar.h"
+#include "insertpagedia.h"
+#include "KPrCustomSlideShowDia.h"
+
+#include <KoPictureFilePreview.h>
+#include <KoCreateStyleDia.h>
+
+#include <dcopclient.h>
+#include <kfiledialog.h>
+#include <kmessagebox.h>
+#include <kstdaction.h>
+#include <kapplication.h>
+#include <kio/netaccess.h>
+
+#include "KPrView.h"
+#include "KPrDocument.h"
+#include "KPrWebPresentation.h"
+#include "KPrMSPresentationSetup.h"
+#include "KPrTextObject.h"
+
+#include <klocale.h>
+#include <kcolordialog.h>
+#include <kconfig.h>
+#include <kfontdialog.h>
+#include <kglobal.h>
+#include <kimageio.h>
+#include <kparts/event.h>
+#include <kdebug.h>
+#include <ktempfile.h>
+#include <kcolorbutton.h>
+#include <kprocess.h>
+
+#include <KoMainWindow.h>
+#include <KoPartSelectDia.h>
+#include <KoQueryTrader.h>
+#include <KoPageLayoutDia.h>
+#include <KoRuler.h>
+#include <KoTemplateCreateDia.h>
+#include <kcoloractions.h>
+#include <tkcoloractions.h>
+#include <kaction.h>
+#include <qspinbox.h>
+#include <qcombobox.h>
+#include <KoPartSelectAction.h>
+#include <KoTextZoomHandler.h>
+#include <Kolinestyleaction.h>
+#include <Kolinewidthaction.h>
+
+#include <stdlib.h>
+#include <signal.h>
+
+#include <kstandarddirs.h>
+
+#include "KPrViewIface.h"
+#include "KPrConfig.h"
+
+#include <KoTextParag.h>
+#include <KoTextObject.h>
+#include "KPrCommand.h"
+#include <KoFontDia.h>
+#include <KoCharSelectDia.h>
+#include <KoInsertLink.h>
+#include <KoAutoFormatDia.h>
+#include <KoParagCounter.h>
+#include <KoParagDia.h>
+#include <KoVariable.h>
+#include <KoCustomVariablesDia.h>
+#include <KoGuideLineDia.h>
+#include <KoCompletionDia.h>
+
+#include <kspell.h>
+#include <kstatusbar.h>
+#include "KPrTextDocument.h"
+
+#include <KoChangeCaseDia.h>
+#include <qregexp.h>
+
+#include <KoSearchDia.h>
+#include "KPrFindReplace.h"
+#include "KPrVariableCollection.h"
+#include "KPrCanvas.h"
+#include <qpaintdevicemetrics.h>
+#include <KoStyleCollection.h>
+#include "KPrStyleManager.h"
+#include "KPrPixmapObject.h"
+#include <KoCommentDia.h>
+
+#include "KPrDuplicateObjDia.h"
+#include <kstdaccel.h>
+#include <KoDocumentInfo.h>
+#include <kaccelgen.h>
+#include "KPrImportStyleDia.h"
+#include <kurldrag.h>
+#include <config.h>
+#include <KoStore.h>
+#include <KoStoreDrag.h>
+
+#include <kspell2/broker.h>
+#include <kspell2/defaultdictionary.h>
+#include <kspell2/dialog.h>
+#include "KoSpell.h"
+#include "KPrPrinterDlg.h"
+using namespace KSpell2;
+
+#define COPYOASISFORMAT 0
+
+static const char * const pageup_xpm[] = {
+ " 14 14 2 1",
+ ". c #000000",
+ "# c none",
+ "##############",
+ "##############",
+ "######..######",
+ "#####....#####",
+ "####......####",
+ "###........###",
+ "##############",
+ "######..######",
+ "#####....#####",
+ "####......####",
+ "###........###",
+ "##############",
+ "##############",
+ "##############"
+};
+
+static const char * const pagedown_xpm[] = {
+ " 14 14 2 1",
+ ". c #000000",
+ "# c none",
+ "##############",
+ "##############",
+ "##############",
+ "###........###",
+ "####......####",
+ "#####....#####",
+ "######..######",
+ "##############",
+ "###........###",
+ "####......####",
+ "#####....#####",
+ "######..######",
+ "##############",
+ "##############"
+};
+
+#ifdef HAVE_DPMS
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xmd.h>
+#include <X11/extensions/dpms.h>
+#include <fixx11h.h>
+
+extern "C" {
+#ifndef HAVE_DPMSCAPABLE_PROTO
+Bool DPMSCapable( Display * );
+#endif
+}
+
+#if defined(XIMStringConversionRetrival) || defined (__sun) || defined(__hpux)
+extern "C" {
+#endif
+ Bool DPMSQueryExtension(Display *, int *, int *);
+ Status DPMSEnable(Display *);
+ Status DPMSDisable(Display *);
+ Bool DPMSGetTimeouts(Display *, CARD16 *, CARD16 *, CARD16 *);
+#if defined(XIMStringConversionRetrival) || defined (__sun) || defined(__hpux)
+}
+#endif
+#endif
+
+static void enableDPMS(bool enable)
+{
+#ifdef HAVE_DPMS
+ Display *display = qt_xdisplay();
+
+ int dummy;
+ bool hasDPMS = DPMSQueryExtension(display, &dummy, &dummy);
+ if (hasDPMS && DPMSCapable(display)) {
+ if (enable) {
+ kdDebug() << "Enabling DPMS" << endl;
+ DPMSEnable(display);
+ } else {
+ kdDebug() << "Disabling DPMS" << endl;
+ DPMSDisable(display);
+ }
+ } else
+ qWarning("Server has no DPMS extension");
+
+ XFlush(display);
+#else
+ Q_UNUSED(enable); /* keep gcc silent */
+#endif
+}
+
+static bool isDPMSEnabled()
+{
+ bool result = false;
+#ifdef HAVE_DPMS
+ int event_base;
+ int error_base;
+ CARD16 x_standby;
+ CARD16 x_suspend;
+ CARD16 x_off;
+ Display *display = qt_xdisplay();
+ if (DPMSQueryExtension(display, &event_base, &error_base))
+ if (DPMSCapable(display))
+ result = (DPMSGetTimeouts(display, &x_standby, &x_suspend, &x_off));
+#endif
+ return result;
+}
+
+KPrView::KPrView( KPrDocument* _doc, QWidget *_parent, const char *_name )
+ : KoView( _doc, _parent, _name )
+{
+
+ setInstance( KPrFactory::global() );
+ if ( !_doc->isReadWrite() )
+ setXMLFile( "kpresenter_readonly.rc" );
+ else
+ setXMLFile( "kpresenter.rc" );
+
+ dcop = 0;
+ dcopObject(); // build it
+
+ m_bDisplayFieldCode=false;
+ // init
+ afChoose = 0;
+ m_propertyEditor = 0;
+ pgConfDia = 0;
+ rotateDia = 0;
+ shadowDia = 0;
+ imageEffectDia = 0;
+ presDurationDia = 0;
+ v_ruler = 0;
+ h_ruler = 0;
+ pen = KoPen( black, 1.0, SolidLine );
+ brush = QBrush( white, SolidPattern );
+ lineBegin = L_NORMAL;
+ lineEnd = L_NORMAL;
+ gColor1 = red;
+ gColor2 = green;
+ gType = BCT_GHORZ;
+ gUnbalanced = false;
+ gXFactor = 100;
+ gYFactor = 100;
+ fillType = FT_BRUSH;
+ pieType = PT_PIE;
+ pieLength = 90 * 16;
+ pieAngle = 45 * 16;
+ setMouseTracking( true );
+ m_bShowGUI = true;
+ presStarted = false;
+ m_autoPresRestart = false;
+ m_autoPresStop = false;
+ rndX = 0;
+ rndY = 0;
+ m_editMaster = false;
+ allowWebPres = true;
+ allowMSPres = true;
+ currPg = 0;
+ sidebar = 0;
+ notebar = 0;
+ splitter = 0;
+ pageBase = 0;
+ m_canvas = 0L;
+ m_spell.kospell = 0;
+ m_spell.textIterator = 0L;
+ m_spell.macroCmdSpellCheck = 0L;
+ m_spell.dlg = 0;
+ m_broker = Broker::openBroker( KSharedConfig::openConfig( "kpresenterrc" ) );
+
+ m_autoPresTimerConnected = false;
+ m_actionList.setAutoDelete( true );
+ checkConcavePolygon = false;
+ cornersValue = 3;
+ sharpnessValue = 0;
+ tbAlign = Qt::AlignLeft;
+ tbFont = font();
+ tbColor = black;
+
+ mirrorType = PM_NORMAL;
+ depth = 0;
+ swapRGB = false;
+ grayscal = false;
+ bright = 0;
+
+ m_currentLineTool = LtLine;
+ m_currentShapeTool = StRectangle;
+ m_currentClosedLineTool = CltFreehand;
+
+ m_searchEntry = 0L;
+ m_replaceEntry = 0L;
+ m_findReplace = 0L;
+ m_switchPage=-1;
+
+ m_fontDlg=0L;
+ m_paragDlg=0L;
+ m_pKPresenterDoc = _doc;
+
+ createGUI();
+
+ setKeyCompression( true );
+ m_specialCharDlg=0L;
+
+ if ( shell() )
+ changeNbOfRecentFiles( m_pKPresenterDoc->maxRecentFiles() );
+
+ connect(this, SIGNAL(embeddImage(const QString &)), SLOT(insertPicture(const QString &)));
+ connect( m_pKPresenterDoc, SIGNAL( sig_refreshMenuCustomVariable()),
+ this, SLOT( refreshCustomMenu()));
+
+ // Cut and copy are directly connected to the selectionChanged signal
+ if ( m_pKPresenterDoc->isReadWrite() )
+ connect( m_canvas, SIGNAL(selectionChanged(bool)),
+ this, SLOT(slotChangeCutState(bool )/*setEnabled(bool)*/) );
+ else
+ actionEditCut->setEnabled( false );
+
+ connect( m_canvas, SIGNAL(selectionChanged(bool)),
+ actionEditCopy, SLOT(setEnabled(bool)) );
+
+ connect (m_canvas, SIGNAL(selectionChanged(bool)),
+ actionChangeCase, SLOT(setEnabled(bool)));
+ //connect (m_canvas, SIGNAL(selectionChanged(bool)),
+ // actionCreateStyleFromSelection, SLOT(setEnabled(bool)));
+
+ connect( m_canvas, SIGNAL( currentObjectEditChanged() ), this, SLOT( slotObjectEditChanged()));
+
+ connect( h_ruler, SIGNAL( tabListChanged( const KoTabulatorList & ) ), this,
+ SLOT( tabListChanged( const KoTabulatorList & ) ) );
+
+ //statusbar stuff
+ connect( m_pKPresenterDoc, SIGNAL( pageNumChanged() ), this, SLOT( pageNumChanged()) );
+ connect( this, SIGNAL( currentPageChanged(int) ), this, SLOT( pageNumChanged()) );
+ connect( m_canvas, SIGNAL( objectSizeChanged() ), this, SLOT( updateObjectStatusBarItem() ));
+ connect( m_canvas, SIGNAL( objectSelectedChanged() ), this, SLOT( updateObjectStatusBarItem() ));
+ connect (m_pKPresenterDoc, SIGNAL(sig_updateRuler()),this, SLOT( slotUpdateRuler()));
+ connect (m_pKPresenterDoc, SIGNAL(sig_updateRuler()),this, SLOT( slotUpdateScrollBarRanges()));
+ connect (m_pKPresenterDoc, SIGNAL(sig_updateMenuBar()),this, SLOT(updateSideBarMenu()));
+ connect (m_pKPresenterDoc, SIGNAL(unitChanged(KoUnit::Unit)),this, SLOT(slotUnitChanged(KoUnit::Unit)));
+ connect( m_pKPresenterDoc, SIGNAL( modified( bool ) ), this, SLOT( documentModified( bool )) );
+ connect( m_pKPresenterDoc, SIGNAL(completed()), this, SLOT(loadingFinished()));
+
+ KStatusBar * sb = statusBar();
+ m_sbPageLabel = 0L;
+ m_sbObjectLabel = 0L;
+ m_sbModifiedLabel = 0;
+ m_sbZoomLabel = 0;
+ m_sbUnitLabel = 0;
+
+ if ( sb ) // No statusbar in e.g. konqueror
+ {
+ m_sbPageLabel = new KStatusBarLabel( QString::null, 0, sb );
+ m_sbPageLabel->setAlignment( AlignLeft | AlignVCenter );
+ addStatusBarItem( m_sbPageLabel, 0 );
+
+ m_sbModifiedLabel = new KStatusBarLabel( " ", 0, sb );
+ m_sbModifiedLabel->setAlignment( AlignLeft | AlignVCenter );
+ addStatusBarItem( m_sbModifiedLabel, 0 );
+
+ m_sbObjectLabel = new KStatusBarLabel( QString::null, 0, sb );
+ m_sbObjectLabel->setAlignment( AlignLeft | AlignVCenter );
+ addStatusBarItem( m_sbObjectLabel, 1 );
+
+ m_sbZoomLabel = new KStatusBarLabel( ' ' + QString::number( m_pKPresenterDoc->zoomHandler()->zoom() ) + "% ", 0, sb );
+ m_sbZoomLabel->setAlignment( AlignHCenter | AlignVCenter );
+ addStatusBarItem( m_sbZoomLabel, 0 );
+
+ m_sbUnitLabel = new KStatusBarLabel( ' ' + KoUnit::unitDescription( m_pKPresenterDoc->unit() ) + ' ', 0, sb );
+ m_sbUnitLabel->setAlignment( AlignHCenter | AlignVCenter );
+ addStatusBarItem( m_sbUnitLabel, 0 );
+ }
+
+ //when kword is embedded into konqueror apply a zoom=100
+ //in konqueror we can't change zoom -- ### TODO ?
+ if(!m_pKPresenterDoc->isReadWrite())
+ {
+ setZoom( 100, true );
+ slotUpdateRuler();
+ initGui();
+ m_pKPresenterDoc->updateZoomRuler();
+ }
+
+
+ setAcceptDrops( TRUE );
+}
+
+DCOPObject* KPrView::dcopObject()
+{
+ if ( !dcop )
+ dcop = new KPrViewIface( this );
+
+ return dcop;
+}
+
+KPrView::~KPrView()
+{
+ delete m_findReplace;
+ m_findReplace = 0L;
+ if(sidebar) {
+ KConfig *config=KGlobal::config();
+ config->setGroup("Global");
+ config->writeEntry("Sidebar", sidebar->isVisible());
+ }
+ if(notebar) {
+ KConfig *config=KGlobal::config();
+ config->setGroup("Global");
+ config->writeEntry("Notebar", notebar->isVisible());
+ }
+ clearSpellChecker();
+
+ delete rb_lbegin;
+ delete rb_lend;
+ delete dcop;
+
+ delete m_sbPageLabel;
+ delete m_sbObjectLabel;
+ delete notebar;
+ delete m_searchEntry;
+ m_searchEntry = 0L;
+ delete m_replaceEntry;
+ m_replaceEntry = 0L;
+ delete m_propertyEditor;
+ delete pgConfDia;
+ delete rotateDia;
+ delete shadowDia;
+ delete afChoose;
+ delete m_fontDlg;
+ delete m_paragDlg;
+ delete m_arrangeObjectsPopup;
+
+ if ( m_specialCharDlg )
+ m_specialCharDlg->closeDialog(); // will call slotSpecialCharDlgClosed
+ delete m_specialCharDlg;
+}
+
+void KPrView::setupPrinter( KPrinter &prt )
+{
+ deSelectAllObjects();
+ m_pKPresenterDoc->recalcVariables( VT_TIME );
+ m_pKPresenterDoc->recalcVariables( VT_DATE );
+ prt.setMinMax( 1, m_pKPresenterDoc->getPageNums() );
+ prt.setFromTo( 1, m_pKPresenterDoc->getPageNums() );
+ prt.setOption( "kde-range", m_pKPresenterDoc->selectedForPrinting() );
+ prt.setPageSelection(KPrinter::ApplicationSide);
+ KoPageLayout layout = m_pKPresenterDoc->pageLayout();
+ prt.setOption( "kde-margin-top", QString::number(layout.ptTop) );
+ prt.setOption( "kde-margin-bottom", QString::number(layout.ptBottom) );
+ prt.setOption( "kde-margin-left", QString::number(layout.ptLeft) );
+ prt.setOption( "kde-margin-right", QString::number(layout.ptRight) );
+ KoFormat pageFormat = layout.format;
+ prt.setPageSize( static_cast<KPrinter::PageSize>( KoPageFormat::printerPageSize( pageFormat ) ) );
+
+ if ( m_pKPresenterDoc->pageLayout().orientation == PG_LANDSCAPE || pageFormat == PG_SCREEN )
+ prt.setOrientation( KPrinter::Landscape );
+ else
+ prt.setOrientation( KPrinter::Portrait );
+ if ( !prt.previewOnly() )
+ prt.addDialogPage( new KPrPrinterDlg( 0, "KPresenter page" ) );
+}
+
+void KPrView::unZoomDocument(int &dpiX,int &dpiY)
+{
+ // ### HACK: disable zooming-when-printing if embedded parts are used.
+ // No koffice app supports zooming in paintContent currently.
+ // Disable in ALL cases now
+ bool doZoom=false;
+ dpiX = doZoom ? 300 : KoGlobal::dpiX();
+ dpiY = doZoom ? 300 : KoGlobal::dpiY();
+ zoomHandler()->setZoomAndResolution( 100, dpiX, dpiY );
+ m_pKPresenterDoc->newZoomAndResolution( false, true /* for printing*/ );
+}
+
+void KPrView::zoomDocument(int zoom)
+{
+ zoomHandler()->setZoomAndResolution( zoom, KoGlobal::dpiX(), KoGlobal::dpiY() );
+ m_pKPresenterDoc->newZoomAndResolution( false, false );
+ updateRuler();
+}
+
+void KPrView::print( KPrinter &prt )
+{
+ float left_margin = 0.0;
+ float top_margin = 0.0;
+ int dpiX=0;
+ int dpiY=0;
+ int oldZoom = zoomHandler()->zoom();
+ bool displayFieldCode = m_pKPresenterDoc->getVariableCollection()->variableSetting()->displayFieldCode();
+ if ( displayFieldCode )
+ {
+ m_pKPresenterDoc->getVariableCollection()->variableSetting()->setDisplayFieldCode(false);
+ m_pKPresenterDoc->recalcVariables( VT_ALL );
+ }
+
+ QPaintDeviceMetrics metrics( &prt );
+ unZoomDocument(dpiX,dpiY);
+ if ( m_pKPresenterDoc->pageLayout().format == PG_SCREEN )
+ {
+ left_margin = 28.5;
+ top_margin = 15.0;
+ }
+
+ QPainter painter;
+ painter.begin( &prt );
+ QRect rect = m_pKPresenterDoc->pageList().at( 0 )->getZoomPageRect();
+ double zoom = QMIN( double( metrics.width() ) / double( rect.width() ),
+ double( metrics.height() ) / double( rect.height() ) );
+ double newZoom = zoom * m_pKPresenterDoc->zoomHandler()->zoom();
+ kdDebug(33001) << "KPrView::print newZoom = " << newZoom << endl;
+ setZoom( int( newZoom ), false );
+ QRect paintingRect = m_pKPresenterDoc->pageList().at( 0 )->getZoomPageRect();
+
+ m_canvas->print( &painter, &prt, left_margin, top_margin );
+ painter.end();
+
+ zoomDocument(oldZoom);
+ if ( displayFieldCode )
+ {
+ m_pKPresenterDoc->getVariableCollection()->variableSetting()->setDisplayFieldCode(true);
+ m_pKPresenterDoc->recalcVariables( VT_ALL );
+ }
+
+ m_canvas->repaint();
+ kdDebug(33001) << "KPrView::print zoom&res reset" << endl;
+ m_pKPresenterDoc->getVariableCollection()->variableSetting()->setLastPrintingDate(QDateTime::currentDateTime());
+ m_pKPresenterDoc->recalcVariables( VT_DATE );
+}
+
+void KPrView::editCut()
+{
+ if ( !m_canvas->currentTextObjectView() ) {
+ m_canvas->setToolEditMode( TEM_MOUSE );
+#if COPYOASISFORMAT
+ m_canvas->copyOasisObjs();
+#else
+ m_canvas->copyObjs();
+#endif
+ m_canvas->deleteObjs();
+ } else {
+ if ( !m_canvas->currentTextObjectView()->kpTextObject()->isProtectContent())
+ m_canvas->currentTextObjectView()->cut();
+ }
+}
+
+void KPrView::editCopy()
+{
+ if ( !m_canvas->currentTextObjectView() ) {
+ m_canvas->setToolEditMode( TEM_MOUSE );
+#if COPYOASISFORMAT
+ m_canvas->copyOasisObjs();
+#else
+ m_canvas->copyObjs();
+#endif
+ }
+ else
+ m_canvas->currentTextObjectView()->copy();
+}
+
+void KPrView::editPaste()
+{
+ if ( !m_canvas->currentTextObjectView() ) {
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ deSelectAllObjects();
+ QMimeSource *data = QApplication::clipboard()->data();
+ if ( data->provides( "text/uri-list" ) )
+ {
+ m_pKPresenterDoc->pastePage( data, currPg );
+ setRanges();
+ skipToPage( currPg );
+ updateSideBarMenu();
+ }
+ else if ( data->provides( KoStoreDrag::mimeType("application/x-kpresenter" ) ))
+ {
+ // TODO: it would be nice to have no offset when pasting onto a different page...
+ m_canvas->activePage()->pasteObjs(
+ data->encodedData(KoStoreDrag::mimeType("application/x-kpresenter")),
+ 1, 0.0, 0.0, 0.0, 20.0, 20.0);
+
+ m_canvas->setMouseSelectedObject(true);
+ emit objectSelectedChanged();
+ }
+#if COPYOASISFORMAT
+ else if ( data->provides( KoStoreDrag::mimeType("application/vnd.oasis.opendocument.presentation" ) ))
+ {
+ //TODO : fix me !!
+ // TODO: it would be nice to have no offset when pasting onto a different page...
+ //m_canvas->activePage()->pasteObjs(
+ //data->encodedData(KoStoreDrag::mimeType("application/vnd.oasis.opendocument.presentation")),
+ //1, 0.0, 0.0, 0.0, 20.0, 20.0);
+
+ m_canvas->setMouseSelectedObject(true);
+ emit objectSelectedChanged();
+ }
+#endif
+ else if (QImageDrag::canDecode (data)) {
+ m_canvas->dropImage( data );
+ }
+ } else {
+ if ( !m_canvas->currentTextObjectView()->kpTextObject()->isProtectContent())
+ m_canvas->currentTextObjectView()->paste();
+ }
+}
+
+void KPrView::editDelete()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->deleteObjs();
+}
+
+void KPrView::editSelectAll()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( !edit ) {
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->selectAllObj();
+ }
+ else
+ edit->selectAll();
+}
+
+void KPrView::editDeSelectAll()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( !edit ) {
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ deSelectAllObjects();
+ }
+ else
+ edit->selectAll(false);
+}
+
+void KPrView::editCopyPage()
+{
+ m_pKPresenterDoc->copyPageToClipboard( currPg );
+}
+
+void KPrView::editDuplicatePage()
+{
+ m_pKPresenterDoc->copyPage( currPg );
+ setRanges();
+}
+
+void KPrView::updateSideBarMenu()
+{
+ actionEditDelPage->setEnabled( m_pKPresenterDoc->getPageNums() > 1 );
+}
+
+void KPrView::editDelPage()
+{
+ if ( KMessageBox::warningContinueCancel( this,
+ i18n( "Do you want to remove the current slide?"),i18n("Remove Slide"),KGuiItem(i18n("&Delete"),"editdelete") )
+ != KMessageBox::Continue )
+ return;
+ m_canvas->exitEditMode();
+ m_pKPresenterDoc->deletePage( currPg );
+ setRanges();
+}
+
+void KPrView::insertPage()
+{
+ InsertPageDia dia( this, 0, TRUE );
+#if COPYOASISFORMAT
+ QString templ = locateLocal( "data", "kpresenter/default.oop" );
+#else
+ QString templ = locateLocal( "data", "kpresenter/default.kpr" );
+#endif
+ if ( !QFile::exists( templ ) ) {
+ dia.radioDifferent->setChecked( TRUE );
+ dia.radioDefault->setEnabled( FALSE );
+ }
+ if ( dia.exec() != QDialog::Accepted )
+ return;
+
+ if (dia.radioCurrentDefault->isChecked())
+ {
+#if COPYOASISFORMAT
+ QString file = locateLocal( "data", "kpresenter/default.oop" );
+ m_pKPresenterDoc->savePage( file, currPg, true /*ignore stickies*/ );
+#else
+ QString file = locateLocal( "data", "kpresenter/default.kpr" );
+ m_pKPresenterDoc->savePage( file, currPg, true /*ignore stickies*/ );
+#endif
+ }
+
+ InsertPos pos = (InsertPos)dia.locationCombo->currentItem();
+ m_pKPresenterDoc->insertNewPage( i18n("Insert new slide"), currPg, pos,
+ dia.radioDifferent->isChecked(), QString::null );
+ setRanges();
+}
+
+void KPrView::insertPicture()
+{
+ m_canvas->setToolEditMode( INS_PICTURE );
+ deSelectAllObjects();
+
+ QStringList mimetypes;
+ mimetypes += KImageIO::mimeTypes( KImageIO::Reading );
+ mimetypes += KoPictureFilePreview::clipartMimeTypes();
+
+ KFileDialog fd( m_pKPresenterDoc->picturePath(), QString::null, this, 0, true );
+ fd.setCaption( i18n( "Insert Picture" ) );
+ fd.setMimeFilter( mimetypes );
+ fd.setPreviewWidget( new KoPictureFilePreview( &fd ) );
+
+ KURL url;
+ if ( fd.exec() == QDialog::Accepted )
+ url = fd.selectedURL();
+
+ if( url.isEmpty() || !url.isValid() )
+ {
+ m_canvas->setToolEditMode( TEM_MOUSE, false );
+ return;
+ }
+ QString file;
+ if ( !KIO::NetAccess::download( url, file, this ) )
+ {
+ m_canvas->setToolEditMode( TEM_MOUSE, false );
+ return;
+ }
+
+ if ( !file.isEmpty() )
+ m_canvas->activePage()->setInsPictureFile( file );
+}
+
+void KPrView::insertPicture(const QString &file)
+{
+ m_canvas->setToolEditMode( INS_PICTURE );
+ deSelectAllObjects();
+
+ if ( !file.isEmpty() )
+ m_canvas->activePage()->setInsPictureFile( file );
+}
+
+void KPrView::savePicture()
+{
+ m_canvas->savePicture();
+}
+
+void KPrView::savePicture( const QString& oldName, KoPicture& picture)
+{
+ QString oldFile(oldName);
+ KURL url;
+ url.setPath( oldFile );
+ if (!QDir(url.directory()).exists())
+ oldFile = url.fileName();
+
+ QString mimetype=picture.getMimeType();
+ kdDebug(33001) << "Picture has mime type: " << mimetype << endl;
+ QStringList mimetypes;
+ mimetypes << mimetype;
+
+ KFileDialog fd( oldFile, QString::null, this, 0, TRUE );
+ fd.setMimeFilter( mimetypes );
+ fd.setCaption(i18n("Save Picture"));
+ fd.setOperationMode(KFileDialog::Saving);
+ if ( fd.exec() == QDialog::Accepted )
+ {
+ url = fd.selectedURL();
+ if ( url.isValid() )
+ {
+ if ( url.isLocalFile() )
+ {
+ QFile file( url.path() );
+ if ( file.open( IO_ReadWrite ) )
+ {
+ picture.save( &file );
+ file.close();
+ }
+ else
+ {
+ KMessageBox::error(this,
+ i18n("Error during saving: could not open '%1' for writing.").arg ( url.path() ),
+ i18n("Save Picture"));
+ }
+ }
+ else
+ {
+ KTempFile tempFile;
+ tempFile.setAutoDelete( true );
+ if ( tempFile.status() == 0 )
+ {
+ QFile file( tempFile.name() );
+ if ( file.open( IO_ReadWrite ) )
+ {
+ picture.save( &file );
+ file.close();
+ if ( !KIO::NetAccess::upload( tempFile.name(), url, this ) )
+ {
+ KMessageBox::sorry( this, i18n(
+ "Unable to save the file to '%1'. %2.").arg( url.prettyURL() ).arg( KIO::NetAccess::lastErrorString() ),
+ i18n("Save Failed") );
+ }
+ }
+ else
+ KMessageBox::error(this,
+ i18n("Error during saving: could not open '%1' temporary file for writing.").arg ( file.name() ),
+ i18n("Save Picture"));
+ }
+ else
+ KMessageBox::sorry( this, i18n(
+ "Error during saving: could not create temporary file: %1.").arg( strerror( tempFile.status() ) ),
+ i18n("Save Picture") );
+ }
+ }
+ }
+}
+
+void KPrView::savePicture( KPrPixmapObject* obj )
+{
+ QString oldFile=obj->getFileName();
+ KoPicture picture(obj->picture());
+ savePicture(oldFile, picture);
+}
+
+void KPrView::toolsMouse()
+{
+ if ( actionToolsMouse->isChecked() )
+ m_canvas->setToolEditMode( TEM_MOUSE, false );
+ else
+ actionToolsMouse->setChecked(true);
+ //deSelectAllObjects();
+}
+
+void KPrView::toolsRotate()
+{
+ if ( actionToolsRotate->isChecked() )
+ m_canvas->setToolEditMode( TEM_ROTATE, false );
+ else
+ actionToolsRotate->setChecked(true);
+}
+
+void KPrView::toolsZoom()
+{
+ if ( actionToolsZoom->isChecked() )
+ m_canvas->setToolEditMode( TEM_ZOOM, false );
+ else
+ actionToolsZoom->setChecked(true);
+}
+
+void KPrView::toolsLinePopup()
+{
+ switch (m_currentLineTool)
+ {
+ case LtLine:
+ actionToolsLine->activate();
+ break;
+ case LtFreehand:
+ actionToolsFreehand->activate();
+ break;
+ case LtPolyline:
+ actionToolsPolyline->activate();
+ break;
+ case LtQuadricBezier:
+ actionToolsQuadricBezierCurve->activate();
+ break;
+ case LtCubicBezier:
+ actionToolsCubicBezierCurve->activate();
+ break;
+ }
+}
+
+void KPrView::toolsLine()
+{
+ if ( actionToolsLine->isChecked() )
+ {
+ m_canvas->setToolEditMode( INS_LINE, false );
+ deSelectAllObjects();
+ m_currentLineTool = LtLine;
+ actionToolsLinePopup->setIcon("line");
+ }
+ else
+ actionToolsLine->setChecked(true);
+}
+
+void KPrView::toolsShapePopup()
+{
+ switch (m_currentShapeTool)
+ {
+ case StRectangle:
+ actionToolsRectangle->activate();
+ break;
+ case StCircle:
+ actionToolsCircleOrEllipse->activate();
+ break;
+ case StPie:
+ actionToolsPie->activate();
+ break;
+ case StPolygon:
+ actionToolsConvexOrConcavePolygon->activate();
+ break;
+ }
+}
+
+void KPrView::toolsRectangle()
+{
+ if ( actionToolsRectangle->isChecked() )
+ {
+ deSelectAllObjects();
+ m_canvas->setToolEditMode( INS_RECT, false );
+ m_currentShapeTool = StRectangle;
+ actionToolsShapePopup->setIcon("rectangle");
+ }
+ else
+ actionToolsRectangle->setChecked(true);
+}
+
+void KPrView::toolsCircleOrEllipse()
+{
+ if ( actionToolsCircleOrEllipse->isChecked() )
+ {
+ deSelectAllObjects();
+ m_canvas->setToolEditMode( INS_ELLIPSE, false );
+ m_currentShapeTool = StCircle;
+ actionToolsShapePopup->setIcon("circle");
+ }
+ else
+ actionToolsCircleOrEllipse->setChecked(true);
+}
+
+void KPrView::toolsPie()
+{
+ if ( actionToolsPie->isChecked() )
+ {
+ deSelectAllObjects();
+ m_canvas->setToolEditMode( INS_PIE, false );
+ m_currentShapeTool = StPie;
+ actionToolsShapePopup->setIcon("pie");
+ }
+ else
+ actionToolsPie->setChecked(true);
+}
+
+void KPrView::toolsDiagramm()
+{
+ if ( actionToolsDiagramm->isChecked() )
+ {
+ deSelectAllObjects();
+ m_canvas->setToolEditMode( INS_DIAGRAMM, false );
+
+ KoDocumentEntry entry = KoDocumentEntry::queryByMimeType( "application/x-kchart" );
+ if (entry.isEmpty())
+ {
+ KMessageBox::sorry( this, i18n( "No chart component registered" ) );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ }
+ else
+ m_canvas->setPartEntry( entry );
+ }
+ else
+ actionToolsDiagramm->setChecked(true);
+}
+
+void KPrView::toolsTable()
+{
+ if ( actionToolsTable->isChecked() )
+ {
+ deSelectAllObjects();
+ m_canvas->setToolEditMode( INS_TABLE, false );
+
+ KoDocumentEntry entry = KoDocumentEntry::queryByMimeType( "application/x-kspread" );
+ if (entry.isEmpty())
+ {
+ KMessageBox::sorry( this, i18n( "No table component registered" ) );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ }
+ else
+ m_canvas->setPartEntry( entry );
+ }
+ else
+ actionToolsTable->setChecked(true);
+}
+
+void KPrView::toolsFormula()
+{
+ if ( actionToolsFormula->isChecked() )
+ {
+ deSelectAllObjects();
+ m_canvas->setToolEditMode( INS_FORMULA, false );
+
+ KoDocumentEntry entry = KoDocumentEntry::queryByMimeType( "application/x-kformula" );
+ if (entry.isEmpty())
+ {
+ KMessageBox::sorry( this, i18n( "No formula component registered" ) );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ }
+ else
+ m_canvas->setPartEntry( entry );
+ }
+ else
+ actionToolsFormula->setChecked(true);
+}
+
+void KPrView::toolsText()
+{
+ if ( actionToolsText->isChecked() )
+ {
+ deSelectAllObjects();
+ m_canvas->setToolEditMode( INS_TEXT, false );
+ }
+ else
+ actionToolsText->setChecked(true);
+}
+
+void KPrView::toolsAutoform()
+{
+ if ( actionToolsAutoform->isChecked() )
+ {
+ deSelectAllObjects();
+ m_canvas->setToolEditMode( TEM_MOUSE, false );
+ if ( afChoose ) {
+ delete afChoose;
+ afChoose = 0;
+ }
+ afChoose = new AFChoose( this, i18n( "Autoform-Choose" ) );
+ afChoose->resize( 400, 300 );
+ afChoose->setCaption( i18n( "Insert Autoform" ) );
+
+ QObject::connect( afChoose, SIGNAL( formChosen( const QString & ) ),
+ this, SLOT( afChooseOk( const QString & ) ) );
+ QObject::connect( afChoose, SIGNAL( afchooseCanceled()),
+ this,SLOT(slotAfchooseCanceled()));
+ afChoose->exec();
+
+ QObject::disconnect( afChoose, SIGNAL( formChosen( const QString & ) ),
+ this, SLOT( afChooseOk( const QString & ) ) );
+ delete afChoose;
+ afChoose = 0;
+ }
+ else
+ actionToolsAutoform->setChecked(true);
+}
+
+void KPrView::toolsObject()
+{
+ KoDocumentEntry pe = actionToolsObject->documentEntry();
+ if ( pe.isEmpty() ) {
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ return;
+ }
+
+ m_canvas->setToolEditMode( INS_OBJECT );
+ m_canvas->setPartEntry( pe );
+}
+
+void KPrView::toolsFreehand()
+{
+ if ( actionToolsFreehand->isChecked() ) {
+ m_canvas->setToolEditMode( INS_FREEHAND, false );
+ deSelectAllObjects();
+ m_currentLineTool = LtFreehand;
+ actionToolsLinePopup->setIcon("freehand");
+ }
+ else
+ actionToolsFreehand->setChecked(true);
+}
+
+void KPrView::toolsPolyline()
+{
+ if ( actionToolsPolyline->isChecked() ) {
+ m_canvas->setToolEditMode( INS_POLYLINE, false );
+ deSelectAllObjects();
+ m_currentLineTool = LtPolyline;
+ actionToolsLinePopup->setIcon("polyline");
+ }
+ else
+ actionToolsPolyline->setChecked(true);
+}
+
+void KPrView::toolsQuadricBezierCurve()
+{
+ if ( actionToolsQuadricBezierCurve->isChecked() ) {
+ m_canvas->setToolEditMode( INS_QUADRICBEZIERCURVE, false );
+ deSelectAllObjects();
+ m_currentLineTool = LtQuadricBezier;
+ actionToolsLinePopup->setIcon("quadricbeziercurve");
+ }
+ else
+ actionToolsQuadricBezierCurve->setChecked(true);
+}
+
+void KPrView::toolsCubicBezierCurve()
+{
+ if ( actionToolsCubicBezierCurve->isChecked() ) {
+ m_canvas->setToolEditMode( INS_CUBICBEZIERCURVE, false );
+ deSelectAllObjects();
+ m_currentLineTool = LtCubicBezier;
+ actionToolsLinePopup->setIcon("cubicbeziercurve");
+ }
+ else
+ actionToolsCubicBezierCurve->setChecked(true);
+}
+
+void KPrView::toolsConvexOrConcavePolygon()
+{
+ if ( actionToolsConvexOrConcavePolygon->isChecked() ) {
+ m_canvas->setToolEditMode( INS_POLYGON, false );
+ deSelectAllObjects();
+ m_currentShapeTool = StPolygon;
+ actionToolsShapePopup->setIcon("polygon");
+ }
+ else
+ actionToolsConvexOrConcavePolygon->setChecked(true);
+}
+
+void KPrView::toolsClosedLinePopup()
+{
+ switch (m_currentClosedLineTool)
+ {
+ case CltFreehand:
+ actionToolsClosedFreehand->activate();
+ break;
+ case CltPolyline:
+ actionToolsClosedPolyline->activate();
+ break;
+ case CltQuadricBezier:
+ actionToolsClosedQuadricBezierCurve->activate();
+ break;
+ case CltCubicBezier:
+ actionToolsClosedCubicBezierCurve->activate();
+ break;
+ }
+}
+
+void KPrView::toolsClosedFreehand()
+{
+ if ( actionToolsClosedFreehand->isChecked() ) {
+ m_canvas->setToolEditMode( INS_CLOSED_FREEHAND, false );
+ deSelectAllObjects();
+ m_currentClosedLineTool = CltFreehand;
+ actionToolsClosedLinePopup->setIcon("closed_freehand");
+ }
+ else
+ actionToolsClosedFreehand->setChecked( true );
+}
+
+void KPrView::toolsClosedPolyline()
+{
+ if ( actionToolsClosedPolyline->isChecked() ) {
+ m_canvas->setToolEditMode( INS_CLOSED_POLYLINE, false );
+ deSelectAllObjects();
+ m_currentClosedLineTool = CltPolyline;
+ actionToolsClosedLinePopup->setIcon("closed_polyline");
+ }
+ else
+ actionToolsClosedPolyline->setChecked( true );
+}
+
+void KPrView::toolsClosedQuadricBezierCurve()
+{
+ if ( actionToolsClosedQuadricBezierCurve->isChecked() ) {
+ m_canvas->setToolEditMode( INS_CLOSED_QUADRICBEZIERCURVE, false );
+ deSelectAllObjects();
+ m_currentClosedLineTool = CltQuadricBezier;
+ actionToolsClosedLinePopup->setIcon("closed_quadricbeziercurve");
+ }
+ else
+ actionToolsClosedQuadricBezierCurve->setChecked( true );
+}
+
+void KPrView::toolsClosedCubicBezierCurve()
+{
+ if ( actionToolsClosedCubicBezierCurve->isChecked() ) {
+ m_canvas->setToolEditMode( INS_CLOSED_CUBICBEZIERCURVE, false );
+ deSelectAllObjects();
+ m_currentClosedLineTool = CltCubicBezier;
+ actionToolsClosedLinePopup->setIcon("closed_cubicbeziercurve");
+ }
+ else
+ actionToolsClosedCubicBezierCurve->setChecked( true );
+}
+
+void KPrView::extraProperties()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+
+ m_propertyEditor = new KPrPropertyEditor( this, "KPrPropertyEditor", m_canvas->activePage(), m_pKPresenterDoc );
+ m_propertyEditor->setCaption( i18n( "Properties" ) );
+
+ connect( m_propertyEditor, SIGNAL( propertiesOk() ), this, SLOT( propertiesOk() ) );
+ m_propertyEditor->exec();
+ disconnect( m_propertyEditor, SIGNAL( propertiesOk() ), this, SLOT( propertiesOk() ) );
+
+ delete m_propertyEditor;
+ m_propertyEditor = 0;
+}
+
+void KPrView::extraRaise()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->raiseObjs( true );
+}
+
+void KPrView::extraLower()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->lowerObjs( true );
+}
+
+void KPrView::extraRotate()
+{
+ if ( m_canvas->numberOfObjectSelected() > 0 ) {
+ if ( !rotateDia ) {
+ rotateDia = new KPrRotationDialogImpl( this );
+ connect( rotateDia, SIGNAL( apply() ), this, SLOT( rotateOk() ) );
+ }
+ rotateDia->setAngle( m_canvas->getSelectedObj()->getAngle() );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ rotateDia->exec();
+ }
+}
+
+void KPrView::extraShadow()
+{
+ if ( m_canvas->numberOfObjectSelected() > 0 ) {
+
+ if ( !shadowDia ) {
+ shadowDia = new KPrShadowDialogImpl( this );
+ shadowDia->resize( shadowDia->minimumSize() );
+ connect( shadowDia, SIGNAL( apply() ), this, SLOT( shadowOk() ) );
+ }
+
+ KPrObject *object=m_canvas->getSelectedObj();
+ shadowDia->setShadowDirection( object->getShadowDirection() );
+ if ( object->getShadowDistance() != 0 )
+ shadowDia->setShadowDistance( object->getShadowDistance() );
+ else
+ shadowDia->setShadowDistance( 3 );
+
+ shadowDia->setShadowColor( object->getShadowColor() );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ shadowDia->exec();
+ }
+}
+
+void KPrView::extraBackground()
+{
+ KPrPage *page=m_canvas->activePage();
+ KPrBackDialog* backDia = new KPrBackDialog( this, "InfoDia", page->getBackType( ),
+ page->getBackColor1( ),
+ page->getBackColor2( ),
+ page->getBackColorType( ),
+ page->getBackPicture( ),
+ page->getBackView(),
+ page->getBackUnbalanced(),
+ page->getBackXFactor(),
+ page->getBackYFactor( ),
+ page );
+ backDia->setCaption( i18n( "Slide Background" ) );
+ QObject::connect( backDia, SIGNAL( backOk( KPrBackDialog*, bool ) ), this, SLOT( backOk( KPrBackDialog*, bool ) ) ) ;
+ backDia->exec();
+
+ QObject::disconnect( backDia, SIGNAL( backOk( KPrBackDialog*, bool ) ), this, SLOT( backOk( KPrBackDialog*, bool ) ) );
+ delete backDia;
+}
+
+void KPrView::extraLayout()
+{
+ KoPageLayout pgLayout = m_pKPresenterDoc->pageLayout();
+ KoPageLayout oldLayout = pgLayout;
+ KoHeadFoot hf;
+ KoUnit::Unit oldUnit = m_pKPresenterDoc->unit();
+ KoUnit::Unit unit = oldUnit;
+
+ if ( KoPageLayoutDia::pageLayout( pgLayout, hf, FORMAT_AND_BORDERS, unit, this ) ) {
+ KPrPgLayoutCmd *pgLayoutCmd = new KPrPgLayoutCmd( i18n( "Set Page Layout" ),
+ pgLayout, oldLayout, oldUnit, unit,kPresenterDoc() );
+ pgLayoutCmd->execute();
+ kPresenterDoc()->addCommand( pgLayoutCmd );
+ updateRuler();
+ }
+}
+
+void KPrView::extraConfigure()
+{
+ KPrConfig configDia( this );
+ configDia.exec();
+}
+
+void KPrView::extraCreateTemplate()
+{
+ int width = 60;
+ int height = 60;
+ QPixmap pix = m_pKPresenterDoc->generatePreview(QSize(width, height));
+#if COPYOASISFORMAT
+ KTempFile tempFile( QString::null, ".otp" );
+ tempFile.setAutoDelete( true );
+ m_pKPresenterDoc->savePage( tempFile.name(), getCurrPgNum() - 1);
+#else
+ KTempFile tempFile( QString::null, ".kpt" );
+ tempFile.setAutoDelete( true );
+ m_pKPresenterDoc->savePage( tempFile.name(), getCurrPgNum() - 1);
+#endif
+
+ KoTemplateCreateDia::createTemplate( "kpresenter_template", KPrFactory::global(),
+ tempFile.name(), pix, this);
+ KPrFactory::global()->dirs()->addResourceType("kpresenter_template",
+ KStandardDirs::kde_default( "data" ) +
+ "kpresenter/templates/");
+}
+
+void KPrView::extraDefaultTemplate()
+{
+#if COPYOASISFORMAT
+ QString file = locateLocal( "data", "kpresenter/default.oop" );
+ m_pKPresenterDoc->savePage( file, currPg );
+#else
+ QString file = locateLocal( "data", "kpresenter/default.kpr" );
+ m_pKPresenterDoc->savePage( file, currPg );
+#endif
+}
+
+void KPrView::extraWebPres()
+{
+ if ( !allowWebPres )
+ return;
+
+ KURL url;
+ QString config = QString::null;
+ int ret =KMessageBox::questionYesNoCancel( this,
+ i18n( "Do you want to load a previously saved configuration"
+ " which will be used for this HTML Presentation?" ),
+ i18n( "Create HTML Presentation" ) );
+ if( ret == KMessageBox::Cancel )
+ return;
+ else if ( ret == KMessageBox::Yes )
+ {
+ url = KFileDialog::getOpenURL( QString::null, i18n("*.kpweb|KPresenter HTML Presentation (*.kpweb)"), this );
+
+ if( url.isEmpty() )
+ return;
+
+ if( !url.isLocalFile() )
+ {
+ KMessageBox::sorry( this, i18n( "Only local files are currently supported." ) );
+ return;
+ }
+
+ config = url.path();
+ }
+
+ KPrWebPresentationWizard::createWebPresentation( config, m_pKPresenterDoc, this );
+}
+
+void KPrView::extraMSPres()
+{
+ if ( !allowMSPres )
+ return;
+
+ KPrMSPresentationSetup::createMSPresentation( m_pKPresenterDoc, this );
+}
+
+void KPrView::extraLineBegin()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ QPoint pnt( QCursor::pos() );
+ rb_lbegin->popup( pnt );
+}
+
+void KPrView::extraLineEnd()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ QPoint pnt( QCursor::pos() );
+ rb_lend->popup( pnt );
+}
+
+void KPrView::extraGroup()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->groupObjects();
+ objectSelectedChanged();
+}
+
+void KPrView::extraUnGroup()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->ungroupObjects();
+ objectSelectedChanged();
+}
+
+void KPrView::extraPenStyle( int newStyle )
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ setExtraPenStyle(static_cast<Qt::PenStyle>(newStyle));
+}
+
+void KPrView::extraPenWidth( double newWidth )
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ setExtraPenWidth( newWidth );
+}
+
+void KPrView::screenConfigPages()
+{
+ delete pgConfDia;
+ pgConfDia = new KPrPgConfDia( this, kPresenterDoc() );
+ pgConfDia->setCaption( i18n( "Configure Slide Show" ) );
+ QObject::connect( pgConfDia, SIGNAL( pgConfDiaOk() ), this, SLOT( pgConfOk() ) );
+ pgConfDia->exec();
+
+ QObject::disconnect( pgConfDia, SIGNAL( pgConfDiaOk() ), this, SLOT( pgConfOk() ) );
+ delete pgConfDia;
+ pgConfDia = 0;
+}
+
+
+void KPrView::screenTransEffect()
+{
+ KPrSlideTransitionDia transitionDia( this, "slideTransitionDialog", this );
+ transitionDia.exec();
+}
+
+void KPrView::screenAssignEffect()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+
+ QPtrList<KPrObject> objs;
+ if ( m_canvas->canAssignEffect( objs ) ) {
+ KPrEffectDia *effectDia = new KPrEffectDia( this, "Object Effect", objs, this );
+ effectDia->setCaption( i18n( "Object Effect" ) );
+ effectDia->exec(); //the dialog executes the command itself
+ delete effectDia;
+ }
+}
+
+void KPrView::screenStart()
+{
+ startScreenPres( getCurrPgNum() );
+}
+
+void KPrView::screenStartFromFirst()
+{
+ startScreenPres( 1 );
+}
+
+void KPrView::startScreenPres( int pgNum /*1-based*/ )
+{
+ // no slide is selected ?
+ if( !kPresenterDoc()->displaySelectedSlides().count() )
+ {
+ KMessageBox::sorry( this, i18n("You didn't select any slide." ),
+ i18n("No Slide") );
+ return;
+ }
+
+ m_canvas->setToolEditMode( TEM_MOUSE );
+
+ if ( m_canvas && !presStarted ) {
+ const QString xdgScreenSaver = KStandardDirs::findExe("xdg-screensaver");
+ if (!xdgScreenSaver.isEmpty()) {
+ KProcess proc;
+ proc << xdgScreenSaver;
+ proc << "suspend";
+ proc << QString::number( topLevelWidget()->winId() );
+ kdDebug() << k_funcinfo << proc.args() << endl;
+ proc.start( KProcess::DontCare );
+ } else {
+ QByteArray data;
+ QByteArray replyData;
+ QCString replyType;
+ m_screenSaverWasEnabled = false;
+ // is screensaver enabled?
+ if (kapp->dcopClient()->call("kdesktop", "KScreensaverIface", "isEnabled()", data, replyType, replyData)
+ && replyType=="bool")
+ {
+ QDataStream replyArg(replyData, IO_ReadOnly);
+ replyArg >> m_screenSaverWasEnabled;
+ kdDebug() << "Screensaver was enabled:" << m_screenSaverWasEnabled << endl;
+ if ( m_screenSaverWasEnabled )
+ {
+ // disable screensaver
+ QDataStream arg(data, IO_WriteOnly);
+ arg << false;
+ if (!kapp->dcopClient()->send("kdesktop", "KScreensaverIface", "enable(bool)", data))
+ kdWarning(33001) << "Couldn't disable screensaver (using dcop to kdesktop)!" << endl;
+ else
+ kdDebug(33001) << "Screensaver successfully disabled" << endl;
+ }
+ } else {
+ kdWarning(33001) << "Couldn't check screensaver (using dcop to kdesktop)!" << endl;
+ }
+ // is DPMS enabled?
+ m_dpmsWasEnabled = isDPMSEnabled();
+ kdDebug() << "DPMS was enabled:" << m_dpmsWasEnabled << endl;
+ if ( m_dpmsWasEnabled ) {
+ enableDPMS( false );
+ }
+ }
+
+ deSelectAllObjects();
+ presStarted = true;
+ m_autoPresRestart = false;
+ QRect desk = KGlobalSettings::desktopGeometry(this);
+ kdDebug(33001) << "KPrView::startScreenPres desk=" << desk << endl;
+ QRect pgRect = kPresenterDoc()->pageList().at(0)->getZoomPageRect();
+ kdDebug(33001) << "KPrView::startScreenPres pgRect=" << pgRect << endl;
+
+ double zoomX = static_cast<double>( desk.width() ) / (double)pgRect.width();
+ double zoomY = static_cast<double>( desk.height() ) / (double)pgRect.height();
+ kdDebug(33001) << "KPrView::startScreenPres zoomX=" << zoomX << " zoomY=" << zoomY << endl;
+
+ xOffsetSaved = canvasXOffset();
+ yOffsetSaved = canvasYOffset();
+ setCanvasXOffset( 0 );
+ setCanvasYOffset( 0 );
+
+ m_bDisplayFieldCode = m_pKPresenterDoc->getVariableCollection()->variableSetting()->displayFieldCode();
+ if ( m_bDisplayFieldCode )
+ {
+ m_pKPresenterDoc->getVariableCollection()->variableSetting()->setDisplayFieldCode(false);
+ m_pKPresenterDoc->recalcVariables( VT_ALL );
+ }
+
+ vert->setEnabled( false );
+ horz->setEnabled( false );
+ m_bShowGUI = false;
+ m_canvas->reparent( ( QWidget* )0L, 0, QPoint( 0, 0 ), FALSE );
+ m_canvas->setPaletteBackgroundColor( Qt::white );
+ m_canvas->showFullScreen();
+ m_canvas->setFocusPolicy( QWidget::StrongFocus );
+
+ if ( !kPresenterDoc()->spManualSwitch() )
+ {
+ m_autoPresStop = false;
+ m_pKPresenterDoc->repaint( false );
+
+ if ( ! m_autoPresTimerConnected ) {
+ connect( &m_autoPresTimer, SIGNAL( timeout() ), SLOT( doAutomaticScreenPres() ) );
+ m_autoPresTimerConnected = true;
+ }
+ }
+
+ m_canvas->startScreenPresentation( zoomX, zoomY, pgNum );
+
+ actionScreenStart->setEnabled( false );
+
+ if ( kPresenterDoc()->presentationDuration() ) {
+ m_duration.start();
+
+ // ### make m_presentationDurationList a QMemArray or QValueVector
+ for ( unsigned int i = 0; i < kPresenterDoc()->pageList().count(); ++i )
+ m_presentationDurationList.append( 0 ); // initialization
+ }
+ }
+}
+
+void KPrView::screenStop()
+{
+ if ( presStarted ) {
+ m_autoPresStop = true;
+ m_canvas->stopSound();
+ m_canvas->showNormal();
+ m_canvas->hide();
+ m_canvas->reparent( pageBase, 0, QPoint( 0, 0 ), true );
+ m_canvas->lower();
+ setCanvasXOffset( xOffsetSaved );
+ setCanvasYOffset( yOffsetSaved );
+
+ if ( m_bDisplayFieldCode )
+ {
+ m_pKPresenterDoc->getVariableCollection()->variableSetting()->setDisplayFieldCode(true);
+ m_pKPresenterDoc->recalcVariables( VT_ALL );
+ }
+
+ m_canvas->stopScreenPresentation();
+ presStarted = false;
+ vert->setEnabled( true );
+ horz->setEnabled( true );
+ m_bShowGUI = true;
+ m_canvas->setMouseTracking( true );
+ m_canvas->setBackgroundMode( Qt::NoBackground );
+
+ const QString xdgScreenSaver = KStandardDirs::findExe("xdg-screensaver");
+ if (!xdgScreenSaver.isEmpty()) {
+ KProcess proc;
+ proc << xdgScreenSaver;
+ proc << "resume";
+ proc << QString::number( topLevelWidget()->winId() );
+ kdDebug() << k_funcinfo << proc.args() << endl;
+ proc.start( KProcess::DontCare );
+ } else {
+ if ( m_screenSaverWasEnabled )
+ {
+ // start screensaver again
+ QByteArray data;
+ QDataStream arg(data, IO_WriteOnly);
+ arg << true;
+ if (!kapp->dcopClient()->send("kdesktop", "KScreensaverIface", "enable(bool)", data))
+ kdWarning(33001) << "Couldn't re-enabled screensaver (using dcop to kdesktop)" << endl;
+ }
+ if ( m_dpmsWasEnabled )
+ {
+ // re-enable DPMS
+ kdDebug(33001) << "Re-enabling DPMS" << endl;
+ enableDPMS( true );
+ }
+ }
+
+ actionScreenStart->setEnabled( true );
+ pageBase->resizeEvent( 0 );
+
+ if ( kPresenterDoc()->presentationDuration() && !m_presentationDurationList.isEmpty() ) {
+ openThePresentationDurationDialog();
+ m_presentationDurationList.clear();
+ }
+ }
+ emit presentationFinished();
+}
+
+void KPrView::screenPause()
+{
+}
+
+void KPrView::screenFirst()
+{
+ m_canvas->deSelectAllObj();
+
+ if ( !presStarted )
+ skipToPage( 0 );
+ else
+ gotoPresPage( 1 );
+}
+
+void KPrView::screenPrev( bool gotoPreviousPage )
+{
+ if ( m_canvas->currentTextObjectView() )
+ return;
+
+ if ( presStarted ) {
+ m_canvas->pPrev( gotoPreviousPage );
+ m_canvas->setFocus();
+ }
+ else
+ prevPage();
+}
+
+void KPrView::screenNext( bool gotoNextPage )
+{
+ if ( m_canvas->currentTextObjectView() )
+ return;
+ if ( presStarted )
+ {
+ m_canvas->pNext( gotoNextPage );
+ m_canvas->setFocus();
+ }
+ else
+ {
+ nextPage();
+ }
+}
+
+void KPrView::screenLast()
+{
+ m_canvas->deSelectAllObj();
+
+ if ( !presStarted )
+ skipToPage( m_pKPresenterDoc->getPageNums() - 1 );
+ else
+ gotoPresPage( getNumPresPages() );
+}
+
+void KPrView::screenSkip()
+{
+}
+
+void KPrView::sizeSelected( int size )
+{
+ tbFont.setPointSize( size );
+ m_canvas->setTextPointSize( size );
+ m_canvas->setFocus();
+}
+
+void KPrView::fontSelected( const QString &fontFamily )
+{
+ tbFont.setFamily( fontFamily );
+ m_canvas->setTextFamily( fontFamily );
+ m_canvas->setFocus();
+}
+
+void KPrView::textBold()
+{
+ bool b=actionTextBold->isChecked();
+ tbFont.setBold( b );
+ m_canvas->setTextBold(b );
+}
+
+
+void KPrView::textStrikeOut()
+{
+ bool b=actionFormatStrikeOut->isChecked();
+ tbFont.setStrikeOut( b );
+ m_canvas->setTextStrikeOut( b );
+}
+
+void KPrView::textItalic()
+{
+ bool b=actionTextItalic->isChecked();
+ tbFont.setItalic( b );
+ m_canvas->setTextItalic( b );
+}
+
+void KPrView::textUnderline()
+{
+ bool b=actionTextUnderline->isChecked();
+ tbFont.setUnderline( b );
+ m_canvas->setTextUnderline( b );
+}
+
+void KPrView::textColor()
+{
+ tbColor = actionTextColor->color();
+ m_canvas->setTextColor( tbColor );
+}
+
+void KPrView::textAlignLeft()
+{
+ if ( actionTextAlignLeft->isChecked() )
+ {
+ tbAlign = Qt::AlignLeft;
+ m_canvas->setTextAlign( tbAlign );
+ }
+ else
+ actionTextAlignLeft->setChecked(true);
+}
+
+void KPrView::textAlignCenter()
+{
+ if ( actionTextAlignCenter->isChecked() )
+ {
+ tbAlign = Qt::AlignHCenter;
+ m_canvas->setTextAlign(tbAlign);
+ }
+ else
+ actionTextAlignCenter->setChecked(true);
+}
+
+void KPrView::textAlignRight()
+{
+ if ( actionTextAlignRight->isChecked() )
+ {
+ tbAlign = Qt::AlignRight;
+ m_canvas->setTextAlign(tbAlign);
+ }
+ else
+ actionTextAlignRight->setChecked(true);
+
+}
+
+void KPrView::textAlignBlock()
+{
+ if ( actionTextAlignBlock->isChecked() )
+ {
+ tbAlign = Qt::AlignJustify;
+ m_canvas->setTextAlign(tbAlign);
+ }
+ else
+ actionTextAlignBlock->setChecked(true);
+
+}
+
+void KPrView::textInsertPageNum()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->insertVariable( VT_PGNUM, KoPageVariable::VST_PGNUM_CURRENT );
+}
+
+void KPrView::mtextFont()
+{
+ KoTextFormatInterface* textIface = m_canvas->applicableTextInterfaces().first();
+ QColor col;
+ if (textIface)
+ col = textIface->textBackgroundColor();
+ col = col.isValid() ? col : QApplication::palette().color( QPalette::Active, QColorGroup::Base );
+
+ delete m_fontDlg;
+
+ m_fontDlg = new KoFontDia( *textIface->currentFormat()
+ , m_broker
+ , this, 0 );
+
+ connect( m_fontDlg, SIGNAL( applyFont() ),
+ this, SLOT( slotApplyFont() ) );
+ m_fontDlg->exec();
+
+ delete m_fontDlg;
+ m_fontDlg=0L;
+}
+
+void KPrView::slotApplyFont()
+{
+ int flags = m_fontDlg->changedFlags();
+ if ( flags )
+ {
+ m_canvas->setTextFormat(m_fontDlg->newFormat(), flags);
+ }
+}
+
+void KPrView::slotCounterStyleSelected()
+{
+ QString actionName = QString::fromLatin1(sender()->name());
+ if ( actionName.startsWith( "counterstyle_" ) )
+ {
+ QString styleStr = actionName.mid(13);
+ //kdDebug(33001) << "KWView::slotCounterStyleSelected styleStr=" << styleStr << endl;
+ KoParagCounter::Style style = (KoParagCounter::Style)(styleStr.toInt());
+ KoParagCounter c;
+ if ( style == KoParagCounter::STYLE_NONE )
+ c.setNumbering( KoParagCounter::NUM_NONE );
+ else {
+ c.setNumbering( KoParagCounter::NUM_LIST );
+ c.setStyle( style );
+ if ( c.isBullet() )
+ c.setSuffix( QString::null );
+ // else the suffix remains the default, '.'
+ // TODO save this setting, to use the last one selected in the dialog?
+ // (same for custom bullet char etc.)
+
+ // 68927: restart numbering, by default, if last parag wasn't numbered
+ // (and if we're not applying this to a selection)
+ KPrTextView *edit = m_canvas->currentTextObjectView();
+ if ( edit && !edit->textObject()->hasSelection() ) {
+ KoTextParag* parag = edit->cursor()->parag();
+ if ( parag->prev() && !parag->prev()->counter() )
+ c.setRestartCounter(true);
+ }
+ }
+
+ QPtrList<KoTextFormatInterface> lst = m_canvas->applicableTextInterfaces();
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it )
+ {
+ KCommand *cmd = it.current()->setCounterCommand( c );
+ if ( cmd )
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Change List Type") );
+ macroCmd->addCommand( cmd );
+ }
+ }
+ if( macroCmd)
+ m_pKPresenterDoc->addCommand( macroCmd );
+ }
+
+}
+
+void KPrView::textDepthPlus()
+{
+ m_canvas->setTextDepthPlus();
+}
+
+void KPrView::textDepthMinus()
+{
+ m_canvas->setTextDepthMinus();
+}
+
+void KPrView::textContentsToHeight()
+{
+ m_canvas->textContentsToHeight();
+}
+
+void KPrView::textObjectToContents()
+{
+ m_canvas->textObjectToContents();
+}
+
+void KPrView::penChosen()
+{
+ QColor c = actionPenColor->color();
+ if ( !m_canvas->currentTextObjectView() )
+ {
+ KCommand * cmd( getPenCmd( i18n( "Change Outline Color" ), KoPen(c),
+ L_NORMAL, L_NORMAL, KoPenCmd::Color ) );
+ if( cmd )
+ m_pKPresenterDoc->addCommand( cmd );
+ else
+ pen.setColor( c );
+ }
+ else
+ {
+ tbColor = c;
+ m_canvas->setTextColor( tbColor );
+ }
+}
+
+void KPrView::brushChosen()
+{
+ QColor c = actionBrushColor->color();
+ KPrTextView *edit = m_canvas->currentTextObjectView();
+ if ( !edit )
+ {
+ //tz TODO remove macro, add parameter for command name in setBrush()
+ KMacroCommand * macro= NULL;
+ KCommand * cmd = NULL;
+ QBrush newBrush( c );
+
+ cmd = m_canvas->activePage()->setBrush( newBrush, FT_BRUSH, QColor(), QColor(), BCT_PLAIN, false,
+ 0, 0, KPrBrushCmd::BrushColor | KPrBrushCmd::BrushStyle |
+ KPrBrushCmd::BrushGradientSelect );
+ if( cmd )
+ {
+ if ( !macro )
+ macro = new KMacroCommand( i18n( "Change Fill Color" ) );
+ macro->addCommand( cmd );
+ }
+
+
+ if( macro )
+ m_pKPresenterDoc->addCommand( macro );
+ else
+ brush.setColor( c );
+ }
+ else
+ {
+ tbColor = c;
+ m_canvas->setTextBackgroundColor( c );
+ }
+}
+
+void KPrView::extraAlignObjLeft()
+{
+ m_canvas->alignObjects( AT_LEFT );
+}
+
+void KPrView::extraAlignObjCenterH()
+{
+ m_canvas->alignObjects( AT_HCENTER );
+}
+
+void KPrView::extraAlignObjRight()
+{
+ m_canvas->alignObjects( AT_RIGHT );
+}
+
+void KPrView::extraAlignObjTop()
+{
+ m_canvas->alignObjects( AT_TOP );
+}
+
+void KPrView::extraAlignObjCenterV()
+{
+ m_canvas->alignObjects( AT_VCENTER );
+}
+
+void KPrView::extraAlignObjBottom()
+{
+ m_canvas->alignObjects( AT_BOTTOM );
+}
+
+void KPrView::extraLineBeginNormal()
+{
+ setExtraLineBegin(L_NORMAL);
+}
+
+void KPrView::extraLineBeginArrow()
+{
+ setExtraLineBegin(L_ARROW);
+}
+
+void KPrView::extraLineBeginRect()
+{
+ setExtraLineBegin(L_SQUARE);
+}
+
+void KPrView::extraLineBeginCircle()
+{
+ setExtraLineBegin(L_CIRCLE);
+}
+
+void KPrView::extraLineBeginLineArrow()
+{
+ setExtraLineBegin( L_LINE_ARROW );
+}
+
+void KPrView::extraLineBeginDimensionLine()
+{
+ setExtraLineBegin( L_DIMENSION_LINE );
+}
+
+void KPrView::extraLineBeginDoubleArrow()
+{
+ setExtraLineBegin( L_DOUBLE_ARROW );
+}
+
+void KPrView::extraLineBeginDoubleLineArrow()
+{
+ setExtraLineBegin( L_DOUBLE_LINE_ARROW );
+}
+
+void KPrView::setExtraLineBegin(LineEnd lb)
+{
+ KCommand * cmd( getPenCmd( i18n("Change Line Begin"), KoPen(),
+ lb, L_NORMAL, KoPenCmd::LineBegin ) );
+ if( cmd )
+ kPresenterDoc()->addCommand( cmd );
+ else
+ lineBegin = lb;
+}
+
+void KPrView::extraLineEndNormal()
+{
+ setExtraLineEnd(L_NORMAL);
+}
+
+void KPrView::extraLineEndArrow()
+{
+ setExtraLineEnd(L_ARROW);
+}
+
+void KPrView::extraLineEndRect()
+{
+ setExtraLineEnd(L_SQUARE);
+}
+
+void KPrView::extraLineEndCircle()
+{
+ setExtraLineEnd(L_CIRCLE);
+}
+
+void KPrView::extraLineEndLineArrow()
+{
+ setExtraLineEnd( L_LINE_ARROW );
+}
+
+void KPrView::extraLineEndDimensionLine()
+{
+ setExtraLineEnd( L_DIMENSION_LINE );
+}
+
+void KPrView::extraLineEndDoubleArrow()
+{
+ setExtraLineEnd( L_DOUBLE_ARROW );
+}
+
+void KPrView::extraLineEndDoubleLineArrow()
+{
+ setExtraLineEnd( L_DOUBLE_LINE_ARROW );
+}
+
+void KPrView::setExtraLineEnd(LineEnd le)
+{
+ KCommand * cmd( getPenCmd( i18n("Change Line End"), KoPen(),
+ L_NORMAL, le, KoPenCmd::LineEnd ) );
+ if( cmd )
+ kPresenterDoc()->addCommand( cmd );
+ else
+ lineEnd = le;
+}
+
+void KPrView::setExtraPenStyle( Qt::PenStyle style )
+{
+ KoPen tmpPen;
+ tmpPen.setStyle( style );
+
+ KCommand * cmd( getPenCmd( i18n("Change Outline Style"), tmpPen,
+ L_NORMAL, L_NORMAL, KoPenCmd::Style ) );
+ if( cmd )
+ kPresenterDoc()->addCommand( cmd );
+ else
+ pen.setStyle( style );
+}
+
+void KPrView::setExtraPenWidth( double width )
+{
+ KoPen tmpPen;
+ tmpPen.setPointWidth( width );
+ KCommand * cmd( getPenCmd( i18n("Change Outline Width"), tmpPen,
+ L_NORMAL, L_NORMAL, KoPenCmd::Width ) );
+
+ if( cmd )
+ kPresenterDoc()->addCommand( cmd );
+ else
+ pen.setPointWidth( width );
+}
+
+void KPrView::newPageLayout( const KoPageLayout &_layout )
+{
+ KoPageLayout oldLayout = m_pKPresenterDoc->pageLayout();
+ KoUnit::Unit unit = m_pKPresenterDoc->unit(); // unchanged
+
+ KPrPgLayoutCmd *pgLayoutCmd = new KPrPgLayoutCmd( i18n( "Set Page Layout" ), _layout, oldLayout, unit, unit,kPresenterDoc() );
+ pgLayoutCmd->execute();
+ kPresenterDoc()->addCommand( pgLayoutCmd );
+ updateRuler();
+}
+
+void KPrView::updateRuler()
+{
+ //update koruler
+ QRect r=m_canvas->activePage()->getZoomPageRect();
+ getHRuler()->setFrameStartEnd( r.left(), r.right()/*+m_canvas->diffx()*/ );
+ getVRuler()->setFrameStartEnd( r.top(), r.bottom()/*+m_canvas->diffy()*/ );
+}
+
+void KPrView::createGUI()
+{
+ splitter = new QSplitter( this );
+
+ if ( !m_pKPresenterDoc->isEmbedded()
+ && !m_pKPresenterDoc->isSingleViewMode() ) // No sidebar if the document is embedded
+ {
+ sidebar = new KPrSideBar( splitter, m_pKPresenterDoc, this );
+ connect( sidebar, SIGNAL( movePage( int, int ) ),
+ m_pKPresenterDoc, SLOT( movePage( int, int ) ) );
+ connect( sidebar, SIGNAL( selectPage( int, bool ) ),
+ m_pKPresenterDoc, SLOT( selectPage( int, bool ) ) );
+ connect( sidebar, SIGNAL( showPage( int ) ),
+ this, SLOT( skipToPage( int ) ) );
+ // This sucks when resizing the window
+ //splitter->setResizeMode( sidebar, QSplitter::FollowSizeHint );
+ //splitter->setResizeMode( pageBase, QSplitter::Stretch );
+ splitter->setResizeMode( sidebar, QSplitter::KeepSize );
+ }
+
+ QSplitter *splitterVertical = new QSplitter( QSplitter::Vertical, splitter );
+
+ // setup page
+ pageBase = new PageBase( splitterVertical, this );
+ pageBase->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+
+ m_canvas=new KPrCanvas( pageBase, "Canvas", this );
+
+ QObject::connect( m_canvas, SIGNAL( fontChanged( const QFont & ) ),
+ this, SLOT( fontChanged( const QFont & ) ) );
+ QObject::connect( m_canvas, SIGNAL( colorChanged( const QColor & ) ),
+ this, SLOT( colorChanged( const QColor & ) ) );
+ QObject::connect( m_canvas, SIGNAL( alignChanged( int ) ),
+ this, SLOT( alignChanged( int ) ) );
+ QObject::connect( m_canvas, SIGNAL( objectSelectedChanged()),
+ this, SLOT( objectSelectedChanged()));
+ QObject::connect( m_canvas, SIGNAL( sigMouseWheelEvent( QWheelEvent* ) ),
+ this, SLOT( getPageMouseWheelEvent( QWheelEvent* ) ) );
+
+
+ // setup notebar.
+ if ( !m_pKPresenterDoc->isEmbedded()
+ && !m_pKPresenterDoc->isSingleViewMode() ) // No notebar if the document is embedded
+ {
+ notebar = new KPrNoteBar( splitterVertical, this );
+ }
+
+ // setup GUI
+ setupActions();
+ setupPopupMenus();
+ setupScrollbars();
+ setRanges();
+ setupRulers();
+
+ if ( m_pKPresenterDoc && m_canvas )
+ {
+ QObject::connect( m_canvas, SIGNAL( stopAutomaticPresentation() ), this, SLOT( stopAutomaticPresentation() ) );
+ QObject::connect( m_canvas, SIGNAL( restartPresentation() ), this, SLOT( restartPresentation() ) );
+
+ connect( getVRuler(), SIGNAL( addGuide( const QPoint &, bool, int ) ),
+ &( m_canvas->guideLines() ), SLOT( addGuide( const QPoint &, bool, int ) ) );
+ connect( getVRuler(), SIGNAL( moveGuide( const QPoint &, bool, int ) ),
+ &( m_canvas->guideLines() ), SLOT( moveGuide( const QPoint &, bool, int ) ) );
+ connect( getHRuler(), SIGNAL( addGuide( const QPoint &, bool, int ) ),
+ &( m_canvas->guideLines() ), SLOT( addGuide( const QPoint &, bool, int ) ) );
+ connect( getHRuler(), SIGNAL( moveGuide( const QPoint &, bool, int ) ),
+ &( m_canvas->guideLines() ), SLOT( moveGuide( const QPoint &, bool, int ) ) );
+ connect( &( m_canvas->guideLines() ), SIGNAL( moveGuides( bool ) ),
+ m_canvas, SLOT( setPaintGuides( bool ) ) );
+ connect( &( m_canvas->guideLines() ), SIGNAL( paintGuides( bool ) ),
+ m_canvas, SLOT( setPaintGuides( bool ) ) );
+ connect( &( m_canvas->guideLines() ), SIGNAL( guideLinesChanged( KoView * ) ),
+ m_pKPresenterDoc, SLOT( slotGuideLinesChanged( KoView * ) ) );
+ m_canvas->guideLines().setGuideLines( m_pKPresenterDoc->horizontalGuideLines(), m_pKPresenterDoc->verticalGuideLines() );
+ }
+
+ if ( sidebar )
+ {
+ sidebar->outline()->setCurrentItem( sidebar->outline()->firstChild() );
+ sidebar->outline()->setSelected( sidebar->outline()->firstChild(), TRUE );
+ KConfig *config=KGlobal::config();
+ config->setGroup("Global");
+ if(!config->readBoolEntry("Sidebar", true)) {
+ sidebar->hide();
+ actionViewShowSideBar->setChecked(false);
+ }
+ else actionViewShowSideBar->setChecked(true);
+ }
+
+ if ( notebar )
+ {
+ KConfig *config=KGlobal::config();
+ config->setGroup("Global");
+ if(!config->readBoolEntry("Notebar", true)) {
+ notebar->hide();
+ actionViewShowNoteBar->setChecked(false);
+ }
+ else actionViewShowNoteBar->setChecked(true);
+ // HACK This is needed to be able to calculate a good initial size for the notebar
+ QTimer::singleShot( 0, this, SLOT( initialLayoutOfSplitter() ) );
+ }
+ KPrPage *initPage=m_pKPresenterDoc->initialActivePage();
+ if ( !initPage )
+ m_pKPresenterDoc->pageList().at( 0 ); // first page
+ skipToPage( m_pKPresenterDoc->pageList().findRef( initPage ) );
+}
+
+void KPrView::initGui()
+{
+ tbColor = Qt::black;
+ actionTextColor->setCurrentColor( Qt::black );
+ actionBrushColor->setCurrentColor( Qt::white );
+ actionPenColor->setCurrentColor( Qt::black );
+ updateSideBarMenu();
+ objectSelectedChanged();
+ refreshPageButton();
+
+ KStatusBar * sb = statusBar();
+ if ( sb )
+ sb->show();
+ showZoom( zoomHandler()->zoom() );
+ updateHeaderFooterButton();
+ updateDisplayObjectMasterPageButton();
+ updateDisplayBackgroundButton();
+
+ actionAllowAutoFormat->setChecked( m_pKPresenterDoc->allowAutoFormat() );
+ actionViewFormattingChars->setChecked( m_pKPresenterDoc->viewFormattingChars() );
+
+ updateGuideLineButton();
+
+ updateGridButton();
+
+ m_pKPresenterDoc->updateZoomRuler();
+ updatePageInfo();
+ actionAllowBgSpellCheck->setChecked( m_pKPresenterDoc->backgroundSpellCheckEnabled());
+ updateDirectCursorButton();
+ m_pKPresenterDoc->updatePresentationButton();
+}
+
+void KPrView::updateDisplayObjectMasterPageButton()
+{
+ actionDisplayObjectFromMasterPage->setChecked( !m_canvas->activePage()->displayObjectFromMasterPage());
+}
+
+void KPrView::updateDisplayBackgroundButton()
+{
+ actionDisplayBackgroundPage->setChecked( !m_canvas->activePage()->displayBackground() );
+}
+
+void KPrView::updateHeaderFooterButton()
+{
+ m_actionExtraHeader->setChecked( m_canvas->activePage()->hasHeader() );
+ m_actionExtraFooter->setChecked( m_canvas->activePage()->hasFooter() );
+}
+
+void KPrView::guiActivateEvent( KParts::GUIActivateEvent *ev )
+{
+ if ( ev->activated() )
+ initGui();
+
+ KoView::guiActivateEvent( ev );
+}
+
+void KPrView::setupActions()
+{
+ actionEditCut = KStdAction::cut( this, SLOT( editCut() ), actionCollection(), "edit_cut" );
+ actionEditCopy = KStdAction::copy( this, SLOT( editCopy() ), actionCollection(), "edit_copy" );
+ actionEditPaste = KStdAction::paste( this, SLOT( editPaste() ), actionCollection(), "edit_paste" );
+ connect( m_pKPresenterDoc, SIGNAL( enablePaste( bool ) ),
+ actionEditPaste, SLOT( setEnabled( bool ) ) );
+ m_pKPresenterDoc->clipboardDataChanged(); // set paste's initial state
+
+ actionEditDelete = new KAction( i18n( "&Delete" ), "editdelete", CTRL + Qt::Key_Delete,
+ this, SLOT( editDelete() ),
+ actionCollection(), "edit_delete" );
+ actionEditSelectAll = KStdAction::selectAll( this, SLOT( editSelectAll() ), actionCollection(), "edit_selectall" );
+ actionEditDeSelectAll= KStdAction::deselect( this, SLOT( editDeSelectAll()), actionCollection(), "edit_deselectall");
+ actionEditCopyPage = new KAction( i18n( "Copy Slide" ), "editcopy",
+ 0, this, SLOT( editCopyPage() ),
+ actionCollection(), "edit_copypage" );
+ actionEditDuplicatePage = new KAction( i18n( "Duplicate Slide" ), "newslide",
+ 0, this, SLOT( editDuplicatePage() ),
+ actionCollection(), "edit_duplicatepage" );
+ actionEditDelPage = new KAction( i18n( "Delete Slide" ), "delslide", 0,
+ this, SLOT( editDelPage() ),
+ actionCollection(), "edit_delpage" );
+
+ actionEditFind=KStdAction::find( this, SLOT( editFind() ), actionCollection(), "edit_find" );
+ actionEditFindNext = KStdAction::findNext( this, SLOT( editFindNext() ), actionCollection(), "edit_findnext" );
+ actionEditFindPrevious = KStdAction::findPrev( this, SLOT( editFindPrevious() ), actionCollection(), "edit_findprevious" );
+ actionEditReplace=KStdAction::replace( this, SLOT( editReplace() ), actionCollection(), "edit_replace" );
+
+ // ---------------- View actions
+
+ if ( !m_pKPresenterDoc->isEmbedded() )
+ {
+ actionViewShowSideBar = new KToggleAction( i18n("Show Sidebar"), 0,
+ this, SLOT( viewShowSideBar() ),
+ actionCollection(), "view_showsidebar" );
+ actionViewShowSideBar->setCheckedState(i18n("Hide Sidebar"));
+
+ actionViewShowNoteBar = new KToggleAction( i18n("Show Notebar"), 0,
+ this, SLOT( viewShowNoteBar() ),
+ actionCollection(), "view_shownotebar" );
+ actionViewShowNoteBar->setCheckedState(i18n("Hide Notebar"));
+ }
+
+ actionViewFormattingChars = new KToggleAction( i18n( "&Formatting Characters" ), 0,
+ this, SLOT( slotViewFormattingChars() ),
+ actionCollection(), "view_formattingchars" );
+ actionViewFormattingChars->setToolTip( i18n( "Toggle the display of non-printing characters." ) );
+ actionViewFormattingChars->setWhatsThis( i18n( "Toggle the display of non-printing characters.<br><br>When this is enabled, KPresenter shows you tabs, spaces, carriage returns and other non-printing characters." ) );
+
+ actionViewSlideMaster = new KToggleAction( i18n( "Slide &Master" ), 0,
+ this, SLOT( viewSlideMaster() ),
+ actionCollection(), "view_master" );
+
+ actionViewShowGuideLine= new KToggleAction( i18n( "Guide Lines" ), 0,
+ this, SLOT( viewGuideLines() ),
+ actionCollection(), "view_guidelines" );
+
+ actionViewShowGrid = new KToggleAction( i18n( "Show &Grid" ), 0,
+ this, SLOT( viewGrid() ),
+ actionCollection(), "view_grid" );
+ actionViewShowGrid->setCheckedState(i18n("Hide &Grid"));
+
+ actionViewSnapToGrid= new KToggleAction( i18n( "Snap to Grid" ), 0,
+ this, SLOT(viewSnapToGrid() ),
+ actionCollection(), "view_snaptogrid" );
+
+ // ---------------- insert actions
+
+ actionInsertPage = new KAction( i18n( "&Slide..." ), "slide", Qt::Key_F2,
+ this, SLOT( insertPage() ),
+ actionCollection(), "insert_page" );
+
+ new KAction( i18n( "Insert &Slide..." ), "newslide", 0,
+ this, SLOT( insertPage() ),
+ actionCollection(), "insert_page_popup" );
+
+ actionInsertPicture = new KAction( i18n( "P&icture..." ), "frame_image", Qt::SHIFT+Qt::Key_F5,
+ this, SLOT( insertPicture() ),
+ actionCollection(), "insert_picture" );
+
+ // ----------------- tools actions
+
+ actionToolsMouse = new KToggleAction( i18n( "Select" ), "select", 0,
+ this, SLOT( toolsMouse() ),
+ actionCollection(), "tools_mouse" );
+ actionToolsMouse->setExclusiveGroup( "tools" );
+ actionToolsMouse->setChecked( true );
+
+ actionToolsRotate = new KToggleAction( i18n( "&Rotate" ), "rotate", 0,
+ this, SLOT( toolsRotate() ),
+ actionCollection(), "tools_rotate" );
+ actionToolsRotate->setExclusiveGroup( "tools" );
+
+ actionToolsZoom = new KToggleAction( i18n( "&Zoom" ), "viewmag", 0,
+ this, SLOT( toolsZoom() ),
+ actionCollection(), "tools_zoom" );
+ actionToolsZoom->setExclusiveGroup( "tools" );
+
+ actionToolsShapePopup = new KActionMenu( i18n( "&Shape" ), "rectangle",
+ actionCollection(), "tools_shapepopup" );
+ actionToolsShapePopup->setDelayed(true);
+ connect(actionToolsShapePopup, SIGNAL(activated()), this, SLOT(toolsShapePopup()));
+
+ actionToolsRectangle = new KToggleAction( i18n( "&Rectangle" ), "rectangle",
+ 0, this, SLOT( toolsRectangle() ),
+ actionCollection(), "tools_rectangle" );
+ actionToolsRectangle->setExclusiveGroup( "tools" );
+
+ actionToolsCircleOrEllipse = new KToggleAction( i18n( "&Circle/Ellipse" ), "circle",
+ 0, this, SLOT( toolsCircleOrEllipse() ),
+ actionCollection(), "tools_circle" );
+ actionToolsCircleOrEllipse->setExclusiveGroup( "tools" );
+
+ actionToolsPie = new KToggleAction( i18n( "&Pie/Arc/Chord" ), "pie", 0,
+ this, SLOT( toolsPie() ),
+ actionCollection(), "tools_pie" );
+ actionToolsPie->setExclusiveGroup( "tools" );
+
+ actionToolsText = new KToggleAction( i18n( "&Text" ), "frame_text", Qt::Key_F10, // same shortcut as KWord
+ this, SLOT( toolsText() ),
+ actionCollection(), "tools_text" );
+ actionToolsText->setExclusiveGroup( "tools" );
+
+ actionToolsAutoform = new KToggleAction( i18n( "&Arrows && Connections" ), "autoform",
+ 0, this, SLOT( toolsAutoform() ),
+ actionCollection(), "tools_autoform" );
+ actionToolsAutoform->setExclusiveGroup( "tools" );
+
+ actionToolsDiagramm = new KToggleAction( i18n( "&Chart" ), "frame_chart", 0,
+ this, SLOT( toolsDiagramm() ),
+ actionCollection(), "tools_diagramm" );
+ actionToolsDiagramm->setExclusiveGroup( "tools" );
+
+ actionToolsTable = new KToggleAction( i18n( "Ta&ble"), "frame_spreadsheet", Qt::Key_F5 /*same as kword*/,
+ this, SLOT( toolsTable() ),
+ actionCollection(), "tools_table" );
+ actionToolsTable->setExclusiveGroup( "tools" );
+
+ actionToolsObject = new KoPartSelectAction( i18n( "&Object" ), "frame_query",
+ this, SLOT( toolsObject() ),
+ actionCollection(), "tools_object" );
+
+ actionToolsLinePopup = new KActionMenu( i18n( "&Line" ), "line",
+ actionCollection(), "tools_linepopup" );
+ actionToolsLinePopup->setDelayed(true);
+ connect(actionToolsLinePopup, SIGNAL(activated()), this, SLOT(toolsLinePopup()));
+
+ actionToolsLine = new KToggleAction( i18n( "&Line" ), "line", 0,
+ this, SLOT( toolsLine() ),
+ actionCollection(), "tools_line" );
+ actionToolsLine->setExclusiveGroup( "tools" );
+
+ actionToolsFreehand = new KToggleAction( i18n( "&Freehand" ), "freehand", 0,
+ this, SLOT( toolsFreehand() ),
+ actionCollection(), "tools_freehand" );
+ actionToolsFreehand->setExclusiveGroup( "tools" );
+
+ actionToolsPolyline = new KToggleAction( i18n( "Po&lyline" ), "polyline", 0,
+ this, SLOT( toolsPolyline() ),
+ actionCollection(), "tools_polyline" );
+ actionToolsPolyline->setExclusiveGroup( "tools" );
+
+ actionToolsQuadricBezierCurve = new KToggleAction( i18n( "&Quadric Bezier Curve" ), "quadricbeziercurve", 0,
+ this, SLOT( toolsQuadricBezierCurve() ),
+ actionCollection(), "tools_quadricbeziercurve" );
+ actionToolsQuadricBezierCurve->setExclusiveGroup( "tools" );
+
+ actionToolsCubicBezierCurve = new KToggleAction( i18n( "C&ubic Bezier Curve" ), "cubicbeziercurve", 0,
+ this, SLOT( toolsCubicBezierCurve() ),
+ actionCollection(), "tools_cubicbeziercurve" );
+ actionToolsCubicBezierCurve->setExclusiveGroup( "tools" );
+
+ actionToolsConvexOrConcavePolygon = new KToggleAction( i18n( "Co&nvex/Concave Polygon" ), "polygon", 0,
+ this, SLOT( toolsConvexOrConcavePolygon() ),
+ actionCollection(), "tools_polygon" );
+ actionToolsConvexOrConcavePolygon->setExclusiveGroup( "tools" );
+
+
+ actionToolsClosedLinePopup = new KActionMenu( i18n( "&Closed Line" ), "closed_freehand",
+ actionCollection(), "tools_closed_linepopup" );
+ actionToolsClosedLinePopup->setDelayed(true);
+ connect(actionToolsClosedLinePopup, SIGNAL(activated()), this, SLOT(toolsClosedLinePopup()));
+
+ actionToolsClosedFreehand = new KToggleAction( i18n( "Closed &Freehand" ), "closed_freehand", 0,
+ this, SLOT( toolsClosedFreehand() ),
+ actionCollection(), "tools_closed_freehand" );
+ actionToolsClosedFreehand->setExclusiveGroup( "tools" );
+
+
+ actionToolsClosedPolyline = new KToggleAction( i18n( "Closed Po&lyline" ), "closed_polyline", 0,
+ this, SLOT( toolsClosedPolyline() ),
+ actionCollection(), "tools_closed_polyline" );
+ actionToolsClosedPolyline->setExclusiveGroup( "tools" );
+
+
+ actionToolsClosedQuadricBezierCurve = new KToggleAction( i18n( "Closed &Quadric Bezier Curve" ), "closed_quadricbeziercurve", 0,
+ this, SLOT( toolsClosedQuadricBezierCurve() ),
+ actionCollection(), "tools_closed_quadricbeziercurve" );
+ actionToolsClosedQuadricBezierCurve->setExclusiveGroup( "tools" );
+
+
+ actionToolsClosedCubicBezierCurve = new KToggleAction( i18n( "Closed C&ubic Bezier Curve" ), "closed_cubicbeziercurve", 0,
+ this, SLOT( toolsClosedCubicBezierCurve() ),
+ actionCollection(), "tools_closed_cubicbeziercurve" );
+ actionToolsClosedCubicBezierCurve->setExclusiveGroup( "tools" );
+
+ // ----------------- text actions
+
+ actionTextFont = new KAction( i18n( "&Font..." ), 0, this, SLOT( mtextFont() ),
+ actionCollection(), "text_font" );
+
+ actionTextFontSize = new KFontSizeAction( i18n( "Font Size" ), 0, actionCollection(), "text_fontsize" );
+ connect( actionTextFontSize, SIGNAL( fontSizeChanged( int ) ),
+ this, SLOT( sizeSelected( int ) ) );
+
+#ifdef KFONTACTION_HAS_CRITERIA_ARG
+ actionTextFontFamily = new KFontAction( KFontChooser::SmoothScalableFonts,
+ i18n( "Font Family" ), 0,
+ actionCollection(), "text_fontfamily" );
+#else
+ actionTextFontFamily = new KFontAction( i18n( "Font Family" ), 0,
+ actionCollection(), "text_fontfamily" );
+#endif
+ connect( actionTextFontFamily , SIGNAL( activated( const QString & ) ),
+ this, SLOT( fontSelected( const QString & ) ) );
+
+ actionTextBold = new KToggleAction( i18n( "&Bold" ), "text_bold", CTRL + Qt::Key_B,
+ this, SLOT( textBold() ),
+ actionCollection(), "text_bold" );
+
+ actionTextItalic = new KToggleAction( i18n( "&Italic" ), "text_italic", CTRL + Qt::Key_I,
+ this, SLOT( textItalic() ),
+ actionCollection(), "text_italic" );
+
+ actionTextUnderline = new KToggleAction( i18n( "&Underline" ), "text_under", CTRL + Qt::Key_U,
+ this, SLOT( textUnderline() ),
+ actionCollection(), "text_underline" );
+
+ actionFormatStrikeOut = new KToggleAction( i18n( "&Strike Out" ), "text_strike", 0 ,
+ this, SLOT( textStrikeOut() ),
+ actionCollection(), "format_strike" );
+
+ actionTextColor = new TKSelectColorAction( i18n( "&Color..." ), TKSelectColorAction::TextColor,
+ actionCollection(), "text_color" ,true);
+ connect( actionTextColor, SIGNAL( activated() ), SLOT( textColor() ) );
+ actionTextColor->setDefaultColor(QColor());
+
+
+ actionTextAlignLeft = new KToggleAction( i18n( "Align &Left" ), "text_left", ALT + Qt::Key_L,
+ this, SLOT( textAlignLeft() ),
+ actionCollection(), "text_alignleft" );
+ actionTextAlignLeft->setExclusiveGroup( "align" );
+ actionTextAlignLeft->setChecked( true );
+
+ actionTextAlignCenter = new KToggleAction( i18n( "Align &Center" ), "text_center", ALT + Qt::Key_C,
+ this, SLOT( textAlignCenter() ),
+ actionCollection(), "text_aligncenter" );
+ actionTextAlignCenter->setExclusiveGroup( "align" );
+
+ actionTextAlignRight = new KToggleAction( i18n( "Align &Right" ), "text_right", ALT + Qt::Key_R,
+ this, SLOT( textAlignRight() ),
+ actionCollection(), "text_alignright" );
+ actionTextAlignRight->setExclusiveGroup( "align" );
+
+ actionTextAlignBlock = new KToggleAction( i18n( "Align &Block" ), "text_block", CTRL + Qt::Key_J,
+ this, SLOT( textAlignBlock() ),
+ actionCollection(), "text_alignblock" );
+ actionTextAlignBlock->setExclusiveGroup( "align" );
+
+
+ actionFormatNumber = new KActionMenu( i18n( "Number" ), "enumList", actionCollection(), "format_number" );
+ actionFormatNumber->setDelayed( false );
+ actionFormatBullet = new KActionMenu( i18n( "Bullet" ), "unsortedList", actionCollection(), "format_bullet" );
+ actionFormatBullet->setDelayed( false );
+ QPtrList<KoCounterStyleWidget::StyleRepresenter> stylesList;
+ KoCounterStyleWidget::makeCounterRepresenterList( stylesList );
+ QPtrListIterator<KoCounterStyleWidget::StyleRepresenter> styleIt( stylesList );
+ for ( ; styleIt.current() ; ++styleIt ) {
+ // Dynamically create toggle-actions for each list style.
+ // This approach allows to edit toolbars and extract separate actions from this menu
+ KToggleAction* act = new KToggleAction( styleIt.current()->name(), /*TODO icon,*/
+ 0, this, SLOT( slotCounterStyleSelected() ),
+ actionCollection(), QString("counterstyle_%1").arg( styleIt.current()->style() ).latin1() );
+ act->setExclusiveGroup( "counterstyle" );
+ // Add to the right menu: both for "none", bullet for bullets, numbers otherwise
+ if ( styleIt.current()->style() == KoParagCounter::STYLE_NONE ) {
+ actionFormatBullet->insert( act );
+ actionFormatNumber->insert( act );
+ } else if ( styleIt.current()->isBullet() )
+ actionFormatBullet->insert( act );
+ else
+ actionFormatNumber->insert( act );
+ }
+ actionTextDepthPlus = new KAction( i18n( "&Increase Depth" ), QApplication::reverseLayout() ?"format_decreaseindent" : "format_increaseindent",
+ CTRL + Qt::Key_Plus, this, SLOT( textDepthPlus() ),
+ actionCollection(), "text_depthPlus" );
+
+ actionTextDepthMinus = new KAction( i18n( "&Decrease Depth" ), QApplication::reverseLayout() ?"format_increaseindent" : "format_decreaseindent",
+ CTRL + Qt::Key_Minus, this, SLOT( textDepthMinus() ),
+ actionCollection(), "text_depthMinus" );
+
+ actionTextExtentCont2Height = new KAction( i18n( "Extend Contents to Object &Height" ), 0,
+ this, SLOT( textContentsToHeight() ),
+ actionCollection(), "text_con2hei" );
+
+ actionTextExtendObj2Cont = new KAction( i18n( "&Extend Object to Fit Contents" ), 0,
+ this, SLOT( textObjectToContents() ),
+ actionCollection(), "text_obj2cont" );
+
+ actionTextInsertPageNum = new KAction( i18n( "&Insert Slide Number" ), "pgnum", 0,
+ this, SLOT( textInsertPageNum() ),
+ actionCollection(), "text_inspgnum" );
+
+ // ----------------- format actions
+
+ actionExtraProperties = new KAction( i18n( "&Properties" ), "penbrush", 0,
+ this, SLOT( extraProperties() ),
+ actionCollection(), "extra_properties" );
+
+ actionExtraArrangePopup = new KActionMenu( i18n( "Arra&nge Objects" ), "arrange",
+ actionCollection(), "extra_arrangepopup" );
+ actionExtraArrangePopup->setDelayed( false );
+
+ actionExtraRaise = new KAction( i18n( "Ra&ise Objects" ), "raise",
+ CTRL+Qt::SHIFT+Qt::Key_R, this, SLOT( extraRaise() ),
+ actionCollection(), "extra_raise" );
+
+ actionExtraLower = new KAction( i18n( "&Lower Objects" ), "lower", CTRL +Qt::SHIFT+ Qt::Key_L,
+ this, SLOT( extraLower() ),
+ actionCollection(), "extra_lower" );
+
+ actionExtraBringForward= new KAction( i18n( "Bring to Front" ), "bring_forward",
+ 0, this, SLOT( extraBringForward() ),
+ actionCollection(), "extra_bring_forward" );
+
+ actionExtraSendBackward= new KAction( i18n( "Send to Back" ), "send_backward",
+ 0, this, SLOT( extraSendBackward() ),
+ actionCollection(), "extra_send_backward" );
+
+
+
+ actionExtraRotate = new KAction( i18n( "R&otate Objects..." ), "rotate_cw", 0,
+ this, SLOT( extraRotate() ),
+ actionCollection(), "extra_rotate" );
+
+ actionExtraShadow = new KAction( i18n( "&Shadow Objects..." ), "shadow", 0,
+ this, SLOT( extraShadow() ),
+ actionCollection(), "extra_shadow" );
+
+ actionExtraAlignObjLeft = new KAction( i18n( "Align &Left" ), "aoleft", 0,
+ this, SLOT( extraAlignObjLeft() ),
+ actionCollection(), "extra_alignleft" );
+
+ actionExtraAlignObjCenterH = new KAction( i18n( "Align Center (&horizontally)" ),
+ "aocenterh", 0,
+ this, SLOT( extraAlignObjCenterH() ),
+ actionCollection(), "extra_aligncenterh" );
+
+ actionExtraAlignObjRight = new KAction( i18n( "Align &Right" ), "aoright", 0,
+ this, SLOT( extraAlignObjRight() ),
+ actionCollection(), "extra_alignright" );
+
+ actionExtraAlignObjTop = new KAction( i18n( "Align &Top" ), "aotop", 0,
+ this, SLOT( extraAlignObjTop() ),
+ actionCollection(), "extra_aligntop" );
+
+ actionExtraAlignObjCenterV = new KAction( i18n( "Align Center (&vertically)" ),
+ "aocenterv", 0,
+ this, SLOT( extraAlignObjCenterV() ),
+ actionCollection(), "extra_aligncenterv" );
+
+ actionExtraAlignObjBottom = new KAction( i18n( "Align &Bottom" ), "aobottom", 0,
+ this, SLOT( extraAlignObjBottom() ),
+ actionCollection(), "extra_alignbottom" );
+
+
+ actionExtraBackground = new KAction( i18n( "Slide Bac&kground..." ), "background", 0,
+ this, SLOT( extraBackground() ),
+ actionCollection(), "extra_background" );
+
+ actionExtraLayout = new KAction( i18n( "Page &Layout..." ), 0,
+ this, SLOT( extraLayout() ),
+ actionCollection(), "extra_layout" );
+
+ m_actionExtraHeader = new KToggleAction( i18n( "Enable Document &Header" ), 0,
+ this, SLOT( viewHeader() ),
+ actionCollection(), "extra_header" );
+ m_actionExtraHeader->setCheckedState( i18n( "Disable Document &Header" ) );
+ m_actionExtraHeader->setToolTip( i18n( "Shows and hides header display for the current slide." ) );
+
+ m_actionExtraFooter = new KToggleAction( i18n( "Enable Document Foo&ter" ), 0,
+ this, SLOT( viewFooter() ),
+ actionCollection(), "extra_footer" );
+ m_actionExtraFooter->setCheckedState( i18n( "Disable Document Foo&ter" ) );
+ m_actionExtraFooter->setToolTip( i18n( "Shows and hides footer display for the current slide." ) );
+
+ actionExtraConfigure = new KAction( i18n( "Configure KPresenter..." ),
+ "configure", 0,
+ this, SLOT( extraConfigure() ),
+ actionCollection(), "extra_configure" );
+
+ actionExtraWebPres = new KAction( i18n( "Create &HTML Slideshow..." ),
+ "webpres", 0,
+ this, SLOT( extraWebPres() ),
+ actionCollection(), "extra_webpres" );
+
+ actionExtraMSPres = new KAction( i18n( "Create Memor&y Stick Slideshow..." ),
+ 0, this, SLOT( extraMSPres() ),
+ actionCollection(), "extra_mspres" );
+
+ actionExtraCreateTemplate = new KAction( i18n( "Template Manager" ), 0,
+ this, SLOT( extraCreateTemplate() ),
+ actionCollection(), "extra_template" );
+
+ actionExtraDefaultTemplate = new KAction( i18n( "Use Current Slide as Default Template" ), 0,
+ this, SLOT( extraDefaultTemplate() ),
+ actionCollection(), "extra_defaulttemplate" );
+
+ actionExtraAlignObjsPopup = new KActionMenu( i18n("Align O&bjects"), "alignobjs",
+ actionCollection(), "extra_alignobjs" );
+ actionExtraAlignObjsPopup->setDelayed( false );
+
+ actionExtraLineBegin = new KAction( i18n("Line Begin"), "line_begin", 0,
+ this, SLOT( extraLineBegin() ),
+ actionCollection(), "extra_linebegin" );
+
+ actionExtraLineEnd = new KAction( i18n("Line End"), "line_end", 0,
+ this, SLOT( extraLineEnd() ),
+ actionCollection(), "extra_lineend" );
+
+ actionExtraPenStyle = new KoLineStyleAction( i18n("Outline Style"), "pen_style",
+ this, SLOT( extraPenStyle(int) ),
+ actionCollection(), "extra_penstyle" );
+ actionExtraPenStyle->setShowCurrentSelection(false);
+
+ actionExtraPenWidth = new KoLineWidthAction( i18n("Outline Width"), "pen_width",
+ this, SLOT( extraPenWidth(double) ),
+ actionCollection(), "extra_penwidth" );
+ actionExtraPenWidth->setUnit( kPresenterDoc()->unit() );
+ actionExtraPenWidth->setShowCurrentSelection(false);
+ connect( kPresenterDoc(), SIGNAL( unitChanged( KoUnit::Unit ) ),
+ actionExtraPenWidth, SLOT( setUnit( KoUnit::Unit ) ) );
+
+ actionExtraGroup = new KAction( i18n( "&Group Objects" ), "group",
+ QKeySequence( "Ctrl+G" ),
+ this, SLOT( extraGroup() ),
+ actionCollection(), "extra_group" );
+
+ actionExtraUnGroup = new KAction( i18n( "&Ungroup Objects" ), "ungroup",
+ QKeySequence( "Ctrl+Shift+G" ),
+ this, SLOT( extraUnGroup() ),
+ actionCollection(), "extra_ungroup" );
+
+ // ----------------- slideshow actions
+
+ actionScreenConfigPages = new KAction( i18n( "&Configure Slide Show..." ),
+ "configure", 0,
+ this, SLOT( screenConfigPages() ),
+ actionCollection(), "screen_configpages" );
+
+ actionScreenAssignEffect = new KAction( i18n( "Edit &Object Effect..." ),
+ "effect", 0,
+ this, SLOT( screenAssignEffect() ),
+ actionCollection(), "screen_assigneffect");
+
+ actionScreenTransEffect = new KAction( i18n( "Edit Slide &Transition..." ),
+ "slide_effect", 0,
+ this, SLOT( screenTransEffect() ),
+ actionCollection(), "screen_transeffect");
+
+
+ actionScreenStart = new KAction( i18n( "&Start" ),
+ "2rightarrow", Qt::Key_F12,
+ this, SLOT( screenStart() ),
+ actionCollection(), "screen_start" );
+
+ actionScreenStartFromFirst = new KAction( i18n( "Start From &First Slide" ),
+ "1rightarrow", 0,
+ this, SLOT( screenStartFromFirst() ),
+ actionCollection(), "screen_startfromfirst" );
+
+ actionScreenFirst = new KAction( i18n( "&Go to Start" ),
+ "start", 0,
+ this, SLOT( screenFirst() ),
+ actionCollection(), "screen_first" );
+
+ actionScreenPrev = new KAction( i18n( "&Previous Slide" ),
+ "back", Qt::Key_Prior,
+ this, SLOT( screenPrev() ),
+ actionCollection(), "screen_prev" );
+
+ actionScreenNext = new KAction( i18n( "&Next Slide" ),
+ "forward", Qt::Key_Next,
+ this, SLOT( screenNext() ),
+ actionCollection(), "screen_next" );
+
+ actionScreenLast = new KAction( i18n( "Go to &End" ),
+ "finish", 0,
+ this, SLOT( screenLast() ),
+ actionCollection(), "screen_last" );
+
+ actionScreenSkip = new KAction( i18n( "Goto &Slide..." ),
+ "goto", 0,
+ this, SLOT( screenSkip() ),
+ actionCollection(), "screen_skip" );
+
+ // ----------------- colorbar(Brush and Pen) action
+
+ actionBrushColor = new TKSelectColorAction( i18n( "Fill Color..." ), TKSelectColorAction::FillColor,
+ actionCollection(), "brush_color" ,true);
+ connect( actionBrushColor, SIGNAL( activated() ), SLOT( brushChosen() ) );
+ actionBrushColor->setDefaultColor(QColor());
+
+ actionPenColor = new TKSelectColorAction( i18n( "Outline Color..." ), TKSelectColorAction::LineColor,
+ actionCollection(), "pen_color" );
+ connect( actionPenColor, SIGNAL( activated() ), SLOT( penChosen() ) );
+ actionPenColor->setDefaultColor(QColor());
+ actionExtendObjectHeight = new KAction( i18n( "&Extend Contents to Object Height" ),0, this, SLOT( textContentsToHeight() ),
+ actionCollection(), "extendobjectheight" );
+
+ actionResizeTextObject = new KAction( i18n( "&Resize Object to Fit Contents" ),0, this, SLOT( textObjectToContents() ),
+ actionCollection(), "resizetextobject" );
+
+ actionRenamePage=new KAction(i18n( "&Rename Slide..." ),0,this,
+ SLOT( renamePageTitle() ),
+ actionCollection(), "rename_page" );
+
+ actionPicOriginalSize = new KAction( i18n( "Sca&le to Original Size" ), 0, this,
+ SLOT( picViewOriginalSize() ),
+ actionCollection(), "pic_original_size" );
+
+ actionPic640x480=new KAction(i18n( "640x480" ),0,this,
+ SLOT( picViewOrig640x480() ),
+ actionCollection(), "pic_640_480" );
+
+ actionPic800x600=new KAction(i18n( "800x600" ),0,this,
+ SLOT( picViewOrig800x600() ),
+ actionCollection(), "pic_800_600" );
+
+ actionPic1024x768=new KAction(i18n( "1024x768" ),0,this,
+ SLOT( picViewOrig1024x768() ),
+ actionCollection(), "pic_1024_768" );
+
+ actionPic1280x1024=new KAction(i18n( "1280x1024" ),0,this,
+ SLOT( picViewOrig1280x1024() ),
+ actionCollection(), "pic_1280_1024" );
+
+ actionPic1600x1200=new KAction(i18n( "1600x1200" ),0,this,
+ SLOT( picViewOrig1600x1200() ),
+ actionCollection(), "pic_1600_1200" );
+
+ actionChangePic=new KAction( i18n( "&Change Picture..." ),"frame_image",0,this,
+ SLOT( chPic() ), actionCollection(), "change_picture" );
+
+
+ actionImageEffect = new KAction( i18n("Image &Effect..."), 0, this,
+ SLOT(imageEffect()), actionCollection(), "image_effect");
+
+
+ actionFormatSuper = new KToggleAction( i18n( "Superscript" ), "super", 0,
+ this, SLOT( textSuperScript() ),
+ actionCollection(), "format_super" );
+ actionFormatSuper->setExclusiveGroup( "valign" );
+ actionFormatSub = new KToggleAction( i18n( "Subscript" ), "sub", 0,
+ this, SLOT( textSubScript() ),
+ actionCollection(), "format_sub" );
+ actionFormatSub->setExclusiveGroup( "valign" );
+
+
+ actionInsertSpecialChar = new KAction( i18n( "Sp&ecial Character..." ), "char",
+ ALT + Qt::SHIFT + Qt::Key_C,
+ this, SLOT( insertSpecialChar() ),
+ actionCollection(), "insert_specialchar" );
+
+ actionInsertLink = new KAction( i18n( "Link..." ), 0,
+ this, SLOT( insertLink() ),
+ actionCollection(), "insert_link" );
+
+#if 0
+ //code from page.cc
+ //not implemented
+ picResizeMenu->insertSeparator();
+ picResizeMenu->insertItem( i18n( "Enter Custom Factor..." ), this, SLOT( picViewOrigFactor() ) );
+#endif
+ (void) new KAction( i18n( "Configure &Autocorrection..." ), 0,
+ this, SLOT( extraAutoFormat() ),
+ actionCollection(), "extra_autocorrection" );
+ actionExtraSpellCheck = KStdAction::spelling( this, SLOT( slotSpellCheck() ), actionCollection(), "extra_spellcheck" );
+
+ actionFormatParag = new KAction( i18n( "&Paragraph..." ), ALT + CTRL + Qt::Key_P,
+ this, SLOT( formatParagraph() ),
+ actionCollection(), "format_paragraph" );
+
+ actionFormatDefault=new KAction( i18n( "Default Format" ), 0,
+ this, SLOT( textDefaultFormat() ),
+ actionCollection(), "text_default" );
+
+ actionOpenLink = new KAction( i18n( "Open Link" ), 0,
+ this, SLOT( openLink() ),
+ actionCollection(), "open_link" );
+
+ actionChangeLink=new KAction( i18n("Change Link..."), 0,
+ this,SLOT(changeLink()),
+ actionCollection(), "change_link");
+
+ actionCopyLink = new KAction( i18n( "Copy Link" ), 0,
+ this, SLOT( copyLink() ),
+ actionCollection(), "copy_link" );
+
+ actionRemoveLink = new KAction( i18n( "Remove Link" ), 0,
+ this, SLOT( removeLink() ),
+ actionCollection(), "remove_link" );
+
+
+ actionAddLinkToBookmak = new KAction( i18n( "Add to Bookmark" ), 0,
+ this, SLOT( addToBookmark() ),
+ actionCollection(), "add_to_bookmark" );
+
+ actionEditCustomVarsEdit = new KAction( i18n( "&Custom Variables..." ), 0,
+ this, SLOT( editCustomVars() ),
+ actionCollection(), "edit_vars" );
+
+ actionEditCustomVars = new KAction( i18n( "Edit Variable..." ), 0,
+ this, SLOT( editCustomVariable() ),
+ actionCollection(), "edit_customvars" );
+
+
+ m_variableDefMap.clear();
+ actionInsertVariable = new KActionMenu( i18n( "&Variable" ),
+ actionCollection(), "insert_variable" );
+ // The last argument is only needed if a submenu is to be created
+ addVariableActions( VT_FIELD, KoFieldVariable::actionTexts(), actionInsertVariable, i18n("&Property") );
+ addVariableActions( VT_DATE, KoDateVariable::actionTexts(), actionInsertVariable, i18n("&Date") );
+ addVariableActions( VT_TIME, KoTimeVariable::actionTexts(), actionInsertVariable, i18n("&Time") );
+
+ actionInsertCustom = new KActionMenu( i18n( "&Custom" ),
+ actionCollection(), "insert_custom" );
+ actionInsertVariable->insert(actionInsertCustom);
+ refreshCustomMenu();
+
+ addVariableActions( VT_PGNUM, KoPageVariable::actionTexts(), actionInsertVariable, i18n("&Page") );
+ addVariableActions( VT_STATISTIC, KPrStatisticVariable::actionTexts(), actionInsertVariable, i18n("&Statistic") );
+
+ actionInsertVariable->popupMenu()->insertSeparator();
+ actionRefreshAllVariable = new KAction( i18n( "&Refresh All Variables" ), 0,
+ this, SLOT( refreshAllVariable() ),
+ actionCollection(), "refresh_all_variable" );
+ actionInsertVariable->insert(actionRefreshAllVariable);
+
+ actionIncreaseFontSize = new KAction( i18n("Increase Font Size"),"fontsizeup", 0,
+ this, SLOT( increaseFontSize() ),
+ actionCollection(), "increaseFontSize" );
+
+ actionDecreaseFontSize = new KAction( i18n("Decrease Font Size"),"fontsizedown", 0,
+ this, SLOT( decreaseFontSize() ),
+ actionCollection(), "decreaseFontSize" );
+
+ actionChangeCase=new KAction( i18n( "Change Case..." ), 0,
+ this, SLOT( changeCaseOfText() ),
+ actionCollection(), "change_case" );
+
+ actionViewZoom = new KSelectAction( i18n( "Zoom" ), "viewmag", 0,
+ actionCollection(), "view_zoom" );
+ connect( actionViewZoom, SIGNAL( activated( const QString & ) ),
+ this, SLOT( viewZoom( const QString & ) ) );
+ actionViewZoom->setEditable(true);
+ changeZoomMenu( );
+
+ actionFormatStylist = new KAction( i18n( "&Style Manager" ), ALT + CTRL + Qt::Key_S,
+ this, SLOT( extraStylist() ),
+ actionCollection(), "format_stylist" );
+
+ actionFormatStyleMenu = new KActionMenu( i18n( "St&yle" ), 0,
+ actionCollection(), "format_stylemenu" );
+
+
+ actionFormatStyle = new KSelectAction( i18n( "St&yle" ), 0,
+ actionCollection(), "format_style" );
+ connect( actionFormatStyle, SIGNAL( activated( int ) ),
+ this, SLOT( textStyleSelected( int ) ) );
+ actionFormatStyle->setMenuAccelsEnabled( true );
+ updateStyleList();
+
+ actionAllowAutoFormat = new KToggleAction( i18n( "Enable Autocorrection" ), 0,
+ this, SLOT( slotAllowAutoFormat() ),
+ actionCollection(), "enable_autocorrection" );
+ actionAllowAutoFormat->setCheckedState(i18n("Disable Autocorrection"));
+
+ // ------------------- Actions with a key binding and no GUI item
+ new KAction( i18n( "Insert Non-Breaking Space" ), CTRL+Qt::Key_Space,
+ this, SLOT( slotNonbreakingSpace() ), actionCollection(), "nonbreaking_space" );
+ new KAction( i18n( "Insert Non-Breaking Hyphen" ), CTRL+Qt::SHIFT+Qt::Key_Minus,
+ this, SLOT( slotNonbreakingHyphen() ), actionCollection(), "nonbreaking_hyphen" );
+ new KAction( i18n( "Insert Soft Hyphen" ), CTRL+Qt::Key_Minus,
+ this, SLOT( slotSoftHyphen() ), actionCollection(), "soft_hyphen" );
+ new KAction( i18n( "Line Break" ), Qt::SHIFT+Qt::Key_Return,
+ this, SLOT( slotLineBreak() ), actionCollection(), "line_break" );
+ new KAction( i18n( "Completion" ), KStdAccel::shortcut(KStdAccel::TextCompletion),
+ this, SLOT( slotCompletion() ), actionCollection(), "completion" );
+
+ new KAction( i18n( "Increase Numbering Level" ), ALT+Qt::Key_Right,
+ this, SLOT( slotIncreaseNumberingLevel() ), actionCollection(), "increase_numbering_level" );
+ new KAction( i18n( "Decrease Numbering Level" ), ALT+Qt::Key_Left,
+ this, SLOT( slotDecreaseNumberingLevel() ), actionCollection(), "decrease_numbering_level" );
+
+
+ actionInsertComment = new KAction( i18n( "Comment..." ), 0,
+ this, SLOT( insertComment() ),
+ actionCollection(), "insert_comment" );
+ actionEditComment = new KAction( i18n("Edit Comment..."), 0,
+ this,SLOT(editComment()),
+ actionCollection(), "edit_comment");
+
+ actionAddGuideLine = new KAction( i18n( "Add Guide Line..."), 0,
+ this, SLOT( addGuideLine()),
+ actionCollection(), "add_guideline");
+
+ actionRemoveComment = new KAction( i18n("Remove Comment"), 0,
+ this,SLOT(removeComment()),
+ actionCollection(), "remove_comment");
+
+ actionCopyTextOfComment = new KAction( i18n("Copy Text of Comment..."), 0,
+ this,SLOT(copyTextOfComment()),
+ actionCollection(), "copy_text_comment");
+
+ actionConfigureCompletion = new KAction( i18n( "&Configure Completion..." ), 0,
+ this, SLOT( configureCompletion() ),
+ actionCollection(), "configure_completion" );
+
+ actionZoomMinus = new KAction( i18n( "Zoom Out" ), "viewmag-",0,
+ this, SLOT( zoomMinus() ),
+ actionCollection(), "zoom_minus" );
+ actionZoomPlus = new KAction( i18n( "Zoom In" ), "viewmag+",0,
+ this, SLOT( zoomPlus() ),
+ actionCollection(), "zoom_plus" );
+ actionZoomEntirePage = new KAction( i18n( "Zoom Entire Slide" ), 0,
+ this, SLOT( zoomEntirePage() ),
+ actionCollection(), "zoom_entire_page" );
+
+ actionZoomMinus = new KAction( i18n( "Zoom Slide Width" ), 0,
+ this, SLOT( zoomPageWidth() ),
+ actionCollection(), "zoom_page_width" );
+ actionZoomSelectedObject= new KAction( i18n( "Zoom Selected Objects" ), "viewmagfit",0,
+ this, SLOT( zoomSelectedObject() ),
+ actionCollection(), "zoom_selected_object" );
+ actionZoomPageHeight= new KAction( i18n( "Zoom Slide Height" ), 0,
+ this, SLOT( zoomPageHeight() ),
+ actionCollection(), "zoom_page_height" );
+
+ actionZoomAllObject= new KAction( i18n( "Zoom All Objects" ), 0,
+ this, SLOT( zoomAllObject() ),
+ actionCollection(), "zoom_all_object" );
+
+ actionFlipHorizontal= new KAction( i18n( "Horizontal Flip" ), 0,
+ this, SLOT( flipHorizontal() ),
+ actionCollection(), "horizontal_flip" );
+
+ actionFlipVertical= new KAction( i18n( "Vertical Flip" ), 0,
+ this, SLOT( flipVertical() ),
+ actionCollection(), "vertical_flip" );
+
+ actionDuplicateObj = new KAction( i18n( "Duplicate Object..." ), 0,
+ this, SLOT( duplicateObj() ),
+ actionCollection(), "duplicate_obj" );
+
+ actionApplyAutoFormat= new KAction( i18n( "Apply Autocorrection" ), 0,
+ this, SLOT( applyAutoFormat() ),
+ actionCollection(), "apply_autoformat" );
+
+ actionCreateStyleFromSelection = new KAction( i18n( "Create Style From Selection..." ), 0,
+ this, SLOT( createStyleFromSelection()),
+ actionCollection(), "create_style" );
+
+ actionCloseObject = new KAction( i18n( "Close Object" ), 0,
+ this, SLOT( closeObject()),
+ actionCollection(), "close_object" );
+
+
+ actionAlignVerticalTop = new KToggleAction( i18n( "Align Top" ), 0,
+ this, SLOT( alignVerticalTop() ),
+ actionCollection(), "align_top" );
+ actionAlignVerticalTop->setExclusiveGroup( "vertical_alignment" );
+ actionAlignVerticalTop->setChecked( true );
+
+
+ actionAlignVerticalBottom = new KToggleAction( i18n( "Align Bottom" ), 0,
+ this, SLOT( alignVerticalBottom() ),
+ actionCollection(), "align_bottom" );
+ actionAlignVerticalBottom->setExclusiveGroup( "vertical_alignment" );
+
+ actionAlignVerticalCenter = new KToggleAction( i18n( "Align Middle" ), 0,
+ this, SLOT( alignVerticalCenter() ),
+ actionCollection(), "align_center" );
+ actionAlignVerticalCenter->setExclusiveGroup( "vertical_alignment" );
+
+
+ actionSavePicture= new KAction( i18n("Save Picture..."), 0,
+ this, SLOT( savePicture() ),
+ actionCollection(), "save_picture");
+
+ actionAllowBgSpellCheck = new KToggleAction( i18n( "Autospellcheck" ), 0,
+ this, SLOT( autoSpellCheck() ),
+ actionCollection(), "tool_auto_spellcheck" );
+
+ actionInsertFile= new KAction( i18n( "File..." ), 0,
+ this, SLOT( insertFile() ),
+ actionCollection(), "insert_file" );
+ actionImportStyle= new KAction( i18n( "Import Styles..." ), 0,
+ this, SLOT( importStyle() ),
+ actionCollection(), "import_style" );
+
+ actionSaveBackgroundPicture= new KAction( i18n( "Save Background Picture..." ), 0,
+ this, SLOT(backgroundPicture() ),
+ actionCollection(), "save_bgpicture" );
+#if 0
+ actionInsertDirectCursor = new KToggleAction( i18n( "Type Anywhere Cursor" ), 0,
+ this, SLOT( insertDirectCursor() ),
+ actionCollection(), "direct_cursor" );
+#endif
+
+ actionSpellIgnoreAll = new KAction( i18n( "Ignore All" ), 0,
+ this, SLOT( slotAddIgnoreAllWord() ),
+ actionCollection(), "ignore_all" );
+
+ actionAddWordToPersonalDictionary=new KAction( i18n( "Add Word to Dictionary" ),0,
+ this, SLOT( addWordToDictionary() ),
+ actionCollection(), "add_word_to_dictionary" );
+ actionCustomSlideShow = new KAction( i18n( "Custom Slide Show..." ), 0,
+ this, SLOT( customSlideShow() ),
+ actionCollection(), "custom_slide_show" );
+
+ actionDisplayObjectFromMasterPage = new KToggleAction( i18n( "Hide Object From Slide Master" ), 0,
+ this, SLOT( displayObjectFromMasterPage() ),
+ actionCollection(), "display_object_from_master_page" );
+ actionDisplayObjectFromMasterPage->setCheckedState(i18n("Display Object From Slide Master"));
+
+
+ actionDisplayBackgroundPage = new KToggleAction( i18n( "Hide Background" ), 0,
+ this, SLOT( displayBackground() ),
+ actionCollection(), "display_background" );
+ actionDisplayBackgroundPage->setCheckedState(i18n("Display Background"));
+}
+
+void KPrView::displayObjectFromMasterPage()
+{
+ bool state=actionDisplayObjectFromMasterPage->isChecked();
+ m_canvas->activePage()->setDisplayObjectFromMasterPage( !state );
+ KPrDisplayObjectFromMasterPage * cmd =new KPrDisplayObjectFromMasterPage( state ? i18n("Hide Object From Slide Master") : i18n("Display Object From Slide Master"), m_pKPresenterDoc, m_canvas->activePage(), !state);
+ m_pKPresenterDoc->addCommand(cmd);
+ m_pKPresenterDoc->updateSideBarItem( m_pKPresenterDoc->masterPage() );
+}
+
+void KPrView::displayBackground()
+{
+ bool state=actionDisplayBackgroundPage->isChecked();
+ m_canvas->activePage()->setDisplayBackground( !state );
+ KPrDisplayBackgroundPage * cmd =new KPrDisplayBackgroundPage( state ? i18n("Hide Background") : i18n("Display Background"), m_pKPresenterDoc, m_canvas->activePage(), !state);
+ m_pKPresenterDoc->addCommand(cmd);
+ m_pKPresenterDoc->updateSideBarItem( m_pKPresenterDoc->masterPage() );
+}
+
+void KPrView::customSlideShow()
+{
+ KPrCustomSlideShowDia *dlg = new KPrCustomSlideShowDia( this, m_pKPresenterDoc, "custom slide show" );
+ dlg->exec();
+ delete dlg;
+ //clear element
+ m_pKPresenterDoc->clearTestCustomSlideShow();
+}
+
+void KPrView::textSubScript()
+{
+ m_canvas->setTextSubScript(actionFormatSub->isChecked());
+}
+
+void KPrView::textSuperScript()
+{
+ m_canvas->setTextSuperScript(actionFormatSuper->isChecked());
+}
+
+void KPrView::decreaseFontSize()
+{
+ m_canvas->setDecreaseFontSize();
+}
+
+void KPrView::increaseFontSize()
+{
+ m_canvas->setIncreaseFontSize();
+}
+
+void KPrView::objectSelectedChanged()
+{
+
+ bool state=m_canvas->isOneObjectSelected();
+ bool headerfooterselected=false;
+
+ if (m_canvas->numberOfObjectSelected()==1)
+ {
+ KPrObject *obj=m_canvas->getSelectedObj();
+ //disable this action when we select a header/footer
+ if (obj==m_pKPresenterDoc->header() || obj==m_pKPresenterDoc->footer())
+ headerfooterselected=true;
+ else
+ headerfooterselected=false;
+ }
+ actionScreenAssignEffect->setEnabled(state && !headerfooterselected);
+ actionEditDelete->setEnabled(state && !headerfooterselected);
+ actionEditCut->setEnabled(state && !headerfooterselected);
+
+ KPrObjectProperties objectProperties( m_canvas->activePage()->getSelectedObjects() );
+ int flags = objectProperties.getPropertyFlags();
+ // only button when object support them or none object is selected
+ actionBrushColor->setEnabled( !state || ( flags & KPrObjectProperties::PtBrush ) );
+ actionExtraLineBegin->setEnabled( !state || ( flags & KPrObjectProperties::PtLineEnds ) );
+ actionExtraLineEnd->setEnabled( !state || ( flags & KPrObjectProperties::PtLineEnds ) );
+ actionExtraPenWidth->setEnabled( !state || ( flags & KPrObjectProperties::PtPenWidth ) );
+
+ actionExtraProperties->setEnabled(state && !headerfooterselected);
+ actionExtraRotate->setEnabled(state && !headerfooterselected);
+ actionExtraShadow->setEnabled(state && !m_canvas->haveASelectedPartObj() && !headerfooterselected);
+
+ actionExtraAlignObjsPopup->setEnabled(state && !headerfooterselected);
+ actionExtraGroup->setEnabled(state && m_canvas->numberOfObjectSelected()>1);
+ actionExtraUnGroup->setEnabled(state && m_canvas->haveASelectedGroupObj());
+
+ bool enableAlign = m_canvas->canMoveOneObject() && state && !headerfooterselected;
+
+ actionExtraAlignObjLeft->setEnabled(enableAlign);
+ actionExtraAlignObjCenterH->setEnabled(enableAlign);
+ actionExtraAlignObjRight->setEnabled(enableAlign);
+ actionExtraAlignObjTop->setEnabled(enableAlign);
+ actionExtraAlignObjCenterV->setEnabled(enableAlign);
+ actionExtraAlignObjBottom->setEnabled(enableAlign);
+ //actionEditDelete->setEnabled(state);
+ int nbobj=m_canvas->numberOfObjectSelected();
+ actionDuplicateObj->setEnabled(state && (nbobj>=1));
+
+ state = state && (nbobj==1);
+ actionExtraArrangePopup->setEnabled(state);
+
+ actionExtraRaise->setEnabled( nbobj > 0 );
+ actionExtraLower->setEnabled( nbobj > 0 );
+ actionExtraBringForward->setEnabled( nbobj > 0 );
+ actionExtraSendBackward->setEnabled( nbobj > 0 );
+
+ //actionExtraConfigPicture->setEnabled( state && m_canvas->haveASelectedPixmapObj() );
+ //actionPenColor->setEnabled(state);
+ //actionExtraPenStyle->setEnabled(state);
+ //actionExtraPenWidth->setEnabled(state);
+
+ actionApplyAutoFormat->setEnabled(m_canvas->oneObjectTextExist());
+ slotObjectEditChanged();
+}
+
+void KPrView::backOk( KPrBackDialog* backDia, bool takeGlobal )
+{
+ KPrPage *page=m_canvas->activePage();
+ KPrSetBackCmd *setBackCmd = new KPrSetBackCmd( i18n( "Set Background" ),
+ backDia->getBackGround(),
+ page->background()->getBackGround(),
+ backDia->useMasterBackground(),
+ takeGlobal, m_pKPresenterDoc,page);
+ setBackCmd->execute();
+ m_pKPresenterDoc->addCommand( setBackCmd );
+}
+
+void KPrView::afChooseOk( const QString & c )
+{
+ QFileInfo fileInfo( c );
+ QString fileName = locate( "autoforms",
+ fileInfo.dirPath( false ) + "/" + fileInfo.baseName() + ".atf",
+ KPrFactory::global() );
+
+ deSelectAllObjects();
+ m_canvas->setToolEditMode( INS_AUTOFORM );
+ m_canvas->setAutoForm( fileName );
+}
+
+void KPrView::slotAfchooseCanceled()
+{
+ setTool( TEM_MOUSE );
+}
+
+void KPrView::propertiesOk()
+{
+ KCommand *cmd = m_propertyEditor->getCommand();
+
+ if ( cmd )
+ {
+ cmd->execute();
+ kPresenterDoc()->addCommand( cmd );
+ }
+}
+
+void KPrView::pgConfOk()
+{
+ QValueList<bool> selectedSlides;
+ for( unsigned i = 0; i < kPresenterDoc()->pageList().count(); i++ ) {
+ selectedSlides.append( kPresenterDoc()->pageList().at( i )->isSlideSelected() );
+ }
+
+ KPrPgConfCmd *pgConfCmd = new KPrPgConfCmd( i18n( "Configure Slide Show" ),
+ pgConfDia->getManualSwitch(), pgConfDia->getInfiniteLoop(),
+ pgConfDia->getShowEndOfPresentationSlide(), pgConfDia->getPresentationDuration(), pgConfDia->getPen(),
+ pgConfDia->getSelectedSlides(),
+ pgConfDia->presentationName(),
+ kPresenterDoc()->spManualSwitch(),
+ kPresenterDoc()->spInfiniteLoop(),
+ kPresenterDoc()->spShowEndOfPresentationSlide(),
+ kPresenterDoc()->presentationDuration(),
+ kPresenterDoc()->presPen(),
+ selectedSlides,
+ kPresenterDoc()->presentationName(),
+ kPresenterDoc() );
+ pgConfCmd->execute();
+ kPresenterDoc()->addCommand( pgConfCmd );
+
+ QPtrListIterator<KPrPage> it( kPresenterDoc()->pageList() );
+ for ( ; it.current(); ++it )
+ updateSideBarItem( it.current() );
+}
+
+
+void KPrView::rotateOk()
+{
+ float _newAngle=rotateDia->angle();
+
+ KCommand *cmd=m_canvas->activePage()->rotateSelectedObjects(_newAngle);
+ if( cmd )
+ kPresenterDoc()->addCommand( cmd );
+}
+
+void KPrView::shadowOk()
+{
+ KCommand *cmd=m_canvas->activePage()->shadowObj(shadowDia->shadowDirection(),
+ shadowDia->shadowDistance(),
+ shadowDia->shadowColor());
+ if( cmd)
+ kPresenterDoc()->addCommand( cmd );
+}
+
+unsigned int KPrView::getCurrPgNum() const
+{
+ return currPg + 1;
+}
+
+
+void KPrView::recalcCurrentPageNum()
+{
+ KPrPage *activePage = m_canvas->activePage();
+
+ QPtrList<KPrPage> pageList( m_pKPresenterDoc->pageList() );
+
+ int pos = pageList.findRef( activePage );
+
+ if ( pos != -1 )
+ {
+ currPg = pos;
+ }
+ else
+ {
+ kdDebug(33001) << "KPrView::recalcCurrentPageNum: activePage not found" << endl;
+ currPg = 0;
+ }
+
+ if( sidebar )
+ sidebar->setCurrentPage( currPg );
+}
+
+
+void KPrView::scrollH( int value )
+{
+ if ( !presStarted ) {
+ m_canvas->scrollX( value );
+ if ( h_ruler )
+ h_ruler->setOffset( value, 0 );
+ }
+}
+
+void KPrView::scrollV( int value )
+{
+ if ( !presStarted ) {
+ m_canvas->scrollY( value );
+ if ( v_ruler )
+ v_ruler->setOffset( 0, value );
+ }
+}
+
+void KPrView::fontChanged( const QFont &font )
+{
+ tbFont.setFamily( font.family() );
+ tbFont.setBold( font.bold() );
+ tbFont.setItalic( font.italic() );
+ tbFont.setUnderline( font.underline() );
+ tbFont.setPointSize( font.pointSize() );
+
+ actionTextFontFamily->setFont( tbFont.family() );
+ actionTextFontSize->setFontSize( tbFont.pointSize() );
+ actionTextBold->setChecked( tbFont.bold() );
+ actionTextItalic->setChecked( tbFont.italic() );
+ actionTextUnderline->setChecked( tbFont.underline() );
+}
+
+void KPrView::colorChanged( const QColor &color )
+{
+ tbColor = color;
+ actionTextColor->setEnabled( true );
+ actionTextColor->setCurrentColor( tbColor );
+}
+
+void KPrView::alignChanged( int align )
+{
+ if ( align != tbAlign ) {
+ tbAlign = align;
+ if ( ( align & AlignLeft ) == AlignLeft ) {
+ actionTextAlignLeft->blockSignals( true );
+ actionTextAlignLeft->setChecked( true );
+ actionTextAlignLeft->blockSignals( false );
+ } else if ( ( align & AlignHCenter ) == AlignHCenter ||
+ ( align & AlignCenter ) == AlignCenter ) {
+ actionTextAlignCenter->blockSignals( true );
+ actionTextAlignCenter->setChecked( true );
+ actionTextAlignCenter->blockSignals( false );
+ } else if ( ( align & AlignRight ) == AlignRight ) {
+ actionTextAlignRight->blockSignals( true );
+ actionTextAlignRight->setChecked( true );
+ actionTextAlignRight->blockSignals( false );
+ } else if ( (align & AlignJustify ) == AlignJustify ) {
+ actionTextAlignBlock->blockSignals( true );
+ actionTextAlignBlock->setChecked( true );
+ actionTextAlignBlock->blockSignals( false );
+ }
+ }
+}
+
+void KPrView::changePicture( const QString & filename )
+{
+ QStringList mimetypes;
+ mimetypes += KImageIO::mimeTypes( KImageIO::Reading );
+ mimetypes += KoPictureFilePreview::clipartMimeTypes();
+
+ KFileDialog fd( filename, QString::null, this, 0, true );
+ fd.setCaption(i18n("Select New Picture"));
+ fd.setMimeFilter( mimetypes );
+ fd.setPreviewWidget( new KoPictureFilePreview( &fd ) );
+
+ KURL url;
+ if ( fd.exec() == QDialog::Accepted )
+ url = fd.selectedURL();
+
+ if( url.isEmpty() || !url.isValid())
+ return;
+
+ m_canvas->changePicture( url, m_canvas );
+}
+
+void KPrView::resizeEvent( QResizeEvent *e )
+{
+ if ( !presStarted )
+ QWidget::resizeEvent( e );
+
+ QSize s = e ? e->size() : size();
+ splitter->setGeometry( 0, 0, s.width(), s.height() );
+}
+
+void KPrView::reorganize()
+{
+ if (m_bShowGUI ) {
+
+ horz->show();
+ vert->show();
+ pgNext->show();
+ pgPrev->show();
+
+ if(kPresenterDoc()->showRuler())
+ {
+ int hSpace = v_ruler->minimumSizeHint().width();
+ int vSpace = h_ruler->minimumSizeHint().height();
+
+ m_canvas->move( hSpace, vSpace );
+ if ( h_ruler )
+ {
+ h_ruler->show();
+ h_ruler->setGeometry( hSpace, 0, m_canvas->width(), vSpace );
+ }
+ if (v_ruler )
+ {
+ v_ruler->show();
+ v_ruler->setGeometry( 0, vSpace, hSpace, m_canvas->height() );
+ }
+ if(getTabChooser())
+ {
+ getTabChooser()->setGeometry(0, 0, hSpace, vSpace);
+ getTabChooser()->show();
+ }
+ }
+ else
+ {
+ m_canvas->move( 0, 0 );
+ if ( h_ruler )
+ h_ruler->hide();
+ if ( v_ruler )
+ v_ruler->hide();
+ getTabChooser()->hide();
+ }
+
+ if( statusBar())
+ {
+ if(m_pKPresenterDoc->showStatusBar())
+ statusBar()->show();
+ else
+ statusBar()->hide();
+ }
+
+ setRanges();
+ }
+ else
+ {
+ horz->hide();
+ vert->hide();
+ pgNext->hide();
+ pgPrev->hide();
+ h_ruler->hide();
+ v_ruler->hide();
+ getTabChooser()->hide();
+ m_canvas->move( 0, 0 );
+ }
+}
+
+void PageBase::resizeEvent( QResizeEvent *e )
+{
+ if ( !view->presStarted )
+ QWidget::resizeEvent( e );
+
+ QSize s = e ? e->size() : size();
+
+ if ( view->m_bShowGUI ) {
+ int hSpace = view->getVRuler()->minimumSizeHint().width();
+ int vSpace = view->getVRuler()->minimumSizeHint().height();
+
+ view->m_canvas->resize( s.width() - ( hSpace + 16 ), s.height() - ( vSpace + 16 ) );
+ view->vert->setGeometry( s.width() - 16, 0, 16, s.height() - 32 );
+ view->pgPrev->setGeometry( s.width() - 15, s.height() - 32, 15, 16 );
+ view->pgNext->setGeometry( s.width() - 15, s.height() - 16, 15, 16 );
+ view->horz->setGeometry( 0, s.height() - 16, s.width() - 16, 16 );
+ }
+ else
+ {
+ view->m_canvas->move( 0, 0 );
+ view->m_canvas->resize( s.width(), s.height() );
+ }
+ view->reorganize();
+}
+
+void KPrView::dragEnterEvent( QDragEnterEvent *e )
+{
+ QApplication::sendEvent( m_canvas, e );
+}
+
+void KPrView::dragMoveEvent( QDragMoveEvent *e )
+{
+ QApplication::sendEvent( m_canvas, e );
+}
+
+void KPrView::dragLeaveEvent( QDragLeaveEvent *e )
+{
+ QApplication::sendEvent( m_canvas, e );
+}
+
+void KPrView::dropEvent( QDropEvent *e )
+{
+ QApplication::sendEvent( m_canvas, e );
+}
+
+void KPrView::getPageMouseWheelEvent( QWheelEvent *e )
+{
+ QApplication::sendEvent( vert, e );
+}
+
+void KPrView::keyPressEvent( QKeyEvent *e )
+{
+ if ( e->key() == Qt::Key_Delete && !m_canvas->currentTextObjectView() )
+ editDelete();
+ else
+ QApplication::sendEvent( m_canvas, e );
+}
+
+void KPrView::doAutomaticScreenPres()
+{
+ if ( m_autoPresStop ) // A user pushed Escape key or clicked "Exit presentation" menu.
+ return;
+ else if ( m_autoPresRestart && kPresenterDoc()->spInfiniteLoop() ) {
+ m_autoPresRestart = false;
+ m_canvas->presGotoFirstPage(); // return to first page.
+ }
+ else
+ screenNext();
+}
+
+void KPrView::updateReadWrite( bool readwrite )
+{
+ // First disable or enable everything
+ QValueList<KAction*> actions = actionCollection()->actions();
+ // Also grab actions from the document
+ actions += m_pKPresenterDoc->actionCollection()->actions();
+ QValueList<KAction*>::ConstIterator aIt = actions.begin();
+ QValueList<KAction*>::ConstIterator aEnd = actions.end();
+ for (; aIt != aEnd; ++aIt )
+ (*aIt)->setEnabled( readwrite );
+
+
+ if ( !readwrite )
+ {
+ // Readonly -> re-enable a few harmless actions
+ refreshPageButton();
+ actionViewFormattingChars->setEnabled( true );
+ actionViewZoom->setEnabled( true );
+ actionEditFind->setEnabled( true );
+ actionEditFindNext->setEnabled( true );
+ actionEditFindPrevious->setEnabled( true );
+ actionEditReplace->setEnabled( true );
+ actionEditSelectAll->setEnabled( true );
+ actionEditDeSelectAll->setEnabled( true );
+ }
+ else
+ {
+ refreshPageButton();
+ objectSelectedChanged();
+
+ refreshCustomMenu();
+
+ // Correctly enable or disable undo/redo actions again
+ m_pKPresenterDoc->commandHistory()->updateActions();
+ updateSideBarMenu();
+ }
+
+}
+
+void KPrView::setupPopupMenus()
+{
+ // create right button line begin
+ rb_lbegin = new QPopupMenu();
+ Q_CHECK_PTR( rb_lbegin );
+ rb_lbegin->insertItem( KPBarIcon("line_normal_begin" ), this, SLOT( extraLineBeginNormal() ) );
+ rb_lbegin->insertSeparator();
+ rb_lbegin->insertItem( KPBarIcon("line_arrow_begin" ), this, SLOT( extraLineBeginArrow() ) );
+ rb_lbegin->insertSeparator();
+ rb_lbegin->insertItem( KPBarIcon("line_rect_begin" ), this, SLOT( extraLineBeginRect() ) );
+ rb_lbegin->insertSeparator();
+ rb_lbegin->insertItem( KPBarIcon("line_circle_begin" ), this, SLOT( extraLineBeginCircle() ) );
+ rb_lbegin->insertSeparator();
+ rb_lbegin->insertItem( KPBarIcon("line_line_arrow_begin" ), this, SLOT( extraLineBeginLineArrow() ) );
+ rb_lbegin->insertSeparator();
+ rb_lbegin->insertItem( KPBarIcon("line_dimension_line_begin" ), this, SLOT( extraLineBeginDimensionLine() ) );
+ rb_lbegin->insertSeparator();
+ rb_lbegin->insertItem( KPBarIcon("line_double_arrow_begin" ), this, SLOT( extraLineBeginDoubleArrow() ) );
+ rb_lbegin->insertSeparator();
+ rb_lbegin->insertItem( KPBarIcon("line_double_line_arrow_begin" ), this, SLOT( extraLineBeginDoubleLineArrow() ) );
+ rb_lbegin->setMouseTracking( true );
+ rb_lbegin->setCheckable( false );
+
+ // create right button line end
+ rb_lend = new QPopupMenu();
+ Q_CHECK_PTR( rb_lend );
+ rb_lend->insertItem( KPBarIcon("line_normal_end" ), this, SLOT( extraLineEndNormal() ) );
+ rb_lend->insertSeparator();
+ rb_lend->insertItem( KPBarIcon("line_arrow_end" ), this, SLOT( extraLineEndArrow() ) );
+ rb_lend->insertSeparator();
+ rb_lend->insertItem( KPBarIcon("line_rect_end" ), this, SLOT( extraLineEndRect() ) );
+ rb_lend->insertSeparator();
+ rb_lend->insertItem( KPBarIcon("line_circle_end" ), this, SLOT( extraLineEndCircle() ) );
+ rb_lend->insertSeparator();
+ rb_lend->insertItem( KPBarIcon("line_line_arrow_end" ), this, SLOT( extraLineEndLineArrow() ) );
+ rb_lend->insertSeparator();
+ rb_lend->insertItem( KPBarIcon("line_dimension_line_end" ), this, SLOT( extraLineEndDimensionLine() ) );
+ rb_lend->insertSeparator();
+ rb_lend->insertItem( KPBarIcon("line_double_arrow_end" ), this, SLOT( extraLineEndDoubleArrow() ) );
+ rb_lend->insertSeparator();
+ rb_lend->insertItem( KPBarIcon("line_double_line_arrow_end" ), this, SLOT( extraLineEndDoubleLineArrow() ) );
+ rb_lend->setMouseTracking( true );
+ rb_lend->setCheckable( false );
+
+ // create arrange-objects popup
+ m_arrangeObjectsPopup = new QPopupMenu();
+ Q_CHECK_PTR(m_arrangeObjectsPopup);
+ m_arrangeObjectsPopup->insertItem(KPBarIcon("lower"), this, SLOT(extraLower()));
+ m_arrangeObjectsPopup->insertSeparator();
+ m_arrangeObjectsPopup->insertItem(KPBarIcon("send_backward"), this, SLOT(extraSendBackward()));
+ m_arrangeObjectsPopup->insertSeparator();
+ m_arrangeObjectsPopup->insertItem(KPBarIcon("bring_forward"), this, SLOT(extraBringForward()));
+ m_arrangeObjectsPopup->insertSeparator();
+ m_arrangeObjectsPopup->insertItem(KPBarIcon("raise"), this, SLOT(extraRaise()));
+ m_arrangeObjectsPopup->setMouseTracking(true);
+ m_arrangeObjectsPopup->setCheckable(false);
+
+ // create insert-line popup
+ actionToolsLinePopup->insert(actionToolsLine);
+ actionToolsLinePopup->insert(actionToolsFreehand);
+ actionToolsLinePopup->insert(actionToolsPolyline);
+ actionToolsLinePopup->insert(actionToolsCubicBezierCurve);
+ actionToolsLinePopup->insert(actionToolsQuadricBezierCurve);
+
+ // create insert-shape popup
+ actionToolsShapePopup->insert(actionToolsRectangle);
+ actionToolsShapePopup->insert(actionToolsCircleOrEllipse);
+ actionToolsShapePopup->insert(actionToolsPie);
+ actionToolsShapePopup->insert(actionToolsConvexOrConcavePolygon);
+
+ // create insert-closed-line popup
+ actionToolsClosedLinePopup->insert(actionToolsClosedFreehand);
+ actionToolsClosedLinePopup->insert(actionToolsClosedPolyline);
+ actionToolsClosedLinePopup->insert(actionToolsClosedQuadricBezierCurve);
+ actionToolsClosedLinePopup->insert(actionToolsClosedCubicBezierCurve);
+
+ actionExtraAlignObjsPopup->insert( actionExtraAlignObjLeft );
+ actionExtraAlignObjsPopup->insert( actionExtraAlignObjCenterV );
+ actionExtraAlignObjsPopup->insert( actionExtraAlignObjRight );
+ actionExtraAlignObjsPopup->insert( actionExtraAlignObjTop );
+ actionExtraAlignObjsPopup->insert( actionExtraAlignObjCenterH );
+ actionExtraAlignObjsPopup->insert( actionExtraAlignObjBottom );
+
+ actionExtraArrangePopup->insert( actionExtraLower );
+ actionExtraArrangePopup->insert( actionExtraSendBackward );
+ actionExtraArrangePopup->insert( actionExtraBringForward );
+ actionExtraArrangePopup->insert( actionExtraRaise );
+}
+
+void KPrView::setupScrollbars()
+{
+ vert = new QScrollBar( QScrollBar::Vertical, pageBase );
+ horz = new QScrollBar( QScrollBar::Horizontal, pageBase );
+ vert->show();
+ horz->show();
+ QObject::connect( vert, SIGNAL( valueChanged( int ) ), this, SLOT( scrollV( int ) ) );
+ QObject::connect( horz, SIGNAL( valueChanged( int ) ), this, SLOT( scrollH( int ) ) );
+ vert->setValue(vert->maxValue());
+ horz->setValue(horz->maxValue());
+ vert->setValue(vert->minValue());
+ horz->setValue(horz->minValue());
+ pgNext = new QToolButton( pageBase );
+ pgNext->setPixmap( QPixmap( pagedown_xpm ) );
+ pgNext->setAutoRepeat( TRUE );
+ QToolTip::add( pgNext, i18n( "Next slide" ) );
+ connect( pgNext, SIGNAL( clicked() ), this, SLOT( nextPage() ) );
+ pgPrev = new QToolButton( pageBase );
+ pgPrev->setPixmap( QPixmap( pageup_xpm ) );
+ pgPrev->setAutoRepeat( TRUE );
+ QToolTip::add( pgPrev, i18n( "Previous slide" ) );
+ connect( pgPrev, SIGNAL( clicked() ), this, SLOT( prevPage() ) );
+}
+
+void KPrView::setupRulers()
+{
+ tabChooser = new KoTabChooser( pageBase, KoTabChooser::TAB_ALL );
+ tabChooser->setReadWrite(kPresenterDoc()->isReadWrite());
+ h_ruler = new KoRuler( pageBase, m_canvas, Qt::Horizontal, kPresenterDoc()->pageLayout(),
+ KoRuler::F_INDENTS | KoRuler::F_TABS, kPresenterDoc()->unit(), tabChooser );
+ h_ruler->changeFlags(0);
+
+ h_ruler->setReadWrite(kPresenterDoc()->isReadWrite());
+ v_ruler = new KoRuler( pageBase, m_canvas, Qt::Vertical, kPresenterDoc()->pageLayout(), 0, kPresenterDoc()->unit() );
+ v_ruler->setReadWrite(kPresenterDoc()->isReadWrite());
+
+ int hSpace = v_ruler->minimumSizeHint().width();
+ int vSpace = h_ruler->minimumSizeHint().height();
+
+ m_canvas->resize( m_canvas->width() - hSpace, m_canvas->height() - vSpace );
+ m_canvas->move( hSpace, vSpace );
+ h_ruler->setGeometry( hSpace, 0, m_canvas->width(), vSpace );
+ v_ruler->setGeometry( 0, vSpace, hSpace, m_canvas->height() );
+
+ QObject::connect( h_ruler, SIGNAL( unitChanged( KoUnit::Unit ) ),
+ this, SLOT( unitChanged( KoUnit::Unit ) ) );
+ QObject::connect( h_ruler, SIGNAL( newPageLayout( const KoPageLayout & ) ),
+ this, SLOT( newPageLayout( const KoPageLayout & ) ) );
+
+ connect( h_ruler, SIGNAL( doubleClicked() ), this,
+ SLOT( slotHRulerDoubleClicked() ) );
+ connect( h_ruler, SIGNAL( doubleClicked(double) ), this,
+ SLOT( slotHRulerDoubleClicked(double) ) );
+
+ QObject::connect( v_ruler, SIGNAL( unitChanged( KoUnit::Unit ) ),
+ this, SLOT( unitChanged( KoUnit::Unit ) ) );
+ QObject::connect( v_ruler, SIGNAL( newPageLayout( const KoPageLayout & ) ),
+ this, SLOT( newPageLayout( const KoPageLayout & ) ) );
+ QObject::connect( v_ruler, SIGNAL( doubleClicked() ),
+ this, SLOT( openPageLayoutDia() ) );
+
+ connect( h_ruler, SIGNAL( newLeftIndent( double ) ), this, SLOT( newLeftIndent( double ) ) );
+ connect( h_ruler, SIGNAL( newFirstIndent( double ) ), this, SLOT( newFirstIndent( double ) ) );
+ connect( h_ruler, SIGNAL( newRightIndent( double ) ), this, SLOT( newRightIndent( double ) ) );
+}
+
+void KPrView::unitChanged( KoUnit::Unit u )
+{
+ m_pKPresenterDoc->setUnit( u );
+}
+
+void KPrView::setRanges()
+{
+ if ( vert && horz && m_canvas && m_pKPresenterDoc ) {
+ vert->setSteps( 10, m_canvas->height() );
+ vert->setRange( 0, QMAX( 0, m_canvas->activePage()->getZoomPageRect().height() - m_canvas->height() ) );
+ horz->setSteps( 10, m_canvas->width() );
+ horz->setRange( 0, QMAX( 0, m_canvas->activePage()->getZoomPageRect().width() + 16 - m_canvas->width() ) );
+ }
+}
+
+void KPrView::skipToPage( int num )
+{
+ setEditMaster( false );
+ if ( num < 0 || num > static_cast<int>( m_pKPresenterDoc->getPageNums() ) - 1 || !m_canvas )
+ return;
+ m_canvas->exitEditMode();
+ currPg = num;
+ emit currentPageChanged( currPg );
+ if( sidebar )
+ sidebar->setCurrentPage( currPg );
+ KPrPage* page = m_pKPresenterDoc->pageList().at( currPg );
+ m_canvas->setActivePage( page );
+ // don't scroll before new active page is set,
+ // the page active until then might have been deleted
+ vert->setValue( 0 );
+ horz->setValue( 0 );
+ if ( notebar ) {
+ QString text = page->noteText( );
+ notebar->setCurrentNoteText( text );
+ }
+ refreshPageButton();
+ //(Laurent) deselect object when we change page.
+ //otherwise you can change object properties on other page
+ deSelectAllObjects();
+ m_pKPresenterDoc->repaint( FALSE );
+
+ m_pKPresenterDoc->displayActivePage( page );
+}
+
+void KPrView::refreshPageButton()
+{
+ bool state = (currPg > 0);
+ pgPrev->setEnabled( state );
+ actionScreenFirst->setEnabled(state);
+ actionScreenPrev->setEnabled(state);
+ state=(currPg < (int)m_pKPresenterDoc->getPageNums() - 1);
+ pgNext->setEnabled( state );
+ actionScreenLast->setEnabled(state);
+ actionScreenNext->setEnabled(state);
+ updateHeaderFooterButton();
+ updateDisplayObjectMasterPageButton();
+ updateDisplayBackgroundButton();
+}
+
+void KPrView::showObjectRect( const KPrObject * object )
+{
+ QRect r = zoomHandler()->zoomRect( object->getRealRect() );
+ if ( ! QRect( getCanvas()->diffx(),
+ getCanvas()->diffy(),
+ getCanvas()->width(),
+ getCanvas()->height() ).contains( r ) )
+ {
+ int x = r.left() - 20;
+ int y = r.top() - 20;
+ if ( x < 0 )
+ {
+ x = 0;
+ }
+ if ( y < 0 )
+ {
+ y = 0;
+ }
+ horz->setValue( x );
+ vert->setValue( y );
+ }
+}
+
+void KPrView::setTool( ToolEditMode toolEditMode )
+{
+ switch ( toolEditMode ) {
+ case TEM_MOUSE:
+ actionToolsMouse->setChecked( true );
+ break;
+ case TEM_ROTATE:
+ actionToolsRotate->setChecked( true );
+ break;
+ case TEM_ZOOM:
+ actionToolsZoom->setChecked( true );
+ break;
+ case INS_LINE:
+ actionToolsLine->setChecked( true );
+ break;
+ case INS_RECT:
+ actionToolsRectangle->setChecked( true );
+ break;
+ case INS_ELLIPSE:
+ actionToolsCircleOrEllipse->setChecked( true );
+ break;
+ case INS_PIE:
+ actionToolsPie->setChecked( true );
+ break;
+ case INS_DIAGRAMM:
+ actionToolsDiagramm->setChecked( true );
+ break;
+ case INS_TABLE:
+ actionToolsTable->setChecked( true );
+ break;
+ case INS_FORMULA:
+ actionToolsFormula->setChecked( true );
+ break;
+ case INS_TEXT:
+ actionToolsText->setChecked( true );
+ break;
+ case INS_AUTOFORM:
+ actionToolsAutoform->setChecked( true );
+ break;
+ default: // Shut up gcc -Wall
+ break; // Shut up gcc 3.x
+ }
+}
+
+void KPrView::setRulerMouseShow( bool _show )
+{
+ v_ruler->showMousePos( _show );
+ h_ruler->showMousePos( _show );
+}
+
+void KPrView::setRulerMousePos( int mx, int my )
+{
+ v_ruler->setMousePos( mx, my );
+ h_ruler->setMousePos( mx, my );
+}
+
+void KPrView::enableWebPres()
+{
+}
+
+void KPrView::enableMSPres()
+{
+}
+
+bool KPrView::doubleClickActivation() const
+{
+ return true;
+}
+
+QWidget* KPrView::canvas() const
+{
+ return m_canvas;
+}
+
+int KPrView::canvasXOffset() const
+{
+ return m_canvas->diffx();
+}
+
+int KPrView::canvasYOffset() const
+{
+ return m_canvas->diffy();
+}
+
+void KPrView::setCanvasXOffset( int _x )
+{
+ m_canvas->setDiffX( _x );
+}
+
+void KPrView::setCanvasYOffset( int _y )
+{
+ m_canvas->setDiffY( _y );
+}
+
+int KPrView::getCurrentPresPage() const
+{
+ if ( !presStarted )
+ return -1;
+
+ return m_canvas->presPage();
+}
+
+int KPrView::getCurrentPresStep() const
+{
+ if ( !presStarted )
+ return -1;
+
+ return m_canvas->presStep();
+}
+
+int KPrView::getPresStepsOfPage() const
+{
+ if ( !presStarted )
+ return -1;
+
+ return m_canvas->numPresSteps();
+}
+
+int KPrView::getNumPresPages() const
+{
+ if ( !presStarted )
+ return -1;
+
+ return m_canvas->numPresPages();
+}
+
+bool KPrView::gotoPresPage( int pg )
+{
+ if ( !presStarted )
+ return false;
+
+ m_canvas->gotoPage( pg );
+ return true;
+}
+
+void KPrView::nextPage()
+{
+ // don't move when on master
+ if ( m_editMaster )
+ return;
+
+ if ( currPg >= (int)m_pKPresenterDoc->getPageNums() - 1 )
+ return;
+
+ //kdDebug(33001)<<"currPg :"<<currPg<<"m_pKPresenterDoc->getPageNums() :"<<m_pKPresenterDoc->getPageNums()<<endl;
+ skipToPage( currPg+1 );
+}
+
+void KPrView::prevPage()
+{
+ // don't move when on master
+ if ( m_editMaster )
+ return;
+
+ if ( currPg == 0 )
+ return;
+ skipToPage( currPg-1 );
+}
+
+void KPrView::updateSideBar()
+{
+ if ( sidebar )
+ {
+ sidebar->blockSignals( TRUE );
+ sidebar->thumbBar()->uptodate = false;
+ sidebar->outline()->rebuildItems();
+ sidebar->thumbBar()->rebuildItems();
+ sidebar->blockSignals( FALSE );
+ }
+}
+
+void KPrView::updateSideBarItem( KPrPage * page )
+{
+ if ( sidebar )
+ sidebar->updateItem( page );
+ m_pKPresenterDoc->recalcVariables( VT_STATISTIC );
+}
+
+void KPrView::addSideBarItem( int pos )
+{
+ if ( sidebar )
+ {
+ sidebar->blockSignals( TRUE );
+ sidebar->addItem( pos );
+ sidebar->blockSignals( FALSE );
+ }
+}
+
+void KPrView::moveSideBarItem( int oldPos, int newPos )
+{
+ if ( sidebar )
+ {
+ sidebar->blockSignals( TRUE );
+ sidebar->moveItem( oldPos, newPos );
+ sidebar->blockSignals( FALSE );
+ }
+}
+
+void KPrView::removeSideBarItem( int pos )
+{
+ if ( sidebar )
+ {
+ sidebar->blockSignals( TRUE );
+ sidebar->removeItem( pos );
+ sidebar->blockSignals( FALSE );
+ }
+}
+
+void KPrView::updatePageInfo()
+{
+ if (m_sbPageLabel)
+ m_sbPageLabel->setText( QString(" ") +
+ i18n("Slide %1/%2").arg(getCurrPgNum()).arg(m_pKPresenterDoc->getPageNums())+
+ QString(" ") );
+}
+
+void KPrView::updateObjectStatusBarItem()
+{
+ KStatusBar * sb = statusBar();
+ int nbObjects = m_canvas->objNums();
+
+ if ( m_pKPresenterDoc->showStatusBar() && sb && nbObjects > 0 ) {
+ int nbSelected = m_canvas->numberOfObjectSelected();
+
+ if (nbSelected == 1) {
+ KoUnit::Unit unit = m_pKPresenterDoc->unit();
+ //QString unitName = m_pKPresenterDoc->unitName();
+ KPrObject * obj = m_canvas->getSelectedObj();
+ KoSize size = obj->getSize();
+ m_sbObjectLabel->setText( ' ' + i18n( "Statusbar info", "%1: %2, %3 - %4, %5 (width: %6, height: %7)" )
+ .arg( /*frame->frameSet()->name()*/obj->getObjectName() )
+ .arg( KoUnit::toUserStringValue( obj->getOrig().x(), unit ) )
+ .arg( KoUnit::toUserStringValue( obj->getOrig().y() , unit) )
+ .arg( KoUnit::toUserStringValue( obj->getOrig().x() + size.width(), unit ) )
+ .arg( KoUnit::toUserStringValue( obj->getOrig().y() + size.height(), unit ) )
+ .arg( KoUnit::toUserStringValue( size.width(), unit ) )
+ .arg( KoUnit::toUserStringValue( size.height(), unit ) ) );
+ }
+ else
+ m_sbObjectLabel->setText( i18n("1 object selected", "%n objects selected", nbSelected) );
+ }
+ else if ( sb && m_sbObjectLabel )
+ m_sbObjectLabel->setText( QString::null );
+}
+
+void KPrView::pageNumChanged()
+{
+ updatePageInfo();
+}
+
+void KPrView::viewShowSideBar()
+{
+ if ( !sidebar )
+ return;
+ if ( sidebar->isVisible() )
+ sidebar->hide();
+ else
+ sidebar->show();
+}
+
+void KPrView::viewShowNoteBar()
+{
+ if ( !notebar )
+ return;
+ if ( notebar->isVisible() )
+ notebar->hide();
+ else
+ notebar->show();
+}
+
+void KPrView::viewSlideMaster()
+{
+ bool state = actionViewSlideMaster->isChecked();
+ setEditMaster( state );
+ //not activate action when slide master is displaying
+ state = !state;
+ m_actionExtraHeader->setEnabled( state );
+ m_actionExtraFooter->setEnabled( state );
+ actionDisplayBackgroundPage->setEnabled( state );
+ actionDisplayObjectFromMasterPage->setEnabled( state );
+
+}
+
+void KPrView::setEditMaster( bool editMaster )
+{
+ if ( m_editMaster != editMaster )
+ {
+ m_canvas->exitEditMode();
+ m_canvas->deSelectAllObj();
+ m_editMaster = editMaster;
+ if ( m_editMaster )
+ {
+ m_canvas->setActivePage( m_pKPresenterDoc->masterPage() );
+ pgPrev->setEnabled( false );
+ actionScreenFirst->setEnabled( false );
+ actionScreenPrev->setEnabled( false );
+ pgNext->setEnabled( false );
+ actionScreenLast->setEnabled( false );
+ actionScreenNext->setEnabled( false );
+ actionEditCopyPage->setEnabled( false );
+ actionEditDuplicatePage->setEnabled( false );
+ actionEditDelPage->setEnabled( false );
+ actionViewSlideMaster->setChecked( true );
+ }
+ else
+ {
+ m_canvas->setActivePage( m_pKPresenterDoc->pageList().at( currPg ) );
+ actionEditCopyPage->setEnabled( true );
+ actionEditDuplicatePage->setEnabled( true );
+ actionEditDelPage->setEnabled( m_pKPresenterDoc->getPageNums() > 1 );
+ actionViewSlideMaster->setChecked( false );
+ refreshPageButton();
+ }
+ if ( sidebar )
+ sidebar->setViewMasterPage( m_editMaster );
+ updateNoteBarText();
+ m_canvas->repaint( false );
+ }
+}
+
+void KPrView::updateNoteBarText()
+{
+ if ( notebar ) {
+ if ( m_editMaster )
+ {
+ QString text = m_pKPresenterDoc->masterPage()->noteText();
+ notebar->setCurrentNoteText( text );
+ }
+ else
+ {
+ QString text = m_pKPresenterDoc->pageList().at( currPg )->noteText( );
+ notebar->setCurrentNoteText( text );
+ }
+ }
+}
+
+void KPrView::openPopupMenuMenuPage( const QPoint & _point )
+{
+ if(!koDocument()->isReadWrite() || !factory())
+ return;
+ QPtrList<KAction> actionList= QPtrList<KAction>();
+ KActionSeparator *separator=new KActionSeparator();
+ switch( m_canvas->activePage()->getBackType())
+ {
+ case BT_COLOR:
+ case BT_BRUSH:
+ break;
+ case BT_PICTURE:
+ case BT_CLIPART:
+ actionList.append(separator);
+ actionList.append(actionSaveBackgroundPicture);
+ break;
+ }
+ if ( actionList.count()>0)
+ plugActionList( "picture_action", actionList );
+ m_mousePos = m_canvas->mapFromGlobal( _point );
+ QPopupMenu* menu = dynamic_cast<QPopupMenu*>(factory()->container("menupage_popup",this));
+ if ( menu )
+ menu->exec(_point);
+ m_mousePos = QPoint( 0, 0 );
+ unplugActionList( "picture_action" );
+ delete separator;
+}
+
+void KPrView::openPopupMenuObject( const QString & name, const QPoint & _point )
+{
+ if(!koDocument()->isReadWrite() || !factory())
+ return;
+ dynamic_cast<QPopupMenu*>(factory()->container(name, this))->popup(_point);
+}
+
+void KPrView::openPopupMenuSideBar(const QPoint & _point)
+{
+ if(!koDocument()->isReadWrite() || !factory())
+ return;
+ dynamic_cast<QPopupMenu*>(factory()->container("sidebarmenu_popup", this))->popup(_point);
+}
+
+void KPrView::renamePageTitle()
+{
+ if(sidebar)
+ sidebar->renamePageTitle();
+}
+
+void KPrView::picViewOriginalSize()
+{
+ m_canvas->picViewOriginalSize();
+}
+
+void KPrView::picViewOrig640x480()
+{
+ m_canvas->picViewOrig640x480();
+}
+
+void KPrView::picViewOrig800x600()
+{
+ m_canvas->picViewOrig800x600();
+}
+
+void KPrView::picViewOrig1024x768()
+{
+ m_canvas->picViewOrig1024x768();
+}
+
+void KPrView::picViewOrig1280x1024()
+{
+ m_canvas->picViewOrig1280x1024();
+}
+
+void KPrView::picViewOrig1600x1200()
+{
+ m_canvas->picViewOrig1600x1200();
+}
+
+void KPrView::chPic()
+{
+ m_canvas->chPic();
+}
+
+void KPrView::penColorChanged( const KoPen & _pen )
+{
+ //actionPenColor->setEnabled( true );
+ actionPenColor->setCurrentColor( _pen.color() );
+}
+
+void KPrView::brushColorChanged( const QBrush & _brush )
+{
+ //actionBrushColor->setEnabled( true );
+ actionBrushColor->setCurrentColor(_brush.style ()==Qt::NoBrush ? Qt::white : _brush.color() );
+}
+
+void KPrView::restartAutoPresTimer()
+{
+ m_autoPresTime.start();
+ m_autoPresElapsedTime = 0;
+ m_autoPresTimer.start( m_autoPresTimerValue, true );
+}
+
+void KPrView::continueAutoPresTimer()
+{
+ m_autoPresTime.restart();
+ //m_autoPresTimer.changeInterval( m_autoPresTimerValue - m_autoPresElapsedTime );
+ m_autoPresTimer.start( m_autoPresTimerValue - m_autoPresElapsedTime, true );
+}
+
+void KPrView::stopAutoPresTimer()
+{
+ m_autoPresTimer.stop();
+ m_autoPresElapsedTime += m_autoPresTime.elapsed();
+}
+
+void KPrView::setAutoPresTimer( int sec )
+{
+ m_autoPresTimerValue = sec * 1000;
+ restartAutoPresTimer();
+}
+
+void KPrView::insertSpecialChar()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( !edit )
+ return;
+ QString f = edit->textFontFamily();
+ QChar c=' ';
+ if (m_specialCharDlg==0)
+ {
+ m_specialCharDlg = new KoCharSelectDia( this, "insert special char", f, c, false );
+ connect( m_specialCharDlg, SIGNAL(insertChar(QChar,const QString &)),
+ this, SLOT(slotSpecialChar(QChar,const QString &)));
+ connect( m_specialCharDlg, SIGNAL( finished() ),
+ this, SLOT( slotSpecialCharDlgClosed() ) );
+ }
+ m_specialCharDlg->show();
+}
+
+void KPrView::slotSpecialCharDlgClosed()
+{
+ if ( m_specialCharDlg)
+ {
+ disconnect( m_specialCharDlg, SIGNAL(insertChar(QChar,const QString &)),
+ this, SLOT(slotSpecialChar(QChar,const QString &)));
+ disconnect( m_specialCharDlg, SIGNAL( finished() ),
+ this, SLOT( slotSpecialCharDlgClosed() ) );
+ m_specialCharDlg->deleteLater();
+ m_specialCharDlg = 0L;
+ }
+}
+
+void KPrView::slotSpecialChar(QChar c, const QString &_font)
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( !edit )
+ return;
+ edit->insertSpecialChar(c, _font);
+}
+
+void KPrView::insertLink()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( !edit )
+ return;
+ QString link;
+ QString ref;
+ if ( edit->textObject()->hasSelection() )
+ {
+ QString selectedText = edit->textObject()->selectedText();
+ if ( edit->textObject()->selectionHasCustomItems() || selectedText.contains('\n') )
+ return;
+ if ( selectedText.startsWith( "mailto:/" ) ||
+ selectedText.startsWith( "ftp:/" ) ||
+ selectedText.startsWith( "http:/" ) )
+ {
+ link=selectedText;
+ ref = selectedText;
+ }
+ else
+ {
+ //Just add text as link name and not url
+ link = selectedText;
+ }
+ }
+
+ if(KoInsertLinkDia::createLinkDia(link, ref, QStringList(), false, this))
+ {
+ if(!link.isEmpty() && !ref.isEmpty())
+ edit->insertLink(link, ref);
+ }
+}
+
+void KPrView::changeLink()
+{
+ KPrTextView * edit = m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ KoLinkVariable * var=edit->linkVariable();
+ if(var)
+ {
+ QString oldhref= var->url();
+ QString oldLinkName=var->value();
+ QString link=oldLinkName;
+ QString ref=oldhref;
+ if(KoInsertLinkDia::createLinkDia(link, ref, QStringList(), false, this))
+ {
+ if(!link.isEmpty() && !ref.isEmpty())
+ {
+ if( ref != oldhref || link!=oldLinkName)
+ {
+ KPrChangeLinkVariable*cmd=new KPrChangeLinkVariable( i18n("Change Link"),
+ m_pKPresenterDoc, oldhref,
+ ref, oldLinkName,link, var);
+ cmd->execute();
+ m_pKPresenterDoc->addCommand(cmd);
+ }
+ }
+ }
+ }
+ }
+}
+
+void KPrView::showFormat( const KoTextFormat &currentFormat )
+{
+ actionTextFontFamily->setFont( currentFormat.font().family() );
+ actionTextFontSize->setFontSize( currentFormat.pointSize() );
+ actionTextBold->setChecked( currentFormat.font().bold());
+ actionTextItalic->setChecked( currentFormat.font().italic() );
+ actionTextUnderline->setChecked( currentFormat.underline());
+ actionFormatStrikeOut->setChecked( currentFormat.strikeOut());
+
+ actionBrushColor->setEnabled(true);
+ //actionBrushColor->setText(i18n("Text Background Color..."));
+
+ switch(currentFormat.vAlign())
+ {
+ case KoTextFormat::AlignSuperScript:
+ {
+ actionFormatSub->setChecked( false );
+ actionFormatSuper->setChecked( true );
+ break;
+ }
+ case KoTextFormat::AlignSubScript:
+ {
+ actionFormatSub->setChecked( true );
+ actionFormatSuper->setChecked( false );
+ break;
+ }
+ case KoTextFormat::AlignNormal:
+ default:
+ {
+ actionFormatSub->setChecked( false );
+ actionFormatSuper->setChecked( false );
+ break;
+ }
+ }
+}
+
+void KPrView::slotSoftHyphen()
+{
+ KPrTextView *edit = m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->insertSoftHyphen();
+}
+
+void KPrView::slotNonbreakingSpace()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->insertNonbreakingSpace();
+}
+
+void KPrView::slotNonbreakingHyphen()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->insertNonbreakingHyphen();
+}
+
+void KPrView::slotLineBreak()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->insertLineBreak();
+}
+
+void KPrView::slotIncreaseNumberingLevel()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ edit->increaseNumberingLevel( m_pKPresenterDoc->styleCollection() );
+ }
+}
+
+void KPrView::slotDecreaseNumberingLevel()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->decreaseNumberingLevel( m_pKPresenterDoc->styleCollection() );
+}
+
+void KPrView::extraAutoFormat()
+{
+ m_pKPresenterDoc->getAutoFormat()->readConfig();
+ KoAutoFormatDia dia( this, 0, m_pKPresenterDoc->getAutoFormat() );
+ dia.exec();
+ m_pKPresenterDoc->startBackgroundSpellCheck(); // will do so if enabled
+}
+
+void KPrView::slotSpellCheck()
+{
+ if (m_spell.kospell) return; // Already in progress
+ //m_doc->setReadWrite(false); // prevent editing text - not anymore
+ m_spell.macroCmdSpellCheck = 0L;
+ m_spell.replaceAll.clear();
+ QValueList<KoTextObject *> objects;
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ int options = 0;
+ if ( edit && edit->textObject()->hasSelection() )
+ {
+ objects.append(edit->kpTextObject()->textObject());
+ options = KFindDialog::SelectedText;
+ }
+ else
+ {
+ objects = spellAddTextObject();
+ QPtrList<KPrObject> lstObj;
+ }
+ if ( ! objects.empty() )
+ {
+ m_spell.textIterator = new KoTextIterator( objects, edit, options );
+ startKSpell();
+ }
+}
+
+QValueList<KoTextObject *> KPrView::spellAddTextObject() const
+{
+ QValueList<KoTextObject *> lst;
+ QPtrList<KPrObject> lstObj;
+ m_canvas->activePage()->getAllObjectSelectedList(lstObj, true);
+ QPtrListIterator<KPrObject> it( lstObj );
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->getType()==OT_TEXT)
+ {
+ KPrTextObject* tmp = dynamic_cast<KPrTextObject*>(it.current() );
+ if ( tmp && !tmp->isProtectContent())
+ lst.append( tmp->textObject() );
+ }
+ }
+ return lst;
+}
+
+
+
+void KPrView::startKSpell()
+{
+ // m_spellCurrFrameSetNum is supposed to be set by the caller of this method
+ if ( !m_spell.kospell )
+ m_spell.kospell = new KoSpell( m_broker, this );
+ m_spell.kospell->check( m_spell.textIterator, true );
+
+ delete m_spell.dlg;
+ m_spell.dlg = new KSpell2::Dialog( m_spell.kospell, this );
+ m_spell.dlg->activeAutoCorrect( true );
+ QObject::connect( m_spell.dlg, SIGNAL(misspelling(const QString&, int)),
+ this, SLOT(spellCheckerMisspelling(const QString&, int)) );
+ QObject::connect( m_spell.dlg, SIGNAL(replace(const QString&, int, const QString&)),
+ this, SLOT(spellCheckerCorrected(const QString&, int, const QString&)) );
+ QObject::connect( m_spell.dlg, SIGNAL(done(const QString&) ),
+ this, SLOT(spellCheckerDone(const QString&)) );
+ QObject::connect( m_spell.dlg, SIGNAL(cancel() ),
+ this, SLOT( spellCheckerCancel() ) );
+ QObject::connect( m_spell.dlg, SIGNAL(autoCorrect(const QString &, const QString & ) ),
+ this, SLOT( spellAddAutoCorrect (const QString &, const QString &) ) );
+
+ m_spell.dlg->show();
+}
+
+
+
+void KPrView::spellCheckerCancel()
+{
+ kdDebug()<<"void KPrView::spellCheckerCancel() \n";
+ spellCheckerRemoveHighlight();
+ clearSpellChecker(true);
+}
+
+
+void KPrView::spellCheckerRemoveHighlight()
+{
+ KoTextObject* textobj = m_spell.kospell->currentTextObject();
+ if ( textobj ) {
+ KPrTextDocument *textdoc=static_cast<KPrTextDocument *>( textobj->textDocument() );
+ if ( textdoc )
+ textdoc->textObject()->removeHighlight();
+ }
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if (edit)
+ edit->drawCursor( TRUE );
+}
+
+
+void KPrView::clearSpellChecker(bool cancelSpellCheck)
+{
+ kdDebug() << "KPrView::clearSpellChecker()" << endl;
+ delete m_spell.textIterator;
+ m_spell.textIterator = 0L;
+
+
+ delete m_spell.kospell;
+ m_spell.kospell = 0;
+ m_initSwitchPage = -1;
+ m_switchPage = -1;
+
+ if ( m_spell.macroCmdSpellCheck )
+ {
+ if ( !cancelSpellCheck )
+ m_pKPresenterDoc->addCommand(m_spell.macroCmdSpellCheck);
+ else
+ {
+ //reverte all changes
+ m_spell.macroCmdSpellCheck->unexecute();
+ delete m_spell.macroCmdSpellCheck;
+ }
+ }
+ m_spell.macroCmdSpellCheck=0L;
+
+ m_spell.replaceAll.clear();
+
+}
+
+void KPrView::spellCheckerMisspelling( const QString &old, int pos )
+{
+ //kdDebug(32001) << "KWView::spellCheckerMisspelling old=" << old << " pos=" << pos << endl;
+ KoTextObject* textobj = m_spell.kospell->currentTextObject();
+ KoTextParag* parag = m_spell.kospell->currentParag();
+ Q_ASSERT( textobj );
+ Q_ASSERT( parag );
+ if ( !textobj || !parag ) return;
+ KPrTextDocument *textdoc=static_cast<KPrTextDocument *>( textobj->textDocument() );
+ Q_ASSERT( textdoc );
+ if ( !textdoc ) return;
+ pos += m_spell.kospell->currentStartIndex();
+
+ kdDebug() << "KWView::spellCheckerMisspelling parag=" << parag->paragId() << " pos=" << pos << " length=" << old.length() << endl;
+
+ textdoc->textObject()->highlightPortion( parag, pos, old.length(), m_canvas,true/*repaint*/ );
+}
+
+void KPrView::spellCheckerCorrected( const QString &old, int pos, const QString &corr )
+{
+ //kdDebug(33001) << "KWView::spellCheckerCorrected old=" << old << " corr=" << corr << " pos=" << pos << endl;
+
+ //kdDebug(32001) << "KWView::spellCheckerCorrected old=" << old << " corr=" << corr << " pos=" << pos << endl;
+ KoTextObject* textobj = m_spell.kospell->currentTextObject();
+ KoTextParag* parag = m_spell.kospell->currentParag();
+ Q_ASSERT( textobj );
+ Q_ASSERT( parag );
+ if ( !textobj || !parag ) return;
+
+ KPrTextDocument *textdoc=static_cast<KPrTextDocument *>( textobj->textDocument() );
+ Q_ASSERT( textdoc );
+ if ( !textdoc )
+ return;
+ pos += m_spell.kospell->currentStartIndex();
+ textdoc->textObject()->highlightPortion( parag, pos, old.length(), m_canvas,true/*repaint*/ );
+
+ KoTextCursor cursor( textdoc );
+ cursor.setParag( parag );
+ cursor.setIndex( pos );
+ if(!m_spell.macroCmdSpellCheck)
+ m_spell.macroCmdSpellCheck=new KMacroCommand(i18n("Correct Misspelled Word"));
+ m_spell.macroCmdSpellCheck->addCommand(textobj->replaceSelectionCommand(&cursor, corr, QString::null, KoTextDocument::HighlightSelection));
+}
+
+void KPrView::spellCheckerDone( const QString & )
+{
+ /* See also KWView::spellCheckerDone from KWord */
+ kdDebug() << "KPrView::spellCheckerDone" << endl;
+ KPrTextDocument *textdoc=static_cast<KPrTextDocument *>( m_spell.kospell->textDocument() );
+ Q_ASSERT( textdoc );
+ if ( textdoc )
+ textdoc->textObject()->removeHighlight();
+
+ clearSpellChecker();
+}
+
+void KPrView::showCounter( KoParagCounter &c )
+{
+ QString styleStr("counterstyle_");
+ styleStr += QString::number( c.style() );
+ //kdDebug(33001) << "KWView::showCounter styleStr=" << styleStr << endl;
+ KToggleAction* act = static_cast<KToggleAction *>( actionCollection()->action( styleStr.latin1() ) );
+ Q_ASSERT( act );
+ if ( act )
+ act->setChecked( true );
+}
+
+void KPrView::formatParagraph()
+{
+ showParagraphDialog();
+}
+
+void KPrView::showParagraphDialog(int initialPage, double initialTabPos)
+{
+ QPtrList<KoTextFormatInterface> lst = m_canvas->applicableTextInterfaces();
+ if ( lst.isEmpty() )
+ return;
+ QPtrList<KPrTextObject> lstObjects = m_canvas->applicableTextObjects();
+ if ( lstObjects.isEmpty() )
+ return;
+
+ delete m_paragDlg;
+ m_paragDlg = new KoParagDia( this, "",
+ KoParagDia::PD_SPACING | KoParagDia::PD_ALIGN |
+ KoParagDia::PD_DECORATION | KoParagDia::PD_NUMBERING |
+ KoParagDia::PD_TABS,
+ m_pKPresenterDoc->unit(),
+ lstObjects.first()->getSize().width(),false );
+ m_paragDlg->setCaption( i18n( "Paragraph Settings" ) );
+
+ // Initialize the dialog from the current paragraph's settings
+ m_paragDlg->setParagLayout( * lst.first()->currentParagLayoutFormat() );
+ // Set initial page and initial tabpos if necessary
+ if ( initialPage != -1 )
+ {
+ m_paragDlg->setCurrentPage( initialPage );
+ if ( initialPage == KoParagDia::PD_TABS )
+ m_paragDlg->tabulatorsWidget()->setCurrentTab( initialTabPos );
+ }
+ connect( m_paragDlg, SIGNAL( applyParagStyle() ), this, SLOT( slotApplyParag() ) );
+
+ m_paragDlg->exec();
+ delete m_paragDlg;
+ m_paragDlg = 0;
+
+}
+
+void KPrView::slotApplyParag()
+{
+ QPtrList<KoTextFormatInterface> lst = m_canvas->applicableTextInterfaces();
+ Q_ASSERT( !lst.isEmpty() );
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KMacroCommand * macroCommand = new KMacroCommand( i18n( "Paragraph Settings" ) );
+ KoParagLayout newLayout = m_paragDlg->paragLayout();
+ int flags = m_paragDlg->changedFlags();
+ kdDebug() << k_funcinfo << "flags=" << flags << endl;
+ if ( !flags )
+ return;
+ for ( ; it.current() ; ++it )
+ {
+ KCommand* cmd = it.current()->setParagLayoutFormatCommand( &newLayout, flags );
+ Q_ASSERT( cmd );
+ if(cmd)
+ {
+ macroCommand->addCommand(cmd);
+ }
+ }
+
+ if(flags)
+ m_pKPresenterDoc->addCommand(macroCommand);
+ else
+ delete macroCommand;
+
+ // Set "oldLayout" in KoParagDia from the current paragraph's settings
+ // Otherwise "isBlahChanged" will return wrong things when doing A -> B -> A
+ m_paragDlg->setParagLayout( *lst.first()->currentParagLayoutFormat() );
+}
+
+void KPrView::textDefaultFormat()
+{
+ m_canvas->setTextDefaultFormat( );
+}
+
+void KPrView::changeNbOfRecentFiles(int _nb)
+{
+ if ( shell() ) // 0 when embedded into konq !
+ shell()->setMaxRecentItems( _nb );
+}
+
+QPopupMenu * KPrView::popupMenu( const QString& name )
+{
+ Q_ASSERT(factory());
+ if ( factory() )
+ return ((QPopupMenu*)factory()->container( name, this ));
+ return 0L;
+}
+
+void KPrView::addVariableActions( int type, const QStringList & texts,
+ KActionMenu * parentMenu, const QString & menuText )
+{
+ // Single items go directly into parentMenu.
+ // For multiple items we create a submenu.
+ if ( texts.count() > 1 && !menuText.isEmpty() )
+ {
+ KActionMenu * subMenu = new KActionMenu( menuText, actionCollection() );
+ parentMenu->insert( subMenu );
+ parentMenu = subMenu;
+ }
+ QStringList::ConstIterator it = texts.begin();
+ for ( int i = 0; it != texts.end() ; ++it, ++i )
+ {
+ if ( !(*it).isEmpty() ) // in case of removed subtypes or placeholders
+ {
+ VariableDef v;
+ v.type = type;
+ v.subtype = i;
+ KAction * act = new KAction( (*it), 0, this, SLOT( insertVariable() ),
+ actionCollection(), "var-action" );
+ m_variableDefMap.insert( act, v );
+ parentMenu->insert( act );
+ }
+ }
+}
+
+void KPrView::refreshCustomMenu()
+{
+ KActionPtrList lst2 = actionCollection()->actions("custom-variable-action");
+ QValueList<KAction *> actions = lst2;
+ QValueList<KAction *>::ConstIterator it2 = lst2.begin();
+ QValueList<KAction *>::ConstIterator end = lst2.end();
+ QMap<QString, KShortcut> shortCuts;
+
+ for (; it2 != end; ++it2 )
+ {
+ shortCuts.insert((*it2)->text(), (*it2)->shortcut());
+ delete *it2;
+ }
+
+ delete actionInsertCustom;
+ actionInsertCustom = new KActionMenu( i18n( "&Custom" ),
+ actionCollection(), "insert_custom" );
+
+ actionInsertVariable->insert(actionInsertCustom, 0);
+
+
+ actionInsertCustom->popupMenu()->clear();
+ QPtrListIterator<KoVariable> it( m_pKPresenterDoc->getVariableCollection()->getVariables() );
+ KAction * act=0;
+ QStringList lst;
+ QString varName;
+ int i = 0;
+ for ( ; it.current() ; ++it )
+ {
+ KoVariable *var = it.current();
+ if ( var->type() == VT_CUSTOM )
+ {
+ varName=( (KoCustomVariable*) var )->name();
+ if ( !lst.contains( varName) )
+ {
+ lst.append( varName );
+ QCString name = QString("custom-action_%1").arg(i).latin1();
+ act = new KAction( varName, shortCuts[varName], this,
+ SLOT( insertCustomVariable() ), actionCollection(), name );
+
+ act->setGroup( "custom-variable-action" );
+ actionInsertCustom->insert( act );
+ i++;
+ }
+ }
+ }
+ bool state=!lst.isEmpty();
+ if(state)
+ actionInsertCustom->popupMenu()->insertSeparator();
+
+ act = new KAction( i18n("New..."), 0, this, SLOT( insertNewCustomVariable() ), actionCollection(),
+ QString("custom-action_%1").arg(i).latin1() );
+ act->setGroup( "custom-variable-action" );
+ actionInsertCustom->insert( act );
+
+ actionInsertCustom->popupMenu()->insertSeparator();
+
+ actionEditCustomVars->setEnabled(state);
+ actionEditCustomVarsEdit->setEnabled( state );
+ actionInsertCustom->insert( actionEditCustomVarsEdit );
+}
+
+void KPrView::insertCustomVariable()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ KAction * act = (KAction *)(sender());
+ edit->insertCustomVariable(act->text());
+ }
+}
+
+void KPrView::insertNewCustomVariable()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->insertVariable( VT_CUSTOM, 0 );
+}
+
+void KPrView::editCustomVariable()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ KoCustomVariable *var = static_cast<KoCustomVariable *>(edit->variable());
+ if (var)
+ {
+ QString oldvalue = var->value();
+ KoCustomVarDialog dia( this, var );
+ if ( dia.exec() )
+ {
+ if( var->value() != oldvalue )
+ {
+ KPrChangeCustomVariableValue *cmd=new KPrChangeCustomVariableValue(i18n( "Change Custom Variable" ),
+ m_pKPresenterDoc, oldvalue, var->value(), var );
+ m_pKPresenterDoc->addCommand(cmd);
+ }
+ m_pKPresenterDoc->recalcVariables( VT_CUSTOM );
+ }
+ }
+ }
+}
+
+void KPrView::editCustomVars()
+{
+ KoCustomVariablesDia dia( this, m_pKPresenterDoc->getVariableCollection()->getVariables() );
+ QStringList listOldCustomValue;
+ QPtrListIterator<KoVariable> oldIt( m_pKPresenterDoc->getVariableCollection()->getVariables() );
+ for ( ; oldIt.current() ; ++oldIt )
+ {
+ if(oldIt.current()->type()==VT_CUSTOM)
+ listOldCustomValue.append(((KoCustomVariable*)oldIt.current())->value());
+ }
+ if(dia.exec())
+ {
+ m_pKPresenterDoc->recalcVariables( VT_CUSTOM );
+ QPtrListIterator<KoVariable> it( m_pKPresenterDoc->getVariableCollection()->getVariables() );
+ KMacroCommand * macroCommand = 0L;
+ int i=0;
+ for ( ; it.current() ; ++it )
+ {
+ if(it.current()->type() == VT_CUSTOM )
+ {
+ if(((KoCustomVariable*)it.current())->value()!=*(listOldCustomValue.at(i)))
+ {
+ if(!macroCommand)
+ macroCommand = new KMacroCommand( i18n( "Change Custom Variable" ) );
+ KPrChangeCustomVariableValue *cmd=
+ new KPrChangeCustomVariableValue(i18n( "Change Custom Variable" ), m_pKPresenterDoc,
+ *(listOldCustomValue.at(i)),
+ ((KoCustomVariable*)it.current())->value(),
+ ((KoCustomVariable*)it.current()));
+ macroCommand->addCommand(cmd);
+ }
+ i++;
+ }
+ }
+ if(macroCommand)
+ m_pKPresenterDoc->addCommand(macroCommand);
+ }
+}
+
+void KPrView::insertVariable()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ KAction * act = (KAction *)(sender());
+ VariableDefMap::ConstIterator it = m_variableDefMap.find( act );
+ if ( it == m_variableDefMap.end() )
+ kdWarning(33001) << "Action not found in m_variableDefMap." << endl;
+ else
+ {
+ if ( (*it).type == VT_FIELD )
+ edit->insertVariable( (*it).type, KoFieldVariable::fieldSubType( (*it).subtype ) );
+ else
+ edit->insertVariable( (*it).type, (*it).subtype );
+ }
+ }
+}
+
+void KPrView::openLink()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->openLink();
+}
+
+void KPrView::showRulerIndent( double _leftMargin, double _firstLine, double _rightMargin, bool rtl )
+{
+ KoRuler * hRuler = getHRuler();
+ if ( hRuler )
+ {
+ hRuler->setFirstIndent( KoUnit::toUserValue( _firstLine, m_pKPresenterDoc->unit() ) );
+ hRuler->setLeftIndent( KoUnit::toUserValue( _leftMargin, m_pKPresenterDoc->unit() ) );
+ hRuler->setRightIndent( KoUnit::toUserValue( _rightMargin, m_pKPresenterDoc->unit() ) );
+ hRuler->setDirection( rtl );
+ actionTextDepthMinus->setEnabled( _leftMargin>0);
+ }
+}
+
+void KPrView::tabListChanged( const KoTabulatorList & tabList )
+{
+ if(!m_pKPresenterDoc->isReadWrite())
+ return;
+
+ m_canvas->setTabList( tabList );
+}
+
+void KPrView::newFirstIndent( double _firstIndent )
+{
+ m_canvas->setNewFirstIndent(_firstIndent);
+}
+
+void KPrView::newLeftIndent( double _leftIndent)
+{
+ m_canvas->setNewLeftIndent(_leftIndent);
+}
+
+void KPrView::newRightIndent( double _rightIndent)
+{
+ m_canvas->setNewRightIndent(_rightIndent);
+}
+
+void KPrView::slotUpdateRuler()
+{
+ // Set the "frame start" in the ruler (tabs are relative to that position)
+ bool isText=!m_canvas->applicableTextObjects().isEmpty();
+ if ( isText )
+ {
+ KPrTextObject *txtobj= m_canvas->applicableTextObjects().first();
+ if ( txtobj )
+ {
+ QRect r= zoomHandler()->zoomRect(txtobj->getRealRect());
+ getHRuler()->setFrameStartEnd( r.left() /*+ m_canvas->diffx()*//*- pc.x()*/, r.right()/*+m_canvas->diffx()*/ /*- pc.x()*/ );
+ getVRuler()->setFrameStartEnd( r.top()/*+ m_canvas->diffy()*//*- pc.y()*/, r.bottom()/*+m_canvas->diffy()*//*- pc.y()*/ );
+ if( getHRuler())
+ {
+ int flags = txtobj->isProtectContent() ? 0 : (KoRuler::F_INDENTS | KoRuler::F_TABS);
+ if( getHRuler()->flags()!= flags )
+ {
+ getHRuler()->changeFlags(flags);
+ getHRuler()->repaint();
+ }
+ }
+ if( getVRuler())
+ {
+ if( getVRuler()->flags() != 0 )
+ {
+ getVRuler()->changeFlags(0);
+ getVRuler()->repaint();
+ }
+ }
+ }
+ }
+ else
+ {
+ refreshRuler( kPresenterDoc()->showGuideLines() );
+ updateRuler();
+ }
+}
+
+// This handles Tabulators _only_
+void KPrView::slotHRulerDoubleClicked( double ptpos )
+{
+ showParagraphDialog( KoParagDia::PD_TABS, ptpos );
+}
+
+// This handles either:
+// - Indents
+// - Page Layout
+//
+// This does _not_ handle Tabulators!
+void KPrView::slotHRulerDoubleClicked()
+{
+ KoRuler *ruler = getHRuler();
+
+ if ( m_canvas && m_canvas->currentTextObjectView() && (ruler->flags() & KoRuler::F_INDENTS) && ruler->doubleClickedIndent() )
+ formatParagraph();
+ else
+ openPageLayoutDia();
+}
+
+void KPrView::changeCaseOfText()
+{
+ QPtrList<KoTextFormatInterface> lst = m_canvas->applicableTextInterfaces();
+ if ( lst.isEmpty() ) return;
+ QPtrListIterator<KoTextFormatInterface> it( lst );
+ KoChangeCaseDia *caseDia=new KoChangeCaseDia( this,"change case" );
+ if(caseDia->exec())
+ {
+ KMacroCommand* macroCmd = 0L;
+ for ( ; it.current() ; ++it )
+ {
+ KCommand *cmd = it.current()->setChangeCaseOfTextCommand(caseDia->getTypeOfCase());
+ if (cmd)
+ {
+ if ( !macroCmd )
+ macroCmd = new KMacroCommand( i18n("Change Case of Text") );
+ macroCmd->addCommand(cmd);
+ }
+ }
+ if( macroCmd )
+ m_pKPresenterDoc->addCommand(macroCmd);
+ }
+ delete caseDia;
+}
+
+void KPrView::editFind()
+{
+ if (!m_searchEntry)
+ m_searchEntry = new KoSearchContext();
+ KPrTextView * edit = m_canvas->currentTextObjectView();
+ bool hasSelection = edit && (edit->kpTextObject())->textObject()->hasSelection();
+ bool hasCursor = edit != 0;
+ KoSearchDia dialog( m_canvas, "find", m_searchEntry, hasSelection, hasCursor );
+
+ /// KoFindReplace needs a QValueList<KoTextObject *>...
+ QValueList<KoTextObject *> list;
+ QPtrList<KoTextObject> list2 = m_pKPresenterDoc->allTextObjects();
+ QPtrListIterator<KoTextObject> it( list2 );
+ for ( ; it.current() ; ++it )
+ list.append(it.current());
+
+ if( list.isEmpty() )
+ return;
+
+ if ( dialog.exec() == QDialog::Accepted )
+ {
+ delete m_findReplace;
+ m_findReplace = new KPrFindReplace( this, m_canvas, &dialog, list, edit );
+ editFindNext();
+ }
+}
+
+void KPrView::editReplace()
+{
+ if (!m_searchEntry)
+ m_searchEntry = new KoSearchContext();
+ if (!m_replaceEntry)
+ m_replaceEntry = new KoSearchContext();
+
+ KPrTextView * edit = m_canvas->currentTextObjectView();
+ bool hasSelection = edit && (edit->kpTextObject())->textObject()->hasSelection();
+ bool hasCursor = edit != 0;
+ KoReplaceDia dialog( m_canvas, "replace", m_searchEntry, m_replaceEntry, hasSelection, hasCursor );
+
+ /// KoFindReplace needs a QValueList<KoTextObject *>...
+ QValueList<KoTextObject *> list;
+ QPtrList<KoTextObject> list2 = m_pKPresenterDoc->allTextObjects();
+ QPtrListIterator<KoTextObject> it( list2 );
+ for ( ; it.current() ; ++it )
+ list.append(it.current());
+
+ if( list.isEmpty() )
+ return;
+
+ if ( dialog.exec() == QDialog::Accepted )
+ {
+ delete m_findReplace;
+ m_findReplace = new KPrFindReplace( this, m_canvas, &dialog, list, edit );
+ editFindNext();
+ }
+}
+
+void KPrView::editFindPrevious()
+{
+ if ( !m_findReplace ) // shouldn't be called before find or replace is activated
+ {
+ editFind();
+ return;
+ }
+ (void) m_findReplace->findPrevious();
+}
+
+void KPrView::editFindNext()
+{
+ if ( !m_findReplace ) // shouldn't be called before find or replace is activated
+ {
+ editFind();
+ return;
+ }
+ (void) m_findReplace->findNext();
+}
+
+void KPrView::refreshAllVariable()
+{
+ m_pKPresenterDoc->recalcVariables( VT_ALL );
+}
+
+void KPrView::changeZoomMenu( int zoom )
+{
+ QStringList lst;
+ lst << i18n( "Width" );
+ lst << i18n( "Whole Slide" );
+
+ if(zoom>0)
+ {
+ QValueList<int> list;
+ bool ok;
+ const QStringList itemsList ( actionViewZoom->items() );
+ QRegExp regexp("(\\d+)"); // "Captured" non-empty sequence of digits
+
+ for (QStringList::ConstIterator it = itemsList.begin() ; it != itemsList.end() ; ++it)
+ {
+ regexp.search(*it);
+ const int val=regexp.cap(1).toInt(&ok);
+ //zoom : limit inferior=10
+ if(ok && val>9 && list.contains(val)==0)
+ list.append( val );
+ }
+ //necessary at the beginning when we read config
+ //this value is not in combo list
+ if(list.contains(zoom)==0)
+ list.append( zoom );
+
+ qHeapSort( list );
+
+ for (QValueList<int>::Iterator it = list.begin() ; it != list.end() ; ++it)
+ lst.append( i18n("%1%").arg(*it) );
+ }
+ else
+ {
+ lst << i18n("%1%").arg("33");
+ lst << i18n("%1%").arg("50");
+ lst << i18n("%1%").arg("75");
+ lst << i18n("%1%").arg("100");
+ lst << i18n("%1%").arg("125");
+ lst << i18n("%1%").arg("150");
+ lst << i18n("%1%").arg("200");
+ lst << i18n("%1%").arg("250");
+ lst << i18n("%1%").arg("350");
+ lst << i18n("%1%").arg("400");
+ lst << i18n("%1%").arg("450");
+ lst << i18n("%1%").arg("500");
+ }
+ actionViewZoom->setItems( lst );
+}
+
+void KPrView::showZoom( int zoom )
+{
+ QStringList list = actionViewZoom->items();
+ QString zoomStr( i18n("%1%").arg( zoom ) );
+ int pos = list.findIndex(zoomStr);
+ if( pos == -1)
+ {
+ changeZoomMenu( zoom );
+ list = actionViewZoom->items();
+ }
+ actionViewZoom->setCurrentItem( list.findIndex(zoomStr) );
+}
+
+void KPrView::viewZoom( const QString &s )
+{
+ bool ok=false;
+ int zoom = 0;
+ if ( s == i18n("Width") )
+ {
+ zoom = qRound( static_cast<double>(m_canvas->visibleRect().width() * 100 ) /
+ (zoomHandler()->resolutionX() * m_pKPresenterDoc->pageLayout().ptWidth ) );
+ ok = true;
+ }
+ else if ( s == i18n("Whole Slide") )
+ {
+ zoom = getZoomEntirePage();
+ ok = true;
+ }
+ else
+ {
+ QRegExp regexp("(\\d+)"); // "Captured" non-empty sequence of digits
+ regexp.search(s);
+ zoom=regexp.cap(1).toInt(&ok);
+ }
+ if( !ok || zoom<10 ) //zoom should be valid and >10
+ zoom = zoomHandler()->zoom();
+ zoom = QMIN( zoom, 4000);
+ //refresh menu
+ changeZoomMenu( zoom );
+ //refresh menu item
+ showZoom(zoom);
+ //apply zoom if zoom!=m_doc->zoom()
+ if( zoom != zoomHandler()->zoom() )
+ {
+ setZoom( zoom, true );
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->ensureCursorVisible();
+ }
+
+ m_canvas->setFocus();
+ m_canvas->repaint();
+}
+
+void KPrView::setZoomRect( const KoRect & rect )
+{
+ double height = zoomHandler()->resolutionY() * rect.height();
+ double width = zoomHandler()->resolutionX() * rect.width();
+ int zoom = QMIN( qRound( static_cast<double>( m_canvas->visibleRect().height() * 100 ) / height ),
+ qRound( static_cast<double>( m_canvas->visibleRect().width() * 100 ) / width ) );
+
+ m_canvas->setUpdatesEnabled( false );
+ viewZoom( QString::number( zoom ) );
+
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->scrollTopLeftPoint( zoomHandler()->zoomPoint( rect.topLeft() ) );
+ m_canvas->setUpdatesEnabled( true );
+ m_canvas->repaint();
+}
+
+void KPrView::setZoom( int zoom, bool updateViews )
+{
+ zoomHandler()->setZoomAndResolution( zoom, KoGlobal::dpiX(),
+ KoGlobal::dpiY());
+ m_pKPresenterDoc->newZoomAndResolution(updateViews,false);
+ m_pKPresenterDoc->updateZoomRuler();
+
+ setRanges();
+
+ if ( statusBar() )
+ m_sbZoomLabel->setText( ' ' + QString::number( zoom ) + "% " );
+}
+
+void KPrView::slotUpdateScrollBarRanges()
+{
+ setRanges();
+}
+
+KoTextZoomHandler *KPrView::zoomHandler() const
+{
+ return m_pKPresenterDoc->zoomHandler();
+}
+
+void KPrView::slotViewFormattingChars()
+{
+ m_pKPresenterDoc->setViewFormattingChars(actionViewFormattingChars->isChecked());
+ m_pKPresenterDoc->layout(); // Due to the different formatting when this option is activated
+ m_pKPresenterDoc->repaint(false);
+}
+
+void KPrView::setPageDuration( int _pgNum )
+{
+ if ( kPresenterDoc()->presentationDuration() )
+ {
+ // kdDebug(33001) << "KPrView::setPageDuration( " << _pgNum << " )" << endl;
+ *m_presentationDurationList.at( _pgNum ) += m_duration.elapsed();
+ m_duration.restart();
+ }
+}
+
+void KPrView::openThePresentationDurationDialog()
+{
+ int totalTime = 0;
+ QStringList presentationDurationStringList;
+ for ( QValueList<int>::Iterator it = m_presentationDurationList.begin();
+ it != m_presentationDurationList.end(); ++it ) {
+ int _time = *it;
+ QString presentationDurationString = presentationDurationDataFormatChange( _time );
+ presentationDurationStringList.append( presentationDurationString );
+ totalTime += _time;
+ }
+
+ QString presentationTotalDurationString = presentationDurationDataFormatChange( totalTime );
+
+ delete presDurationDia;
+ presDurationDia = 0;
+
+ presDurationDia = new KPrPresDurationDia( this, "presDurationDia", kPresenterDoc(),
+ presentationDurationStringList, presentationTotalDurationString );
+ presDurationDia->setCaption( i18n( "Presentation Duration" ) );
+ QObject::connect( presDurationDia, SIGNAL( presDurationDiaClosed() ), this, SLOT( pddClosed() ) );
+ presDurationDia->exec();
+
+ delete presDurationDia;
+ presDurationDia = 0;
+}
+
+void KPrView::pddClosed()
+{
+ presDurationDia = 0;
+}
+
+// change from milliseconds to hh:mm:ss
+// in kdelibs 3.2.90, an additional method was added that basically
+// allows formatting of time as a duration. Before this, you can get
+// weirdness (such as a duration of 12:00:03 am) depending on how the
+// time format is set.
+QString KPrView::presentationDurationDataFormatChange( int _time )
+{
+ QTime time( 0, 0, 0 );
+ return KGlobal::locale()->formatTime( time.addMSecs( _time ), true, true );
+}
+
+
+void KPrView::viewFooter()
+{
+ bool state = m_actionExtraFooter->isChecked();
+ m_canvas->activePage()->setFooter( state );
+ KPrHideShowHeaderFooter * cmd =new KPrHideShowHeaderFooter( state ? i18n("Enable Document Header") : i18n("Disable Document Header"),
+ m_pKPresenterDoc, m_canvas->activePage(), state, m_pKPresenterDoc->footer());
+ m_pKPresenterDoc->addCommand(cmd);
+
+ m_pKPresenterDoc->updateSideBarItem( m_pKPresenterDoc->masterPage() );
+}
+
+void KPrView::viewHeader()
+{
+ bool state = m_actionExtraHeader->isChecked();
+ m_canvas->activePage()->setHeader( state );
+ KPrHideShowHeaderFooter * cmd =new KPrHideShowHeaderFooter( state ? i18n("Enable Document Footer") : i18n("Disable Document Footer"),
+ m_pKPresenterDoc, m_canvas->activePage(), state, m_pKPresenterDoc->header());
+ m_pKPresenterDoc->addCommand(cmd);
+
+ m_pKPresenterDoc->updateSideBarItem( m_pKPresenterDoc->masterPage() );
+}
+
+void KPrView::showStyle( const QString & styleName )
+{
+ KoParagStyle* style = m_pKPresenterDoc->styleCollection()->findStyle( styleName );
+ if ( style ) {
+ int pos = m_pKPresenterDoc->styleCollection()->indexOf( style );
+ // Select style in combo
+ actionFormatStyle->setCurrentItem( pos );
+ }
+}
+
+void KPrView::updateStyleList()
+{
+ QString currentStyle = actionFormatStyle->currentText();
+ // Generate list of styles
+ const QStringList lst = m_pKPresenterDoc->styleCollection()->displayNameList();
+ const int pos = lst.findIndex( currentStyle );
+ // Fill the combo - using a KSelectAction
+ actionFormatStyle->setItems( lst );
+ if ( pos > -1 )
+ actionFormatStyle->setCurrentItem( pos );
+
+ // Fill the menu - using a KActionMenu, so that it's possible to bind keys
+ // to individual actions
+ QStringList lstWithAccels;
+ // Generate unique accelerators for the menu items
+ KAccelGen::generate( lst, lstWithAccels );
+ QMap<QString, KShortcut> shortCuts;
+
+ KActionPtrList lst2 = actionCollection()->actions("styleList");
+ QValueList<KAction *> actions = lst2;
+ QValueList<KAction *>::ConstIterator it = lst2.begin();
+ QValueList<KAction *>::ConstIterator end = lst2.end();
+ for (; it != end; ++it )
+ {
+ shortCuts.insert( QString::fromUtf8( (*it)->name() ), (*it)->shortcut() );
+ actionFormatStyleMenu->remove( *it );
+ delete *it;
+ }
+
+
+ uint i = 0;
+ for ( QStringList::Iterator it = lstWithAccels.begin(); it != lstWithAccels.end(); ++it, ++i )
+ {
+ KoParagStyle *style = m_pKPresenterDoc->styleCollection()->styleAt( i );
+ if ( style )
+ {
+ QString name = "paragstyle_" + style->name();
+ KToggleAction* act = new KToggleAction( (*it),
+ shortCuts[name], this, SLOT( slotStyleSelected() ),
+ actionCollection(), name.utf8() );
+ act->setGroup( "styleList" );
+ act->setExclusiveGroup( "styleListAction" );
+ act->setToolTip( i18n( "Apply a paragraph style" ) );
+ actionFormatStyleMenu->insert( act );
+ }
+ }
+ bool isText=!m_canvas->applicableTextInterfaces().isEmpty();
+ actionFormatStyleMenu->setEnabled( isText );
+ actionFormatStyle->setEnabled(isText);
+}
+
+void KPrView::extraStylist()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ QString activeStyleName = QString::null;
+ if ( edit )
+ {
+ edit->hideCursor();
+ if (edit->cursor() && edit->cursor()->parag() && edit->cursor()->parag()->style())
+ activeStyleName = edit->cursor()->parag()->style()->displayName();
+ }
+ KPrStyleManager * styleManager = new KPrStyleManager( this, m_pKPresenterDoc->unit(), m_pKPresenterDoc,
+ *m_pKPresenterDoc->styleCollection(), activeStyleName);
+ styleManager->exec();
+ delete styleManager;
+ if ( edit )
+ edit->showCursor();
+}
+
+// Called when selecting a style in the Format / Style menu
+void KPrView::slotStyleSelected()
+{
+ QString actionName = QString::fromUtf8(sender()->name());
+ kdDebug(33001) << "KPrView::slotStyleSelected " << actionName << endl;
+ textStyleSelected( m_pKPresenterDoc->styleCollection()->findStyle( actionName ) );
+}
+
+void KPrView::textStyleSelected( int index )
+{
+ textStyleSelected( m_pKPresenterDoc->styleCollection()->styleAt( index ) );
+}
+
+void KPrView::textStyleSelected( KoParagStyle *_sty )
+{
+ if ( !_sty )
+ return;
+
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if(edit)
+ {
+ edit->applyStyle( _sty );
+ m_canvas->setFocus();
+ }
+ else
+ {
+ QPtrList<KPrTextObject> selectedFrames = m_canvas->selectedTextObjs();
+
+ if (selectedFrames.count() <= 0)
+ return; // nope, no frames are selected.
+ // yes, indeed frames are selected.
+ QPtrListIterator<KPrTextObject> it( selectedFrames );
+ KMacroCommand *globalCmd = 0L;
+ for ( ; it.current() ; ++it )
+ {
+ KoTextObject *textObject = it.current()->textObject();
+ textObject->textDocument()->selectAll( KoTextDocument::Temp );
+ KCommand *cmd = textObject->applyStyleCommand( 0L, _sty,
+ KoTextDocument::Temp, KoParagLayout::All, KoTextFormat::Format,
+ true, true );
+ textObject->textDocument()->removeSelection( KoTextDocument::Temp );
+ if (cmd)
+ {
+ if ( !globalCmd)
+ globalCmd = new KMacroCommand( selectedFrames.count() == 1 ? i18n("Apply Style to Frame") :
+ i18n("Apply Style to Frames"));
+ globalCmd->addCommand( cmd );
+ }
+ }
+ if ( globalCmd )
+ m_pKPresenterDoc->addCommand( globalCmd );
+ }
+
+}
+
+void KPrView::slotAllowAutoFormat()
+{
+ bool state = actionAllowAutoFormat->isChecked();
+ m_pKPresenterDoc->setAllowAutoFormat( state );
+}
+
+void KPrView::slotCompletion()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if(edit)
+ edit->completion();
+}
+
+void KPrView::insertComment()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( !edit )
+ return;
+ QString authorName;
+ KoDocumentInfo * info = m_pKPresenterDoc->documentInfo();
+ KoDocumentInfoAuthor * authorPage = static_cast<KoDocumentInfoAuthor *>(info->page( "author" ));
+ if ( !authorPage )
+ kdWarning() << "Author information not found in documentInfo !" << endl;
+ else
+ authorName = authorPage->fullName();
+
+ KoCommentDia *commentDia = new KoCommentDia( this, QString::null,authorName );
+ if( commentDia->exec() )
+ edit->insertComment(commentDia->commentText());
+ delete commentDia;
+}
+
+void KPrView::editComment()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ KoVariable * tmpVar=edit->variable();
+ KoNoteVariable * var = dynamic_cast<KoNoteVariable *>(tmpVar);
+ if(var)
+ {
+ QString authorName;
+ KoDocumentInfo * info = m_pKPresenterDoc->documentInfo();
+ KoDocumentInfoAuthor * authorPage = static_cast<KoDocumentInfoAuthor *>(info->page( "author" ));
+ if ( !authorPage )
+ kdWarning() << "Author information not found in documentInfo !" << endl;
+ else
+ authorName = authorPage->fullName();
+ QString oldValue = var->note();
+ QString createDate = var->createdNote();
+ KoCommentDia *commentDia = new KoCommentDia( this, oldValue, authorName, createDate);
+
+ if( commentDia->exec() )
+ {
+ if ( oldValue != commentDia->commentText())
+ {
+ KPrChangeVariableNoteText *cmd = new KPrChangeVariableNoteText( i18n("Change Note Text"), m_pKPresenterDoc, oldValue,commentDia->commentText(), var);
+ m_pKPresenterDoc->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+ delete commentDia;
+ }
+ }
+}
+
+void KPrView::viewGuideLines()
+{
+ bool state=actionViewShowGuideLine->isChecked();
+ m_pKPresenterDoc->setShowGuideLines( state );
+ m_pKPresenterDoc->updateGuideLineButton();
+ deSelectAllObjects();
+ refreshRuler( state );
+ m_pKPresenterDoc->repaint(false);
+}
+
+
+void KPrView::viewGrid()
+{
+ m_pKPresenterDoc->setShowGrid( actionViewShowGrid->isChecked() );
+ m_pKPresenterDoc->setModified( true );
+ m_pKPresenterDoc->updateGridButton();
+ m_pKPresenterDoc->repaint(false);
+}
+
+
+void KPrView::updateGuideLineButton()
+{
+ bool state = m_pKPresenterDoc->showGuideLines();
+ actionViewShowGuideLine->setChecked( state );
+ refreshRuler( state );
+}
+
+void KPrView::updateGridButton()
+{
+ actionViewShowGrid->setChecked( m_pKPresenterDoc->showGrid() );
+ actionViewSnapToGrid->setChecked ( m_pKPresenterDoc->snapToGrid() );
+}
+
+void KPrView::refreshRuler( bool state )
+{
+ if( getHRuler() )
+ {
+
+ if ( !m_pKPresenterDoc->isReadWrite())
+ {
+ getHRuler()->changeFlags(KoRuler::F_NORESIZE);
+ getHRuler()->repaint();
+ }
+ else
+ {
+ if( state )
+ {
+ if( getHRuler()->flags() != KoRuler::F_HELPLINES )
+ {
+ getHRuler()->changeFlags(KoRuler::F_HELPLINES);
+ getHRuler()->repaint();
+ }
+ }
+ else
+ {
+ if( getHRuler()->flags() != 0 )
+ {
+ getHRuler()->changeFlags( 0 );
+ getHRuler()->repaint();
+ }
+ }
+ }
+ }
+
+ if( getVRuler())
+ {
+ if ( !m_pKPresenterDoc->isReadWrite())
+ {
+ getVRuler()->changeFlags(KoRuler::F_NORESIZE);
+ getVRuler()->repaint();
+ }
+ else
+ {
+ if( state )
+ {
+ if( getVRuler()->flags() != KoRuler::F_HELPLINES )
+ {
+ getVRuler()->changeFlags(KoRuler::F_HELPLINES);
+ getVRuler()->repaint();
+ }
+ }
+ else
+ {
+ if( getVRuler()->flags()!= 0)
+ {
+ getVRuler()->changeFlags(0);
+ getVRuler()->repaint();
+ }
+ }
+ }
+ }
+
+}
+
+void KPrView::addGuideLine()
+{
+ KoRect rect( m_canvas->activePage()->getPageRect() );
+
+ KoPoint pos( zoomHandler()->unzoomPoint( m_mousePos + QPoint( m_canvas->diffx(), m_canvas->diffy() ) ) );
+ KoGuideLineDia dia( 0, pos, rect, m_pKPresenterDoc->unit() );
+ if ( dia.exec() == QDialog::Accepted )
+ {
+ m_pKPresenterDoc->addGuideLine( dia.orientation(), dia.pos() );
+ }
+}
+
+void KPrView::removeComment()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->removeComment();
+}
+
+void KPrView::configureCompletion()
+{
+ m_pKPresenterDoc->getAutoFormat()->readConfig();
+ KoCompletionDia dia( this, 0, m_pKPresenterDoc->getAutoFormat() );
+ dia.exec();
+}
+
+void KPrView::openPopupMenuZoom( const QPoint & _point )
+{
+ if(!koDocument()->isReadWrite() || !factory())
+ return;
+ actionZoomSelectedObject->setEnabled( m_canvas->isOneObjectSelected());
+ int nbObj = m_canvas->activePage()->objectList().count();
+ actionZoomAllObject->setEnabled( nbObj > 0);
+ static_cast<QPopupMenu*>(factory()->container("zoom_popup",this))->popup(_point);
+}
+
+void KPrView::zoomMinus()
+{
+ //unzoom from 25%
+ int zoom = zoomHandler()->zoom() - (int)(zoomHandler()->zoom()*0.25);
+ viewZoom( QString::number(zoom ) );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+}
+
+void KPrView::zoomPageWidth()
+{
+ int zoom = qRound( static_cast<double>(m_canvas->visibleRect().width() * 100 ) /
+ (zoomHandler()->resolutionX() * m_pKPresenterDoc->pageLayout().ptWidth ) );
+ viewZoom( QString::number(zoom ) );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+}
+
+void KPrView::zoomEntirePage()
+{
+ viewZoom( QString::number(getZoomEntirePage() ) );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+}
+
+void KPrView::zoomPlus()
+{
+ int zoom = zoomHandler()->zoom() + int( zoomHandler()->zoom() * 0.25 );
+ viewZoom( QString::number( zoom ) );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+}
+
+int KPrView::getZoomEntirePage() const
+{
+ double height = zoomHandler()->resolutionY() * m_pKPresenterDoc->pageLayout().ptHeight;
+ double width = zoomHandler()->resolutionX() * m_pKPresenterDoc->pageLayout().ptWidth;
+ int zoom = QMIN( qRound( static_cast<double>(m_canvas->visibleRect().height() * 100 ) / height ),
+ qRound( static_cast<double>(m_canvas->visibleRect().width() * 100 ) / width ) );
+ return zoom;
+}
+
+void KPrView::zoomSelectedObject()
+{
+ if( m_canvas->isOneObjectSelected() )
+ {
+ KoRect rect = m_canvas->objectRect( false );
+ setZoomRect( rect );
+ }
+}
+
+void KPrView::zoomPageHeight()
+{
+ int zoom = qRound( static_cast<double>(m_canvas->visibleRect().height() * 100 ) /
+ (zoomHandler()->resolutionX() * m_pKPresenterDoc->pageLayout().ptHeight ) );
+ viewZoom( QString::number(zoom ) );
+ m_canvas->setToolEditMode( TEM_MOUSE );
+}
+
+void KPrView::zoomAllObject()
+{
+ KoRect rect = m_canvas->objectRect( true );
+ double height = zoomHandler()->resolutionY() * rect.height();
+ double width = zoomHandler()->resolutionX() * rect.width();
+ int zoom = QMIN( qRound( static_cast<double>(m_canvas->visibleRect().height() * 100 ) / height ),
+ qRound( static_cast<double>(m_canvas->visibleRect().width() * 100 ) / width ) );
+ viewZoom( QString::number(zoom ) );
+
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->scrollTopLeftPoint( zoomHandler()->zoomPoint( rect.topLeft()) );
+}
+
+void KPrView::flipHorizontal()
+{
+ m_canvas->flipObject( true );
+}
+
+void KPrView::flipVertical()
+{
+ m_canvas->flipObject( false );
+}
+
+void KPrView::slotObjectEditChanged()
+{
+ bool state=m_canvas->isOneObjectSelected();
+ bool rw = koDocument()->isReadWrite();
+
+ bool isText=!m_canvas->applicableTextInterfaces().isEmpty();
+ actionTextFont->setEnabled(isText);
+ actionTextFontSize->setEnabled(isText);
+ actionTextFontFamily->setEnabled(isText);
+ actionTextColor->setEnabled(isText);
+ actionTextAlignLeft->setEnabled(isText);
+ actionTextAlignCenter->setEnabled(isText);
+ actionTextAlignRight->setEnabled(isText);
+ actionTextAlignBlock->setEnabled(isText);
+
+ actionFormatBullet->setEnabled(rw && isText );
+ actionFormatNumber->setEnabled(rw && isText );
+
+ actionTextDepthPlus->setEnabled(isText);
+ actionFormatDefault->setEnabled(isText);
+ actionTextDepthMinus->setEnabled(isText);
+
+ actionTextExtentCont2Height->setEnabled(isText);
+ actionTextExtendObj2Cont->setEnabled(isText);
+ actionTextBold->setEnabled(isText);
+ actionTextItalic->setEnabled(isText);
+ actionTextUnderline->setEnabled(isText);
+ actionFormatStrikeOut->setEnabled(isText);
+ actionFormatSuper->setEnabled(isText);
+ actionFormatSub->setEnabled(isText);
+ actionIncreaseFontSize->setEnabled(isText);
+ actionDecreaseFontSize->setEnabled(isText);
+
+ if ( isText )
+ {
+ KoTextFormat format =*(m_canvas->applicableTextInterfaces().first()->currentFormat());
+ showFormat( format );
+ const KoParagLayout * paragLayout=m_canvas->applicableTextInterfaces().first()->currentParagLayoutFormat();
+ KoParagCounter counter;
+ if(paragLayout->counter)
+ counter = *(paragLayout->counter);
+ int align = paragLayout->alignment;
+ if ( align == Qt::AlignAuto )
+ align = Qt::AlignLeft; // ## seems hard to detect RTL here
+ alignChanged( align );
+ }
+
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ bool val=(edit!=0) && isText && !edit->kpTextObject()->isProtectContent();
+ actionInsertSpecialChar->setEnabled(val);
+ actionInsertComment->setEnabled( val );
+
+ actionInsertLink->setEnabled(val);
+ actionFormatParag->setEnabled(isText);
+ actionInsertVariable->setEnabled(val);
+ actionTextInsertPageNum->setEnabled(val);
+ if ( edit )
+ actionBrushColor->setEnabled(val);
+
+ bool hasSelection = false ;
+ if(edit)
+ {
+ double leftMargin =edit->currentParagLayout().margins[QStyleSheetItem::MarginLeft];
+ actionTextDepthMinus->setEnabled(val && leftMargin>0);
+ hasSelection = edit->textObject()->hasSelection();
+ actionEditCut->setEnabled(hasSelection);
+ }
+ actionCreateStyleFromSelection->setEnabled(edit!=0);
+
+ actionChangeCase->setEnabled( (val && rw && hasSelection ) || (rw && !edit && isText) );
+
+ if(!edit)
+ {
+ actionEditCopy->setEnabled(state);
+ bool headerfooterselected = false;
+ if(m_canvas->numberOfObjectSelected()==1)
+ {
+ KPrObject *obj=m_canvas->getSelectedObj();
+ //disable this action when we select a header/footer
+ if(obj==m_pKPresenterDoc->header() || obj==m_pKPresenterDoc->footer())
+ headerfooterselected=true;
+ else
+ headerfooterselected=false;
+ }
+
+ actionEditCut->setEnabled(state&&!headerfooterselected);
+ }
+ actionFormatStyleMenu->setEnabled( isText );
+ actionFormatStyle->setEnabled(isText);
+
+ state=m_canvas->oneObjectTextExist();
+ actionEditFind->setEnabled(state);
+ actionEditFindNext->setEnabled( state );
+ actionEditFindPrevious->setEnabled( state );
+ actionEditReplace->setEnabled(state);
+
+ slotUpdateRuler();
+}
+
+void KPrView::duplicateObj()
+{
+ if (m_canvas->currentTextObjectView() && !m_canvas->isOneObjectSelected() )
+ return;
+
+ KPrDuplicatObjDia *dlg= new KPrDuplicatObjDia(this, m_pKPresenterDoc);
+ if ( dlg->exec() )
+ {
+ int nbCopy= dlg->nbCopy();
+ double angle = dlg->angle();
+ double increaseX = dlg->increaseX();
+ double increaseY = dlg->increaseY();
+ double moveX = dlg->moveX();
+ double moveY = dlg->moveY();
+ m_canvas->copyObjs();
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ deSelectAllObjects();
+ QMimeSource *data = QApplication::clipboard()->data();
+ QCString clip_str = KoStoreDrag::mimeType("application/x-kpresenter");
+ if ( data->provides( clip_str ) )
+ {
+ m_canvas->activePage()->pasteObjs( data->encodedData(clip_str),
+ nbCopy, angle, increaseX,increaseY, moveX, moveY );
+ m_canvas->setMouseSelectedObject(true);
+ emit objectSelectedChanged();
+ }
+ }
+ delete dlg;
+}
+
+void KPrView::extraArrangePopup()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ QPoint pnt( QCursor::pos() );
+ m_arrangeObjectsPopup->popup( pnt );
+}
+
+void KPrView::extraSendBackward()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->lowerObjs( false );
+}
+
+void KPrView::extraBringForward()
+{
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ m_canvas->raiseObjs( false );
+}
+
+void KPrView::applyAutoFormat()
+{
+ m_pKPresenterDoc->getAutoFormat()->readConfig();
+ KMacroCommand *macro = 0L;
+ m_switchPage=m_pKPresenterDoc->pageList().findRef(m_canvas->activePage());
+ m_initSwitchPage=m_switchPage;
+ QPtrList<KoTextObject> list=m_canvas->activePage()->allTextObjects();
+
+ KCommand * cmd2 = applyAutoFormatToCurrentPage( list );
+ if ( cmd2 )
+ {
+ if ( !macro )
+ macro = new KMacroCommand( i18n("Apply Autoformat"));
+ macro->addCommand( cmd2 );
+ }
+
+ while(switchInOtherPage(i18n( "Do you want to apply autoformat in new slide?")) )
+ {
+ KCommand * cmd = applyAutoFormatToCurrentPage(m_canvas->activePage()->allTextObjects());
+ if ( cmd )
+ {
+ if ( !macro )
+ macro = new KMacroCommand( i18n("Apply Autoformat"));
+ macro->addCommand( cmd );
+ }
+ }
+ if ( macro )
+ m_pKPresenterDoc->addCommand(macro);
+ m_switchPage=-1;
+ m_initSwitchPage=-1;
+}
+
+bool KPrView::switchInOtherPage( const QString & text )
+{
+ //there is not other page
+ if(m_pKPresenterDoc->pageList().count()==1)
+ return false;
+ m_switchPage++;
+ if( m_switchPage>=(int)m_pKPresenterDoc->pageList().count())
+ m_switchPage=0;
+ if( m_switchPage==m_initSwitchPage)
+ return false;
+ if ( KMessageBox::questionYesNo( this, text) != KMessageBox::Yes )
+ return false;
+ skipToPage(m_switchPage);
+ return true;
+}
+
+KCommand * KPrView::applyAutoFormatToCurrentPage( const QPtrList<KoTextObject> & lst)
+{
+ KMacroCommand *macro = 0L;
+ QPtrList<KoTextObject> list(lst);
+ QPtrListIterator<KoTextObject> fit(list);
+ for ( ; fit.current() ; ++fit )
+ {
+ KCommand *cmd = m_pKPresenterDoc->getAutoFormat()->applyAutoFormat( fit.current() );
+ if ( cmd )
+ {
+ if ( !macro )
+ macro = new KMacroCommand( i18n("Apply Autoformat"));
+ macro->addCommand( cmd );
+ }
+ }
+ return macro;
+}
+
+void KPrView::createStyleFromSelection()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ KoStyleCollection* coll = m_pKPresenterDoc->styleCollection();
+ KoCreateStyleDia *dia = new KoCreateStyleDia( QStringList(), this, 0 );
+ if ( dia->exec() )
+ {
+ QString name = dia->nameOfNewStyle();
+ KoParagStyle* style = coll->findStyleByDisplayName( name );
+ if ( style ) // update existing style
+ {
+ // TODO confirmation message box
+ edit->updateStyleFromSelection( style );
+ }
+ else // create new style
+ {
+ style = edit->createStyleFromSelection( name );
+ m_pKPresenterDoc->styleCollection()->addStyle( style );
+ m_pKPresenterDoc->updateAllStyleLists();
+ }
+ showStyle( name );
+ }
+ delete dia;
+ }
+}
+
+void KPrView::closeObject()
+{
+ m_canvas->closeObject(true);
+}
+
+void KPrView::viewSnapToGrid()
+{
+ m_pKPresenterDoc->setSnapToGrid( actionViewSnapToGrid->isChecked() );
+ m_pKPresenterDoc->setModified( true );
+ m_pKPresenterDoc->updateGridButton();
+}
+
+void KPrView::alignVerticalTop()
+{
+ if ( actionAlignVerticalTop->isChecked() )
+ m_canvas->alignVertical(KP_TOP );
+ else
+ actionAlignVerticalTop->setChecked(true);
+}
+
+void KPrView::alignVerticalBottom()
+{
+ if ( actionAlignVerticalBottom->isChecked() )
+ m_canvas->alignVertical(KP_BOTTOM );
+ else
+ actionAlignVerticalBottom->setChecked(true);
+}
+
+void KPrView::alignVerticalCenter()
+{
+ if ( actionAlignVerticalCenter->isChecked() )
+ m_canvas->alignVertical(KP_CENTER );
+ else
+ actionAlignVerticalCenter->setChecked(true);
+}
+
+void KPrView::changeVerticalAlignmentStatus(VerticalAlignmentType _type )
+{
+ switch( _type )
+ {
+ case KP_CENTER:
+ actionAlignVerticalCenter->setChecked( true );
+ break;
+ case KP_TOP:
+ actionAlignVerticalTop->setChecked( true );
+ break;
+ case KP_BOTTOM:
+ actionAlignVerticalBottom->setChecked( true );
+ break;
+ }
+}
+
+void KPrView::autoSpellCheck()
+{
+ m_pKPresenterDoc->changeBgSpellCheckingState( actionAllowBgSpellCheck->isChecked() );
+}
+
+void KPrView::insertFile( )
+{
+ KFileDialog fd( QString::null, QString::null, this, 0, TRUE );
+ QStringList filter;
+ filter<<"application/x-kpresenter";
+ filter<<"application/vnd.oasis.opendocument.presentation";
+ fd.setMimeFilter( filter );
+ fd.setCaption(i18n("Insert File"));
+
+ KURL url;
+ if ( fd.exec() == QDialog::Accepted )
+ {
+ url = fd.selectedURL();
+ if( url.isEmpty() )
+ {
+ KMessageBox::sorry( this,
+ i18n("File name is empty."),
+ i18n("Insert File"));
+ return;
+ }
+ insertFile(url.path());
+ }
+}
+
+void KPrView::insertFile(const QString &path)
+{
+ m_pKPresenterDoc->insertFile(path);
+}
+
+void KPrView::importStyle()
+{
+ KPrImportStyleDia dia( m_pKPresenterDoc, m_pKPresenterDoc->styleCollection(), this );
+ if ( dia.exec() && !dia.importedStyles().isEmpty() ) {
+ m_pKPresenterDoc->styleCollection()->importStyles( dia.importedStyles() );
+ m_pKPresenterDoc->setModified( true );
+ m_pKPresenterDoc->updateAllStyleLists();
+ }
+}
+
+void KPrView::backgroundPicture()
+{
+ switch( m_canvas->activePage()->getBackType())
+ {
+ case BT_COLOR:
+ case BT_BRUSH:
+ break;
+ case BT_CLIPART:
+ case BT_PICTURE:
+ KoPicture picture=m_canvas->activePage()->background()->picture();
+ savePicture(picture.getKey().filename(), picture);
+ break;
+ }
+}
+
+void KPrView::testAndCloseAllTextObjectProtectedContent()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit && edit->kpTextObject()->isProtectContent())
+ {
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ deSelectAllObjects();
+ }
+}
+
+void KPrView::updateBgSpellCheckingState()
+{
+ actionAllowBgSpellCheck->setChecked( m_pKPresenterDoc->backgroundSpellCheckEnabled() );
+}
+
+void KPrView::updateRulerInProtectContentMode()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit && getHRuler()) {
+ if ( !edit->kpTextObject()->isProtectContent() )
+ getHRuler()->changeFlags(KoRuler::F_INDENTS | KoRuler::F_TABS);
+ else
+ getHRuler()->changeFlags(0);
+ getHRuler()->repaint();
+ }
+}
+
+void KPrView::slotChangeCutState(bool b)
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+
+ if ( edit && edit->kpTextObject()->isProtectContent())
+ actionEditCut->setEnabled( false );
+ else
+ actionEditCut->setEnabled( b );
+}
+
+void KPrView::updatePresentationButton(bool b)
+{
+ actionScreenStart->setEnabled( b );
+}
+
+void KPrView::refreshGroupButton()
+{
+ bool state=m_canvas->isOneObjectSelected();
+ actionExtraGroup->setEnabled(state && m_canvas->numberOfObjectSelected()>1);
+ actionExtraUnGroup->setEnabled(state && m_canvas->haveASelectedGroupObj());
+}
+
+void KPrView::closeTextObject()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit)
+ {
+ m_canvas->setToolEditMode( TEM_MOUSE );
+ deSelectAllObjects();
+ }
+}
+
+void KPrView::deSelectAllObjects()
+{
+ m_canvas->deSelectAllObj();
+}
+
+void KPrView::copyLink()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->copyLink();
+}
+
+void KPrView::addToBookmark()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ KoLinkVariable * var=edit->linkVariable();
+ if(var)
+ edit->addBookmarks(var->url());
+ }
+}
+
+void KPrView::removeLink()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->removeLink();
+}
+
+void KPrView::insertDirectCursor()
+{
+#if 0
+ insertDirectCursor( actionInsertDirectCursor->isChecked());
+#endif
+}
+
+void KPrView::insertDirectCursor(bool b)
+{
+ m_pKPresenterDoc->setInsertDirectCursor(b);
+}
+
+void KPrView::updateDirectCursorButton()
+{
+#if 0
+ actionInsertDirectCursor->setChecked(m_pKPresenterDoc->insertDirectCursor());
+#endif
+}
+
+void KPrView::copyTextOfComment()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ edit->copyTextOfComment();
+}
+
+void KPrView::slotAddIgnoreAllWord()
+{
+ KPrTextView *edit=m_canvas->currentTextObjectView();
+ if ( edit )
+ m_pKPresenterDoc->addSpellCheckIgnoreWord( edit->currentWordOrSelection() );
+}
+
+void KPrView::addWordToDictionary()
+{
+ KPrTextView* edit = m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ QString word = edit->wordUnderCursor( *edit->cursor() );
+ if ( !word.isEmpty() )
+ m_pKPresenterDoc->addWordToDictionary( word );
+ }
+}
+
+void KPrView::imageEffect()
+{
+ if (m_canvas->numberOfObjectSelected() > 0) {
+ imageEffectDia = new KPrImageEffectDia(this);
+
+ KPrPixmapObject *object=m_canvas->getSelectedImage();
+
+ imageEffectDia->setPixmap(object->getOriginalPixmap());
+ imageEffectDia->setEffect(object->getImageEffect(), object->getIEParam1(), object->getIEParam2(),
+ object->getIEParam3());
+
+ m_canvas->setToolEditMode(TEM_MOUSE);
+
+ if (imageEffectDia->exec()==QDialog::Accepted) {
+ KCommand *cmd=m_canvas->activePage()->setImageEffect(imageEffectDia->getEffect(), imageEffectDia->getParam1(),
+ imageEffectDia->getParam2(), imageEffectDia->getParam3());
+ if ( cmd )
+ kPresenterDoc()->addCommand( cmd );
+ }
+
+ delete imageEffectDia;
+ imageEffectDia = 0L;
+ }
+}
+
+void KPrView::spellAddAutoCorrect (const QString & originalword, const QString & newword)
+{
+ m_pKPresenterDoc->getAutoFormat()->addAutoFormatEntry( originalword, newword );
+}
+
+QPtrList<KAction> KPrView::listOfResultOfCheckWord( const QString &word )
+{
+ QPtrList<KAction> listAction;
+ DefaultDictionary *dict = m_broker->defaultDictionary();
+ QStringList lst = dict->suggest( word );
+ if ( !lst.contains( word ))
+ {
+ QStringList::ConstIterator it = lst.begin();
+ for ( int i = 0; it != lst.end() ; ++it, ++i )
+ {
+ if ( !(*it).isEmpty() ) // in case of removed subtypes or placeholders
+ {
+ KAction * act = new KAction( (*it));
+ connect( act, SIGNAL(activated()), this, SLOT(slotCorrectWord()) );
+ listAction.append( act );
+ }
+ }
+ }
+
+ return listAction;
+}
+
+void KPrView::slotCorrectWord()
+{
+ KAction * act = (KAction *)(sender());
+ KPrTextView* edit = m_canvas->currentTextObjectView();
+ if ( edit )
+ {
+ edit->selectWordUnderCursor( *(edit->cursor()) );
+ m_pKPresenterDoc->addCommand(edit->textObject()->replaceSelectionCommand(
+ edit->cursor(), act->text(),
+ i18n("Replace Word"), KoTextDocument::Standard));
+ }
+}
+
+KCommand * KPrView::getPenCmd( const QString &name, KoPen pen, LineEnd lb, LineEnd le, int flags )
+{
+ KMacroCommand * macro = NULL;
+
+ //tz TODO remove macro, add parameter for command name to setPen()
+ KCommand * cmd = m_canvas->activePage()->setPen( pen, lb, le, flags );
+ if( cmd )
+ {
+ macro = new KMacroCommand( name );
+ macro->addCommand( cmd );
+ }
+
+ return macro;
+}
+
+void KPrView::initialLayoutOfSplitter()
+{
+ if( !notebar )
+ {
+ return;
+ }
+
+ QSplitter* splitterVertical = static_cast<QSplitter*>( notebar->parent() );
+ QValueList<int> tmpList;
+ int noteHeight = height() / 25;
+ tmpList << height() - noteHeight << noteHeight;
+ splitterVertical->setSizes( tmpList );
+}
+
+void KPrView::slotChildActivated(bool a)
+{
+ KoViewChild* ch = child( (KoView*)sender() );
+ if ( !ch )
+ return;
+
+ if( !a ) {
+ m_canvas->exitEditMode();
+ }
+
+ KoView::slotChildActivated( a );
+}
+
+Broker *KPrView::broker() const
+{
+ return m_broker;
+}
+
+void KPrView::slotUnitChanged( KoUnit::Unit unit )
+{
+ h_ruler->setUnit( unit );
+ v_ruler->setUnit( unit );
+ if ( statusBar() )
+ {
+ m_sbUnitLabel->setText( ' ' + KoUnit::unitDescription( unit ) + ' ' );
+ updateObjectStatusBarItem();
+ }
+}
+
+void KPrView::documentModified( bool b )
+{
+ if ( !statusBar() )
+ return;
+
+ if ( b )
+ m_sbModifiedLabel->setPixmap( KGlobal::iconLoader()->loadIcon( "action-modified", KIcon::Small ) );
+ else
+ m_sbModifiedLabel->setText( " " );
+}
+
+void KPrView::loadingFinished()
+{
+ h_ruler->setPageLayout(m_pKPresenterDoc->pageLayout());
+ v_ruler->setPageLayout(m_pKPresenterDoc->pageLayout());
+ slotUpdateRuler();
+ m_pKPresenterDoc->updateZoomRuler();
+ updateSideBar();
+}
+
+#include "KPrView.moc"
diff --git a/kpresenter/KPrView.h b/kpresenter/KPrView.h
new file mode 100644
index 000000000..01c67e16e
--- /dev/null
+++ b/kpresenter/KPrView.h
@@ -0,0 +1,1228 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef kpresenter_view_h
+#define kpresenter_view_h
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qguardedptr.h>
+#include <qtimer.h>
+#include <qdatetime.h>
+
+#include <KoView.h>
+#include "global.h"
+#include <KoBrush.h>
+#include <KoPen.h>
+#include <KoRuler.h>
+
+class QPopupMenu;
+class QSplitter;
+class QLabel;
+class DCOPObject;
+class KPrView;
+class KPrBackDialog;
+class KoRuler;
+class QScrollBar;
+class AFChoose;
+class KPrPropertyEditor;
+class KPrPgConfDia;
+class KPrSlideTransitionDia;
+class KPrRotationDialogImpl;
+class KPrShadowDialogImpl;
+class KPrImageEffectDia;
+class ConfPieDia;
+class ConfRectDia;
+class ConfPolygonDia;
+class ConfPictureDia;
+class KPrPresDurationDia;
+class QToolButton;
+class KPrSideBar;
+class KPrNoteBar;
+
+class KAction;
+class KActionMenu;
+class KToggleAction;
+class TKSelectColorAction;
+class KoPartSelectAction;
+class KoPicture;
+class KoParagStyle;
+class KoLineStyleAction;
+class KoLineWidthAction;
+class KoRect;
+
+class KoCharSelectDia;
+class KoTextFormat;
+class KoTextObject;
+class KoTextZoomHandler;
+
+class KCommand;
+class KMacroCommand;
+class KFontSizeAction;
+class KColorAction;
+class KSelectAction;
+class KFontAction;
+class KoParagCounter;
+class KActionMenu;
+class KoSearchContext;
+class KPrFindReplace;
+class KPrCanvas;
+class KoFontDia;
+class KoParagDia;
+class KPrObject;
+class KPrPixmapObject;
+class KPrDocument;
+class KPrPage;
+class KPrTextObject;
+class KoTextIterator;
+class KStatusBarLabel;
+
+class KoSpell;
+#include <kspell2/broker.h>
+namespace KSpell2 {
+ class Dialog;
+}
+
+class PageBase : public QWidget
+{
+public:
+ PageBase( QWidget *parent, KPrView *v ) : QWidget( parent ), view( v ) {}
+ void resizeEvent( QResizeEvent *e );
+
+private:
+ KPrView *view;
+
+};
+
+
+class KPrView : public KoView
+{
+ friend class PageBase;
+ Q_OBJECT
+
+public:
+ KPrView( KPrDocument* _doc, QWidget *_parent = 0, const char *_name = 0 );
+ ~KPrView();
+
+ void initGui();
+ virtual DCOPObject* dcopObject();
+
+ // for dcop interface
+ int getCurrentPresPage() const;
+ int getCurrentPresStep() const;
+ int getPresStepsOfPage() const;
+ int getNumPresPages() const;
+ bool gotoPresPage( int pg );
+
+ virtual void setupPrinter( KPrinter &printer );
+ virtual void print( KPrinter &printer );
+
+ void showFormat( const KoTextFormat &format );
+
+ void showZoom( int zoom ); // show a zoom value in the combo
+ void setZoom( int zoom, bool updateViews ); // change the zoom value
+ void changeZoomMenu( int zoom=-1);
+ void showStyle( const QString & styleName );
+ void updateStyleList();
+
+ KoTextZoomHandler *zoomHandler() const;
+
+ //used this function when we when to print/create web presentation etc...
+ //=>we unzoom it.
+ void unZoomDocument(int &dpiX,int &dpiY);
+ void zoomDocument(int zoom);
+
+ //refresh footer/header button when we make undo/redo show/hide header/footer
+ void updateHeaderFooterButton();
+ void updateDisplayObjectMasterPageButton();
+
+ void updateDisplayBackgroundButton();
+ virtual int leftBorder() const { return canvas()->mapTo(const_cast<KPrView *>(this), QPoint(0,0)).x(); };
+ virtual int rightBorder() const { return width() - canvas()->mapTo(const_cast<KPrView *>(this), QPoint(canvas()->width(), 0)).x(); };
+ virtual int topBorder() const { return canvas()->mapTo(const_cast<KPrView *>(this), QPoint(0,0)).y(); };
+ virtual int bottomBorder() const { return height() - canvas()->mapTo(const_cast<KPrView *>(this), QPoint(0, canvas()->height())).y(); };
+
+ void updateGuideLineButton();
+
+ void updateGridButton();
+ void savePicture( const QString& oldName, KoPicture& picture);
+ void savePicture( KPrPixmapObject* obj );
+
+ void insertFile(const QString &path);
+ void testAndCloseAllTextObjectProtectedContent();
+ void updateRulerInProtectContentMode();
+ QPtrList<KAction> listOfResultOfCheckWord( const QString &word );
+
+ /**
+ * Returns the KPresenter global KSpell2 Broker object.
+ */
+ KSpell2::Broker *broker() const;
+ bool editMaster() const { return m_editMaster;}
+
+signals:
+ void currentPageChanged( int );
+ void presentationFinished();
+
+public slots:
+ // edit menu
+ void editCut();
+ void editCopy();
+ void editPaste();
+ void editDelete();
+ void editSelectAll();
+ void editDeSelectAll();
+ void editCopyPage();
+ void editDuplicatePage();
+ void editDelPage();
+ void editFind();
+ void editReplace();
+
+ // view menu
+ void viewShowSideBar();
+ void viewShowNoteBar();
+ void viewSlideMaster();
+ void viewZoom( const QString &s );
+
+ void viewFooter();
+ void viewHeader();
+ void insertComment();
+ void editComment();
+
+ void viewGuideLines();
+
+ void viewGrid();
+
+ void viewSnapToGrid();
+
+ // insert menu
+ void insertPage();
+ void insertPicture();
+ void insertPicture(const QString &file);
+ void insertSpecialChar();
+
+ // tools menu
+ void toolsMouse();
+ void toolsRotate();
+ void toolsZoom();
+ void toolsLine();
+ void toolsLinePopup();
+ void toolsShapePopup();
+ void toolsRectangle();
+ void toolsCircleOrEllipse();
+ void toolsPie();
+ void toolsText();
+ void toolsAutoform();
+ void toolsDiagramm();
+ void toolsTable();
+ void toolsFormula();
+ void toolsObject();
+ void toolsFreehand();
+ void toolsPolyline();
+ void toolsQuadricBezierCurve();
+ void toolsCubicBezierCurve();
+ void toolsConvexOrConcavePolygon();
+ void toolsClosedLinePopup();
+ void toolsClosedFreehand();
+ void toolsClosedPolyline();
+ void toolsClosedQuadricBezierCurve();
+ void toolsClosedCubicBezierCurve();
+
+ // extra menu
+ void extraProperties();
+ void extraRaise();
+ void extraLower();
+ void extraRotate();
+ void extraSendBackward();
+ void extraBringForward();
+ void extraArrangePopup();
+
+ void extraShadow();
+ void extraBackground();
+ void extraLayout();
+ void extraConfigure();
+ void extraLineBegin();
+ void extraLineEnd();
+ void extraWebPres();
+ void extraMSPres();
+ void extraCreateTemplate();
+ void extraDefaultTemplate();
+ void extraGroup();
+ void extraUnGroup();
+ void extraPenStyle( int newStyle );
+ void extraPenWidth( double newWidth );
+
+ void configureCompletion();
+
+ void extraAlignObjLeft();
+ void extraAlignObjCenterH();
+ void extraAlignObjRight();
+ void extraAlignObjTop();
+ void extraAlignObjCenterV();
+ void extraAlignObjBottom();
+
+ // screen menu
+ void screenConfigPages();
+ void screenAssignEffect();
+ void screenTransEffect();
+ void screenStart();
+ void screenStartFromFirst();
+ void screenStop();
+ void screenPause();
+ void screenFirst();
+ /**
+ * Go to previous step of the presentation.
+ * gotoPreviousPage: if is set to true go to beginning of the
+ * previous page.
+ */
+ void screenPrev( bool gotoPreviousPage = false );
+ /**
+ * Go to the next step of the presentation.
+ * gotoNextPage: if is set to true go to beginning of the
+ * next page.
+ */
+ void screenNext( bool gotoNextPage = false );
+ void screenLast();
+ void screenSkip();
+
+ // text toolbar
+ void sizeSelected( int size );
+ void fontSelected( const QString &fontFamily );
+ void textBold();
+ void textItalic();
+ void textUnderline();
+ void textStrikeOut();
+ void textColor();
+ void textAlignLeft();
+ void textAlignCenter();
+ void textAlignRight();
+ void textAlignBlock();
+ void mtextFont();
+
+ void slotCounterStyleSelected();
+
+ void textDepthPlus();
+ void textDepthMinus();
+ void textContentsToHeight();
+ void textObjectToContents();
+ void textInsertPageNum();
+ void textDefaultFormat();
+
+ // color bar
+ void penChosen();
+ void brushChosen();
+
+ void skipToPage( int _num );
+ void nextPage();
+ void prevPage();
+
+ /**
+ * Update a given item in the sidebar
+ */
+ void updateSideBarItem( KPrPage * page );
+ void addSideBarItem( int pos );
+ void moveSideBarItem( int oldPos, int newPos );
+ void removeSideBarItem( int pos );
+
+ //statusbar updates
+ void updatePageInfo();
+ void updateObjectStatusBarItem();
+ void pageNumChanged();
+ void updateSideBarMenu();
+
+ void objectSelectedChanged();
+
+ void renamePageTitle();
+
+ void picViewOriginalSize();
+ void picViewOrig640x480();
+ void picViewOrig800x600();
+ void picViewOrig1024x768();
+ void picViewOrig1280x1024();
+ void picViewOrig1600x1200();
+
+ void chPic();
+ void imageEffect();
+
+ void textSubScript();
+ void textSuperScript();
+
+ void slotSpecialChar(QChar, const QString &);
+ void slotSpecialCharDlgClosed();
+
+ void insertLink();
+ void changeLink();
+ void copyLink();
+ void removeLink();
+ void addToBookmark();
+ void slotSoftHyphen();
+ void slotNonbreakingSpace();
+ void slotNonbreakingHyphen();
+ void slotLineBreak();
+ void slotIncreaseNumberingLevel();
+ void slotDecreaseNumberingLevel();
+
+ void extraAutoFormat();
+ void slotSpellCheck();
+
+
+ void spellCheckerDone( const QString & );
+ void spellCheckerCancel();
+ void startKSpell();
+ void spellAddAutoCorrect (const QString & originalword, const QString & newword);
+ void spellCheckerMisspelling( const QString &, int );
+ void spellCheckerCorrected( const QString &, int, const QString & );
+ void alignChanged( int );
+
+ void formatParagraph();
+ void changeNbOfRecentFiles(int _nb);
+
+ void insertVariable();
+
+ void insertCustomVariable();
+ void insertNewCustomVariable();
+ void refreshCustomMenu();
+
+ void editCustomVars ();
+ void openLink();
+
+ void increaseFontSize();
+ void decreaseFontSize();
+
+ void tabListChanged( const KoTabulatorList & tabList );
+
+ void newLeftIndent( double _leftIndent);
+ void newFirstIndent( double _firstIndent);
+ void newRightIndent( double _rightIndent);
+ void slotUpdateRuler();
+
+ void slotHRulerDoubleClicked( double ptpos );
+ void slotHRulerDoubleClicked();
+
+ void changeCaseOfText();
+ void slotStyleSelected();
+ void textStyleSelected( int );
+ void extraStylist();
+
+ void slotAllowAutoFormat();
+
+ void slotCompletion();
+
+ void removeComment();
+ void copyTextOfComment();
+
+ //zoom menu
+ void zoomMinus();
+ void zoomPageWidth();
+ void zoomEntirePage();
+ void zoomPlus();
+ void zoomSelectedObject();
+ void zoomPageHeight();
+ void zoomAllObject();
+
+ void flipHorizontal();
+ void flipVertical();
+ void closeObject();
+
+ void duplicateObj();
+ void applyAutoFormat();
+ void createStyleFromSelection();
+
+ void alignVerticalTop();
+ void alignVerticalBottom();
+ void alignVerticalCenter();
+
+
+ void savePicture();
+ void autoSpellCheck();
+
+ void insertFile();
+ void editCustomVariable();
+ void importStyle();
+
+ void backgroundPicture();
+ void updateBgSpellCheckingState();
+ void updatePresentationButton(bool);
+ void refreshGroupButton();
+ void slotAddIgnoreAllWord();
+ void addWordToDictionary();
+ void customSlideShow();
+
+ void displayObjectFromMasterPage();
+ void displayBackground();
+ void slotUnitChanged(KoUnit::Unit);
+ void documentModified( bool );
+
+public:
+ // create GUI
+ virtual void createGUI();
+
+ // get current pagenum, 1-based
+ unsigned int getCurrPgNum() const;
+ /**
+ * Recalculate the currPgNum from the activePage of the canvas
+ * This is necessary after a page has inserted.
+ */
+ void recalcCurrentPageNum();
+
+ // return pointer to document
+ KPrDocument *kPresenterDoc() const {return m_pKPresenterDoc; }
+
+ // properties
+ void changePicture( const QString & );
+
+ KPrCanvas* getCanvas() const { return m_canvas;}
+
+ void setRulerMouseShow( bool _show );
+ void setRulerMousePos( int mx, int my );
+
+ // set scrollbar ranges
+ void setRanges();
+
+ KoRuler *getHRuler() const { return h_ruler; }
+ KoRuler *getVRuler() const { return v_ruler; }
+ KoTabChooser *getTabChooser() const { return tabChooser; }
+ QScrollBar *getHScrollBar() const { return horz; }
+ QScrollBar *getVScrollBar() const { return vert; }
+
+ /**
+ * @brief Show the rect where object lies
+ *
+ * It will move the screen to the top right corner of object
+ * when it is not allready totaly visible on the screen.
+ *
+ * @param object which should be shown
+ */
+ void showObjectRect( const KPrObject * object );
+
+ PieType getPieType() const { return pieType; }
+ int getPieAngle() const { return pieAngle; }
+ int getPieLength() const { return pieLength; }
+ KoPen getPen() const { return pen; }
+ QBrush getBrush() const { return brush; }
+ LineEnd getLineBegin() const { return lineBegin; }
+ LineEnd getLineEnd() const{ return lineEnd; }
+ QColor getGColor1() const { return gColor1; }
+ QColor getGColor2() const { return gColor2; }
+ BCType getGType() const { return gType; }
+ FillType getFillType() const { return fillType; }
+ bool getGUnbalanced() const { return gUnbalanced; }
+ int getGXFactor() const { return gXFactor; }
+ int getGYFactor() const { return gYFactor; }
+ TKSelectColorAction* getActionBrushColor() const { return actionBrushColor; }
+ TKSelectColorAction* getActionPenColor() const { return actionPenColor; }
+
+ void setPieType(PieType _pieType) { pieType = _pieType; }
+ void setPieAngle(int _pieAngle) { pieAngle = _pieAngle; }
+ void setPieLength(int _pieLength) { pieLength = _pieLength; }
+ void setPen(KoPen _pen) { pen = _pen; }
+ void setBrush(QBrush _brush) { brush = _brush; }
+ void setLineBegin(LineEnd _lineBegin) { lineBegin = _lineBegin; }
+ void setLineEnd(LineEnd _lineEnd){ lineEnd = _lineEnd; }
+ void setGColor1(QColor _gColor1) { gColor1 = _gColor1; }
+ void setGColor2(QColor _gColor2) { gColor2 = _gColor2; }
+ void setGType(BCType _gType) { gType = _gType; }
+ void setFillType(FillType _fillType) { fillType = _fillType; }
+ void setGUnbalanced(bool _gUnbalanced) { gUnbalanced = _gUnbalanced; }
+ void setGXFactor(int _gXFactor) { gXFactor = _gXFactor; }
+ void setGYFactor(int _gYFactor) { gYFactor = _gYFactor; }
+
+ void setTool( ToolEditMode toolEditMode );
+
+ int getRndX() const { return rndX; }
+ int getRndY() const { return rndY; }
+
+ void setRndX(int _rndX) { rndX = _rndX; }
+ void setRndY(int _rndY) { rndY = _rndY; }
+
+// QFont &currFont() { return tbFont; }
+// QColor &currColor() { return tbColor; }
+
+ void enableWebPres();
+ void enableMSPres();
+
+ /**
+ * Overloaded from View
+ */
+ bool doubleClickActivation() const;
+ /**
+ * Overloaded from View
+ */
+ QWidget* canvas() const;
+ /**
+ * Overloaded from View
+ */
+ int canvasXOffset() const;
+ /**
+ * Overloaded from View
+ */
+ int canvasYOffset() const;
+
+ /**
+ * Rebuild the whole sidebar
+ */
+ void updateSideBar();
+
+ void refreshPageButton();
+
+ void setCanvasXOffset( int _x );
+ void setCanvasYOffset( int _y );
+
+ void openPopupMenuObject( const QString & name , const QPoint & _point );
+ void openPopupMenuMenuPage( const QPoint & _point );
+ void openPopupMenuSideBar(const QPoint & _point);
+
+ void openPopupMenuZoom( const QPoint & _point );
+
+ void penColorChanged( const KoPen & _pen );
+ void brushColorChanged( const QBrush & _brush );
+
+ /**
+ * Restart the timer for going to the next page.
+ * This is used in automatic presentation mode.
+ */
+ void restartAutoPresTimer();
+
+ /**
+ * Continue the stopped timer for going to the next page.
+ * This is used in automatic presentation mode.
+ */
+ void continueAutoPresTimer();
+
+ /**
+ * Stop the timer for going to the next page.
+ * This is used in automatic presentation mode.
+ */
+ void stopAutoPresTimer();
+
+ /**
+ * Set the timer for going to next step to sec seconds.
+ * This is used in automatic presentation mode.
+ */
+ void setAutoPresTimer( int sec );
+
+ void showCounter( KoParagCounter &c );
+
+ QPopupMenu * popupMenu( const QString& name );
+
+ void showRulerIndent( double _leftMargin, double _firstLine, double _rightMargin, bool rtl );
+
+ void reorganize();
+
+ // For KPrNoteBar
+ KPrNoteBar *getNoteBar() const { return notebar; }
+
+ // Used by Page to plug/unplug the datatool actions
+ QPtrList<KAction>& actionList() { return m_actionList; }
+ // Used by Page to plug/unplug the variable actions
+ QPtrList<KAction> &variableActionList() { return m_variableActionList; }
+
+ // for Polygon object
+ bool getCheckConcavePolygon() const { return checkConcavePolygon; }
+ int getCornersValue() const { return cornersValue; }
+ int getSharpnessValue() const { return sharpnessValue; }
+
+ void setCheckConcavePolygon(bool _concavePolygon) { checkConcavePolygon = _concavePolygon; }
+ void setCornersValue(int _cornersValue) { cornersValue = _cornersValue; }
+ void setSharpnessValue(int _sharpnessValue) { sharpnessValue = _sharpnessValue; }
+
+ // for Picture Object
+ PictureMirrorType getPictureMirrorType() const { return mirrorType; }
+ int getPictureDepth() const { return depth; }
+ bool getPictureSwapRGB() const { return swapRGB; }
+ bool getPictureGrayscal() const { return grayscal; }
+ int getPictureBright() const { return bright; }
+
+ /**
+ * Set the duration of the given page ( zero based ).
+ * This reads out m_duration and adds it to the given page.
+ * m_duration is restarted.
+ */
+ void setPageDuration( int _pgNum );
+
+ /**
+ * @brief Zoom the rect
+ *
+ * @param rect The rect which should be zoomed to.
+ */
+ void setZoomRect( const KoRect & rect );
+ void changeVerticalAlignmentStatus(VerticalAlignmentType _type );
+
+ void closeTextObject();
+ void deSelectAllObjects();
+
+ void insertDirectCursor(bool b);
+ void updateDirectCursorButton();
+
+ void setEditMaster( bool editMaster );
+
+protected slots:
+ // dialog slots
+ void backOk( KPrBackDialog*, bool );
+ void afChooseOk( const QString & );
+ void slotAfchooseCanceled();
+ void propertiesOk();
+ void pgConfOk();
+ void rotateOk();
+ void shadowOk();
+ void pddClosed();
+
+ // scrolling
+ void scrollH( int );
+ void scrollV( int );
+
+ // textobject
+ void fontChanged( const QFont & );
+ void colorChanged( const QColor &color );
+
+ void extraLineBeginNormal();
+ void extraLineBeginArrow();
+ void extraLineBeginRect();
+ void extraLineBeginCircle();
+ void extraLineBeginLineArrow();
+ void extraLineBeginDimensionLine();
+ void extraLineBeginDoubleArrow();
+ void extraLineBeginDoubleLineArrow();
+ void setExtraLineBegin(LineEnd lb);
+ void extraLineEndNormal();
+ void extraLineEndArrow();
+ void extraLineEndRect();
+ void extraLineEndCircle();
+ void extraLineEndLineArrow();
+ void extraLineEndDimensionLine();
+ void extraLineEndDoubleArrow();
+ void extraLineEndDoubleLineArrow();
+ void setExtraLineEnd(LineEnd le);
+
+ void setExtraPenStyle( Qt::PenStyle style );
+ void setExtraPenWidth( double width );
+
+ /**
+ * Restart the presenation from the first shown slide.
+ * This only works in automatic presentation and infinite loop mode.
+ */
+ void restartPresentation() { m_autoPresRestart = true; }
+ /**
+ * Finish the automatic presentation mode.
+ * This only works in automatic presentation mode.
+ */
+ void stopAutomaticPresentation() { m_autoPresStop = true; }
+
+ void newPageLayout( const KoPageLayout &_layout );
+ void openPageLayoutDia() { extraLayout(); }
+ void unitChanged( KoUnit::Unit );
+
+ void doAutomaticScreenPres();
+
+ void getPageMouseWheelEvent( QWheelEvent *e );
+ void updateRuler();
+
+ void refreshAllVariable();
+ void slotViewFormattingChars();
+ void slotUpdateScrollBarRanges();
+
+ void addGuideLine();
+
+ void refreshRuler( bool state );
+ void slotApplyFont();
+ void slotApplyParag();
+ void slotObjectEditChanged();
+ void slotChangeCutState(bool );
+
+ void insertDirectCursor();
+ void slotCorrectWord();
+ void editFindNext();
+ void editFindPrevious();
+
+ void initialLayoutOfSplitter();
+
+ virtual void slotChildActivated(bool a);
+
+ void loadingFinished();
+
+protected:
+ virtual void resizeEvent( QResizeEvent* );
+ virtual void dragEnterEvent( QDragEnterEvent *e );
+ virtual void dragMoveEvent( QDragMoveEvent *e );
+ virtual void dragLeaveEvent( QDragLeaveEvent *e );
+ virtual void dropEvent( QDropEvent *e );
+
+ virtual void keyPressEvent( QKeyEvent* );
+
+ virtual void guiActivateEvent( KParts::GUIActivateEvent *ev );
+
+// GUI
+ void setupActions();
+ void setupPopupMenus();
+ void setupScrollbars();
+ void setupRulers();
+
+ void startScreenPres( int pgNum = -1 );
+
+ virtual void updateReadWrite( bool readwrite );
+
+ void addVariableActions( int type, const QStringList & texts,
+ KActionMenu * parentMenu, const QString & menuText );
+
+ void showParagraphDialog( int initialPage = -1, double initialTabPos = 0.0 );
+
+ QValueList<KoTextObject *> spellAddTextObject() const;
+
+ bool switchInOtherPage( const QString & text );
+
+ void openThePresentationDurationDialog();
+ QString presentationDurationDataFormatChange( int _time );
+
+ int getZoomEntirePage() const;
+
+ KCommand * applyAutoFormatToCurrentPage( const QPtrList<KoTextObject> & lst);
+ void textStyleSelected( KoParagStyle *_sty );
+
+ /*
+ * create a command which sets the pen according to the flags
+ * for the selected objects on the active and sticky page
+ */
+ KCommand * getPenCmd( const QString &name, KoPen pen, LineEnd lb, LineEnd le, int flags );
+
+ void spellCheckerRemoveHighlight();
+
+ void updateNoteBarText();
+private:
+ void clearSpellChecker(bool cancelSpellCheck = false);
+
+// ********** variables **********
+
+ // document
+ KPrDocument *m_pKPresenterDoc;
+
+ // flags
+ /**
+ * Set to true if the presentation sould be restarted.
+ * This only works in automatic presentation and infinite loop mode.
+ */
+ bool m_autoPresRestart;
+
+ /**
+ * Set to true if the presentation sould be stoped.
+ * This only works in automatic presentation mode.
+ */
+ bool m_autoPresStop;
+ bool m_screenSaverWasEnabled;
+ bool m_dpmsWasEnabled;
+
+ // right button popup menus
+ QPopupMenu *rb_lbegin, *rb_lend;
+ QPopupMenu *m_arrangeObjectsPopup;
+ QPtrList<KAction> m_actionList; // for the kodatatools
+ QPtrList<KAction> m_variableActionList;
+
+ // scrollbars
+ QScrollBar *vert, *horz;
+
+ // dialogs
+ AFChoose *afChoose;
+ KPrPropertyEditor *m_propertyEditor;
+ KPrPgConfDia *pgConfDia;
+ KPrRotationDialogImpl *rotateDia;
+ KPrShadowDialogImpl *shadowDia;
+ KPrImageEffectDia *imageEffectDia;
+ KPrPresDurationDia *presDurationDia;
+
+ // default pen and brush
+ KoPen pen;
+ QBrush brush;
+ LineEnd lineBegin;
+ LineEnd lineEnd;
+ QColor gColor1, gColor2;
+ BCType gType;
+ FillType fillType;
+ PieType pieType;
+ bool gUnbalanced;
+ int gXFactor, gYFactor;
+ int pieLength, pieAngle;
+ int rndX, rndY;
+ // for Convex/Concave Polygon
+ bool checkConcavePolygon;
+ int cornersValue;
+ int sharpnessValue;
+ /// used to save mouse pos
+ QPoint m_mousePos;
+
+ // for Picture Object
+ PictureMirrorType mirrorType;
+ int depth;
+ bool swapRGB;
+ bool grayscal;
+ int bright;
+
+ // the page
+ KPrCanvas *m_canvas;
+ KoRuler *h_ruler, *v_ruler;
+ KoTabChooser *tabChooser;
+ // text toolbar values
+ QFont tbFont;
+ int tbAlign;
+ QColor tbColor;
+
+ bool m_bShowGUI;
+ bool presStarted;
+ /**
+ * Indicates if the master page is edited
+ */
+ bool m_editMaster;
+ bool allowWebPres;
+ bool allowMSPres;
+ int currPg; // 0-based
+
+ QSize oldSize;
+
+ int screensaver_pid;
+
+ // Statusbar items
+ QLabel * m_sbPageLabel; // 'Current page number and page count' label
+ QLabel * m_sbObjectLabel; // Info about selected object
+ QLabel *m_sbSavingLabel; // use when saving file
+ KStatusBarLabel* m_sbModifiedLabel;
+ KStatusBarLabel* m_sbUnitLabel;
+ KStatusBarLabel* m_sbZoomLabel;
+
+ // actions
+ KAction *actionEditCut;
+ KAction *actionEditCustomVars;
+ KAction *actionEditCopy;
+ KAction *actionEditPaste;
+ KAction *actionEditDelete;
+ KAction *actionEditSelectAll;
+ KAction *actionEditDeSelectAll;
+ KAction *actionEditCopyPage;
+ KAction *actionEditDuplicatePage;
+ KAction *actionEditDelPage;
+
+ KToggleAction *actionViewShowSideBar;
+ KToggleAction *actionViewShowNoteBar;
+ KToggleAction *actionViewSlideMaster;
+
+ KToggleAction *actionViewShowGuideLine;
+
+ KToggleAction *actionViewFormattingChars;
+ KToggleAction *actionViewShowGrid;
+ KToggleAction *actionViewSnapToGrid;
+
+ KAction *actionInsertPage;
+ KAction *actionInsertPicture;
+
+ KToggleAction *actionToolsMouse;
+ KToggleAction *actionToolsRotate;
+ KToggleAction *actionToolsZoom;
+ KToggleAction *actionToolsLine;
+ KToggleAction *actionToolsRectangle;
+ KToggleAction *actionToolsCircleOrEllipse;
+ KToggleAction *actionToolsPie;
+ KToggleAction *actionToolsText;
+ KToggleAction *actionToolsAutoform;
+ KToggleAction *actionToolsDiagramm;
+ KToggleAction *actionToolsTable;
+ KToggleAction *actionToolsFormula;
+ KToggleAction *actionToolsFreehand;
+ KToggleAction *actionToolsPolyline;
+ KToggleAction *actionToolsQuadricBezierCurve;
+ KToggleAction *actionToolsCubicBezierCurve;
+ KToggleAction *actionToolsConvexOrConcavePolygon;
+ KToggleAction *actionToolsClosedFreehand;
+ KToggleAction *actionToolsClosedPolyline;
+ KToggleAction *actionToolsClosedQuadricBezierCurve;
+ KToggleAction *actionToolsClosedCubicBezierCurve;
+ KoPartSelectAction *actionToolsObject;
+ KActionMenu *actionToolsLinePopup;
+ KActionMenu *actionToolsShapePopup;
+ KActionMenu *actionToolsClosedLinePopup;
+
+ KAction *actionTextFont;
+ KFontSizeAction *actionTextFontSize;
+ KFontAction *actionTextFontFamily;
+ KToggleAction *actionTextAlignLeft;
+ KToggleAction *actionTextAlignCenter;
+ KToggleAction *actionTextAlignRight;
+ KToggleAction *actionTextAlignBlock;
+
+ KActionMenu *actionFormatBullet;
+ KActionMenu *actionFormatNumber;
+
+
+ KAction *actionTextDepthPlus;
+ KAction *actionTextDepthMinus;
+ KAction *actionTextExtentCont2Height;
+ KAction *actionTextExtendObj2Cont;
+ KToggleAction *actionTextBold;
+ KToggleAction *actionTextItalic;
+ KToggleAction *actionTextUnderline;
+ KToggleAction *actionFormatStrikeOut;
+ KAction *actionTextInsertPageNum;
+
+ KAction *actionExtraProperties;
+ KAction *actionExtraRaise;
+ KAction *actionExtraLower;
+
+ KAction *actionExtraBringForward;
+ KAction *actionExtraSendBackward;
+ KActionMenu *actionExtraArrangePopup;
+
+ KAction *actionExtraRotate;
+ KAction *actionExtraShadow;
+ KActionMenu *actionExtraAlignObjsPopup;
+ KAction *actionExtraAlignObjLeft;
+ KAction *actionExtraAlignObjCenterH;
+ KAction *actionExtraAlignObjRight;
+ KAction *actionExtraAlignObjTop;
+ KAction *actionExtraAlignObjCenterV;
+ KAction *actionExtraAlignObjBottom;
+ KAction *actionExtraBackground;
+ KAction *actionExtraLayout;
+ KAction *actionExtraConfigure;
+ KAction *actionExtraWebPres;
+ KAction *actionExtraMSPres;
+ KAction *actionExtraCreateTemplate;
+ KAction *actionExtraLineBegin;
+ KAction *actionExtraLineEnd;
+ KAction *actionExtraGroup;
+ KAction *actionExtraUnGroup;
+ KoLineStyleAction *actionExtraPenStyle;
+ KoLineWidthAction *actionExtraPenWidth;
+
+ KAction *actionScreenConfigPages;
+ KAction *actionScreenAssignEffect;
+ KAction *actionScreenTransEffect;
+ KAction *actionScreenStart;
+ KAction *actionScreenStartFromFirst;
+ KAction *actionScreenStop;
+ KAction *actionScreenPause;
+ KAction *actionScreenFirst;
+ KAction *actionScreenPrev;
+ KAction *actionScreenNext;
+ KAction *actionScreenLast;
+ KAction *actionScreenSkip;
+
+ KAction *actionEditFind;
+ KAction *actionEditFindNext;
+ KAction *actionEditFindPrevious;
+ KAction *actionEditReplace;
+
+ KAction *actionCustomSlideShow;
+
+ KAction *actionColorBar;
+ KAction *actionExtraDefaultTemplate;
+
+ TKSelectColorAction* actionBrushColor;
+ TKSelectColorAction* actionPenColor;
+ TKSelectColorAction* actionTextColor;
+
+
+ KAction *actionResizeTextObject;
+ KAction *actionExtendObjectHeight;
+ KAction *actionObjectProperties;
+
+ KAction *actionRenamePage;
+
+ KAction *actionPicOriginalSize;
+ KAction *actionPic640x480;
+ KAction *actionPic800x600;
+ KAction *actionPic1024x768;
+ KAction *actionPic1280x1024;
+ KAction *actionPic1600x1200;
+ KAction *actionChangePic;
+ KAction *actionExtraSpellCheck;
+ KAction *actionFormatDefault;
+
+ KAction *actionImageEffect;
+
+ KAction *actionInsertComment;
+ KAction *actionEditComment;
+ KAction *actionRemoveComment;
+ KAction *actionCopyTextOfComment;
+
+ KAction *actionImportStyle;
+
+ DCOPObject *dcop;
+
+ QToolButton *pgNext, *pgPrev;
+ KPrSideBar *sidebar;
+ KPrNoteBar *notebar;
+ QSplitter *splitter;
+ PageBase *pageBase;
+
+ KToggleAction *actionFormatSuper;
+ KToggleAction *actionFormatSub;
+
+ KToggleAction *m_actionExtraHeader;
+ KToggleAction *m_actionExtraFooter;
+
+ KAction* actionInsertSpecialChar;
+ KAction *actionInsertLink;
+
+ KAction * actionChangeLink;
+ KAction *actionCopyLink;
+ KAction *actionRemoveLink;
+
+ KAction *actionAddLinkToBookmak;
+ KAction *actionFormatParag;
+ KAction *actionOpenLink;
+ KAction *actionIncreaseFontSize;
+ KAction *actionDecreaseFontSize;
+ KAction *actionChangeCase;
+ KAction *actionRefreshAllVariable;
+
+ KSelectAction *actionViewZoom;
+
+ KSelectAction *actionFormatStyle;
+
+ KToggleAction *actionAllowAutoFormat;
+
+ KToggleAction *actionDisplayObjectFromMasterPage;
+
+ KToggleAction *actionDisplayBackgroundPage;
+
+ KAction *actionFormatStylist;
+
+ KAction *actionAddGuideLine;
+
+ KAction *actionConfigureCompletion;
+
+ KAction *actionZoomMinus;
+ KAction *actionZoomPageWidth;
+ KAction *actionZoomEntirePage;
+ KAction *actionZoomPlus;
+ KAction *actionZoomSelectedObject;
+ KAction *actionZoomPageHeight;
+ KAction *actionZoomAllObject;
+
+ KAction *actionFlipHorizontal;
+ KAction *actionFlipVertical;
+ KAction *actionCloseObject;
+
+ KAction *actionDuplicateObj;
+ KAction *actionApplyAutoFormat;
+
+ KAction *actionCreateStyleFromSelection;
+
+ KAction *actionSavePicture;
+
+ KAction *actionSaveBackgroundPicture;
+
+
+ KAction *actionInsertFile;
+
+ KAction *actionSpellIgnoreAll;
+
+ KToggleAction *actionAlignVerticalTop;
+ KToggleAction *actionAlignVerticalBottom;
+ KToggleAction *actionAlignVerticalCenter;
+
+ KToggleAction *actionAllowBgSpellCheck;
+ KAction *actionEditCustomVarsEdit;
+ KActionMenu *actionFormatStyleMenu;
+ KToggleAction *actionInsertDirectCursor;
+
+ KAction *actionAddWordToPersonalDictionary;
+
+ /// timer for automatic presentation mode
+ QTimer m_autoPresTimer;
+ /// time for messuring the elapsed time of the timer
+ QTime m_autoPresTime;
+ /// the elapsed time if the timer gets stopped in milliseconds
+ int m_autoPresElapsedTime;
+ /// the value of m_autoPresTimer in milliseconds
+ int m_autoPresTimerValue;
+ /// true if the timer is connected to doAutomaticScreenPres
+ bool m_autoPresTimerConnected;
+
+ /// timer for duration of a page
+ QTime m_duration;
+ /// list for saving the duration of the pages
+ QValueList<int> m_presentationDurationList;
+
+ KoCharSelectDia *m_specialCharDlg;
+
+ // store the currently selected line-tool
+ enum CurrentLineTool {
+ LtLine = 1,
+ LtFreehand = 2,
+ LtPolyline = 4,
+ LtQuadricBezier = 8,
+ LtCubicBezier = 16
+ };
+
+ CurrentLineTool m_currentLineTool;
+
+ // store the currently selected shape-tool
+ enum CurrentShapeTool {
+ StRectangle = 1,
+ StCircle = 2,
+ StPie = 4,
+ StPolygon = 8
+ };
+
+ CurrentShapeTool m_currentShapeTool;
+
+ // store the currently selected closed-line-tool
+ enum CurrentClosedLineTool {
+ CltFreehand = 1,
+ CltPolyline = 2,
+ CltQuadricBezier = 4,
+ CltCubicBezier = 8
+ };
+
+ CurrentClosedLineTool m_currentClosedLineTool;
+
+ // Spell-checking
+ struct {
+ KoSpell *kospell;
+ KMacroCommand * macroCmdSpellCheck;
+ QStringList replaceAll;
+ KoTextIterator * textIterator;
+ KSpell2::Dialog *dlg;
+ } m_spell;
+
+ KSpell2::Broker::Ptr m_broker;
+
+
+
+ KActionMenu *actionInsertVariable;
+ KActionMenu *actionInsertCustom;
+
+ struct VariableDef {
+ int type;
+ int subtype;
+ };
+ typedef QMap<KAction *, VariableDef> VariableDefMap;
+ VariableDefMap m_variableDefMap;
+
+ KoSearchContext *m_searchEntry, *m_replaceEntry;
+ KPrFindReplace *m_findReplace;
+ KoFontDia *m_fontDlg;
+ KoParagDia *m_paragDlg;
+ int m_switchPage;
+ int m_initSwitchPage;
+
+ int xOffsetSaved, yOffsetSaved; // saved when going fullscreen
+ bool m_bDisplayFieldCode; //save state before to go to presentation mode
+};
+
+#endif
diff --git a/kpresenter/KPrViewIface.cpp b/kpresenter/KPrViewIface.cpp
new file mode 100644
index 000000000..8186e284b
--- /dev/null
+++ b/kpresenter/KPrViewIface.cpp
@@ -0,0 +1,719 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrViewIface.h"
+
+#include "KPrView.h"
+#include "KPrCanvas.h"
+#include "KPrPage.h"
+#include "KPrDocument.h"
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+KPrViewIface::KPrViewIface( KPrView *view_ )
+ : KoViewIface( view_ )
+{
+ view = view_;
+}
+
+void KPrViewIface::editCut()
+{
+ view->editCut();
+}
+
+void KPrViewIface::editCopy()
+{
+ view->editCopy();
+}
+
+void KPrViewIface::editPaste()
+{
+ view->editPaste();
+}
+
+void KPrViewIface::editDelete()
+{
+ view->editDelete();
+}
+
+void KPrViewIface::editSelectAll()
+{
+ view->editSelectAll();
+}
+
+void KPrViewIface::editDuplicatePage()
+{
+ view->editDuplicatePage();
+}
+
+void KPrViewIface::editDelPage()
+{
+ view->editDelPage();
+}
+
+void KPrViewIface::editFind()
+{
+ view->editFind();
+}
+
+void KPrViewIface::editReplace()
+{
+ view->editReplace();
+}
+
+void KPrViewIface::newView()
+{
+ view->newView();
+}
+
+void KPrViewIface::insertPage()
+{
+ view->insertPage();
+}
+
+void KPrViewIface::insertPicture()
+{
+ view->insertPicture();
+}
+
+void KPrViewIface::toolsMouse()
+{
+ view->toolsMouse();
+}
+
+void KPrViewIface::toolsLine()
+{
+ view->toolsLine();
+}
+
+void KPrViewIface::toolsRectangle()
+{
+ view->toolsRectangle();
+}
+
+void KPrViewIface::toolsCircleOrEllipse()
+{
+ view->toolsCircleOrEllipse();
+}
+
+void KPrViewIface::toolsPie()
+{
+ view->toolsPie();
+}
+
+void KPrViewIface::toolsText()
+{
+ view->toolsText();
+}
+
+void KPrViewIface::toolsAutoform()
+{
+ view->toolsAutoform();
+}
+
+void KPrViewIface::toolsDiagramm()
+{
+ view->toolsDiagramm();
+}
+
+void KPrViewIface::toolsTable()
+{
+ view->toolsTable();
+}
+
+void KPrViewIface::toolsFormula()
+{
+ view->toolsFormula();
+}
+
+void KPrViewIface::toolsObject()
+{
+ view->toolsObject();
+}
+
+void KPrViewIface::toolsFreehand()
+{
+ view->toolsFreehand();
+}
+
+void KPrViewIface::toolsPolyline()
+{
+ view->toolsPolyline();
+}
+
+void KPrViewIface::toolsQuadricBezierCurve()
+{
+ view->toolsQuadricBezierCurve();
+}
+
+void KPrViewIface::toolsCubicBezierCurve()
+{
+ view->toolsCubicBezierCurve();
+}
+
+void KPrViewIface::toolsConvexOrConcavePolygon()
+{
+ view->toolsConvexOrConcavePolygon();
+}
+
+void KPrViewIface::extraPenBrush()
+{
+ view->extraProperties();
+}
+
+void KPrViewIface::extraProperties()
+{
+ view->extraProperties();
+}
+
+void KPrViewIface::extraRaise()
+{
+ view->extraRaise();
+}
+
+void KPrViewIface::extraLower()
+{
+ view->extraLower();
+}
+
+void KPrViewIface::extraRotate()
+{
+ view->extraRotate();
+}
+
+void KPrViewIface::extraShadow()
+{
+ view->extraShadow();
+}
+
+void KPrViewIface::extraBackground()
+{
+ view->extraBackground();
+}
+
+void KPrViewIface::extraLayout()
+{
+ view->extraLayout();
+}
+
+void KPrViewIface::extraConfigure()
+{
+ view->extraConfigure();
+}
+
+void KPrViewIface::extraLineBegin()
+{
+ view->extraLineBegin();
+}
+
+void KPrViewIface::extraLineEnd()
+{
+ view->extraLineEnd();
+}
+
+void KPrViewIface::extraWebPres()
+{
+ view->extraWebPres();
+}
+
+void KPrViewIface::extraMSPres()
+{
+ view->extraMSPres();
+}
+
+void KPrViewIface::extraAlignObjLeft()
+{
+ view->extraAlignObjLeft();
+}
+
+void KPrViewIface::extraAlignObjCenterH()
+{
+ view->extraAlignObjCenterH();
+}
+
+void KPrViewIface::extraAlignObjRight()
+{
+ view->extraAlignObjRight();
+}
+
+void KPrViewIface::extraAlignObjTop()
+{
+ view->extraAlignObjTop();
+}
+
+void KPrViewIface::extraAlignObjCenterV()
+{
+ view->extraAlignObjCenterV();
+}
+
+void KPrViewIface::extraAlignObjBottom()
+{
+ view->extraAlignObjBottom();
+}
+
+void KPrViewIface::extraGroup()
+{
+ view->extraGroup();
+}
+
+void KPrViewIface::extraUnGroup()
+{
+ view->extraUnGroup();
+}
+
+void KPrViewIface::extraPenStyle()
+{
+// FIXME
+// view->extraPenStyle();
+}
+
+void KPrViewIface::extraPenWidth()
+{
+// FIXME
+// view->extraPenWidth();
+}
+
+void KPrViewIface::screenTransEffect()
+{
+ view->screenTransEffect();
+}
+
+void KPrViewIface::screenConfigPages()
+{
+ view->screenConfigPages();
+}
+
+void KPrViewIface::screenAssignEffect()
+{
+ view->screenAssignEffect();
+}
+
+void KPrViewIface::screenStart()
+{
+ view->screenStart();
+}
+
+void KPrViewIface::screenStartFromFirst()
+{
+ view->screenStartFromFirst();
+}
+
+void KPrViewIface::screenStop()
+{
+ view->screenStop();
+}
+
+void KPrViewIface::screenPause()
+{
+ view->screenPause();
+}
+
+void KPrViewIface::screenFirst()
+{
+ view->screenFirst();
+}
+
+void KPrViewIface::screenPrev()
+{
+ view->screenPrev();
+}
+
+void KPrViewIface::screenNext()
+{
+ view->screenNext();
+}
+
+void KPrViewIface::screenLast()
+{
+ view->screenLast();
+}
+
+void KPrViewIface::screenSkip()
+{
+ view->screenSkip();
+}
+
+void KPrViewIface::sizeSelected( int size )
+{
+ view->sizeSelected( size );
+}
+
+void KPrViewIface::fontSelected( const QString &fontFamily )
+{
+ view->fontSelected( fontFamily );
+}
+
+void KPrViewIface::textBold()
+{
+ view->textBold();
+}
+
+void KPrViewIface::textItalic()
+{
+ view->textItalic();
+}
+
+void KPrViewIface::textUnderline()
+{
+ view->textUnderline();
+}
+
+void KPrViewIface::textColor()
+{
+ view->textColor();
+}
+
+void KPrViewIface::textAlignLeft()
+{
+ view->textAlignLeft();
+}
+
+void KPrViewIface::textAlignCenter()
+{
+ view->textAlignCenter();
+}
+
+void KPrViewIface::textAlignRight()
+{
+ view->textAlignRight();
+}
+
+void KPrViewIface::mtextFont()
+{
+ view->mtextFont();
+}
+
+void KPrViewIface::textDepthPlus()
+{
+ view->textDepthPlus();
+}
+
+void KPrViewIface::textDepthMinus()
+{
+ view->textDepthMinus();
+}
+
+void KPrViewIface::textContentsToHeight()
+{
+ view->textContentsToHeight();
+}
+
+void KPrViewIface::textObjectToContents()
+{
+ view->textObjectToContents();
+}
+
+void KPrViewIface::penChosen()
+{
+ view->penChosen();
+}
+
+void KPrViewIface::brushChosen()
+{
+ view->brushChosen();
+}
+
+int KPrViewIface::getCurrentPresPage() const
+{
+ return view->getCurrentPresPage();
+}
+
+int KPrViewIface::getCurrentPresStep() const
+{
+ return view->getCurrentPresStep();
+}
+
+int KPrViewIface::getPresStepsOfPage() const
+{
+ return view->getPresStepsOfPage();
+}
+
+int KPrViewIface::getNumPresPages() const
+{
+ return view->getNumPresPages();
+}
+
+bool KPrViewIface::gotoPresPage( int pg ) const
+{
+ return view->gotoPresPage( pg );
+}
+
+int KPrViewIface::getCurrentPageNum() const
+{
+ return view->getCurrPgNum();
+}
+
+void KPrViewIface::insertSpecialChar()
+{
+ view->insertSpecialChar();
+}
+
+void KPrViewIface::insertLink()
+{
+ view->insertLink();
+}
+
+void KPrViewIface::editCustomVars()
+{
+ view->editCustomVars();
+}
+
+void KPrViewIface::insertVariable()
+{
+ view->insertVariable();
+}
+
+void KPrViewIface::insertCustomVariable()
+{
+ view->insertCustomVariable();
+}
+
+void KPrViewIface::insertNewCustomVariable()
+{
+ view->insertNewCustomVariable();
+}
+
+void KPrViewIface::changeCaseOfText()
+{
+ view->changeCaseOfText();
+}
+
+void KPrViewIface::viewShowSideBar()
+{
+ view->viewShowSideBar();
+}
+
+void KPrViewIface::viewShowNoteBar()
+{
+ view->viewShowNoteBar();
+}
+
+void KPrViewIface::viewSlideMaster()
+{
+ view->viewSlideMaster();
+}
+
+
+void KPrViewIface::formatParagraph()
+{
+ view->formatParagraph();
+}
+
+void KPrViewIface::extraAutoFormat()
+{
+ view->extraAutoFormat();
+}
+
+void KPrViewIface::refreshAllVariable()
+{
+ view->extraAutoFormat();
+}
+
+bool KPrViewIface::skipToPage( int _num )
+{
+ //don't try to skip to a not exist page
+ if(_num>(int)view->kPresenterDoc()->getPageNums()-1)
+ return false;
+ view->skipToPage(_num);
+ return true;
+}
+
+void KPrViewIface::toolsRotate()
+{
+ view->toolsRotate();
+}
+
+void KPrViewIface::toolsZoom()
+{
+ view->toolsZoom();
+}
+
+void KPrViewIface::insertComment()
+{
+ view->insertComment();
+}
+
+void KPrViewIface::configureCompletion()
+{
+ view->configureCompletion();
+}
+
+void KPrViewIface::duplicateObj()
+{
+ view->duplicateObj();
+}
+
+void KPrViewIface::extraSendBackward()
+{
+ view->extraSendBackward();
+}
+
+void KPrViewIface::extraBringForward()
+{
+ view->extraBringForward();
+}
+
+void KPrViewIface::applyAutoFormat()
+{
+ view->applyAutoFormat();
+}
+
+void KPrViewIface::editDeSelectAll()
+{
+ view->editDeSelectAll();
+}
+
+void KPrViewIface::createStyleFromSelection()
+{
+ view->createStyleFromSelection();
+}
+
+void KPrViewIface::closeObject()
+{
+ view->closeObject();
+}
+
+void KPrViewIface::savePicture()
+{
+ view->savePicture();
+}
+
+void KPrViewIface::viewFooter()
+{
+ view->viewFooter();
+}
+
+void KPrViewIface::viewHeader()
+{
+ view->viewHeader();
+}
+
+
+// note: _nPage is the user visible 1-based page number
+// if 0 < _verbose exportPage() returns the title and notes of the page
+// if not verbose it returns an empty string
+QStringList KPrViewIface::exportPage( int _nPage,
+ int _nWidth,
+ int _nHeight,
+ const QString & _fileName,
+ const QString & _format,
+ int _quality,
+ int _verbose )const
+{
+ QStringList res;
+ // we translate the user visible 1-based page number
+ // to KPresenter's internal 0-based page number
+ const int nPage = _nPage-1;
+ if( 0 <= nPage &&
+ view &&
+ view->kPresenterDoc() &&
+ nPage < (int)view->kPresenterDoc()->getPageNums() ){
+ KPrCanvas* canvas = view->getCanvas();
+ if( canvas ){
+ if( canvas->exportPage( nPage,
+ QMAX(8, _nWidth),
+ QMAX(8, _nHeight),
+ KURL::fromPathOrURL( _fileName ),
+ _format.isEmpty() ? "PNG" : _format.latin1(),
+ QMAX(-1, QMIN(100, _quality))) ){
+ if( 0 < _verbose ){
+ KPrPage* page = view->kPresenterDoc()->pageList().at( nPage );
+ if( page ){
+ // Note: Do not i18n the following strings, they are prepared
+ // to be written to an IndeView page information file,
+ // see http://www.indeview.org for details.
+ // Note: We use the 1-based page number as fallback page title.
+ res << QString("Name=%1")
+ .arg( page->pageTitle( QString("Page%1").arg(_nPage) ) );
+ res << QString("Notes=%1")
+ .arg( page->noteText() );
+ }
+ }
+ }
+ }
+ }
+ return res;
+}
+
+void KPrViewIface::insertFile()
+{
+ view->insertFile();
+}
+
+void KPrViewIface::importStyle()
+{
+ view->importStyle();
+}
+
+void KPrViewIface::backgroundPicture()
+{
+ view->backgroundPicture();
+}
+
+void KPrViewIface::insertFile( const QString & file )
+{
+ view->insertFile( file );
+}
+
+void KPrViewIface::addWordToDictionary()
+{
+ view->addWordToDictionary();
+}
+
+void KPrViewIface::customSlideShow()
+{
+ view->customSlideShow();
+}
+
+void KPrViewIface::insertLineBreak()
+{
+ view->slotLineBreak();
+}
+
+void KPrViewIface::increaseNumberingLevel()
+{
+ view->slotIncreaseNumberingLevel();
+}
+
+void KPrViewIface::decreaseNumberingLevel()
+{
+ view->slotDecreaseNumberingLevel();
+}
+
+void KPrViewIface::increaseFontSize()
+{
+ view->increaseFontSize();
+}
+
+void KPrViewIface::decreaseFontSize()
+{
+ view->decreaseFontSize();
+}
+
+void KPrViewIface::flipHorizontal()
+{
+ view->flipHorizontal();
+}
+
+void KPrViewIface::flipVertical()
+{
+ view->flipVertical();
+}
diff --git a/kpresenter/KPrViewIface.h b/kpresenter/KPrViewIface.h
new file mode 100644
index 000000000..b95610239
--- /dev/null
+++ b/kpresenter/KPrViewIface.h
@@ -0,0 +1,238 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef KPRESENTER_VIEW_IFACE_H
+#define KPRESENTER_VIEW_IFACE_H
+
+#include <KoViewIface.h>
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+class KPrView;
+
+class KPrViewIface : public KoViewIface
+{
+ K_DCOP
+public:
+ KPrViewIface( KPrView *view_ );
+
+k_dcop:
+ // edit menu
+ virtual void editCut();
+ virtual void editCopy();
+ virtual void editPaste();
+ virtual void editDelete();
+ virtual void editSelectAll();
+ virtual void editDuplicatePage();
+ virtual void editDelPage();
+ virtual void editFind();
+ virtual void editReplace();
+ virtual void editDeSelectAll();
+ // view menu
+ virtual void newView();
+ virtual void viewShowSideBar();
+ virtual void viewShowNoteBar();
+ virtual void viewSlideMaster();
+ virtual void viewFooter();
+ virtual void viewHeader();
+
+ // insert menu
+ virtual void insertPage();
+ virtual void insertPicture();
+ virtual void insertSpecialChar();
+ virtual void insertLink();
+ virtual void insertComment();
+
+
+ // tools menu
+ virtual void toolsMouse();
+ virtual void toolsLine();
+ virtual void toolsRectangle();
+ virtual void toolsCircleOrEllipse();
+ virtual void toolsPie();
+ virtual void toolsText();
+ virtual void toolsAutoform();
+ virtual void toolsDiagramm();
+ virtual void toolsTable();
+ virtual void toolsFormula();
+ virtual void toolsObject();
+ virtual void toolsFreehand();
+ virtual void toolsPolyline();
+ virtual void toolsQuadricBezierCurve();
+ virtual void toolsCubicBezierCurve();
+ virtual void toolsConvexOrConcavePolygon();
+ virtual void toolsRotate();
+ virtual void toolsZoom();
+
+
+ // extra menu
+ virtual void extraProperties();
+ virtual void extraPenBrush(); /** * @deprecated */
+ virtual void extraRaise();
+ virtual void extraLower();
+ virtual void extraRotate();
+ virtual void extraShadow();
+ virtual void extraBackground();
+ virtual void extraLayout();
+ virtual void extraConfigure();
+ virtual void extraLineBegin();
+ virtual void extraLineEnd();
+ virtual void extraWebPres();
+ virtual void extraMSPres();
+ virtual void extraGroup();
+ virtual void extraUnGroup();
+ virtual void extraPenStyle();
+ virtual void extraPenWidth();
+
+ virtual void extraAlignObjLeft();
+ virtual void extraAlignObjCenterH();
+ virtual void extraAlignObjRight();
+ virtual void extraAlignObjTop();
+ virtual void extraAlignObjCenterV();
+ virtual void extraAlignObjBottom();
+
+ virtual void extraAutoFormat();
+
+ virtual void extraSendBackward();
+ virtual void extraBringForward();
+
+ // screen menu
+ virtual void screenConfigPages();
+ virtual void screenAssignEffect();
+ virtual void screenStart();
+ virtual void screenStartFromFirst();
+ virtual void screenStop();
+ virtual void screenPause();
+ virtual void screenFirst();
+ virtual void screenPrev();
+ virtual void screenNext();
+ virtual void screenLast();
+ virtual void screenSkip();
+ virtual void screenTransEffect();
+
+
+ // text toolbar
+ virtual void sizeSelected( int size );
+ virtual void fontSelected( const QString &fontFamily );
+ virtual void textBold();
+ virtual void textItalic();
+ virtual void textUnderline();
+ virtual void textColor();
+ virtual void textAlignLeft();
+ virtual void textAlignCenter();
+ virtual void textAlignRight();
+ virtual void mtextFont();
+ virtual void textDepthPlus();
+ virtual void textDepthMinus();
+ virtual void textContentsToHeight();
+ virtual void textObjectToContents();
+ virtual void formatParagraph();
+
+ // color bar
+ virtual void penChosen();
+ virtual void brushChosen();
+
+ // in presentation mode
+ virtual int getCurrentPresPage() const;
+ virtual int getCurrentPresStep() const;
+ virtual int getPresStepsOfPage() const;
+ virtual int getNumPresPages() const;
+ virtual bool gotoPresPage( int pg ) const;
+
+ // in edit mode
+ virtual int getCurrentPageNum() const;
+
+ // in both modes
+ virtual void insertCustomVariable();
+ virtual void insertNewCustomVariable();
+ virtual void insertVariable();
+
+ virtual void editCustomVars ();
+ virtual void changeCaseOfText();
+
+ virtual void refreshAllVariable();
+
+ //return false when we can't "skipToPage" (num > nbpage )
+ virtual bool skipToPage( int _num );
+
+ virtual void configureCompletion();
+ virtual void duplicateObj();
+ virtual void applyAutoFormat();
+ virtual void createStyleFromSelection();
+
+ virtual void closeObject();
+
+ void savePicture();
+
+ /**
+ \brief Save page to bitmap file.
+
+ Export a page of the currently open presentation to disk
+ using a bitmap format like e.g. PNG.
+ This method uses a QPixmap::save() call.
+
+ \param _nPage the user visible <b>1-based</b> page number
+ \param _nWidth the desired image width in px
+ \param _nHeight the desired image height in px
+ \param _fileName the name of the image file to be created (see QPixmap::save())
+ \param _format the format of the image file (see QPixmap::save())
+ \param _quality the quality of the image (see QPixmap::save())
+ \param _verbose the verbosity of the method's return value:
+ if 0 < _verbose exportPage() returns the title and the notes of the page
+ if not _verbose it returns an empty string
+
+ \returns Page title and page notes if the file was written successfully.
+
+ \sa KPrCanvas::exportPage
+ */
+ QStringList exportPage( int _nPage,
+ int _nWidth,
+ int _nHeight,
+ const QString & _fileName,
+ const QString & _format,
+ int _quality,
+ int _verbose )const;
+ void insertFile();
+ void importStyle();
+ void backgroundPicture();
+ void insertFile( const QString & file );
+ void addWordToDictionary();
+
+ void customSlideShow();
+
+ void insertLineBreak();
+ void increaseNumberingLevel();
+ void decreaseNumberingLevel();
+
+ void increaseFontSize();
+ void decreaseFontSize();
+
+ void flipHorizontal();
+ void flipVertical();
+
+
+
+private:
+ KPrView *view;
+
+};
+
+#endif
diff --git a/kpresenter/KPrWebPresentation.cpp b/kpresenter/KPrWebPresentation.cpp
new file mode 100644
index 000000000..627013f97
--- /dev/null
+++ b/kpresenter/KPrWebPresentation.cpp
@@ -0,0 +1,1305 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+ Copyright 2001, 2002 Nicolas GOUTTE <goutte@kde.org>
+ Copyright 2002 Ariya Hidayat <ariya@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrWebPresentation.h"
+
+#include "KPrView.h"
+#include "KPrDocument.h"
+#include "KPrCanvas.h"
+#include "KPrPage.h"
+
+#include <kstandarddirs.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <ktempfile.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qvbox.h>
+#include <qhbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qfileinfo.h>
+#include <qframe.h>
+#include <qfont.h>
+#include <qpixmap.h>
+#include <qdatetime.h>
+#include <qdir.h>
+#include <qheader.h>
+#include <qwmatrix.h>
+#include <qtextcodec.h>
+#include <qregexp.h>
+#include <qimage.h>
+#include <qlayout.h>
+#include <qwhatsthis.h>
+#include <qcheckbox.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kcolorbutton.h>
+#include <kfiledialog.h>
+#include <kmessagebox.h>
+#include <kbuttonbox.h>
+#include <ksimpleconfig.h>
+#include <kapplication.h>
+#include <kprogress.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <kcharsets.h>
+#include <kurlrequester.h>
+#include <klineedit.h>
+#include <klistview.h>
+#include <knuminput.h>
+#include <kcombobox.h>
+#include <kurl.h>
+#include <kio/netaccess.h>
+#include <kdialog.h>
+
+#include "KoDocumentInfo.h"
+
+
+// Comes from koffice/filters/libexport/KWEFUtils.cc
+static QString EscapeSgmlText(const QTextCodec* codec, const QString& strIn,
+ const bool quot = false , const bool apos = false )
+{
+ QString strReturn;
+ QChar ch;
+
+ for (uint i=0; i<strIn.length(); i++)
+ {
+ ch=strIn[i];
+ switch (ch.unicode())
+ {
+ case 38: // &
+ {
+ strReturn+="&amp;";
+ break;
+ }
+ case 60: // <
+ {
+ strReturn+="&lt;";
+ break;
+ }
+ case 62: // >
+ {
+ strReturn+="&gt;";
+ break;
+ }
+ case 34: // "
+ {
+ if (quot)
+ strReturn+="&quot;";
+ else
+ strReturn+=ch;
+ break;
+ }
+ case 39: // '
+ {
+ // NOTE: HTML does not define &apos; by default (only XML/XHTML does)
+ if (apos)
+ strReturn+="&apos;";
+ else
+ strReturn+=ch;
+ break;
+ }
+ default:
+ {
+ // verify that the character ch can be expressed in the
+ // encoding in which we will write the HTML file.
+ if (codec)
+ {
+ if (!codec->canEncode(ch))
+ {
+ strReturn+=QString("&#%1;").arg(ch.unicode());
+ break;
+ }
+ }
+ strReturn+=ch;
+ break;
+ }
+ }
+ }
+
+ return strReturn;
+}
+
+// Escape only if the encoding do not support the character
+// Special SGML characters like < > & are supposed to be already escaped.
+static QString EscapeEncodingOnly(const QTextCodec* codec, const QString& strIn)
+{
+ QString strReturn;
+ QChar ch;
+
+ for (uint i=0; i<strIn.length(); i++)
+ {
+ ch=strIn[i];
+ if (codec)
+ {
+ if (!codec->canEncode(ch))
+ {
+ strReturn+=QString("&#%1;").arg(ch.unicode());
+ continue;
+ }
+ }
+ strReturn+=ch;
+ }
+ return strReturn;
+}
+
+KPrWebPresentation::KPrWebPresentation( KPrDocument *_doc, KPrView *_view )
+ : config( QString::null ), xml( false )
+{
+ doc = _doc;
+ view = _view;
+ init();
+}
+
+KPrWebPresentation::KPrWebPresentation( const QString &_config, KPrDocument *_doc, KPrView *_view )
+ : config( _config ), xml( false ), m_bWriteHeader( true ), m_bWriteFooter( true ), m_bLoopSlides( false )
+{
+ doc = _doc;
+ view = _view;
+ init();
+ loadConfig();
+}
+
+KPrWebPresentation::KPrWebPresentation( const KPrWebPresentation &webPres )
+ : config( webPres.config ), author( webPres.author ), title( webPres.title ), email( webPres.email ),
+ slideInfos( webPres.slideInfos ), backColor( webPres.backColor ), titleColor( webPres.titleColor ),
+ textColor( webPres.textColor ), path( webPres.path ), xml( webPres.xml),
+ m_bWriteHeader( webPres.m_bWriteHeader ),
+ m_bWriteFooter( webPres.m_bWriteFooter ), m_bLoopSlides( webPres.m_bLoopSlides ),
+ timeBetweenSlides ( webPres.timeBetweenSlides ), zoom( webPres.zoom ), m_encoding( webPres.m_encoding )
+{
+ doc = webPres.doc;
+ view = webPres.view;
+}
+
+void KPrWebPresentation::loadConfig()
+{
+ if ( config.isEmpty() )
+ return;
+
+ KSimpleConfig cfg( config );
+ cfg.setGroup( "General" );
+
+ author = cfg.readEntry( "Author", author );
+ title = cfg.readEntry( "Title", title );
+ email = cfg.readEntry( "EMail", email );
+ unsigned int num = cfg.readNumEntry( "Slides", slideInfos.count() );
+ //kdDebug(33001) << "KPrWebPresentation::loadConfig num=" << num << endl;
+
+ if ( num <= slideInfos.count() ) {
+ for ( unsigned int i = 0; i < num; i++ )
+ {
+ QString key = QString::fromLatin1( "SlideTitle%1" ).arg( i );
+ if ( cfg.hasKey( key ) )
+ {
+ // We'll assume that the selected pages haven't changed... Hmm.
+ slideInfos[ i ].slideTitle = cfg.readEntry( key );
+ kdDebug(33001) << "KPrWebPresentation::loadConfig key=" << key << " data=" << slideInfos[i].slideTitle << endl;
+ } else kdDebug(33001) << " key not found " << key << endl;
+ }
+ }
+
+ backColor = cfg.readColorEntry( "BackColor", &backColor );
+ titleColor = cfg.readColorEntry( "TitleColor", &titleColor );
+ textColor = cfg.readColorEntry( "TextColor", &textColor );
+ path = cfg.readPathEntry( "Path", path );
+ xml = cfg.readBoolEntry( "XML", xml );
+ m_bWriteHeader = cfg.readBoolEntry( "WriteHeader", m_bWriteHeader );
+ m_bWriteFooter = cfg.readBoolEntry( "WriteFooter", m_bWriteFooter );
+ m_bLoopSlides = cfg.readBoolEntry( "LoopSlides", m_bLoopSlides );
+ zoom = cfg.readNumEntry( "Zoom", zoom );
+ timeBetweenSlides = cfg.readNumEntry("TimeBetweenSlides", timeBetweenSlides );
+ m_encoding = cfg.readEntry( "Encoding", m_encoding );
+}
+
+void KPrWebPresentation::saveConfig()
+{
+ KSimpleConfig cfg( config );
+ cfg.setGroup( "General" );
+
+ cfg.writeEntry( "Author", author );
+ cfg.writeEntry( "Title", title );
+ cfg.writeEntry( "EMail", email );
+ cfg.writeEntry( "Slides", slideInfos.count() );
+
+ for ( unsigned int i = 0; i < slideInfos.count(); i++ )
+ cfg.writeEntry( QString::fromLatin1( "SlideTitle%1" ).arg( i ), slideInfos[ i ].slideTitle );
+
+ cfg.writeEntry( "BackColor", backColor );
+ cfg.writeEntry( "TitleColor", titleColor );
+ cfg.writeEntry( "TextColor", textColor );
+#if KDE_IS_VERSION(3,1,3)
+ cfg.writePathEntry( "Path", path );
+#else
+ cfg.writeEntry( "Path", path );
+#endif
+ cfg.writeEntry( "XML", xml );
+ cfg.writeEntry( "WriteHeader", m_bWriteHeader );
+ cfg.writeEntry( "WriteFooter", m_bWriteFooter );
+ cfg.writeEntry( "LoopSlides", m_bLoopSlides );
+ cfg.writeEntry( "Zoom", zoom );
+ cfg.writeEntry( "TimeBetweenSlides", timeBetweenSlides );
+ cfg.writeEntry( "Encoding", m_encoding );
+}
+
+void KPrWebPresentation::initCreation( KProgress *progressBar )
+{
+ QString cmd;
+ int p;
+ KURL str( path + "/html" );
+ KIO::NetAccess::mkdir( str,( QWidget* )0L );
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ str = path + "/pics";
+ KIO::NetAccess::mkdir( str,( QWidget* )0L );
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+
+ const char *pics[] = { "home", "first", "next", "prev", "last", 0 };
+
+ KURL srcurl, desturl;
+
+ for ( uint index = 0; pics[ index ]; index ++ )
+ {
+ QString filename = pics[ index ];
+ filename += ".png";
+ srcurl.setPath( locate( "slideshow", filename, KPrFactory::global() ) );
+ desturl = path;
+ desturl.addPath( "/pics/" + filename );
+ KIO::NetAccess::file_copy( srcurl, desturl, -1, true /*overwrite*/);
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+ }
+}
+
+void KPrWebPresentation::createSlidesPictures( KProgress *progressBar )
+{
+ if ( slideInfos.isEmpty() )
+ return;
+ QPixmap pix( 10, 10 );
+ QString filename;
+ int p;
+ for ( unsigned int i = 0; i < slideInfos.count(); i++ ) {
+ int pgNum = slideInfos[i].pageNumber;
+ view->getCanvas()->drawPageInPix( pix, pgNum, zoom, true /*force real variable value*/ );
+ filename = QString( "%1/pics/slide_%2.png" ).arg( path ).arg( i + 1 );
+
+ KTempFile tmp;
+ pix.save( tmp.name(), "PNG" );
+
+ KIO::NetAccess::file_move( tmp.name(), filename, -1, true /*overwrite*/);
+
+ p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+ }
+}
+
+QString KPrWebPresentation::escapeHtmlText( QTextCodec *codec, const QString& strText ) const
+{
+ // Escape quotes (needed in attributes)
+ // Do not escape apostrophs (only allowed in XHTML!)
+ return EscapeSgmlText( codec, strText, true, false );
+}
+
+void KPrWebPresentation::writeStartOfHeader(QTextStream& streamOut, QTextCodec *codec, const QString& subtitle, const QString& next)
+{
+ QString mimeName ( codec->mimeName() );
+ if ( isXML() )
+ { //Write out the XML declaration
+ streamOut << "<?xml version=\"1.0\" encoding=\""
+ << mimeName << "\"?>\n";
+ }
+ // write <!DOCTYPE
+ streamOut << "<!DOCTYPE ";
+ if ( isXML() )
+ {
+ streamOut << "html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"";
+ streamOut << " \"DTD/xhtml1-transitional.dtd\">\n";
+ }
+ else
+ {
+ streamOut << "HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"";
+ streamOut << " \"http://www.w3.org/TR/html4/loose.dtd\">\n";
+ }
+ streamOut << "<html";
+ if ( isXML() )
+ {
+ // XHTML has an extra attribute defining its namespace (in the <html> opening tag)
+ streamOut << " xmlns=\"http://www.w3.org/1999/xhtml\"";
+ }
+ streamOut << ">\n" << "<head>\n";
+
+ // Declare what charset we are using
+ streamOut << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=";
+ streamOut << mimeName << '"' << ( isXML() ?" /":"") << ">\n" ;
+
+ // Tell who we are (with the CVS revision number) in case we have a bug in our output!
+ QString strVersion("$Revision: 508787 $");
+ // Eliminate the dollar signs
+ // (We don't want that the version number changes if the HTML file is itself put in a CVS storage.)
+ streamOut << "<meta name=\"Generator\" content=\"KPresenter's Web Presentation "
+ << strVersion.mid(10).replace("$","")
+ << "\""<< ( isXML() ?" /":"") // X(HT)ML closes empty elements, HTML not!
+ << ">\n";
+
+ // Load the next slide after time elapsed
+ if ( (timeBetweenSlides > 0) && ( ! next.isNull() ) )
+ {
+ streamOut << "<meta http-equiv=\"refresh\" content=\""
+ << timeBetweenSlides
+ << ";url=" << next
+ << "\">\n";
+ }
+
+ streamOut << "<title>"<< escapeHtmlText( codec, title ) << " - " << escapeHtmlText( codec, subtitle ) << "</title>\n";
+
+ // ### TODO: transform documentinfo.xml into many <META> elements (at least the author!)
+}
+
+void KPrWebPresentation::createSlidesHTML( KProgress *progressBar )
+{
+ QTextCodec *codec = KGlobal::charsets()->codecForName( m_encoding );
+
+ const QString brtag ( "<br" + QString(isXML()?" /":"") + ">" );
+
+ for ( unsigned int i = 0; i < slideInfos.count(); i++ ) {
+
+ unsigned int pgNum = i + 1; // pgquiles # elpauer . org - I think this is a bug, seems to be an overflow if we have max_unsigned_int slides
+ KTempFile tmp;
+ QString dest= QString( "%1/html/slide_%2.html" ).arg( path ).arg( pgNum );
+ QString next= QString( "slide_%2.html" ).arg( pgNum<slideInfos.count() ? pgNum+1 : (m_bLoopSlides ? 1 : pgNum ) ); // Ugly, but it works
+
+ QFile file( tmp.name() );
+ file.open( IO_WriteOnly );
+ QTextStream streamOut( &file );
+ streamOut.setCodec( codec );
+
+ writeStartOfHeader( streamOut, codec, slideInfos[ i ].slideTitle, next );
+
+ // ### TODO: transform documentinfo.xml into many <META> elements (at least the author!)
+
+ if ( i > 0 ) {
+ streamOut << "<link rel=\"first\" href=\"slide_1.html\"" << ( isXML() ?" /":"") << ">\n";
+ streamOut << "<link rel=\"prev\" href=\"slide_" << pgNum - 1 << ".html\"" << ( isXML() ?" /":"") << ">\n";
+ }
+ if ( i < slideInfos.count() - 1 ) {
+ streamOut << "<link rel=\"next\" href=\"slide_" << pgNum + 1 << ".html\"" << ( isXML() ?" /":"") << ">\n";
+ streamOut << "<link rel=\"last\" href=\"slide_" << slideInfos.count() << ".html\"" << ( isXML() ?" /":"") << ">\n";
+ }
+ streamOut << "<link rel=\"contents\" href=\"../index.html\"" << ( isXML() ?" /":"") << ">\n";
+
+ streamOut << "</head>\n";
+ streamOut << "<body bgcolor=\"" << backColor.name() << "\" text=\"" << textColor.name() << "\">\n";
+
+ if (m_bWriteHeader) {
+ streamOut << " <center>\n";
+
+ if ( i > 0 )
+ streamOut << " <a href=\"slide_1.html\">";
+ streamOut << "<img src=\"../pics/first.png\" border=\"0\" alt=\"" << i18n( "First" )
+ << "\" title=\"" << i18n( "First" ) << "\"" << ( isXML() ?" /":"") << ">";
+ if ( i > 0 )
+ streamOut << "</a>";
+
+ streamOut << "\n";
+
+ if ( i > 0 )
+ streamOut << " <a href=\"slide_" << pgNum - 1 << ".html\">";
+ streamOut << "<img src=\"../pics/prev.png\" border=\"0\" alt=\"" << i18n( "Previous" )
+ << "\" title=\"" << i18n( "Previous" ) << "\"" << ( isXML() ?" /":"") << ">";
+ if ( i > 0 )
+ streamOut << "</a>";
+
+ streamOut << "\n";
+
+ if ( (m_bLoopSlides) || (i < slideInfos.count() - 1 ) )
+ streamOut << " <a href=\"" << next << "\">";
+ streamOut << "<img src=\"../pics/next.png\" border=\"0\" alt=\"" << i18n( "Next" )
+ << "\" title=\"" << i18n( "Next" ) << "\"" << ( isXML() ?" /":"") << ">";
+ if ( (m_bLoopSlides) || (i < slideInfos.count() - 1 ) )
+ streamOut << "</a>";
+
+ streamOut << "\n";
+
+ if ( i < slideInfos.count() - 1 )
+ streamOut << " <a href=\"slide_" << slideInfos.count() << ".html\">";
+ streamOut << "<img src=\"../pics/last.png\" border=\"0\" alt=\"" << i18n( "Last" )
+ << "\" title=\"" << i18n( "Last" ) << "\"" << ( isXML() ?" /":"") << ">";
+ if ( i < slideInfos.count() - 1 )
+ streamOut << "</a>";
+
+ streamOut << "\n" << " &nbsp; &nbsp; &nbsp; &nbsp;\n";
+
+ streamOut << " <a href=\"../index.html\">";
+ streamOut << "<img src=\"../pics/home.png\" border=\"0\" alt=\"" << i18n( "Home" )
+ << "\" title=\"" << i18n( "Home" ) << "\"" << ( isXML() ?" /":"") << ">";
+ streamOut << "</a>\n";
+
+ streamOut << " </center>" << brtag << "<hr noshade=\"noshade\"" << ( isXML() ?" /":"") << ">\n"; // ### TODO: is noshade W3C?
+
+ streamOut << " <center>\n <font color=\"" << escapeHtmlText( codec, titleColor.name() ) << "\">\n";
+ streamOut << " <b>" << escapeHtmlText( codec, title ) << "</b> - <i>" << escapeHtmlText( codec, slideInfos[ i ].slideTitle ) << "</i>\n";
+
+ streamOut << " </font>\n </center>\n";
+
+ streamOut << "<hr noshade=\"noshade\"" << ( isXML() ?" /":"") << ">" << brtag << "\n";
+ }
+
+ streamOut << " <center>\n ";
+
+ if ( (m_bLoopSlides) || (i < slideInfos.count() - 1) )
+ streamOut << "<a href=\"" << next << "\">";
+
+ streamOut << "<img src=\"../pics/slide_" << pgNum << ".png\" border=\"0\" alt=\""
+ << i18n( "Slide %1" ).arg( pgNum ) << "\"" << ( isXML() ?" /":"") << ">";
+
+ if ( i < slideInfos.count() - 1 )
+ streamOut << "</a>";
+
+ streamOut << "\n";
+
+ streamOut << " </center>\n";
+
+ if (m_bWriteFooter) {
+ streamOut << brtag << "<hr noshade=\"noshade\"" << ( isXML() ?" /":"") << ">\n";
+
+ QPtrList<KPrPage> _tmpList( doc->getPageList() );
+ QString note ( escapeHtmlText( codec, _tmpList.at(i)->noteText() ) );
+ if ( !note.isEmpty() ) {
+ streamOut << " <b>" << escapeHtmlText( codec, i18n( "Note" ) ) << "</b>\n";
+ streamOut << " <blockquote>\n";
+
+ streamOut << note.replace( "\n", brtag );
+
+ streamOut << " </blockquote><hr noshade=\"noshade\"" << ( isXML() ?" /":"") << ">\n";
+ }
+
+ streamOut << " <center>\n";
+
+ QString htmlAuthor;
+ if (email.isEmpty())
+ htmlAuthor=escapeHtmlText( codec, author );
+ else
+ htmlAuthor=QString("<a href=\"mailto:%1\">%2</a>").arg( escapeHtmlText( codec, email )).arg( escapeHtmlText( codec, author ));
+ streamOut << EscapeEncodingOnly ( codec, i18n( "Created on %1 by <i>%2</i> with <a href=\"http://www.koffice.org/kpresenter\">KPresenter</a>" )
+ .arg( KGlobal::locale()->formatDate ( QDate::currentDate() ) ).arg( htmlAuthor ) );
+
+ streamOut << " </center><hr noshade=\"noshade\"" << ( isXML() ?" /":"") << ">\n";
+ }
+
+ streamOut << "</body>\n</html>\n";
+
+ file.close();
+
+ KIO::NetAccess::file_move( tmp.name(), dest, -1, true /*overwrite*/);
+
+ int p = progressBar->progress();
+ progressBar->setProgress( ++p );
+ kapp->processEvents();
+ }
+}
+
+void KPrWebPresentation::createMainPage( KProgress *progressBar )
+{
+ QTextCodec *codec = KGlobal::charsets()->codecForName( m_encoding );
+ KTempFile tmp;
+ QString dest = QString( "%1/index.html" ).arg( path );
+ QFile file( tmp.name() );
+ file.open( IO_WriteOnly );
+ QTextStream streamOut( &file );
+ streamOut.setCodec( codec );
+
+ writeStartOfHeader( streamOut, codec, i18n("Table of Contents"), QString() );
+ streamOut << "</head>\n";
+
+ streamOut << "<body bgcolor=\"" << backColor.name() << "\" text=\"" << textColor.name() << "\">\n";
+
+ streamOut << "<h1 align=\"center\"><font color=\"" << titleColor.name()
+ << "\">" << title << "</font></h1>";
+
+ streamOut << "<p align=\"center\"><a href=\"html/slide_1.html\">";
+ streamOut << i18n("Click here to start the Slideshow");
+ streamOut << "</a></p>\n";
+
+ streamOut << "<p><b>" << i18n("Table of Contents") << "</b></p>\n";
+
+ // create list of slides (with proper link)
+ streamOut << "<ol>\n";
+ for ( unsigned int i = 0; i < slideInfos.count(); i++ )
+ streamOut << " <li><a href=\"html/slide_" << i+1 << ".html\">" << slideInfos[ i ].slideTitle << "</a></li>\n";
+ streamOut << "</ol>\n";
+
+ // footer: author name, e-mail
+ QString htmlAuthor = email.isEmpty() ? escapeHtmlText( codec, author ) :
+ QString("<a href=\"mailto:%1\">%2</a>").arg( escapeHtmlText( codec, email )).arg( escapeHtmlText( codec, author ));
+ streamOut << EscapeEncodingOnly ( codec, i18n( "Created on %1 by <i>%2</i> with <a href=\"http://www.koffice.org/kpresenter\">KPresenter</a>" )
+ .arg( KGlobal::locale()->formatDate ( QDate::currentDate() ) ).arg( htmlAuthor ) );
+
+ streamOut << "</body>\n</html>\n";
+ file.close();
+
+ KIO::NetAccess::file_move( tmp.name(), dest, -1, true /*overwrite*/);
+
+
+ progressBar->setProgress( progressBar->totalSteps() );
+ kapp->processEvents();
+}
+
+void KPrWebPresentation::init()
+{
+
+ KoDocumentInfo * info = doc->documentInfo();
+ KoDocumentInfoAuthor * authorPage = static_cast<KoDocumentInfoAuthor *>(info->page( "author" ));
+ if ( !authorPage )
+ kdWarning() << "Author information not found in documentInfo !" << endl;
+ else
+ {
+ author = authorPage->fullName();
+ email = authorPage->email();
+ }
+
+ title = i18n("Slideshow");
+ kdDebug(33001) << "KPrWebPresentation::init : " << doc->getPageNums() << " pages." << endl;
+ for ( unsigned int i = 0; i < doc->getPageNums(); i++ )
+ {
+ if ( doc->isSlideSelected( i ) )
+ {
+ SlideInfo info;
+ info.pageNumber = i;
+ info.slideTitle = doc->pageList().at(i)->pageTitle();
+ slideInfos.append( info );
+ }
+ }
+ if ( slideInfos.isEmpty() )
+ kdWarning() << "No slides selected!" << endl;
+ backColor = Qt::white;
+ textColor = Qt::black;
+ titleColor = Qt::red;
+
+ path = KGlobalSettings::documentPath() + "www";
+
+ zoom = 100;
+
+ timeBetweenSlides = 0;
+
+ m_encoding = QTextCodec::codecForLocale()->name();
+}
+
+KPrWebPresentationWizard::KPrWebPresentationWizard( const QString &_config, KPrDocument *_doc,
+ KPrView *_view )
+ : KWizard( 0, "", false ), config( _config ), webPres( config, _doc, _view )
+{
+ doc = _doc;
+ view = _view;
+
+ setupPage1();
+ setupPage2();
+ setupPage3();
+ setupPage4();
+ setupPage5();
+
+ connect( nextButton(), SIGNAL( clicked() ), this, SLOT( pageChanged() ) );
+ connect( backButton(), SIGNAL( clicked() ), this, SLOT( pageChanged() ) );
+ connect( finishButton(), SIGNAL( clicked() ), this, SLOT( finish() ) );
+}
+
+KPrWebPresentationWizard::~KPrWebPresentationWizard()
+{
+ view->enableWebPres();
+}
+
+void KPrWebPresentationWizard::createWebPresentation( const QString &_config, KPrDocument *_doc,
+ KPrView *_view )
+{
+ KPrWebPresentationWizard *dlg = new KPrWebPresentationWizard( _config, _doc, _view );
+
+ dlg->setCaption( i18n( "Create HTML Slideshow Wizard" ) );
+ dlg->show();
+}
+
+void KPrWebPresentationWizard::setupPage1()
+{
+ page1 = new QHBox( this );
+ QWhatsThis::add( page1, i18n("This page allows you to specify some of the key"
+ " values for how your presentation will be shown"
+ " in HTML. Select individual items for more help"
+ " on what they do.") );
+ page1->setSpacing( KDialog::spacingHint() );
+ page1->setMargin( KDialog::marginHint() );
+
+ QLabel* sidebar = new QLabel( page1 );
+ sidebar->setMinimumSize( 106, 318 );
+ sidebar->setMaximumSize( 106, 318 );
+ sidebar->setFrameShape( QFrame::Panel );
+ sidebar->setFrameShadow( QFrame::Sunken );
+ sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));
+
+ QWidget* canvas = new QWidget( page1 );
+ QGridLayout *layout = new QGridLayout( canvas, 7, 2,
+ KDialog::marginHint(), KDialog::spacingHint() );
+
+ QLabel *helptext = new QLabel( canvas );
+ helptext->setAlignment( Qt::WordBreak | Qt::AlignTop| Qt::AlignLeft );
+ helptext->setText( i18n( "Enter your name, email address and "
+ "the title of the web presentation. "
+ "Also enter the output directory where the "
+ "web presentation should be saved. " ) );
+ layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );
+
+ layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );
+
+ QLabel *label1 = new QLabel( i18n("Author:"), canvas );
+ label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ QWhatsThis::add( label1, i18n("This is where you enter the name of the person or "
+ "organization that should be named as the author of "
+ "the presentation.") );
+ layout->addWidget( label1, 2, 0 );
+
+ QLabel *label2 = new QLabel( i18n("Title:"), canvas );
+ label2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ QWhatsThis::add( label2, i18n("This is where you enter the title of the overall "
+ "presentation." ) );
+ layout->addWidget( label2, 3, 0 );
+
+ QLabel *label3 = new QLabel( i18n("Email address:"), canvas );
+ label3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ QWhatsThis::add( label3, i18n("This is where you enter the email address of the "
+ "person or organization that is responsible for "
+ "the presentation.") );
+ layout->addWidget( label3, 4, 0 );
+
+ QLabel *label4 = new QLabel( i18n("Path:"), canvas );
+ label4->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ QWhatsThis::add( label4, i18n("The value entered for the path is the directory "
+ "where the presentation will be saved. If it does "
+ "not exist, you'll be asked if you want to create "
+ "the directory or abort the creation.") );
+ layout->addWidget( label4, 5, 0 );
+
+ author = new KLineEdit( webPres.getAuthor(), canvas );
+ QWhatsThis::add( author, i18n("This is where you enter the name of the person or "
+ "organization that should be named as the author of "
+ "the presentation.") );
+ layout->addWidget( author, 2, 1 );
+
+ title = new KLineEdit( webPres.getTitle(), canvas );
+ QWhatsThis::add( title, i18n("This is where you enter the title of the overall "
+ "presentation." ) );
+ layout->addWidget( title, 3, 1 );
+
+ email = new KLineEdit( webPres.getEmail(), canvas );
+ QWhatsThis::add( email, i18n("This is where you enter the email address of the "
+ "person or organization that is responsible for "
+ "the presentation.") );
+ layout->addWidget( email, 4, 1 );
+
+ path=new KURLRequester( canvas );
+ path->setMode( KFile::Directory);
+ path->lineEdit()->setText(webPres.getPath());
+ QWhatsThis::add( path, i18n("The value entered for the path is the directory "
+ "where the presentation will be saved. If it does "
+ "not exist, you'll be asked if you want to create "
+ "the directory or abort the creation.") );
+ layout->addWidget( path, 5, 1 );
+
+ QSpacerItem* spacer = new QSpacerItem( 1, 10,
+ QSizePolicy::Minimum, QSizePolicy::Expanding );
+ layout->addMultiCell( spacer, 6, 6, 0, 1 );
+
+ connect(path, SIGNAL(textChanged(const QString&)),
+ this,SLOT(slotChoosePath(const QString&)));
+ connect(path, SIGNAL(urlSelected( const QString& )),
+ this,SLOT(slotChoosePath(const QString&)));
+
+ addPage( page1, i18n( "Step 1: General Information" ) );
+
+ setHelpEnabled(page1, false); //doesn't do anything currently
+}
+
+void KPrWebPresentationWizard::setupPage2()
+{
+ page2 = new QHBox( this );
+ QWhatsThis::add( page2, i18n("This page allows you to specify how the HTML "
+ "for your presentation will be displayed. Select "
+ "individual items for more help on what they do.") );
+ page2->setSpacing( KDialog::spacingHint() );
+ page2->setMargin( KDialog::marginHint() );
+
+ QLabel* sidebar = new QLabel( page2 );
+ sidebar->setMinimumSize( 106, 318 );
+ sidebar->setMaximumSize( 106, 318 );
+ sidebar->setFrameShape( QFrame::Panel );
+ sidebar->setFrameShadow( QFrame::Sunken );
+ sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));
+
+ QWidget* canvas = new QWidget( page2 );
+ QGridLayout *layout = new QGridLayout( canvas, 6, 2,
+ KDialog::marginHint(), KDialog::spacingHint() );
+
+ QLabel *helptext = new QLabel( canvas );
+ helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
+ QString help = i18n("Here you can configure the style of the web pages.");
+ help += i18n( "You can also specify the zoom for the slides." );
+ helptext->setText(help);
+
+ layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );
+
+ layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );
+
+ QLabel *label1 = new QLabel( i18n("Zoom:"), canvas );
+ label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ QWhatsThis::add( label1, i18n( "This selection allows you to specify "
+ "the size of the slide image." ) );
+ layout->addWidget( label1, 2, 0 );
+
+ QLabel *label2 = new QLabel( i18n( "Encoding:" ), canvas );
+ label2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+
+ layout->addWidget( label2, 3, 0 );
+
+ QLabel *label3 = new QLabel( i18n( "Document type:" ), canvas );
+ label3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ layout->addWidget( label3, 4, 0 );
+
+ zoom = new KIntNumInput( webPres.getZoom(), canvas );
+ QWhatsThis::add( zoom, i18n( "This selection allows you to specify "
+ "the size of the slide image." ) );
+ layout->addWidget( zoom, 2, 1 );
+ zoom->setSuffix( " %" );
+ zoom->setRange( 25, 1000, 5 );
+
+ encoding = new KComboBox( false, canvas );
+ layout->addWidget( encoding, 3, 1 );
+
+ // Fill encoding combo
+ // Stolen from kdelibs/kate/part/katedialogs.cpp
+ QStringList encodings(KGlobal::charsets()->descriptiveEncodingNames());
+ int idx = 0;
+ for (uint i = 0; i < encodings.count(); i++)
+ {
+ bool found = false;
+ QTextCodec *codecForEnc = KGlobal::charsets()->codecForName(KGlobal::charsets()->encodingForName(encodings[i]), found);
+ if (found)
+ {
+ encoding->insertItem(encodings[i]);
+
+ if ( codecForEnc->name() == webPres.getEncoding() )
+ encoding->setCurrentItem(idx);
+ idx++;
+ }
+ }
+
+ doctype = new KComboBox( false, canvas );
+ layout->addWidget( doctype, 4, 1 );
+ doctype->insertItem( "HTML 4.01", -1 );
+ doctype->insertItem( "XHTML 1.0", -1 );
+
+ doctype->setCurrentItem( webPres.isXML() ? 1 : 0 );
+
+ QSpacerItem* spacer = new QSpacerItem( 1, 10,
+ QSizePolicy::Minimum, QSizePolicy::Expanding );
+ layout->addMultiCell( spacer, 5, 5, 0, 1 );
+
+ addPage( page2, i18n( "Step 2: Configure HTML" ) );
+
+ setHelpEnabled(page2, false); //doesn't do anything currently
+}
+
+void KPrWebPresentationWizard::setupPage3()
+{
+ page3 = new QHBox( this );
+ QWhatsThis::add( page3, i18n("This page allows you to specify the colors for "
+ "your presentation display. Select individual "
+ "items for more help on what they do.") );
+
+ page3->setSpacing( KDialog::spacingHint() );
+ page3->setMargin( KDialog::marginHint() );
+
+ QLabel* sidebar = new QLabel( page3 );
+ sidebar->setMinimumSize( 106, 318 );
+ sidebar->setMaximumSize( 106, 318 );
+ sidebar->setFrameShape( QFrame::Panel );
+ sidebar->setFrameShadow( QFrame::Sunken );
+ sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));
+
+ QWidget* canvas = new QWidget( page3 );
+ QGridLayout *layout = new QGridLayout( canvas, 6, 2,
+ KDialog::marginHint(), KDialog::spacingHint() );
+
+ QLabel *helptext = new QLabel( canvas );
+ helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
+ helptext->setText( i18n( "Now you can customize the colors of the web pages." ) );
+ layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );
+
+ layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );
+
+ QLabel *label1 = new QLabel( i18n("Text color:"), canvas );
+ label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ layout->addWidget( label1, 2, 0 );
+
+ QLabel *label2 = new QLabel( i18n("Title color:"), canvas );
+ label2->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ layout->addWidget( label2, 3, 0 );
+
+ QLabel *label3 = new QLabel( i18n("Background color:"), canvas );
+ label3->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ layout->addWidget( label3, 4, 0 );
+
+ textColor = new KColorButton( webPres.getTextColor(), canvas );
+ layout->addWidget( textColor, 2, 1 );
+
+ titleColor = new KColorButton( webPres.getTitleColor(), canvas );
+ layout->addWidget( titleColor, 3, 1 );
+
+ backColor = new KColorButton( webPres.getBackColor(), canvas );
+ layout->addWidget( backColor, 4, 1 );
+
+ QSpacerItem* spacer = new QSpacerItem( 1, 10,
+ QSizePolicy::Minimum, QSizePolicy::Expanding );
+ layout->addMultiCell( spacer, 5, 5, 0, 1 );
+
+ addPage( page3, i18n( "Step 3: Customize Colors" ) );
+
+ setHelpEnabled(page3, false); //doesn't do anything currently
+}
+
+void KPrWebPresentationWizard::setupPage4()
+{
+ page4 = new QHBox( this );
+ QWhatsThis::add( page4, i18n("This page allows you to modify the titles of "
+ "each slide, if required. You normally do not need "
+ "to do this, but it is available if required.") );
+ page4->setSpacing( KDialog::spacingHint() );
+ page4->setMargin( KDialog::marginHint() );
+
+ QLabel* sidebar = new QLabel( page4 );
+ sidebar->setMinimumSize( 106, 318 );
+ sidebar->setMaximumSize( 106, 318 );
+ sidebar->setFrameShape( QFrame::Panel );
+ sidebar->setFrameShadow( QFrame::Sunken );
+ sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));
+
+ QWidget* canvas = new QWidget( page4 );
+ QGridLayout *layout = new QGridLayout( canvas, 3, 2,
+ KDialog::marginHint(), KDialog::spacingHint() );
+
+ QLabel *helptext = new QLabel( canvas );
+ helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
+ helptext->setText( i18n( "Here you can specify titles for "
+ "each slide. Click on a slide in "
+ "the list and then enter the title "
+ "in the textbox below. If you "
+ "click on a title, KPresenter "
+ "mainview will display the slide.") );
+
+ layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );
+
+ QLabel *label = new QLabel( i18n( "Slide title:" ), canvas );
+ label->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ layout->addWidget( label, 1, 0 );
+
+ slideTitle = new KLineEdit( canvas );
+ layout->addWidget( slideTitle, 1, 1 );
+ connect( slideTitle, SIGNAL( textChanged( const QString & ) ), this,
+ SLOT( slideTitleChanged( const QString & ) ) );
+
+ slideTitles = new KListView( canvas );
+ layout->addMultiCellWidget( slideTitles, 2, 2, 0, 1 );
+ slideTitles->addColumn( i18n( "No." ) );
+ slideTitles->addColumn( i18n( "Slide Title" ) );
+ connect( slideTitles, SIGNAL( selectionChanged( QListViewItem * ) ), this,
+ SLOT( slideTitleChanged( QListViewItem * ) ) );
+ slideTitles->setSorting( -1 );
+ slideTitles->setAllColumnsShowFocus( true );
+ slideTitles->setResizeMode( QListView::LastColumn );
+ slideTitles->header()->setMovingEnabled( false );
+
+ QValueList<KPrWebPresentation::SlideInfo> infos = webPres.getSlideInfos();
+ for ( int i = infos.count() - 1; i >= 0; --i ) {
+ KListViewItem *item = new KListViewItem( slideTitles );
+ item->setText( 0, QString::number( i + 1 ) );
+ //kdDebug(33001) << "KPrWebPresentationWizard::setupPage3 " << infos[ i ].slideTitle << endl;
+ item->setText( 1, infos[ i ].slideTitle );
+ }
+
+ slideTitles->setSelected( slideTitles->firstChild(), true );
+
+ addPage( page4, i18n( "Step 4: Customize Slide Titles" ) );
+
+ setHelpEnabled(page4, false); //doesn't do anything currently
+}
+
+void KPrWebPresentationWizard::setupPage5()
+{
+ page5 = new QHBox( this );
+ QWhatsThis::add( page5, i18n("This page allows you to specify some options for "
+ "presentations which run unattended, such as time "
+ "elapsed before advancing to the next slide, looping "
+ "and the presence of headers. If you do not want "
+ "an unattended presentation, just leave defaults unchanged.") );
+ page5->setSpacing( KDialog::spacingHint() );
+ page5->setMargin( KDialog::marginHint() );
+
+ QLabel* sidebar = new QLabel( page5 );
+ sidebar->setMinimumSize( 106, 318 );
+ sidebar->setMaximumSize( 106, 318 );
+ sidebar->setFrameShape( QFrame::Panel );
+ sidebar->setFrameShadow( QFrame::Sunken );
+ sidebar->setPixmap(locate("data", "kpresenter/pics/webslideshow-sidebar.png"));
+
+ QWidget* canvas = new QWidget( page5 );
+ QGridLayout *layout = new QGridLayout( canvas, 6, 2,
+ KDialog::marginHint(), KDialog::spacingHint() );
+
+ QLabel *helptext = new QLabel( canvas );
+ helptext->setAlignment( Qt::WordBreak | Qt::AlignVCenter| Qt::AlignLeft );
+ QString help = i18n("Here you can configure some options for unattended "
+ "presentations, such as time elapsed before automatically advance to "
+ "the next slide, looping and the presence of headers.");
+ helptext->setText(help);
+
+ layout->addMultiCellWidget( helptext, 0, 0, 0, 1 );
+
+ layout->addMultiCell( new QSpacerItem( 1, 50 ), 1, 1, 0, 1 );
+
+ QLabel *label1 = new QLabel( i18n("Advance after:"), canvas );
+ label1->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
+ QWhatsThis::add( label1, i18n( "This selection allows you to specify "
+ "the time between slides." ) );
+ layout->addWidget( label1, 2, 0 );
+
+ timeBetweenSlides = new KIntNumInput( webPres.getTimeBetweenSlides(), canvas );
+ timeBetweenSlides->setSpecialValueText(i18n( "Disabled" ));
+ QWhatsThis::add( timeBetweenSlides, i18n( "This selection allows you to specify "
+ "the time between slides." ) );
+ layout->addWidget( timeBetweenSlides, 2, 1 );
+ timeBetweenSlides->setSuffix( " seconds" );
+ timeBetweenSlides->setRange( 0, 900, 1 );
+
+ layout->addMultiCell( new QSpacerItem( 1, 10 ), 1, 1, 0, 1 );
+
+ writeHeader=new QCheckBox( i18n("Write header to the slides"), canvas);
+ QWhatsThis::add( writeHeader, i18n( "This checkbox allows you to specify if you "
+ "want to write the navigation buttons on top "
+ "of the slide." ) );
+ writeHeader->setChecked( webPres.wantHeader() );
+ layout->addWidget( writeHeader, 3, 1);
+
+ writeFooter=new QCheckBox( i18n("Write footer to the slides"), canvas);
+ QWhatsThis::add( writeFooter, i18n( "This checkbox allows you to specify if you "
+ "want to write an imprint consisting on the author "
+ "and the software used to create these slides." ) );
+ writeFooter->setChecked( webPres.wantFooter() );
+ layout->addWidget( writeFooter, 4, 1);
+
+ loopSlides=new QCheckBox( i18n("Loop presentation"), canvas);
+ QWhatsThis::add( loopSlides, i18n( "This checkbox allows you to specify if you "
+ "want the presentation to start again once "
+ "the latest slide is reached." ) );
+ loopSlides->setChecked( webPres.wantLoopSlides() );
+ layout->addWidget( loopSlides, 5, 1);
+
+ QSpacerItem* spacer = new QSpacerItem( 1, 10,
+ QSizePolicy::Minimum, QSizePolicy::Expanding );
+ layout->addMultiCell( spacer, 5, 5, 0, 1 );
+
+ addPage( page5, i18n( "Step 5: Options for Unattended Presentations" ) );
+
+ setHelpEnabled(page5, false); //doesn't do anything currently
+
+ setFinish( page5, true );
+}
+
+void KPrWebPresentationWizard::finish()
+{
+ webPres.setAuthor( author->text() );
+ webPres.setEMail( email->text() );
+ webPres.setTitle( title->text() );
+
+ QListViewItemIterator it( slideTitles );
+ for ( ; it.current(); ++it )
+ webPres.setSlideTitle( it.current()->text( 0 ).toInt() - 1, it.current()->text( 1 ) );
+
+ webPres.setBackColor( backColor->color() );
+ webPres.setTitleColor( titleColor->color() );
+ webPres.setTextColor( textColor->color() );
+ webPres.setPath( path->lineEdit()->text() );
+ webPres.setZoom( zoom->value() );
+ webPres.setTimeBetweenSlides( timeBetweenSlides->value() );
+ webPres.setWriteHeader( writeHeader->isChecked() );
+ webPres.setWriteFooter( writeFooter->isChecked() );
+ webPres.setLoopSlides( loopSlides->isChecked() );
+ webPres.setXML( doctype->currentItem() != 0 );
+ bool found = false;
+ QTextCodec *codecForEnc = KGlobal::charsets()->codecForName(KGlobal::charsets()->encodingForName(encoding->currentText()), found);
+ if ( found )
+ {
+ webPres.setEncoding( codecForEnc->name() );
+ }
+
+ close();
+ KPrWebPresentationCreateDialog::createWebPresentation( doc, view, webPres );
+}
+
+void KPrWebPresentationWizard::pageChanged()
+{
+ if ( currentPage() != page5 )
+ {
+ QString pathname = path->lineEdit()->text();
+
+ // path doesn't exist. ask user if it should be created.
+ if ( !KIO::NetAccess::exists( pathname, true/*write*/,this ) )
+ {
+ QString msg = i18n( "<qt>The directory <b>%1</b> does not exist.<br>"
+ "Do you want create it?</qt>" );
+ if( KMessageBox::questionYesNo( this, msg.arg( pathname ),
+ i18n( "Directory Not Found" ) )
+ == KMessageBox::Yes)
+ {
+ bool ok = KIO::NetAccess::mkdir( pathname, this );
+ if( !ok )
+ {
+ KMessageBox::sorry( this,
+ i18n( "Cannot create directory." ) );
+ // go back to first step
+ showPage( page1 );
+ path->setFocus();
+ }
+
+ }
+ else
+ {
+ // go back to first step
+ showPage( page1 );
+ path->setFocus();
+ }
+ }
+ } else
+ finishButton()->setEnabled( true );
+}
+
+void KPrWebPresentationWizard::slideTitleChanged( const QString &s )
+{
+ if ( slideTitles->currentItem() )
+ slideTitles->currentItem()->setText( 1, s );
+}
+
+void KPrWebPresentationWizard::slideTitleChanged( QListViewItem *i )
+{
+ if ( !i ) return;
+
+ slideTitle->setText( i->text( 1 ) );
+ view->skipToPage( i->text( 0 ).toInt() - 1 );
+}
+
+void KPrWebPresentationWizard::closeEvent( QCloseEvent *e )
+{
+ view->enableWebPres();
+ KWizard::closeEvent( e );
+}
+
+void KPrWebPresentationWizard::slotChoosePath(const QString &text)
+{
+ webPres.setPath(text);
+}
+
+KPrWebPresentationCreateDialog::KPrWebPresentationCreateDialog( KPrDocument *_doc, KPrView *_view,
+ const KPrWebPresentation &_webPres )
+ : QDialog( 0, "", false ), webPres( _webPres )
+{
+ doc = _doc;
+ view = _view;
+
+ setupGUI();
+}
+
+KPrWebPresentationCreateDialog::~KPrWebPresentationCreateDialog()
+{
+ view->enableWebPres();
+}
+
+void KPrWebPresentationCreateDialog::createWebPresentation( KPrDocument *_doc, KPrView *_view,
+ const KPrWebPresentation &_webPres )
+{
+ KPrWebPresentationCreateDialog *dlg = new KPrWebPresentationCreateDialog( _doc, _view, _webPres );
+
+ dlg->setCaption( i18n( "Create HTML Slideshow" ) );
+ dlg->resize( 400, 300 );
+ dlg->show();
+ dlg->start();
+}
+
+void KPrWebPresentationCreateDialog::start()
+{
+ setCursor( waitCursor );
+ initCreation();
+ createSlidesPictures();
+ createSlidesHTML();
+ createMainPage();
+ setCursor( arrowCursor );
+
+ bDone->setEnabled( true );
+ bSave->setEnabled( true );
+}
+
+void KPrWebPresentationCreateDialog::initCreation()
+{
+ QFont f = step1->font(), f2 = step1->font();
+ f.setBold( true );
+ step1->setFont( f );
+
+ progressBar->setProgress( 0 );
+ progressBar->setTotalSteps( webPres.initSteps() );
+
+ webPres.initCreation( progressBar );
+
+ step1->setFont( f2 );
+ progressBar->setProgress( progressBar->totalSteps() );
+}
+
+void KPrWebPresentationCreateDialog::createSlidesPictures()
+{
+ QFont f = step2->font(), f2 = f;
+ f.setBold( true );
+ step2->setFont( f );
+
+ progressBar->setProgress( 0 );
+ if ( webPres.slides1Steps() > 0 )
+ {
+ progressBar->setTotalSteps( webPres.slides1Steps() );
+ webPres.createSlidesPictures( progressBar );
+ }
+
+ step2->setFont( f2 );
+ progressBar->setProgress( progressBar->totalSteps() );
+}
+
+void KPrWebPresentationCreateDialog::createSlidesHTML()
+{
+ QFont f = step3->font(), f2 = step3->font();
+ f.setBold( true );
+ step3->setFont( f );
+
+ progressBar->setProgress( 0 );
+ if ( webPres.slides1Steps() > 0 )
+ {
+ progressBar->setTotalSteps( webPres.slides1Steps() );
+ webPres.createSlidesHTML( progressBar );
+ }
+
+ step3->setFont( f2 );
+ progressBar->setProgress( progressBar->totalSteps() );
+}
+
+void KPrWebPresentationCreateDialog::createMainPage()
+{
+ QFont f = step4->font(), f2 = step4->font();
+ f.setBold( true );
+ step4->setFont( f );
+
+ progressBar->setProgress( 0 );
+ progressBar->setTotalSteps( webPres.slides1Steps() );
+
+ webPres.createMainPage( progressBar );
+
+ step4->setFont( f2 );
+ progressBar->setProgress( progressBar->totalSteps() );
+}
+
+void KPrWebPresentationCreateDialog::setupGUI()
+{
+ back = new QVBox( this );
+ back->setMargin( KDialog::marginHint() );
+
+ QFrame *line;
+
+ line = new QFrame( back );
+ line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ line->setMaximumHeight( 20 );
+
+ step1 = new QLabel( i18n( "Initialize (create file structure, etc.)" ), back );
+ step2 = new QLabel( i18n( "Create Pictures of the Slides" ), back );
+ step3 = new QLabel( i18n( "Create HTML Pages for the Slides" ), back );
+ step4 = new QLabel( i18n( "Create Main Page (Table of Contents)" ), back );
+ step5 = new QLabel( i18n( "Options for Unattended Presentations" ), back);
+
+ line = new QFrame( back );
+ line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ line->setMaximumHeight( 20 );
+
+ progressBar = new KProgress( back );
+
+ line = new QFrame( back );
+ line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ line->setMaximumHeight( 20 );
+
+ KButtonBox *bb = new KButtonBox( back );
+ bSave = bb->addButton( i18n( "Save Configuration..." ) );
+ bb->addStretch();
+ bDone = bb->addButton( i18n( "Done" ) );
+
+ bSave->setEnabled( false );
+ bDone->setEnabled( false );
+
+ connect( bDone, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( bSave, SIGNAL( clicked() ), this, SLOT( saveConfig() ) );
+}
+
+void KPrWebPresentationCreateDialog::resizeEvent( QResizeEvent *e )
+{
+ QDialog::resizeEvent( e );
+ back->resize( size() );
+}
+
+void KPrWebPresentationCreateDialog::saveConfig()
+{
+ QString filename = webPres.getConfig();
+ if ( QFileInfo( filename ).exists() )
+ filename = QFileInfo( filename ).absFilePath();
+ else
+ filename = QString::null;
+
+ KFileDialog fd (filename, i18n("*.kpweb|KPresenter Web-Presentation (*.kpweb)"),
+ 0/*parent*/, 0/*name*/, true/*modal*/);
+ fd.setCaption (i18n ("Save Web Presentation Configuration"));
+ fd.setOperationMode (KFileDialog::Saving);
+ fd.setMode (KFile::File | KFile::LocalOnly);
+
+ if (fd.exec ())
+ {
+ webPres.setConfig( fd.selectedFile () );
+ webPres.saveConfig();
+ }
+}
+
+#include "KPrGradient.h"
+#include "KPrWebPresentation.moc"
diff --git a/kpresenter/KPrWebPresentation.h b/kpresenter/KPrWebPresentation.h
new file mode 100644
index 000000000..873c49272
--- /dev/null
+++ b/kpresenter/KPrWebPresentation.h
@@ -0,0 +1,227 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef webpresentation_h
+#define webpresentation_h
+
+#include <kwizard.h>
+
+#include <qdialog.h>
+#include <qvaluelist.h>
+
+
+class KPrDocument;
+class KPrView;
+
+class KURLRequester;
+class KColorButton;
+class KListView;
+class KIntNumInput;
+class KLineEdit;
+class KComboBox;
+
+class QVBox;
+class QHBox;
+
+class QListViewItem;
+class QCloseEvent;
+class KProgress;
+class QLabel;
+
+class QCheckBox;
+
+class KPrWebPresentation
+{
+public:
+
+ KPrWebPresentation( KPrDocument *_doc, KPrView *_view );
+ KPrWebPresentation( const QString &_config, KPrDocument *_doc, KPrView *_view );
+ KPrWebPresentation( const KPrWebPresentation &webPres );
+
+ void setAuthor( const QString &_author )
+ { author = _author; }
+ void setEMail( const QString &_email )
+ { email = _email; }
+ void setTitle( const QString &_title )
+ { title = _title; }
+ void setBackColor( const QColor &_backColor )
+ { backColor = _backColor; }
+ void setTitleColor( const QColor &_titleColor )
+ { titleColor = _titleColor; }
+ void setTextColor( const QColor &_textColor )
+ { textColor = _textColor; }
+ void setXML( bool _xml )
+ { xml = _xml; }
+ void setWriteHeader( bool _writeHeader )
+ { m_bWriteHeader = _writeHeader; }
+ void setWriteFooter( bool _writeFooter )
+ { m_bWriteFooter = _writeFooter; }
+ void setLoopSlides( bool _loopSlides )
+ { m_bLoopSlides = _loopSlides; }
+ void setPath( const QString &_path )
+ { path = _path; }
+ void setZoom( int _zoom )
+ { zoom = _zoom; }
+ void setTimeBetweenSlides( int _timeBetweenSlides )
+ { timeBetweenSlides = _timeBetweenSlides; } // PAU
+ void setEncoding( const QString &_encoding ) { m_encoding = _encoding; }
+
+ QString getAuthor() const { return author; }
+ QString getEmail() const { return email; }
+ QString getTitle() const { return title; }
+ QColor getBackColor() const { return backColor; }
+ QColor getTitleColor() const { return titleColor; }
+ QColor getTextColor() const { return textColor; }
+ bool isXML() const { return xml; }
+ bool wantHeader() const { return m_bWriteHeader; }
+ bool wantFooter() const { return m_bWriteFooter; }
+ bool wantLoopSlides() const { return m_bLoopSlides; }
+ QString getPath() const { return path; }
+ int getZoom() const { return zoom; }
+ int getTimeBetweenSlides() const { return timeBetweenSlides; } // PAU
+ QString getEncoding() const { return m_encoding; }
+
+ struct SlideInfo {
+ int pageNumber; /* 0-based */
+ QString slideTitle;
+ };
+ // Each entry in this list is a page (number+title).
+ // This allows to skip pages.
+ QValueList<SlideInfo> getSlideInfos() const { return slideInfos; }
+
+ void setSlideTitle( int i, const QString &slideTitle )
+ { slideInfos[i].slideTitle = slideTitle; }
+
+ void setConfig( const QString &_config )
+ { config = _config; }
+ QString getConfig() const { return config; }
+
+ void loadConfig();
+ void saveConfig();
+
+ int initSteps() const { return 7; }
+ int slides1Steps() { return slideInfos.count(); }
+ int slides2Steps() { return slideInfos.count(); }
+ int mainSteps() const { return 1; }
+
+ void initCreation( KProgress *progressBar );
+ void createSlidesPictures( KProgress *progressBar );
+ void createSlidesHTML( KProgress *progressBar );
+ void createMainPage( KProgress *progressBar );
+
+protected:
+ void init();
+ QString escapeHtmlText( QTextCodec *codec, const QString& strText ) const;
+ void writeStartOfHeader(QTextStream& streamOut, QTextCodec *codec,
+ const QString& subtitle, const QString& dest );
+
+ KPrDocument *doc;
+ KPrView *view;
+ QString config;
+ QString author, title, email;
+ QValueList<SlideInfo> slideInfos;
+ QColor backColor, titleColor, textColor;
+ QString path;
+ bool xml;
+ bool m_bWriteHeader, m_bWriteFooter, m_bLoopSlides;
+ int timeBetweenSlides;
+ int zoom;
+ QString m_encoding;
+};
+
+class KPrWebPresentationWizard : public KWizard
+{
+ Q_OBJECT
+
+public:
+ KPrWebPresentationWizard( const QString &_config, KPrDocument *_doc, KPrView *_view );
+ ~KPrWebPresentationWizard();
+
+ static void createWebPresentation( const QString &_config, KPrDocument *_doc, KPrView *_view );
+
+protected:
+
+ void setupPage1();
+ void setupPage2();
+ void setupPage3();
+ void setupPage4();
+ void setupPage5(); // PAU
+
+ void closeEvent( QCloseEvent *e );
+
+ QString config;
+ KPrDocument *doc;
+ KPrView *view;
+ KPrWebPresentation webPres;
+
+ QHBox *page1, *page2, *page3, *page4, *page5; // PAU
+ QCheckBox *writeHeader, *writeFooter, *loopSlides; // PAU
+ KLineEdit *author, *title, *email;
+ KColorButton *textColor, *titleColor, *backColor;
+ KComboBox *encoding, *doctype;
+ KIntNumInput *zoom, *timeBetweenSlides; // PAU
+ KURLRequester *path;
+ KListView *slideTitles;
+ KLineEdit *slideTitle;
+
+protected slots:
+ virtual void finish();
+ void pageChanged();
+ void slotChoosePath(const QString &);
+ void slideTitleChanged( const QString & );
+ void slideTitleChanged( QListViewItem * );
+
+};
+
+class KPrWebPresentationCreateDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ KPrWebPresentationCreateDialog( KPrDocument *_doc, KPrView *_view, const KPrWebPresentation &_webPres );
+ ~KPrWebPresentationCreateDialog();
+
+ static void createWebPresentation( KPrDocument *_doc, KPrView *_view, const KPrWebPresentation &_webPres );
+
+ void start();
+
+ void initCreation();
+ void createSlidesPictures();
+ void createSlidesHTML();
+ void createMainPage();
+
+protected:
+ void setupGUI();
+ void resizeEvent( QResizeEvent *e );
+
+ KPrView *view;
+ KPrDocument *doc;
+ KPrWebPresentation webPres;
+
+ KProgress *progressBar;
+ QLabel *step1, *step2, *step3, *step4, *step5;
+ QPushButton *bDone, *bSave;
+ QVBox *back;
+
+protected slots:
+ void saveConfig();
+
+};
+#endif
diff --git a/kpresenter/KoPointArray.cpp b/kpresenter/KoPointArray.cpp
new file mode 100644
index 000000000..17f54e664
--- /dev/null
+++ b/kpresenter/KoPointArray.cpp
@@ -0,0 +1,320 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KoPointArray.h"
+#include <KoRect.h>
+#include <stdarg.h>
+#include <KoZoomHandler.h>
+
+void KoPointArray::translate( double dx, double dy )
+{
+ register KoPoint *p = data();
+ register int i = size();
+ KoPoint pt( dx, dy );
+ while ( i-- ) {
+ *p += pt;
+ p++;
+ }
+}
+
+void KoPointArray::point( uint index, double *x, double *y ) const
+{
+ KoPoint p = QMemArray<KoPoint>::at( index );
+ if ( x )
+ *x = (double)p.x();
+ if ( y )
+ *y = (double)p.y();
+}
+
+KoPoint KoPointArray::point( uint index ) const
+{ // #### index out of bounds
+ return QMemArray<KoPoint>::at( index );
+}
+
+void KoPointArray::setPoint( uint index, double x, double y )
+{ // #### index out of bounds
+ QMemArray<KoPoint>::at( index ) = KoPoint( x, y );
+}
+
+
+
+bool KoPointArray::putPoints( int index, int nPoints, double firstx, double firsty,
+ ... )
+{
+ va_list ap;
+ if ( index + nPoints > (int)size() ) { // extend array
+ if ( !resize(index + nPoints) )
+ return FALSE;
+ }
+ if ( nPoints <= 0 )
+ return TRUE;
+ setPoint( index, firstx, firsty ); // set first point
+ int i = index + 1;
+ double x, y;
+ nPoints--;
+ va_start( ap, firsty );
+ while ( nPoints-- ) {
+ x = va_arg( ap, double );
+ y = va_arg( ap, double );
+ setPoint( i++, x, y );
+ }
+ va_end( ap );
+ return TRUE;
+}
+
+void split(const double *p, double *l, double *r)
+{
+ double tmpx;
+ double tmpy;
+
+ l[0] = p[0];
+ l[1] = p[1];
+ r[6] = p[6];
+ r[7] = p[7];
+
+ l[2] = (p[0]+ p[2])/2;
+ l[3] = (p[1]+ p[3])/2;
+ tmpx = (p[2]+ p[4])/2;
+ tmpy = (p[3]+ p[5])/2;
+ r[4] = (p[4]+ p[6])/2;
+ r[5] = (p[5]+ p[7])/2;
+
+ l[4] = (l[2]+ tmpx)/2;
+ l[5] = (l[3]+ tmpy)/2;
+ r[2] = (tmpx + r[4])/2;
+ r[3] = (tmpy + r[5])/2;
+
+ l[6] = (l[4]+ r[2])/2;
+ l[7] = (l[5]+ r[3])/2;
+ r[0] = l[6];
+ r[1] = l[7];
+}
+
+// Based on:
+//
+// A Fast 2D Point-On-Line Test
+// by Alan Paeth
+// from "Graphics Gems", Academic Press, 1990
+static
+int pnt_on_line( const int* p, const int* q, const int* t )
+{
+/*
+ * given a line through P:(px,py) Q:(qx,qy) and T:(tx,ty)
+ * return 0 if T is not on the line through <--P--Q-->
+ * 1 if T is on the open ray ending at P: <--P
+ * 2 if T is on the closed interior along: P--Q
+ * 3 if T is on the open ray beginning at Q: Q-->
+ *
+ * Example: consider the line P = (3,2), Q = (17,7). A plot
+ * of the test points T(x,y) (with 0 mapped onto '.') yields:
+ *
+ * 8| . . . . . . . . . . . . . . . . . 3 3
+ * Y 7| . . . . . . . . . . . . . . 2 2 Q 3 3 Q = 2
+ * 6| . . . . . . . . . . . 2 2 2 2 2 . . .
+ * a 5| . . . . . . . . 2 2 2 2 2 2 . . . . .
+ * x 4| . . . . . 2 2 2 2 2 2 . . . . . . . .
+ * i 3| . . . 2 2 2 2 2 . . . . . . . . . . .
+ * s 2| 1 1 P 2 2 . . . . . . . . . . . . . . P = 2
+ * 1| 1 1 . . . . . . . . . . . . . . . . .
+ * +--------------------------------------
+ * 1 2 3 4 5 X-axis 10 15 19
+ *
+ * Point-Line distance is normalized with the Infinity Norm
+ * avoiding square-root code and tightening the test vs the
+ * Manhattan Norm. All math is done on the field of integers.
+ * The latter replaces the initial ">= MAX(...)" test with
+ * "> (ABS(qx-px) + ABS(qy-py))" loosening both inequality
+ * and norm, yielding a broader target line for selection.
+ * The tightest test is employed here for best discrimination
+ * in merging collinear (to grid coordinates) vertex chains
+ * into a larger, spanning vectors within the Lemming editor.
+ */
+
+ // if all points are coincident, return condition 2 (on line)
+ if(q[0]==p[0] && q[1]==p[1] && q[0]==t[0] && q[1]==t[1]) {
+ return 2;
+ }
+
+ if ( QABS((q[1]-p[1])*(t[0]-p[0])-(t[1]-p[1])*(q[0]-p[0])) >=
+ (QMAX(QABS(q[0]-p[0]), QABS(q[1]-p[1])))) return 0;
+
+ if (((q[0]<p[0])&&(p[0]<t[0])) || ((q[1]<p[1])&&(p[1]<t[1])))
+ return 1 ;
+ if (((t[0]<p[0])&&(p[0]<q[0])) || ((t[1]<p[1])&&(p[1]<q[1])))
+ return 1 ;
+ if (((p[0]<q[0])&&(q[0]<t[0])) || ((p[1]<q[1])&&(q[1]<t[1])))
+ return 3 ;
+ if (((t[0]<q[0])&&(q[0]<p[0])) || ((t[1]<q[1])&&(q[1]<p[1])))
+ return 3 ;
+
+ return 2 ;
+}
+
+static
+void polygonizeQBezier( double* acc, int& accsize, const double ctrl[],
+ int maxsize )
+{
+ if ( accsize > maxsize / 2 )
+ {
+ // This never happens in practice.
+
+ if ( accsize >= maxsize-4 )
+ return;
+ // Running out of space - approximate by a line.
+ acc[accsize++] = ctrl[0];
+ acc[accsize++] = ctrl[1];
+ acc[accsize++] = ctrl[6];
+ acc[accsize++] = ctrl[7];
+ return;
+ }
+
+ //intersects:
+ double l[8];
+ double r[8];
+ split( ctrl, l, r);
+
+ // convert to integers for line condition check
+ int c0[2]; c0[0] = int(ctrl[0]); c0[1] = int(ctrl[1]);
+ int c1[2]; c1[0] = int(ctrl[2]); c1[1] = int(ctrl[3]);
+ int c2[2]; c2[0] = int(ctrl[4]); c2[1] = int(ctrl[5]);
+ int c3[2]; c3[0] = int(ctrl[6]); c3[1] = int(ctrl[7]);
+
+ // #### Duplication needed?
+ if ( QABS(c1[0]-c0[0]) <= 1 && QABS(c1[1]-c0[1]) <= 1
+ && QABS(c2[0]-c0[0]) <= 1 && QABS(c2[1]-c0[1]) <= 1
+ && QABS(c3[0]-c1[0]) <= 1 && QABS(c3[1]-c0[1]) <= 1 )
+ {
+ // Approximate by one line.
+ // Dont need to write last pt as it is the same as first pt
+ // on the next segment
+ acc[accsize++] = l[0];
+ acc[accsize++] = l[1];
+ return;
+ }
+
+ if ( ( pnt_on_line( c0, c3, c1 ) == 2 && pnt_on_line( c0, c3, c2 ) == 2 )
+ || ( QABS(c1[0]-c0[0]) <= 1 && QABS(c1[1]-c0[1]) <= 1
+ && QABS(c2[0]-c0[0]) <= 1 && QABS(c2[1]-c0[1]) <= 1
+ && QABS(c3[0]-c1[0]) <= 1 && QABS(c3[1]-c0[1]) <= 1 ) )
+ {
+ // Approximate by one line.
+ // Dont need to write last pt as it is the same as first pt
+ // on the next segment
+ acc[accsize++] = l[0];
+ acc[accsize++] = l[1];
+ return;
+ }
+
+ // Too big and too curved - recusively subdivide.
+ polygonizeQBezier( acc, accsize, l, maxsize );
+ polygonizeQBezier( acc, accsize, r, maxsize );
+}
+
+
+KoRect KoPointArray::boundingRect() const
+{
+ if ( isEmpty() )
+ return KoRect( 0, 0, 0, 0 ); // null rectangle
+ register KoPoint *pd = data();
+ double minx, maxx, miny, maxy;
+ minx = maxx = pd->x();
+ miny = maxy = pd->y();
+ pd++;
+ for ( int i=1; i<(int)size(); i++ ) { // find min+max x and y
+ if ( pd->x() < minx )
+ minx = pd->x();
+ else if ( pd->x() > maxx )
+ maxx = pd->x();
+ if ( pd->y() < miny )
+ miny = pd->y();
+ else if ( pd->y() > maxy )
+ maxy = pd->y();
+ pd++;
+ }
+ return KoRect( KoPoint(minx,miny), KoPoint(maxx,maxy) );
+}
+
+
+KoPointArray KoPointArray::cubicBezier() const
+{
+ if ( size() != 4 ) {
+#if defined(QT_CHECK_RANGE)
+ qWarning( "QPointArray::bezier: The array must have 4 control points" );
+#endif
+ KoPointArray pa;
+ return pa;
+ } else {
+ KoRect r = boundingRect();
+ int m = (int)(4+2*QMAX(r.width(),r.height()));
+ double *p = new double[m];
+ double ctrl[8];
+ int i;
+ for (i=0; i<4; i++) {
+ ctrl[i*2] = at(i).x();
+ ctrl[i*2+1] = at(i).y();
+ }
+ int len=0;
+ polygonizeQBezier( p, len, ctrl, m );
+ KoPointArray pa((len/2)+1); // one extra point for last point on line
+ int j=0;
+ for (i=0; j<len; i++) {
+ double x = qRound(p[j++]);
+ double y = qRound(p[j++]);
+ pa[i] = KoPoint(x,y);
+ }
+ // add last pt on the line, which will be at the last control pt
+ pa[(int)pa.size()-1] = at(3);
+ delete[] p;
+
+ return pa;
+ }
+}
+
+QPointArray KoPointArray::zoomPointArray( const KoZoomHandler* zoomHandler ) const
+{
+ QPointArray tmpPoints(size());
+ for ( uint i= 0; i<size();i++ ) {
+ KoPoint p = at( i );
+ tmpPoints.putPoints( i, 1, zoomHandler->zoomItX(p.x()),zoomHandler->zoomItY(p.y()) );
+ }
+ return tmpPoints;
+}
+
+QPointArray KoPointArray::zoomPointArray( const KoZoomHandler* zoomHandler, int penWidth ) const
+{
+ double fx;
+ double fy;
+ KoSize ext = boundingRect().size();
+ int pw = zoomHandler->zoomItX( penWidth ) / 2;
+
+ fx = (double)( zoomHandler->zoomItX(ext.width()) - 2 * pw ) / ext.width();
+ fy = (double)( zoomHandler->zoomItY(ext.height()) - 2 * pw ) / ext.height();
+
+ unsigned int index = 0;
+ QPointArray tmpPoints;
+ KoPointArray::ConstIterator it;
+ for ( it = begin(); it != end(); ++it, ++index ) {
+ int tmpX = qRound((*it).x() * fx + pw);
+ int tmpY = qRound((*it).y() * fy + pw);
+
+ tmpPoints.putPoints( index, 1, tmpX, tmpY );
+ }
+ return tmpPoints;
+}
diff --git a/kpresenter/KoPointArray.h b/kpresenter/KoPointArray.h
new file mode 100644
index 000000000..c78689413
--- /dev/null
+++ b/kpresenter/KoPointArray.h
@@ -0,0 +1,65 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2001 Laurent MONTEL <lmontel@mandrakesoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+#ifndef KOPOINTARRAY_H
+#define KOPOINTARRAY_H
+
+#include <qmemarray.h>
+#include <KoPoint.h>
+#include <KoRect.h>
+
+class KoZoomHandler;
+class KoPointArray : public QMemArray<KoPoint>
+{
+public:
+ KoPointArray() {}
+ ~KoPointArray() {}
+ KoPointArray( int size ) : QMemArray<KoPoint>( size ) {}
+ KoPointArray( const KoPointArray &a ) : QMemArray<KoPoint>( a ) {}
+
+ KoPointArray &operator=( const KoPointArray &a )
+ { return (KoPointArray&)assign( a ); }
+
+ KoPointArray copy() const
+ { KoPointArray tmp; return *((KoPointArray*)&tmp.duplicate(*this)); }
+
+ void translate( double dx, double dy );
+ KoRect boundingRect() const;
+
+ void point( uint i, double *x, double *y ) const;
+ KoPoint point( uint i ) const;
+ void setPoint( uint i, double x, double y );
+ void setPoint( uint i, const KoPoint &p );
+ bool putPoints( int index, int nPoints, double firstx, double firsty, ... );
+
+ KoPointArray cubicBezier() const;
+ static void cleanBuffers();
+
+ QPointArray zoomPointArray( const KoZoomHandler* zoomHandler ) const;
+ // Zoom the point array, taking into account the width of the pen
+ // (reducing the figure as necessary)
+ QPointArray zoomPointArray( const KoZoomHandler* zoomHandler, int penWidth ) const;
+
+protected:
+ static uint splen;
+ static void* sp;
+};
+
+
+#endif // KOPOINTARRAY_H
diff --git a/kpresenter/Makefile.am b/kpresenter/Makefile.am
new file mode 100644
index 000000000..7af7d3dad
--- /dev/null
+++ b/kpresenter/Makefile.am
@@ -0,0 +1,104 @@
+KDE_CXXFLAGS = $(USE_RTTI)
+INCLUDES = $(KOFFICE_INCLUDES) $(KOTEXT_INCLUDES) $(KOPAINTER_INCLUDES) -I$(kde_includes)/arts $(all_includes)
+
+bin_SCRIPTS = kprconverter.pl
+
+## A lib with all the code; can be used by filters
+lib_LTLIBRARIES = libkpresenterprivate.la
+libkpresenterprivate_la_SOURCES = KoPointArray.cpp KPrCanvas.cpp \
+ KPrPage.cpp KPrFindReplace.cpp KPrBackDia.cpp \
+ KPrWebPresentation.cpp KPrView.cpp KPrMSPresentationSetup.cpp \
+ KPrBrush.cpp \
+ KPrDocument.cpp \
+ KPrSoundPlayer.cpp \
+ KPrPgConfDia.cpp KPrEffectDia.cpp KPrCommand.cpp \
+ KPrUtils.cpp \
+ KPrEffectHandler.cpp KPrPageEffects.cpp\
+ KPrTransEffectDia.cpp \
+ KPrObject.cpp KPrLineObject.cpp KPrRectObject.cpp KPrEllipseObject.cpp \
+ KPrAutoformObject.cpp KPrTextObject.cpp \
+ KPrPixmapObject.cpp KPrPieObject.cpp KPrPartObject.cpp KPrGroupObject.cpp \
+ KPrBackground.cpp KPrGradient.cpp \
+ KPrGradientCollection.cpp \
+ KPrGotoPage.cpp \
+ KPrFactory.cpp \
+ KPrDocumentIface.skel KPrDocumentIface.cpp \
+ KPrViewIface.skel KPrViewIface.cpp\
+ KPrObjectIface.skel KPrObjectIface.cpp \
+ KPrPageIface.skel KPrPageIface.cpp \
+ KPrSideBar.cpp \
+ insertpagedia.ui \
+ KPrConfig.cpp KPrVariableCollection.cpp \
+ KPrTextDocument.cpp KPrPointObject.cpp KPrFreehandObject.cpp KPrPolylineObject.cpp \
+ KPrBezierCurveObject.cpp \
+ KPrPolygonObject.cpp KPrNoteBar.cpp \
+ KPrTextObjectIface.skel KPrTextObjectIface.cpp \
+ KPrTextViewIface.skel KPrTextViewIface.cpp KPrPresDurationDia.cpp \
+ KPrPieObjectIface.skel KPrPieObjectIface.cpp \
+ KPrPolygonObjectIface.skel KPrPolygonObjectIface.cpp \
+ KPrRectObjectIface.skel KPrRectObjectIface.cpp \
+ KPrPixmapObjectIface.skel KPrPixmapObjectIface.cpp \
+ KPrAutoFormObjectIface.skel KPrAutoFormObjectIface.cpp \
+ KPrObject2DIface.skel KPrObject2DIface.cpp \
+ KPrLineObjectIface.skel KPrLineObjectIface.cpp \
+ KPrQuadricBezierCurveObjectIface.skel KPrQuadricBezierCurveObjectIface.cpp \
+ KPrCubicBezierCurveObjectIface.skel KPrCubicBezierCurveObjectIface.cpp \
+ KPrSVGPathParser.cpp \
+ shadowdialog.ui KPrShadowDialogImpl.cpp KPrTextPreview.cpp \
+ KPrRotationDialogImpl.cpp rotationpropertyui.ui \
+ KPrFreehandObjectIface.skel KPrFreehandObjectIface.cpp KPrStyleManager.cpp \
+ KPrBgSpellCheck.cpp KPrMoveHelpLineDia.cpp \
+ KPrPolyLineObjectIface.skel KPrPolyLineObjectIface.cpp \
+ KPrDuplicateObjDia.cpp KPrClosedLineObject.cpp \
+ KPrImportStyleDia.cpp \
+ KPrImageEffectDia.cpp imageEffectBase.ui KPrCustomSlideShowDia.cpp \
+ KPrPBPreview.cpp penstyle.ui KPrPenStyleWidget.cpp \
+ KPrRectPreview.cpp rectpropertyui.ui KPrRectProperty.cpp \
+ KPrPiePreview.cpp \
+ KPrPolygonPreview.cpp \
+ KPrPicturePreview.cpp \
+ brushpropertyui.ui gradientpropertyui.ui KPrBrushProperty.cpp \
+ KPrGeneralProperty.cpp \
+ polygonpropertyui.ui KPrPolygonProperty.cpp \
+ piepropertyui.ui KPrPieProperty.cpp \
+ picturepropertyui.ui KPrPictureProperty.cpp \
+ marginui.ui KPrMarginWidget.cpp KPrTextProperty.cpp \
+ KPrObjectProperties.cpp \
+ KPrPropertyEditor.cpp \
+ slidetransitionwidget.ui KPrSlideTransitionDia.cpp \
+ KPrPrinterDlg.cpp
+
+libkpresenterprivate_la_LDFLAGS = $(all_libraries) -version-info 4:0 -no-undefined
+if include_ARTS
+ARTSKDE = -lartskde
+endif
+libkpresenterprivate_la_LIBADD = autoformEdit/libaf.la $(LIB_KOFFICEUI) $(LIB_KOTEXT) $(LIB_KOPAINTER) $(ARTSKDE)
+
+## The part
+kde_module_LTLIBRARIES = libkpresenterpart.la
+libkpresenterpart_la_SOURCES = KPrFactoryInit.cpp
+libkpresenterpart_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+libkpresenterpart_la_LIBADD = libkpresenterprivate.la
+
+## The kdeinit loadable module and the executable
+kdeinit_LTLIBRARIES = kpresenter.la
+bin_PROGRAMS =
+kpresenter_la_SOURCES = main.cpp
+kpresenter_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+kpresenter_la_LIBADD = $(LIB_KOFFICECORE)
+
+METASOURCES = AUTO
+
+xdg_apps_DATA = kpresenter.desktop
+
+kde_services_DATA = kpresenterpart.desktop
+
+rcdir = $(kde_datadir)/kpresenter
+rc_DATA = kpresenter.rc kpresenter_readonly.rc
+
+SUBDIRS = autoformEdit autoforms . pics templates dtd slideshow toolbar
+
+messages: rc.cpp
+ $(XGETTEXT) rc.cpp */*.cpp *.cpp *.h KPrAboutData.h -o $(podir)/kpresenter.pot
+
+include $(top_srcdir)/admin/Doxyfile.am
diff --git a/kpresenter/TODO b/kpresenter/TODO
new file mode 100644
index 000000000..97f5c36ac
--- /dev/null
+++ b/kpresenter/TODO
@@ -0,0 +1,117 @@
+BUGS :
+======
+- Placing of objects is not precise
+
+TO FINISH:
+===========
+- Presentation structure editor/viewer
+- Group objects (resizing is fucked up, set properties doesn't work)
+
+MISSING FEATURES / TODO:
+==============================
+- Current "align objects" aligns in relation with the page, is there a
+ way to align the h or v centers of several objects ?
+- use libkformula (or better, make a KPart out of it)
+- seperate the general configuration and page/slide specific config dialog
+ and make 2 out of them (currently it's one, which is confusing)
+- use GM in all dialogs
+- Rewrite autoforms (using XML)
+- Possibility to print 1, 2 or 4 slides / page
+- Menu item for copy page (to do it without copy+paste)
+- Extend Contents to Height => Fit contents to height (also shrink spacings!)
+ Maybe dont only change spacings but also fontsizes
+- Make option for txt obj to be abe to set a few colors and automatically use
+ them in this order for the paragraphs (like always one in black and one in blue and
+ again and again)
+- Synchronize object background and page background => object can't load picture and page can't use different brush type.
+
+KOffice in general:
+=======================
+- koTemplateChooseDia:
+ - Restart with last presentation (suggesting it in initial "open" dialog)
+ (using kapp->getConfig)
+
+
+KPresenter after koffice 1.3
+============================
+Todo:
+- Create compatibility for saving in old format for page effect speed.
+- Put in zip format copy/paste object to dnd between OO and koffice
+
+
+In Progress:
+-> copy/paste element as oasis format
+ -> copy object (In Progress)
+
+Done:
+-> copy/paste element as oasis format
+ -> duplicate page
+ -> copy page
+ -> create template
+-> Hide/show header/footer by page (allow by oasis format)
+-> implement custom slide show
+
+KPresenter Oasis Format:
+========================
+Done:
+->save/load object:
+ -> rectangle
+ -> pie
+ -> text object
+ -> ellipse
+ -> group objet
+ -> polygone object
+ -> polyline object (all attributes)
+-> save/load page background
+-> save/load object background
+-> save/load page effect (hide/show effect)
+-> save/load page sound effect
+-> save/load object effect
+-> save/load notes
+-> save/load stroke line
+-> save/load shadow object
+-> save/load page layout
+-> save/load sound page effect
+-> save/load picture object
+-> save/load page background image
+-> save/load animation group
+-> save/load sticky object
+-> save/load closed element (defined as polygone into oo spec draw:polygone)
+-> save/load picture effect
+ -> bright
+ -> contrast
+ -> intensity channel (green/blue/red)
+ -> grayscal
+-> save/load general config (GridIsVisible etc.)
+-> save/load object transparency
+-> save/load header/footer object
+-> save/load display header/footer
+-> save/load regular polygon
+-> save/load variable settings
+-> Save/load masterpage
+-> save/load in old format master page attribute
+
+Todo:
+-> save/load cubic/quadric/freehand object (define as svg object)
+-> save/load picture effect
+ -> picture effect (extend oasis format)
+ -> depth
+ -> mirror type (we must use rotate and draw:mirror element)
+
+Bugs:
+-> fix default value
+-> fix some arrow style
+
+In Progress:
+-> save/load backgroud of master page (save works not perfect)
+-> save/load picture effect
+-> save/load protect object
+-> save/load embedded object
+
+After koffice-1.4
+-> allow to move object outside page (ask by boiko)
+-> allow to put all transparent picture with a specific color (ask by boiko)
+
+Reginald Stadlbauer <reggie@kde.org>
+Laurent Montel <montel@kde.org>
+
diff --git a/kpresenter/autoformEdit/AFChoose.cpp b/kpresenter/autoformEdit/AFChoose.cpp
new file mode 100644
index 000000000..d5f007585
--- /dev/null
+++ b/kpresenter/autoformEdit/AFChoose.cpp
@@ -0,0 +1,202 @@
+// -*- Mode: c++-mode; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "AFChoose.h"
+
+#include <qlabel.h>
+#include <qvbox.h>
+#include <qtextstream.h>
+#include <qdir.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+#include <ksimpleconfig.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kicondialog.h>
+
+#include <KPrFactory.h>
+
+AFChoose::AFChoose(QWidget *parent, const QString &caption, const char *name)
+ : QTabDialog(parent,name,true)
+{
+ setCaption(caption);
+ setCancelButton(i18n("&Cancel"));
+ setOkButton(i18n("&OK"));
+ groupList.setAutoDelete(true);
+ getGroups();
+ setupTabs();
+ connect(this,SIGNAL(applyButtonPressed()),this,SLOT(chosen()));
+ connect(this,SIGNAL(cancelButtonPressed()),this,SLOT(cancelClicked()));
+}
+
+AFChoose::~AFChoose()
+{
+}
+
+void AFChoose::getGroups()
+{
+ // global autoforms (as we don't have an editor we don't have local ones)
+ QString afDir = locate( "autoforms", ".autoforms", KPrFactory::global() );
+
+ QFile f( afDir );
+ if ( f.open(IO_ReadOnly) ) {
+ QTextStream t( &f );
+ QString s;
+ while ( !t.eof() ) {
+ s = t.readLine();
+ if ( !s.isEmpty() ) {
+ grpPtr = new Group;
+ QString directory=QFileInfo( afDir ).dirPath() + "/" + s.simplifyWhiteSpace();
+ grpPtr->dir.setFile(directory);
+ QDir d(directory);
+ if(d.exists(".directory")) {
+ KSimpleConfig config(d.absPath()+"/.directory", true);
+ config.setDesktopGroup();
+ grpPtr->name=config.readEntry("Name");
+ }
+ groupList.append( grpPtr );
+ }
+ }
+ f.close();
+ }
+}
+
+void AFChoose::setupTabs()
+{
+ if (!groupList.isEmpty())
+ {
+ for (grpPtr=groupList.first();grpPtr != 0;grpPtr=groupList.next())
+ {
+ grpPtr->tab = new QVBox(this);
+ QWhatsThis::add(grpPtr->tab, i18n( "Choose a predefined shape by clicking on it then clicking the OK button (or just double-click on the shape). You can then insert the shape onto your slide by drawing the area with the mouse pointer." ) );
+ grpPtr->loadWid = new KIconCanvas(grpPtr->tab);
+ // Changes for the new KIconCanvas (Werner)
+ QDir d( grpPtr->dir.absFilePath() );
+ d.setNameFilter( "*.desktop" );
+ if( d.exists() ) {
+ QStringList files=d.entryList( QDir::Files | QDir::Readable, QDir::Name );
+ for(unsigned int i=0; i<files.count(); ++i) {
+ QString path=grpPtr->dir.absFilePath() + QChar('/');
+ files[i]=path + files[i];
+ KSimpleConfig config(files[i]);
+ config.setDesktopGroup();
+ if (config.readEntry("Type")=="Link") {
+ QString text=config.readEntry("Name");
+ QString icon=config.readEntry("Icon");
+ if(icon[0]!='/') // allow absolute paths for icons
+ icon=path + icon;
+ QString filename=config.readPathEntry("URL");
+ if(filename[0]!='/') {
+ if(filename.left(6)=="file:/") // I doubt this will happen
+ filename=filename.right(filename.length()-6);
+ filename=path + filename;
+ }
+ grpPtr->entries.insert(text, filename);
+ // now load the icon and create the item
+ // This code is shamelessly borrowed from KIconCanvas::slotLoadFiles
+ QImage img;
+ img.load(icon);
+ if (img.isNull()) {
+ kdWarning() << "Couldn't find icon " << icon << endl;
+ continue;
+ }
+ if (img.width() > 60 || img.height() > 60) {
+ if (img.width() > img.height()) {
+ int height = (int) ((60.0 / img.width()) * img.height());
+ img = img.smoothScale(60, height);
+ } else {
+ int width = (int) ((60.0 / img.height()) * img.width());
+ img = img.smoothScale(width, 60);
+ }
+ }
+ QPixmap pic;
+ pic.convertFromImage(img);
+ QIconViewItem *item = new QIconViewItem(grpPtr->loadWid, text, pic);
+ item->setKey(text);
+ item->setDragEnabled(false);
+ item->setDropEnabled(false);
+ } else
+ continue; // Invalid .desktop file
+ }
+ }
+ grpPtr->loadWid->setBackgroundColor(colorGroup().base());
+ grpPtr->loadWid->setResizeMode(QIconView::Adjust);
+ grpPtr->loadWid->sort();
+ connect(grpPtr->loadWid,SIGNAL(nameChanged(QString)),
+ this,SLOT(nameChanged(QString)));
+ connect(this, SIGNAL(currentChanged(QWidget *)), this,
+ SLOT(tabChanged(QWidget*)));
+ connect(grpPtr->loadWid,SIGNAL( doubleClicked ( QIconViewItem *)),this,
+ SLOT(slotDoubleClick()));
+ grpPtr->label = new QLabel(grpPtr->tab);
+ grpPtr->label->setText(" ");
+ grpPtr->label->setMaximumHeight(grpPtr->label->sizeHint().height());
+ addTab(grpPtr->tab,grpPtr->name);
+ }
+ }
+}
+
+void AFChoose::slotDoubleClick()
+{
+ chosen();
+ accept();
+}
+
+void AFChoose::nameChanged(QString name)
+{
+ for (grpPtr=groupList.first();grpPtr != 0;grpPtr=groupList.next())
+ grpPtr->label->setText(name);
+}
+
+void AFChoose::tabChanged(QWidget *w) {
+
+ for(grpPtr=groupList.first();grpPtr != 0;grpPtr=groupList.next()) {
+ if(grpPtr->tab==w)
+ grpPtr->label->setText(grpPtr->loadWid->getCurrent());
+ }
+}
+
+void AFChoose::chosen()
+{
+ if (!groupList.isEmpty())
+ {
+ for (grpPtr=groupList.first();grpPtr != 0;grpPtr=groupList.next())
+ {
+ if (grpPtr->tab->isVisible() && !grpPtr->loadWid->getCurrent().isEmpty())
+ emit formChosen(grpPtr->entries[grpPtr->loadWid->getCurrent()]);
+ else
+ emit afchooseCanceled();
+ }
+ }
+}
+
+void AFChoose::cancelClicked()
+{
+ emit afchooseCanceled();
+}
+
+void AFChoose::closeEvent ( QCloseEvent *e )
+{
+ emit afchooseCanceled();
+ QTabDialog::closeEvent ( e );
+}
+
+#include "AFChoose.moc"
diff --git a/kpresenter/autoformEdit/AFChoose.h b/kpresenter/autoformEdit/AFChoose.h
new file mode 100644
index 000000000..e767e4bfc
--- /dev/null
+++ b/kpresenter/autoformEdit/AFChoose.h
@@ -0,0 +1,89 @@
+// -*- Mode: c++-mode; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef AFCHOOSE_H
+#define AFCHOOSE_H
+
+#include <qtabdialog.h>
+#include <qptrlist.h>
+#include <qmap.h>
+#include <qfileinfo.h>
+
+class QLabel;
+class KIconCanvas;
+
+class AFChoose : public QTabDialog
+{
+ Q_OBJECT
+
+public:
+
+ // constructor - destructor
+ AFChoose(QWidget *parent=0, const QString &caption=QString::null, const char *name=0);
+ ~AFChoose();
+
+private:
+
+ // structure of a group
+ struct Group
+ {
+ QFileInfo dir;
+ QString name;
+ QWidget *tab;
+ KIconCanvas *loadWid;
+ QLabel *label;
+ QMap<QString, QString> entries;
+ };
+
+ // set groups
+ void getGroups();
+
+ // setup tabs
+ void setupTabs();
+
+ // ********** variables **********
+
+ // list of groups and a pointer to a group
+ QPtrList<Group> groupList;
+ Group *grpPtr;
+
+private slots:
+
+ // name changed
+ void nameChanged(QString);
+ void tabChanged(QWidget *);
+
+ // autoform chosen
+ void chosen();
+
+ void cancelClicked();
+
+ void slotDoubleClick();
+protected:
+ void closeEvent ( QCloseEvent * );
+
+signals:
+
+ //autoform chosen
+ void formChosen(const QString &);
+ void afchooseCanceled();
+};
+
+#endif //AFCHOOSE_H
diff --git a/kpresenter/autoformEdit/ATFInterpreter.cpp b/kpresenter/autoformEdit/ATFInterpreter.cpp
new file mode 100644
index 000000000..a32ff7ea9
--- /dev/null
+++ b/kpresenter/autoformEdit/ATFInterpreter.cpp
@@ -0,0 +1,453 @@
+// -*- Mode: c++-mode; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "ATFInterpreter.h"
+
+#include <qvaluestack.h>
+#include <qfile.h>
+
+const char ATFInterpreter::PNT_BG[] = "POINT {";
+const char ATFInterpreter::X_BG[] = "X {";
+const char ATFInterpreter::Y_BG[] = "Y {";
+const char ATFInterpreter::ATTR_BG[] = "ATTRIB {";
+const char ATFInterpreter::END[] = "}";
+
+// fields
+const int ATFInterpreter::ST_WIDTH = 1;
+const int ATFInterpreter::ST_HEIGHT = 2;
+const int ATFInterpreter::ST_VARIABLE = 3;
+const int ATFInterpreter::ST_NUMBER = 4;
+const int ATFInterpreter::ST_OPERATOR = 5;
+
+// operators
+const char ATFInterpreter::OP_EQUAL = '=';
+const char ATFInterpreter::OP_PLUS = '+';
+const char ATFInterpreter::OP_MINUS = '-';
+const char ATFInterpreter::OP_MULT = '*';
+const char ATFInterpreter::OP_DIV = '/';
+const char ATFInterpreter::COMMENT = '#';
+
+// allowed variables
+const char ATFInterpreter::VAR_1 = 'a';
+const char ATFInterpreter::VAR_2 = 'b';
+const char ATFInterpreter::VAR_3 = 'c';
+const char ATFInterpreter::VAR_4 = 'd';
+const char ATFInterpreter::VAR_5 = 'e';
+const char ATFInterpreter::VAR_6 = 'f';
+const char ATFInterpreter::VAR_X = 'x';
+const char ATFInterpreter::VAR_Y = 'y';
+const char ATFInterpreter::VAR_VARIA = 'v';
+const char ATFInterpreter::VAR_PW = 'p';
+const char ATFInterpreter::VAR_W = 'w';
+const char ATFInterpreter::VAR_H = 'h';
+
+// level (depth) of the syntax
+const int ATFInterpreter::LEVEL_NULL = 0;
+const int ATFInterpreter::LEVEL_POINT = 1;
+const int ATFInterpreter::LEVEL_X = 2;
+const int ATFInterpreter::LEVEL_Y = 3;
+const int ATFInterpreter::LEVEL_ATTR = 4;
+
+// numbers
+const char ATFInterpreter::NUM_0 = '0';
+const char ATFInterpreter::NUM_1 = '1';
+const char ATFInterpreter::NUM_2 = '2';
+const char ATFInterpreter::NUM_3 = '3';
+const char ATFInterpreter::NUM_4 = '4';
+const char ATFInterpreter::NUM_5 = '5';
+const char ATFInterpreter::NUM_6 = '6';
+const char ATFInterpreter::NUM_7 = '7';
+const char ATFInterpreter::NUM_8 = '8';
+const char ATFInterpreter::NUM_9 = '9';
+
+/******************************************************************/
+/* class ATFInterpreter */
+/******************************************************************/
+
+/*====================== constructor =============================*/
+ATFInterpreter::ATFInterpreter() {
+}
+
+/*======================= destrcutor =============================*/
+ATFInterpreter::~ATFInterpreter()
+{
+ coordList.setAutoDelete(true);
+ attrLs.setAutoDelete( true );
+}
+
+void ATFInterpreter::load(const QString & fileName)
+{
+ QString line;
+ QFile ptA(fileName);
+
+ coordList.clear();
+ lines.clear();
+
+ if (ptA.open(IO_ReadOnly))
+ {
+ while (!ptA.atEnd())
+ {
+ ptA.readLine(line,255);
+ lines.append(line.simplifyWhiteSpace());
+ }
+ ptA.close();
+ interpret();
+ }
+}
+
+QPointArray ATFInterpreter::getPointArray(int wid,int heig)
+{
+ unsigned int px = 0,py = 0,a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;
+ unsigned int tmp = 0,num = 0;
+ bool calc = false,res = false;
+ char op = OP_EQUAL,var = VAR_1;
+ QPtrList<Sign> slp;
+ QPointArray pntArray(coordList.count());
+
+ if (!coordList.isEmpty())
+ {
+ for (coordPtr=coordList.first();coordPtr != 0;coordPtr=coordList.next())
+ {
+ for (unsigned int i = 1; i<= 14; i++)
+ {
+ switch (i)
+ {
+ case 1: slp = coordPtr->pntX.var1; break;
+ case 2: slp = coordPtr->pntX.var2; break;
+ case 3: slp = coordPtr->pntX.var3; break;
+ case 4: slp = coordPtr->pntX.var4; break;
+ case 5: slp = coordPtr->pntX.var5; break;
+ case 6: slp = coordPtr->pntX.var6; break;
+ case 7: slp = coordPtr->pntX.result; break;
+ case 8: slp = coordPtr->pntY.var1; break;
+ case 9: slp = coordPtr->pntY.var2; break;
+ case 10: slp = coordPtr->pntY.var3; break;
+ case 11: slp = coordPtr->pntY.var4; break;
+ case 12: slp = coordPtr->pntY.var5; break;
+ case 13: slp = coordPtr->pntY.var6; break;
+ case 14: slp = coordPtr->pntY.result; break;
+ }
+ if (!slp.isEmpty())
+ {
+ tmp = 0;
+ for (signPtr=slp.first();signPtr != 0;signPtr=slp.next())
+ {
+ switch (signPtr->type)
+ {
+ case ST_WIDTH: { num = wid; calc = true; res = false;} break;
+ case ST_HEIGHT: { num = heig; calc = true; res = false;} break;
+ case ST_OPERATOR: { op = signPtr->op; calc = false; res = false;} break;
+ case ST_VARIABLE: { var = signPtr->var; calc = false; res = true;} break;
+ case ST_NUMBER: { num = signPtr->num; calc = true; res = false;} break;
+ }
+ if (calc)
+ {
+ switch (op)
+ {
+ case OP_EQUAL: tmp = num; break;
+ case OP_PLUS: tmp += num; break;
+ case OP_MINUS: tmp -= num; break;
+ case OP_MULT: tmp *= num; break;
+ case OP_DIV: tmp /= num; break;
+ }
+ }
+ else if (res)
+ {
+ switch (var)
+ {
+ case VAR_1: num = a; break;
+ case VAR_2: num = b; break;
+ case VAR_3: num = c; break;
+ case VAR_4: num = d; break;
+ case VAR_5: num = e; break;
+ case VAR_6: num = f; break;
+ }
+ switch (op)
+ {
+ case OP_EQUAL: tmp = num; break;
+ case OP_PLUS: tmp += num; break;
+ case OP_MINUS: tmp -= num; break;
+ case OP_MULT: tmp *= num; break;
+ case OP_DIV: tmp /= num; break;
+ }
+ }
+ }
+ if (i == 1 || i == 8) a = tmp;
+ if (i == 2 || i == 9) b = tmp;
+ if (i == 3 || i == 10) c = tmp;
+ if (i == 4 || i == 11) d = tmp;
+ if (i == 5 || i == 12) e = tmp;
+ if (i == 6 || i == 13) f = tmp;
+ if (i == 7) px = tmp;
+ if (i == 14) py = tmp;
+ }
+ }
+ pntArray.setPoint(coordList.at(),px,py);
+ }
+ }
+ return pntArray;
+}
+
+QPtrList<ATFInterpreter::AttribList> ATFInterpreter::getAttribList()
+{
+ if(!attrLs.isEmpty())
+ return attrLs;
+
+ AttribList *attribPtr;
+
+ if (!coordList.isEmpty())
+ {
+ for (coordPtr=coordList.first();coordPtr != 0;coordPtr=coordList.next())
+ {
+ attribPtr = new AttribList;
+ attribPtr->isVariable = coordPtr->isVariable;
+ attribPtr->pwDiv = coordPtr->pwDiv;
+ attrLs.append(attribPtr);
+ }
+ }
+ attrLs.setAutoDelete(true);
+ return attrLs;
+}
+
+void ATFInterpreter::interpret()
+{
+ QValueStack<int> level;
+ Value value;
+ bool v = false;
+ int pw = 1;
+ CoordStruct coord;
+ AttribStruct attrib;
+
+ level.push(LEVEL_NULL);
+
+ for (QStringList::Iterator it=lines.begin(); it!=lines.end(); ++it)
+ {
+ if (!(*it).isEmpty() && (*it).at(0) != COMMENT)
+ {
+ if (level.top() == LEVEL_NULL)
+ {
+ if ((*it) == PNT_BG)
+ {
+ coordPtr = new Coord;
+ level.push(LEVEL_POINT);
+ }
+ }
+ else if (level.top() == LEVEL_POINT)
+ {
+ if ((*it) == X_BG)
+ level.push(LEVEL_X);
+ else if ((*it) == Y_BG)
+ level.push(LEVEL_Y);
+ else if ((*it) == ATTR_BG)
+ level.push(LEVEL_ATTR);
+ else if ((*it) == QString(END))
+ {
+ level.pop();
+ coordList.append(coordPtr);
+ }
+ }
+ else if (level.top() == LEVEL_X || level.top() == LEVEL_Y || level.top() == LEVEL_ATTR)
+ {
+ switch (((*it).at(0)).latin1())
+ {
+ case VAR_1:
+ {
+ coord.a = (*it);
+ value.var1 = getVar(*it);
+ } break;
+ case VAR_2:
+ {
+ coord.b = (*it);
+ value.var2 = getVar(*it);
+ } break;
+ case VAR_3:
+ {
+ coord.c = (*it);
+ value.var3 = getVar(*it);
+ } break;
+ case VAR_4:
+ {
+ coord.d = (*it);
+ value.var4 = getVar(*it);
+ } break;
+ case VAR_5:
+ {
+ coord.e = (*it);
+ value.var5 = getVar(*it);
+ } break;
+ case VAR_6:
+ {
+ coord.f = (*it);
+ value.var6 = getVar(*it);
+ } break;
+ case VAR_X: case VAR_Y:
+ {
+ coord.result = (*it);
+ value.result = getVar(*it);
+ } break;
+ case VAR_VARIA:
+ {
+ if ((*it).find('0') != -1) v = false;
+ else v = true;
+ attrib.isVariable = (*it);
+ } break;
+ case VAR_PW:
+ {
+ pw = 1; pw = ((*it).at(4)).latin1() - 48;
+ attrib.pwDiv = (*it);
+ } break;
+ case '}':
+ {
+ switch (level.top())
+ {
+ case LEVEL_X:
+ {
+ coordPtr->pntX = value;
+ coord.a = QString::null;
+ coord.b = QString::null;
+ coord.c = QString::null;
+ coord.d = QString::null;
+ coord.e = QString::null;
+ coord.f = QString::null;
+ coord.result = QString::null;
+ } break;
+ case LEVEL_Y:
+ {
+ coordPtr->pntY = value;
+ coord.a = QString::null;
+ coord.b = QString::null;
+ coord.c = QString::null;
+ coord.d = QString::null;
+ coord.e = QString::null;
+ coord.f = QString::null;
+ coord.result = QString::null;
+ } break;
+ case LEVEL_ATTR:
+ {
+ coordPtr->isVariable = v;
+ coordPtr->pwDiv = pw;
+ pw = 1;
+ v = false;
+ attrib.isVariable = QString::null;
+ attrib.pwDiv = 1;
+ } break;
+ }
+ level.pop();
+ } break;
+ }
+ }
+ }
+ }
+}
+
+QPtrList<ATFInterpreter::Sign> ATFInterpreter::getVar(const QString &s)
+{
+ QPtrList<Sign> list;
+
+ for (unsigned int i=1; i<s.length(); ++i)
+ {
+ if(s.at(i)==' ')
+ continue;
+ signPtr = new Sign;
+ switch (s.at(i).latin1())
+ {
+ case VAR_W: signPtr->type = ST_WIDTH; break;
+ case VAR_H: signPtr->type = ST_HEIGHT; break;
+ case VAR_1:
+ {
+ signPtr->type = ST_VARIABLE;
+ signPtr->var = VAR_1;
+ } break;
+ case VAR_2:
+ {
+ signPtr->type = ST_VARIABLE;
+ signPtr->var = VAR_2;
+ } break;
+ case VAR_3:
+ {
+ signPtr->type = ST_VARIABLE;
+ signPtr->var = VAR_3;
+ } break;
+ case VAR_4:
+ {
+ signPtr->type = ST_VARIABLE;
+ signPtr->var = VAR_4;
+ } break;
+ case VAR_5:
+ {
+ signPtr->type = ST_VARIABLE;
+ signPtr->var = VAR_5;
+ } break;
+ case VAR_6:
+ {
+ signPtr->type = ST_VARIABLE;
+ signPtr->var = VAR_6;
+ } break;
+ case OP_EQUAL:
+ {
+ signPtr->type = ST_OPERATOR;
+ signPtr->op = OP_EQUAL;
+ } break;
+ case OP_PLUS:
+ {
+ signPtr->type = ST_OPERATOR;
+ signPtr->op = OP_PLUS;
+ } break;
+ case OP_MINUS:
+ {
+ signPtr->type = ST_OPERATOR;
+ signPtr->op = OP_MINUS;
+ } break;
+ case OP_DIV:
+ {
+ signPtr->type = ST_OPERATOR;
+ signPtr->op = OP_DIV;
+ } break;
+ case OP_MULT:
+ {
+ signPtr->type = ST_OPERATOR;
+ signPtr->op = OP_MULT;
+ } break;
+ case NUM_0: case NUM_1: case NUM_2: case NUM_3: case NUM_4:
+ case NUM_5: case NUM_6: case NUM_7: case NUM_8: case NUM_9:
+ {
+ signPtr->type = ST_NUMBER;
+ if (s.length() - 1 > i)
+ {
+ switch (s.at(i+1).latin1())
+ {
+ case NUM_0: case NUM_1: case NUM_2: case NUM_3: case NUM_4:
+ case NUM_5: case NUM_6: case NUM_7: case NUM_8: case NUM_9:
+ {
+ signPtr->num = (s.at(i).latin1() - 48) * 10 + s.at(i+1).latin1() - 48;
+ i++;
+ } break;
+ default:
+ signPtr->num = s.at(i).latin1() - 48; break;
+ }
+ }
+ else
+ signPtr->num = s.at(i).latin1() - 48;
+ } break;
+ }
+ list.append(signPtr);
+ }
+ return list;
+}
diff --git a/kpresenter/autoformEdit/ATFInterpreter.h b/kpresenter/autoformEdit/ATFInterpreter.h
new file mode 100644
index 000000000..8e0feebbb
--- /dev/null
+++ b/kpresenter/autoformEdit/ATFInterpreter.h
@@ -0,0 +1,175 @@
+// -*- Mode: c++-mode; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef ATFINTERP_H
+#define ATFINTERP_H
+
+#include <qpointarray.h>
+#include <qptrlist.h>
+#include <qstringlist.h>
+
+class ATFInterpreter {
+
+public:
+
+ // structure of an attribute list
+ struct AttribList
+ {
+ bool isVariable;
+ int pwDiv;
+ };
+
+ // coordinate structure
+ struct CoordStruct
+ {
+ QString a;
+ QString b;
+ QString c;
+ QString d;
+ QString e;
+ QString f;
+ QString result;
+ };
+
+ // attribute structure
+ struct AttribStruct
+ {
+ QString isVariable;
+ QString pwDiv;
+ };
+
+ // structure of signs
+ struct Sign
+ {
+ char op;
+ int num;
+ char var;
+ int type;
+ };
+
+ // structure of values
+ struct Value
+ {
+ QPtrList<Sign> var1;
+ QPtrList<Sign> var2;
+ QPtrList<Sign> var3;
+ QPtrList<Sign> var4;
+ QPtrList<Sign> var5;
+ QPtrList<Sign> var6;
+ QPtrList<Sign> result;
+ };
+
+ // constructure - destructure
+ ATFInterpreter();
+ ~ATFInterpreter();
+
+ // load autoform
+ void load(const QString &);
+
+ // get pointarray/attribute list/points
+ QPointArray getPointArray(int,int);
+ QPtrList<AttribList> getAttribList();
+
+protected:
+
+ // fields
+ static const int ST_WIDTH;
+ static const int ST_HEIGHT;
+ static const int ST_VARIABLE;
+ static const int ST_NUMBER;
+ static const int ST_OPERATOR;
+
+ // operators
+ static const char OP_EQUAL;
+ static const char OP_PLUS;
+ static const char OP_MINUS;
+ static const char OP_MULT;
+ static const char OP_DIV;
+ static const char COMMENT;
+
+ // block (structure) beginnings - ends
+ static const char PNT_BG[];
+ static const char X_BG[];
+ static const char Y_BG[];
+ static const char ATTR_BG[];
+ static const char END[];
+
+ // allowed variables
+ static const char VAR_1;
+ static const char VAR_2;
+ static const char VAR_3;
+ static const char VAR_4;
+ static const char VAR_5;
+ static const char VAR_6;
+ static const char VAR_X;
+ static const char VAR_Y;
+ static const char VAR_VARIA;
+ static const char VAR_PW;
+ static const char VAR_W;
+ static const char VAR_H;
+
+ // level (depth) of the syntax
+ static const int LEVEL_NULL;
+ static const int LEVEL_POINT;
+ static const int LEVEL_X;
+ static const int LEVEL_Y;
+ static const int LEVEL_ATTR;
+
+ // numbers
+ static const char NUM_0;
+ static const char NUM_1;
+ static const char NUM_2;
+ static const char NUM_3;
+ static const char NUM_4;
+ static const char NUM_5;
+ static const char NUM_6;
+ static const char NUM_7;
+ static const char NUM_8;
+ static const char NUM_9;
+
+ // structure of coordinates
+ struct Coord
+ {
+ Value pntX;
+ Value pntY;
+ bool isVariable;
+ int pwDiv;
+ };
+
+ // interpret the code
+ void interpret();
+
+ // get varaible of a line
+ QPtrList<Sign> getVar(const QString&);
+
+ // ********** variables **********
+
+ // list of coordinates and pointers to coordinate/sign/value
+ QPtrList<Coord> coordList;
+ QPtrList<AttribList> attrLs;
+ Coord *coordPtr;
+ Sign *signPtr;
+ Value *valuePtr;
+
+ // list of lines
+ QStringList lines;
+};
+
+#endif //ATFINTERP_H
diff --git a/kpresenter/autoformEdit/Makefile.am b/kpresenter/autoformEdit/Makefile.am
new file mode 100644
index 000000000..248b3f25f
--- /dev/null
+++ b/kpresenter/autoformEdit/Makefile.am
@@ -0,0 +1,12 @@
+####### General stuff
+
+INCLUDES = -I$(srcdir)/.. $(KOFFICE_INCLUDES) $(all_includes)
+
+####### Files
+
+noinst_LTLIBRARIES = libaf.la
+
+libaf_la_SOURCES = ATFInterpreter.cpp AFChoose.cpp
+
+METASOURCES = AUTO
+
diff --git a/kpresenter/autoforms/.autoforms b/kpresenter/autoforms/.autoforms
new file mode 100644
index 000000000..11ac6a238
--- /dev/null
+++ b/kpresenter/autoforms/.autoforms
@@ -0,0 +1,2 @@
+Arrows
+Connections \ No newline at end of file
diff --git a/kpresenter/autoforms/Arrows/.directory b/kpresenter/autoforms/Arrows/.directory
new file mode 100644
index 000000000..76c402aca
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/.directory
@@ -0,0 +1,41 @@
+[Desktop Entry]
+Name=Arrows
+Name[af]=Pyltjies
+Name[az]=Oxlar
+Name[bg]=Стрелки
+Name[bs]=Strelice
+Name[ca]=Fletxes
+Name[cy]=Saethau
+Name[da]=Pile
+Name[de]=Pfeile
+Name[el]=Βέλη
+Name[eo]=Sagoj
+Name[es]=Flechas
+Name[et]=Nooled
+Name[fo]=Pílir
+Name[fy]=Pylken
+Name[hi]=तीर
+Name[id]=Panah
+Name[is]=Örvar
+Name[it]=Frecce
+Name[ja]=矢印
+Name[km]=ព្រួញ​
+Name[lo]=ລູກສອນ
+Name[mt]=Vleġeġ
+Name[nds]=Pielen
+Name[nl]=Pijlen
+Name[pl]=Strzałki
+Name[pt]=Setas
+Name[pt_BR]=Setas
+Name[sk]=Šipky
+Name[sr]=Стрелице
+Name[sr@Latn]=Strelice
+Name[sv]=Pilar
+Name[ta]=அம்புக்குறிகள்
+Name[tg]=Ақрабакҳо
+Name[th]=ลูกศร
+Name[ven]=Misevhe
+Name[wa]=Fletches
+Name[xh]=Amatolo
+Name[zh_TW]=箭頭
+Name[zu]=Imicibisholo
diff --git a/kpresenter/autoforms/Arrows/ArrowDown.atf b/kpresenter/autoforms/Arrows/ArrowDown.atf
new file mode 100644
index 000000000..02fd58674
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowDown.atf
@@ -0,0 +1,255 @@
+####################################
+# RightArrow Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w * 3 / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w * 3 / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+b = h / 7
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+b = h / 7
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w / 2
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+b = h / 7
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+b = h / 7
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 8. Point
+
+POINT {
+
+ X {
+a = w / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Arrows/ArrowDown.desktop b/kpresenter/autoforms/Arrows/ArrowDown.desktop
new file mode 100644
index 000000000..aeca2db6d
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowDown.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Link
+URL=.source/ArrowDown.atf
+Name=Arrow Down
+Name[bg]=Стрелка надолу
+Name[ca]=Fletxa a baix
+Name[cy]=Saeth i Lawr
+Name[da]=Pil ned
+Name[de]=Pfeil nach unten
+Name[el]=Κάτω βέλος
+Name[eo]=Malsupren
+Name[es]=Flecha hacia abajo
+Name[et]=Nool alla
+Name[eu]=Beheko gezia
+Name[fa]=جهت پایین
+Name[fi]=Nuoli alas
+Name[fr]=Flèche basse
+Name[fy]=Pylk omleech
+Name[gl]=Frecha para Baixo
+Name[he]=חץ למטה
+Name[hr]=Strelica na dolje
+Name[hu]=Lefelé nyíl
+Name[is]=Píla niður
+Name[it]=Freccia giù
+Name[ja]=下矢印
+Name[km]=ព្រួញ​ចុះក្រោម​
+Name[lv]=Bulta uz leju
+Name[ms]=Anak Panah Ke bawah
+Name[nb]=Pil ned
+Name[nds]=Piel daal
+Name[ne]=तल्लो बाँण
+Name[nl]=Pijl omlaag
+Name[nn]=Pil ned
+Name[pl]=Strzałka w dół
+Name[pt]=Seta para Baixo
+Name[pt_BR]=Seta para baixo
+Name[ru]=Стрелка вниз
+Name[se]=Vulosnjuolla
+Name[sk]=Šipka dolu
+Name[sl]=Puščica dol
+Name[sr]=Стрелица доле
+Name[sr@Latn]=Strelica dole
+Name[sv]=Pil ned
+Name[uk]=Стрілка вниз
+Name[uz]=Pastga belgisi
+Name[uz@cyrillic]=Пастга белгиси
+Name[zh_CN]=下箭头
+Name[zh_TW]=下箭頭
+Icon=.icon/ArrowDown.png
diff --git a/kpresenter/autoforms/Arrows/ArrowDown.png b/kpresenter/autoforms/Arrows/ArrowDown.png
new file mode 100644
index 000000000..067af7e87
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowDown.png
Binary files differ
diff --git a/kpresenter/autoforms/Arrows/ArrowLeft.atf b/kpresenter/autoforms/Arrows/ArrowLeft.atf
new file mode 100644
index 000000000..5c0dfa1de
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowLeft.atf
@@ -0,0 +1,255 @@
+####################################
+# RightArrow Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h * 3 / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w
+b = w * 2 / 3
+c = w / 7
+ d = 0
+ e = 0
+ f = 0
+x = a - b + c
+ }
+
+ Y {
+a = h * 3 / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+b = w * 2 / 3
+c = w / 7
+ d = 0
+ e = 0
+ f = 0
+x = a - b + c
+ }
+
+ Y {
+a = h
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w
+b = w * 2 / 3
+c = w / 7
+ d = 0
+ e = 0
+ f = 0
+x = a - b + c
+ }
+
+ Y {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w
+b = w * 2 / 3
+c = w / 7
+ d = 0
+ e = 0
+ f = 0
+x = a - b + c
+ }
+
+ Y {
+a = h / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 8. Point
+
+POINT {
+
+ X {
+a = w
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Arrows/ArrowLeft.desktop b/kpresenter/autoforms/Arrows/ArrowLeft.desktop
new file mode 100644
index 000000000..97ec7e9bb
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowLeft.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Link
+URL=.source/ArrowLeft.atf
+Name=Arrow Left
+Name[bg]=Стрелка наляво
+Name[ca]=Fletxa esquerra
+Name[cy]=Saeth i'r Chwith
+Name[da]=Pil til venstre
+Name[de]=Pfeil nach links
+Name[el]=Αριστερό βέλος
+Name[eo]=Maldekstren
+Name[es]=Flecha a la izquierda
+Name[et]=Nool vasakule
+Name[eu]=Ezker-gezia
+Name[fa]=جهت چپ
+Name[fi]=Nuoli vasemmalle
+Name[fr]=Flèche gauche
+Name[fy]=Pylk lofts
+Name[gl]=Frecha para a Esquerda
+Name[he]=חץ שמאלה
+Name[hr]=Strelica ulijevo
+Name[hu]=Balra nyíl
+Name[is]=Vinstri píla
+Name[it]=Freccia sinistra
+Name[ja]=左矢印
+Name[km]=ព្រួញ​ទៅ​ឆ្វេង​
+Name[lv]=Bulta pa kreisi
+Name[ms]=Anak Panah Kiri
+Name[nb]=Pil til venstre
+Name[nds]=Piel links
+Name[ne]=बायाँ बाँण
+Name[nl]=Pijl links
+Name[nn]=Pil til venstre
+Name[pl]=Strzałka w lewo
+Name[pt]=Seta para a Esquerda
+Name[pt_BR]=Seta para esquerda
+Name[ru]=Стрелка влево
+Name[se]=Gurutnjuolla
+Name[sk]=Šipka vľavo
+Name[sl]=Puščica levo
+Name[sr]=Стрелица лево
+Name[sr@Latn]=Strelica levo
+Name[sv]=Pil vänster
+Name[uk]=Стрілка ліворуч
+Name[uz]=Chapga belgisi
+Name[uz@cyrillic]=Чапга белгиси
+Name[zh_CN]=左箭头
+Name[zh_TW]=左箭頭
+Icon=.icon/ArrowLeft.png
diff --git a/kpresenter/autoforms/Arrows/ArrowLeft.png b/kpresenter/autoforms/Arrows/ArrowLeft.png
new file mode 100644
index 000000000..11fc41e0a
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowLeft.png
Binary files differ
diff --git a/kpresenter/autoforms/Arrows/ArrowLeftDown.atf b/kpresenter/autoforms/Arrows/ArrowLeftDown.atf
new file mode 100644
index 000000000..0ddd66852
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowLeftDown.atf
@@ -0,0 +1,255 @@
+####################################
+# Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 0
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w / 16
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 16
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w / 16
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = h / 16
+c = 0
+d = 0
+e = 0
+f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w
+b = w / 16
+c = 0
+d = 0
+e = 0
+f = 0
+x = a - b
+ }
+
+ Y {
+a = h
+b = h / 16
+c = 0
+d = 0
+e = 0
+f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 0
+ }
+
+}
+
+################ 8. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Arrows/ArrowLeftDown.desktop b/kpresenter/autoforms/Arrows/ArrowLeftDown.desktop
new file mode 100644
index 000000000..4110c2332
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowLeftDown.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Link
+URL=.source/ArrowLeftDown.atf
+Name=Arrow Left/Down
+Name[bg]=Стрелка наляво/надолу
+Name[ca]=Fletxa esquerra/a baix
+Name[cy]=Saeth i'r Chwith/i Lawr
+Name[da]=Pil til venstre/ned
+Name[de]=Pfeil nach links/unten
+Name[el]=Αριστερό/κάτω βέλος
+Name[eo]=Malsupren maldekstren
+Name[es]=Flecha a la izquierda/abajo
+Name[et]=Nool vasakule/alla
+Name[eu]=Ezker-beheko gezia
+Name[fa]=جهت چپ/پایین
+Name[fi]=Nuoli vasemalle alas
+Name[fr]=Flèche gauche / basse
+Name[fy]=Pylk lofts/omleech
+Name[gl]=Frecha para Baixo/Esquerda
+Name[he]=חץ שמאלה ולמטה
+Name[hr]=Strelica ulijevo/dolje
+Name[hu]=Balra/lefelé nyíl
+Name[is]=Píla vinstri/niður
+Name[it]=Freccia sinistra/giù
+Name[ja]=左下矢印
+Name[km]=ព្រួញ​ទៅ​ឆ្វេង/ចុះក្រោម
+Name[lv]=Bulta pa kreisi/lejup
+Name[ms]=Anak Panah Kiri/Ke bawah
+Name[nb]=Pil ned til venstre
+Name[nds]=Piel na links/nerrn
+Name[ne]=बायाँ/तल बाँण
+Name[nl]=Pijl linksonder
+Name[nn]=Pil ned til venstre
+Name[pl]=Strzałka w lewo/dół
+Name[pt]=Seta para Baixo/Esquerda
+Name[pt_BR]=Seta para esquerda/baixo
+Name[ru]=Стрелка влево-вниз
+Name[se]=Gurut/vulosnjuolla
+Name[sk]=Šipka vľavo/dolu
+Name[sl]=Puščica levo/dol
+Name[sr]=Стрелица лево/доле
+Name[sr@Latn]=Strelica levo/dole
+Name[sv]=Pil vänster/ned
+Name[uk]=Стрілка ліворуч/вниз
+Name[uz]=Chapga/Pastga belgisi
+Name[uz@cyrillic]=Чапга/Пастга белгиси
+Name[zh_CN]=左下箭头
+Name[zh_TW]=左下箭頭
+Icon=.icon/ArrowLeftDown.png
diff --git a/kpresenter/autoforms/Arrows/ArrowLeftDown.png b/kpresenter/autoforms/Arrows/ArrowLeftDown.png
new file mode 100644
index 000000000..8befeeb57
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowLeftDown.png
Binary files differ
diff --git a/kpresenter/autoforms/Arrows/ArrowLeftUp.atf b/kpresenter/autoforms/Arrows/ArrowLeftUp.atf
new file mode 100644
index 000000000..eb8605ac9
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowLeftUp.atf
@@ -0,0 +1,255 @@
+####################################
+# RightArrow Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 0
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+b = w / 16
+c = 0
+d = 0
+e = 0
+f = 0
+x = a - b
+ }
+
+ Y {
+a = h / 16
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w / 16
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 16
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w / 16
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = h / 16
+c = 0
+d = 0
+e = 0
+f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 0
+ }
+
+}
+
+################ 8. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Arrows/ArrowLeftUp.desktop b/kpresenter/autoforms/Arrows/ArrowLeftUp.desktop
new file mode 100644
index 000000000..67cc35649
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowLeftUp.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Link
+URL=.source/ArrowLeftUp.atf
+Name=Arrow Left/Up
+Name[bg]=Стрелка наляво/нагоре
+Name[ca]=Fletxa esquerra/a dalt
+Name[cy]=Saeth i'r Chwith/i Fyny
+Name[da]=Pil til venstre/op
+Name[de]=Pfeil nach links/oben
+Name[el]=Αριστερό/πάνω βέλος
+Name[eo]=Supren maldekstren
+Name[es]=Flecha a la izquierda/arriba
+Name[et]=Nool vasakule/üles
+Name[eu]=Ezker-goiko gezia
+Name[fa]=جهت چپ/بالا
+Name[fi]=Nuoli vasemmalle ylös
+Name[fr]=Flèche gauche / haute
+Name[fy]=Pylk lofts/omheech
+Name[gl]=Frecha para Cima/Esquerda
+Name[he]=חץ שמאלה ולמעלה
+Name[hr]=Strelica ulijevo/gore
+Name[hu]=Balra/felfelé nyíl
+Name[is]=Píla vinstri/upp
+Name[it]=Freccia sinistra/su
+Name[ja]=左上矢印
+Name[km]=ព្រួញ​ទៅ​ឆ្វេង/ឡើង​លើ
+Name[lv]=Bulta pa kreisi/augšup
+Name[ms]=Anak Panah Kiri/Ke atas
+Name[nb]=Pil opp til venstre
+Name[nds]=Piel na links/hooch
+Name[ne]=बायाँ/माथि बाँण
+Name[nl]=Pijl linksboven
+Name[nn]=Pil opp til venstre
+Name[pl]=Strzałka w lewo/górę
+Name[pt]=Seta para Cima/Esquerda
+Name[pt_BR]=Seta para esquetda/cima
+Name[ru]=Стрелка влево-вверх
+Name[se]=Gurut/bajásnjuolla
+Name[sk]=Šipka vľavo/hore
+Name[sl]=Puščica levo/gor
+Name[sr]=Стрелица лево/горе
+Name[sr@Latn]=Strelica levo/gore
+Name[sv]=Pil vänster/upp
+Name[uk]=Стрілка ліворуч/вгору
+Name[uz]=Chapga/Yuqoriga belgisi
+Name[uz@cyrillic]=Чапга/Юқорига белгиси
+Name[zh_CN]=左上箭头
+Name[zh_TW]=左上箭頭
+Icon=.icon/ArrowLeftUp.png
diff --git a/kpresenter/autoforms/Arrows/ArrowLeftUp.png b/kpresenter/autoforms/Arrows/ArrowLeftUp.png
new file mode 100644
index 000000000..f1ffe3e6e
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowLeftUp.png
Binary files differ
diff --git a/kpresenter/autoforms/Arrows/ArrowRight.atf b/kpresenter/autoforms/Arrows/ArrowRight.atf
new file mode 100644
index 000000000..5cfbdb705
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowRight.atf
@@ -0,0 +1,255 @@
+####################################
+# RightArrow Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 4
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h * 3 / 4
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = w / 7
+c = 0
+d = 0
+e = 0
+f = 0
+x = a - b
+ }
+
+ Y {
+a = h * 3 / 4
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = w / 7
+c = 0
+d = 0
+e = 0
+f = 0
+x = a - b
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = w / 7
+c = 0
+d = 0
+e = 0
+f = 0
+x = a - b
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = w / 7
+c = 0
+d = 0
+e = 0
+f = 0
+x = a - b
+ }
+
+ Y {
+a = h / 4
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 8. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 4
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Arrows/ArrowRight.desktop b/kpresenter/autoforms/Arrows/ArrowRight.desktop
new file mode 100644
index 000000000..88e981b07
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowRight.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Link
+URL=.source/ArrowRight.atf
+Name=Arrow Right
+Name[bg]=Стрелка надясно
+Name[ca]=Fletxa dreta
+Name[cy]=Saeth i'r Dde
+Name[da]=Pil til højre
+Name[de]=Pfeil nach rechts
+Name[el]=Δεξί βέλος
+Name[eo]=Dekstren
+Name[es]=Flecha a la derecha
+Name[et]=Nool paremale
+Name[eu]=Eskuin-gezia
+Name[fa]=جهت راست
+Name[fi]=Nuoli oikealle
+Name[fr]=Flèche droite
+Name[fy]=Pylk rjochts
+Name[gl]=Frecha para a Direita
+Name[he]=חץ ימינה
+Name[hr]=Strelica udesno
+Name[hu]=Jobbra nyíl
+Name[is]=Hægri píla
+Name[it]=Freccia destra
+Name[ja]=右矢印
+Name[km]=ព្រួញទៅ​ស្តាំ​
+Name[lv]=Bulta pa labi
+Name[ms]=Anak Panah Kanan
+Name[nb]=Pil til høyre
+Name[nds]=Piel rechts
+Name[ne]=दायाँ बाँण
+Name[nl]=Pijl rechts
+Name[nn]=Pil til høgre
+Name[pl]=Strzałka w prawo
+Name[pt]=Seta para Direita
+Name[pt_BR]=Seta para direita
+Name[ru]=Стрелка вправо
+Name[se]=Olgešnjuolla
+Name[sk]=Šipka vpravo
+Name[sl]=Puščica desno
+Name[sr]=Стрелица десно
+Name[sr@Latn]=Strelica desno
+Name[sv]=Pil höger
+Name[uk]=Стрілка праворуч
+Name[uz]=Oʻngga belgisi
+Name[uz@cyrillic]=Ўнгга белгиси
+Name[zh_CN]=右箭头
+Name[zh_TW]=右箭頭
+Icon=.icon/ArrowRight.png
diff --git a/kpresenter/autoforms/Arrows/ArrowRight.png b/kpresenter/autoforms/Arrows/ArrowRight.png
new file mode 100644
index 000000000..869b0952a
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowRight.png
Binary files differ
diff --git a/kpresenter/autoforms/Arrows/ArrowRightDown.atf b/kpresenter/autoforms/Arrows/ArrowRightDown.atf
new file mode 100644
index 000000000..cdf158269
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowRightDown.atf
@@ -0,0 +1,255 @@
+####################################
+# Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 0
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w / 16
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = h / 16
+c = 0
+d = 0
+e = 0
+f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w
+b = w / 16
+c = 0
+d = 0
+e = 0
+f = 0
+x = a - b
+ }
+
+ Y {
+a = h
+b = h / 16
+c = 0
+d = 0
+e = 0
+f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w
+b = w / 16
+c = 0
+d = 0
+e = 0
+f = 0
+x = a - b
+ }
+
+ Y {
+a = h / 16
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 0
+ }
+
+}
+
+################ 8. Point
+
+POINT {
+
+ X {
+a = w / 3
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Arrows/ArrowRightDown.desktop b/kpresenter/autoforms/Arrows/ArrowRightDown.desktop
new file mode 100644
index 000000000..54817e453
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowRightDown.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Link
+URL=.source/ArrowRightDown.atf
+Name=Arrow Right/Down
+Name[bg]=Стрелка надясно/надолу
+Name[ca]=Fletxa dreta/a baix
+Name[cy]=Saeth i'r Dde/i Lawr
+Name[da]=Pil til højre/ned
+Name[de]=Pfeil nach rechts/unten
+Name[el]=Δεξί/κάτω βέλος
+Name[eo]=Dekstren/Malsupren
+Name[es]=Flecha a la derecha/abajo
+Name[et]=Nool paremale/alla
+Name[eu]=Eskuin-beheko gezia
+Name[fa]=جهت راست/پایین
+Name[fi]=Nuoli oikealle/alas
+Name[fr]=Flèche droite / basse
+Name[fy]=Pylk rjochts/omleech
+Name[gl]=Frecha para Baixo/Direita
+Name[he]=חץ ימינה ולמטה
+Name[hr]=Strelica udesno/dolje
+Name[hu]=Jobbra/lefelé nyíl
+Name[is]=Píla hægri/niður
+Name[it]=Freccia destra/giù
+Name[ja]=右下矢印
+Name[km]=ព្រួញ​ទៅ​ស្ដាំ/ចុះក្រោម
+Name[lv]=Bulta pa labi/lejup
+Name[ms]=Anak Panah Kanan/Ke bawah
+Name[nb]=Pil ned til høyre
+Name[nds]=Piel na rechts/nerrn
+Name[ne]=दायाँ/तल बाँण
+Name[nl]=Pijl rechtsonder
+Name[nn]=Pil ned til høgre
+Name[pl]=Strzałka w prawo/dół
+Name[pt]=Seta para Baixo/Direita
+Name[pt_BR]=Seta para direita/baixo
+Name[ru]=Стрелка вправо-вниз
+Name[se]=Olgeš/vulosnjuolla
+Name[sk]=Šipka vpravo/dolu
+Name[sl]=Puščica desno/dol
+Name[sr]=Стрелица десно/доле
+Name[sr@Latn]=Strelica desno/dole
+Name[sv]=Pil höger/ned
+Name[uk]=Стрілка праворуч/вниз
+Name[uz]=Oʻngga/Pastga belgisi
+Name[uz@cyrillic]=Ўнгга/Пастга белгиси
+Name[zh_CN]=右下箭头
+Name[zh_TW]=右下箭頭
+Icon=.icon/ArrowRightDown.png
diff --git a/kpresenter/autoforms/Arrows/ArrowRightDown.png b/kpresenter/autoforms/Arrows/ArrowRightDown.png
new file mode 100644
index 000000000..102639a38
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowRightDown.png
Binary files differ
diff --git a/kpresenter/autoforms/Arrows/ArrowRightUp.atf b/kpresenter/autoforms/Arrows/ArrowRightUp.atf
new file mode 100644
index 000000000..5d6d1e327
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowRightUp.atf
@@ -0,0 +1,255 @@
+####################################
+# RightArrow Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w / 3
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w * 2 / 3
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 0
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+b = w / 16
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a - b
+ }
+
+ Y {
+a = h
+b = h / 16
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a - b
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w
+b = w / 16
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a - b
+ }
+
+ Y {
+a = h / 16
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w / 16
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h / 16
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w / 3
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h / 3
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 0
+ }
+
+}
+
+################ 8. Point
+
+POINT {
+
+ X {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h * 2 / 3
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Arrows/ArrowRightUp.desktop b/kpresenter/autoforms/Arrows/ArrowRightUp.desktop
new file mode 100644
index 000000000..0181fc8b8
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowRightUp.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Link
+URL=.source/ArrowRightUp.atf
+Name=Arrow Right/Up
+Name[bg]=Стрелка надясно/нагоре
+Name[ca]=Fletxa dreta/a dalt
+Name[cy]=Saeth i'r Chwith/i Fyny
+Name[da]=Pil til højre/op
+Name[de]=Pfeil nach rechts/oben
+Name[el]=Δεξί/πάνω βέλος
+Name[eo]=Dekstren/Supren
+Name[es]=Flecha a la derecha/arriba
+Name[et]=Nool paremale/üles
+Name[eu]=Eskuin-goiko gezia
+Name[fa]=جهت راست/بالا
+Name[fi]=Nuoli oikealle ylös
+Name[fr]=Flèche droite / haute
+Name[fy]=Pylk rjochts/omheech
+Name[gl]=Frecha para Cima/Direita
+Name[he]=חץ ימינה ולמעלה
+Name[hr]=Arrow udesno/gore
+Name[hu]=Jobbra/felfelé nyíl
+Name[is]=Píla hægri/upp
+Name[it]=Freccia destra/su
+Name[ja]=右上矢印
+Name[km]=ព្រួញ​ទៅ​ស្ដាំ/ឡើង​លើ
+Name[lv]=Bulta pa labi/augšup
+Name[ms]=Anak Panah Kanan/Ke atas
+Name[nb]=Pil opp til høyre
+Name[nds]=Piel na rechts/hooch
+Name[ne]=दायाँ/माथि बाँण
+Name[nl]=Pijl rechtsboven
+Name[nn]=Pil opp til høgre
+Name[pl]=Strzałka w prawo/górę
+Name[pt]=Seta para Cima/Direita
+Name[pt_BR]=Seta para direita/cima
+Name[ru]=Стрелка вправо-вверх
+Name[se]=Olgeš/bajásnjuolla
+Name[sk]=Šipka vpravo/hore
+Name[sl]=Puščica desno/gor
+Name[sr]=Стрелица десно/горе
+Name[sr@Latn]=Strelica desno/gore
+Name[sv]=Pil höger/upp
+Name[uk]=Стрілка праворуч/вгору
+Name[uz]=Oʻngga/Yuqoriga belgisi
+Name[uz@cyrillic]=Ўнгга/Юқорига белгиси
+Name[zh_CN]=右上箭头
+Name[zh_TW]=右上箭頭
+Icon=.icon/ArrowRightUp.png
diff --git a/kpresenter/autoforms/Arrows/ArrowRightUp.png b/kpresenter/autoforms/Arrows/ArrowRightUp.png
new file mode 100644
index 000000000..fde0def82
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowRightUp.png
Binary files differ
diff --git a/kpresenter/autoforms/Arrows/ArrowUp.atf b/kpresenter/autoforms/Arrows/ArrowUp.atf
new file mode 100644
index 000000000..e81b40b9a
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowUp.atf
@@ -0,0 +1,255 @@
+####################################
+# RightArrow Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w * 3 / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w * 3 / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = h * 2 / 3
+c = h / 7
+ d = 0
+ e = 0
+ f = 0
+y = a - b + c
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = h * 2 / 3
+c = h / 7
+ d = 0
+ e = 0
+ f = 0
+y = a - b + c
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w / 2
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = 0
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = h * 2 / 3
+c = h / 7
+ d = 0
+ e = 0
+ f = 0
+y = a - b + c
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = h * 2 / 3
+c = h / 7
+ d = 0
+ e = 0
+ f = 0
+y = a - b + c
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
+################ 8. Point
+
+POINT {
+
+ X {
+a = w / 4
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+x = a
+ }
+
+ Y {
+a = h
+ b = 0
+ c = 0
+ d = 0
+ e = 0
+ f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+ p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Arrows/ArrowUp.desktop b/kpresenter/autoforms/Arrows/ArrowUp.desktop
new file mode 100644
index 000000000..770373b3d
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowUp.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Link
+URL=.source/ArrowUp.atf
+Name=Arrow Up
+Name[bg]=Стрелка нагоре
+Name[ca]=Fletxa a dalt
+Name[cy]=Saeth i Fyny
+Name[da]=Pil op
+Name[de]=Pfeil nach oben
+Name[el]=Πάνω βέλος
+Name[eo]=Supren
+Name[es]=Flecha arriba
+Name[et]=Nool üles
+Name[eu]=Goiko gezia
+Name[fa]=جهت بالا
+Name[fi]=Nuoli ylös
+Name[fr]=Flèche haute
+Name[fy]=Pylk omheech
+Name[gl]=Frecha para Cima
+Name[he]=חץ למעלה
+Name[hr]=Strelica prema gore
+Name[hu]=Felfelé nyíl
+Name[is]=Píla upp
+Name[it]=Freccia su
+Name[ja]=上矢印
+Name[km]=ព្រួញ​ឡើង​លើ​
+Name[lv]=Bulta uz augšu
+Name[ms]=Anak Panah Ke atas
+Name[nb]=Pil opp
+Name[nds]=Piel hooch
+Name[ne]=माथि बाँण
+Name[nl]=Pijl omhoog
+Name[nn]=Pil opp
+Name[pl]=Strzałka w górę
+Name[pt]=Seta para Cima
+Name[pt_BR]=Seta para cima
+Name[ru]=Стрелка вверх
+Name[se]=Bajásnjuolla
+Name[sk]=Šipka hore
+Name[sl]=Puščica gor
+Name[sr]=Стрелица горе
+Name[sr@Latn]=Strelica gore
+Name[sv]=Pil upp
+Name[uk]=Стрілка вгору
+Name[uz]=Yuqoriga belgisi
+Name[uz@cyrillic]=Юқорига белгиси
+Name[zh_CN]=上箭头
+Name[zh_TW]=上箭頭
+Icon=.icon/ArrowUp.png
diff --git a/kpresenter/autoforms/Arrows/ArrowUp.png b/kpresenter/autoforms/Arrows/ArrowUp.png
new file mode 100644
index 000000000..dc68d5dff
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/ArrowUp.png
Binary files differ
diff --git a/kpresenter/autoforms/Arrows/Makefile.am b/kpresenter/autoforms/Arrows/Makefile.am
new file mode 100644
index 000000000..3f2693c68
--- /dev/null
+++ b/kpresenter/autoforms/Arrows/Makefile.am
@@ -0,0 +1,18 @@
+
+autoforms_DATA = .directory ArrowDown.desktop ArrowLeft.desktop \
+ ArrowLeftDown.desktop ArrowLeftUp.desktop \
+ ArrowRight.desktop ArrowRightDown.desktop \
+ ArrowRightUp.desktop ArrowUp.desktop
+autoformsdir = $(kde_datadir)/kpresenter/autoforms/Arrows
+
+autoformsrc_DATA = ArrowDown.atf ArrowLeft.atf \
+ ArrowLeftDown.atf ArrowLeftUp.atf \
+ ArrowRight.atf ArrowRightDown.atf \
+ ArrowRightUp.atf ArrowUp.atf
+autoformsrcdir = $(kde_datadir)/kpresenter/autoforms/Arrows/.source
+
+autoformsicons_DATA = ArrowDown.png ArrowLeft.png \
+ ArrowLeftDown.png ArrowLeftUp.png \
+ ArrowRight.png ArrowRightDown.png \
+ ArrowRightUp.png ArrowUp.png
+autoformsiconsdir = $(kde_datadir)/kpresenter/autoforms/Arrows/.icon
diff --git a/kpresenter/autoforms/Connections/.directory b/kpresenter/autoforms/Connections/.directory
new file mode 100644
index 000000000..7b1f3d0fe
--- /dev/null
+++ b/kpresenter/autoforms/Connections/.directory
@@ -0,0 +1,42 @@
+[Desktop Entry]
+Name=Connections
+Name[af]=Koppelinge
+Name[az]=Bağlantılar
+Name[bg]=Връзки
+Name[br]=Kevreadurioù
+Name[bs]=Veze
+Name[ca]=Connexions
+Name[cy]=Cysylltiadau
+Name[da]=Forbindelser
+Name[de]=Verbindungen
+Name[el]=Συνδέσεις
+Name[eo]=Konektiloj
+Name[es]=Conexiones
+Name[et]=Ühendused
+Name[fo]=Sambindingar
+Name[fy]=Ferbinings
+Name[hi]=कनेक्शन्स
+Name[id]=Hubungan
+Name[is]=Tengingar
+Name[it]=Connessioni
+Name[ja]=接続
+Name[km]=តភ្ជាប់
+Name[lo]=ການເຊື່ອມຕໍ່
+Name[mt]=Konnessjonijiet
+Name[nds]=Verbinnen
+Name[nl]=Verbindingen
+Name[pl]=Połączenia
+Name[pt]=Ligações
+Name[pt_BR]=Conexões
+Name[sk]=Spojenia
+Name[sr]=Везе
+Name[sr@Latn]=Veze
+Name[sv]=Anslutningar
+Name[ta]=இணைப்புக்கள்
+Name[tg]=Алоқаҳо
+Name[th]=การเชื่อมต่อ
+Name[ven]=Vhukwamani
+Name[wa]=Raloyaedjes
+Name[xh]=Izinxulumano
+Name[zh_TW]=連接
+Name[zu]=Izixhumaniso
diff --git a/kpresenter/autoforms/Connections/Connection1.atf b/kpresenter/autoforms/Connections/Connection1.atf
new file mode 100644
index 000000000..553639063
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection1.atf
@@ -0,0 +1,131 @@
+####################################
+# Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection1.desktop b/kpresenter/autoforms/Connections/Connection1.desktop
new file mode 100644
index 000000000..c69e69d56
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection1.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection1.atf
+Name=Connection 01
+Name[af]=Verbinding 01
+Name[ar]=إتصال 01
+Name[az]=1. Bağlantı
+Name[bg]=Връзка 01
+Name[br]=Kevreadur 01
+Name[bs]=Veza 01
+Name[ca]=Connexió 01
+Name[cs]=Spoj 01
+Name[cy]=Cysylltiad 01
+Name[da]=Forbindelse 01
+Name[de]=Verbindung 01
+Name[el]=Σύνδεση 01
+Name[eo]=Konektilo 01
+Name[es]=Conexión 01
+Name[et]=Ühendus 01
+Name[eu]=Konexioa 01
+Name[fa]=اتصال ۰۱
+Name[fi]=Yhteys 01
+Name[fo]=Sambinding 01
+Name[fr]=Connexion 01
+Name[fy]=Ferbining 01
+Name[ga]=Nasc 01
+Name[gl]=Conexón 01
+Name[he]=חיבור 01
+Name[hi]=कनेक्शन 01
+Name[hr]=Veza 01
+Name[hu]=1. kapcsolat
+Name[id]=Hubungan 01
+Name[is]=Tenging 01
+Name[it]=Connessione 01
+Name[ja]=接続 01
+Name[km]=តភ្ជាប់ ០១
+Name[lo]=ກາານເຊື່ອມຕໍ່ທີ 01
+Name[lt]=Prisijungimas 01
+Name[lv]=Savienojums 01
+Name[ms]=Sambungan 01
+Name[mt]=Konnessjoni 01
+Name[nb]=Kobling 01
+Name[nds]=Verbinnen 01
+Name[ne]=जडान ०१
+Name[nl]=Verbinding 01
+Name[nn]=Samband 01
+Name[pl]=Połączenie 01
+Name[pt]=Ligação 01
+Name[pt_BR]=Conexão 01
+Name[ro]=Conexiunea 01
+Name[ru]=Соединение 01
+Name[se]=Oktavuohta 01
+Name[sk]=Spojenie 1
+Name[sl]=Povezava 01
+Name[sr]=Веза 01
+Name[sr@Latn]=Veza 01
+Name[sv]=Anslutning 01
+Name[ta]=இணைப்பு 01
+Name[tg]=Алоқа 01
+Name[th]=การเชื่อมต่อที่ 01
+Name[tr]=01. Bağlantı
+Name[uk]=З'єднання 01
+Name[uz]=Ulanish 01
+Name[uz@cyrillic]=Уланиш 01
+Name[ven]=Vhukwamani ha 01
+Name[wa]=Raloyaedje 01
+Name[xh]=Unxulumano 01
+Name[zh_CN]=连接 01
+Name[zh_TW]=連接 01
+Name[zu]=Uxhumaniso 01
+Icon=.icon/Connection1.png
diff --git a/kpresenter/autoforms/Connections/Connection1.png b/kpresenter/autoforms/Connections/Connection1.png
new file mode 100644
index 000000000..72a23d5f5
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection1.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection10.atf b/kpresenter/autoforms/Connections/Connection10.atf
new file mode 100644
index 000000000..799cb7daa
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection10.atf
@@ -0,0 +1,131 @@
+####################################
+# Autoform
+# Generated with KAutoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection10.desktop b/kpresenter/autoforms/Connections/Connection10.desktop
new file mode 100644
index 000000000..fc448439a
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection10.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection10.atf
+Name=Connection 10
+Name[af]=Verbinding 10
+Name[ar]=إتصال 10
+Name[az]=10. Bağlantı
+Name[bg]=Връзка 10
+Name[br]=Kevreadur 10
+Name[bs]=Veza 10
+Name[ca]=Connexió 10
+Name[cs]=Spoj 10
+Name[cy]=Cysylltiad 10
+Name[da]=Forbindelse 10
+Name[de]=Verbindung 10
+Name[el]=Σύνδεση 10
+Name[eo]=Konektilo 10
+Name[es]=Conexión 10
+Name[et]=Ühendus 10
+Name[eu]=Konexioa 10
+Name[fa]=اتصال ۱۰
+Name[fi]=Yhteys 10
+Name[fo]=Sambinding 10
+Name[fr]=Connexion 10
+Name[fy]=Ferbining 10
+Name[ga]=Nasc 10
+Name[gl]=Conexón 10
+Name[he]=חיבור 10
+Name[hi]=कनेक्शन 10
+Name[hr]=Veza 10
+Name[hu]=10. kapcsolat
+Name[id]=Hubungan 10
+Name[is]=Tenging 10
+Name[it]=Connessione 10
+Name[ja]=接続 10
+Name[km]=តភ្ជាប់ ១០
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 10
+Name[lt]=Prisijungimas 10
+Name[lv]=Savienojums 10
+Name[ms]=Sambungan 10
+Name[mt]=Konnessjoni 10
+Name[nb]=Kobling 10
+Name[nds]=Verbinnen 10
+Name[ne]=जडान १०
+Name[nl]=Verbinding 10
+Name[nn]=Samband 10
+Name[pl]=Połączenie 10
+Name[pt]=Ligação 10
+Name[pt_BR]=Conexão 10
+Name[ro]=Conexiunea 10
+Name[ru]=Соединение 10
+Name[se]=Oktavuohta 10
+Name[sk]=Spojenie 10
+Name[sl]=Povezava 10
+Name[sr]=Веза 10
+Name[sr@Latn]=Veza 10
+Name[sv]=Anslutning 10
+Name[ta]=இணைப்பு 10
+Name[tg]=Алоқа 10
+Name[th]=การเชื่อมต่อที่ 10
+Name[tr]=10. Bağlantı
+Name[uk]=З'єднання 10
+Name[uz]=Ulanish 10
+Name[uz@cyrillic]=Уланиш 10
+Name[ven]=Vhukwamani ha 10
+Name[wa]=Raloyaedje 10
+Name[xh]=Unxulumano (10)
+Name[zh_CN]=连接 10
+Name[zh_TW]=連接 10
+Name[zu]=Uxhumaniso lweshumi 10
+Icon=.icon/Connection10.png
diff --git a/kpresenter/autoforms/Connections/Connection10.png b/kpresenter/autoforms/Connections/Connection10.png
new file mode 100644
index 000000000..9e631da85
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection10.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection11.atf b/kpresenter/autoforms/Connections/Connection11.atf
new file mode 100644
index 000000000..3049bf0ef
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection11.atf
@@ -0,0 +1,131 @@
+####################################
+# Autoform
+# Generated with KAutoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection11.desktop b/kpresenter/autoforms/Connections/Connection11.desktop
new file mode 100644
index 000000000..87b1d0c3b
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection11.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection11.atf
+Name=Connection 11
+Name[af]=Verbinding 11
+Name[ar]=إتصال 11
+Name[az]=11. Bağlantı
+Name[bg]=Връзка 11
+Name[br]=Kevreadur 11
+Name[bs]=Veza 11
+Name[ca]=Connexió 11
+Name[cs]=Spoj 11
+Name[cy]=Cysylltiad 11
+Name[da]=Forbindelse 11
+Name[de]=Verbindung 11
+Name[el]=Σύνδεση 11
+Name[eo]=Konektilo 11
+Name[es]=Conexión 11
+Name[et]=Ühendus 11
+Name[eu]=Konexioa 11
+Name[fa]=اتصال ۱۱
+Name[fi]=Yhteys 11
+Name[fo]=Sambinding 11
+Name[fr]=Connexion 11
+Name[fy]=Ferbining 11
+Name[ga]=Nasc 11
+Name[gl]=Conexón 11
+Name[he]=חיבור 11
+Name[hi]=कनेक्शन 11
+Name[hr]=Veza 11
+Name[hu]=11. kapcsolat
+Name[id]=Hubungan 11
+Name[is]=Tenging 11
+Name[it]=Connessione 11
+Name[ja]=接続 11
+Name[km]=តភ្ជាប់ ១១
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 11
+Name[lt]=Prisijungimas 11
+Name[lv]=Savienojums 11
+Name[ms]=Sambungan 11
+Name[mt]=Konnessjoni 11
+Name[nb]=Kobling 11
+Name[nds]=Verbinnen 11
+Name[ne]=जडान ११
+Name[nl]=Verbinding 11
+Name[nn]=Samband 11
+Name[pl]=Połączenie 11
+Name[pt]=Ligação 11
+Name[pt_BR]=Conexão 11
+Name[ro]=Conexiunea 11
+Name[ru]=Соединение 11
+Name[se]=Oktavuohta 11
+Name[sk]=Spojenie 11
+Name[sl]=Povezava 11
+Name[sr]=Веза 11
+Name[sr@Latn]=Veza 11
+Name[sv]=Anslutning 11
+Name[ta]=இணைப்பு 11
+Name[tg]=Алоқа 11
+Name[th]=การเชื่อมต่อที่ 11
+Name[tr]=11. Bağlantı
+Name[uk]=З'єднання 11
+Name[uz]=Ulanish 11
+Name[uz@cyrillic]=Уланиш 11
+Name[ven]=Vhukwamani ha 11
+Name[wa]=Raloyaedje 11
+Name[xh]=Unxulumano (11)
+Name[zh_CN]=连接 11
+Name[zh_TW]=連接 11
+Name[zu]=Uxhumaniso lweshumi nanye 11
+Icon=.icon/Connection11.png
diff --git a/kpresenter/autoforms/Connections/Connection11.png b/kpresenter/autoforms/Connections/Connection11.png
new file mode 100644
index 000000000..080508714
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection11.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection12.atf b/kpresenter/autoforms/Connections/Connection12.atf
new file mode 100644
index 000000000..cdf7048b5
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection12.atf
@@ -0,0 +1,131 @@
+####################################
+# Autoform
+# Generated with KAutoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection12.desktop b/kpresenter/autoforms/Connections/Connection12.desktop
new file mode 100644
index 000000000..37f54301c
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection12.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection12.atf
+Name=Connection 12
+Name[af]=Verbinding 12
+Name[ar]=إتصال 12
+Name[az]=12. Bağlantı
+Name[bg]=Връзка 12
+Name[br]=Kevreadur 12
+Name[bs]=Veza 12
+Name[ca]=Connexió 12
+Name[cs]=Spoj 12
+Name[cy]=Cysylltiad 12
+Name[da]=Forbindelse 12
+Name[de]=Verbindung 12
+Name[el]=Σύνδεση 12
+Name[eo]=Konektilo 12
+Name[es]=Conexión 12
+Name[et]=Ühendus 12
+Name[eu]=Konexioa 12
+Name[fa]=اتصال ۱۲
+Name[fi]=Yhteys 12
+Name[fo]=Sambinding 12
+Name[fr]=Connexion 12
+Name[fy]=Ferbining 12
+Name[ga]=Nasc 12
+Name[gl]=Conexón 12
+Name[he]=חיבור 12
+Name[hi]=कनेक्शन 12
+Name[hr]=Veza 12
+Name[hu]=12. kapcsolat
+Name[id]=Hubungan 12
+Name[is]=Tenging 12
+Name[it]=Connessione 12
+Name[ja]=接続 12
+Name[km]=តភ្ជាប់ ១២
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 12
+Name[lt]=Prisijungimas 12
+Name[lv]=Savienojums 12
+Name[ms]=Sambungan 12
+Name[mt]=Konnessjoni 12
+Name[nb]=Kobling 12
+Name[nds]=Verbinnen 12
+Name[ne]=जडान १२
+Name[nl]=Verbinding 12
+Name[nn]=Samband 12
+Name[pl]=Połączenie 12
+Name[pt]=Ligação 12
+Name[pt_BR]=Conexão 12
+Name[ro]=Conexiunea 01
+Name[ru]=Соединение 12
+Name[se]=Oktavuohta 12
+Name[sk]=Spojenie 12
+Name[sl]=Povezava 12
+Name[sr]=Веза 12
+Name[sr@Latn]=Veza 12
+Name[sv]=Anslutning 12
+Name[ta]=இணைப்பு 12
+Name[tg]=Алоқа 12
+Name[th]=การเชื่อมต่อที่ 12
+Name[tr]=12. Bağlantı
+Name[uk]=З'єднання 12
+Name[uz]=Ulanish 12
+Name[uz@cyrillic]=Уланиш 12
+Name[ven]=Vhukwamani ha 12
+Name[wa]=Raloyaedje 12
+Name[xh]=Unxulumano (12)
+Name[zh_CN]=连接 12
+Name[zh_TW]=連接 12
+Name[zu]=Udxhumaniso lweshumi nambili 12
+Icon=.icon/Connection12.png
diff --git a/kpresenter/autoforms/Connections/Connection12.png b/kpresenter/autoforms/Connections/Connection12.png
new file mode 100644
index 000000000..accbeaac7
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection12.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection2.atf b/kpresenter/autoforms/Connections/Connection2.atf
new file mode 100644
index 000000000..321cac672
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection2.atf
@@ -0,0 +1,131 @@
+####################################
+# Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection2.desktop b/kpresenter/autoforms/Connections/Connection2.desktop
new file mode 100644
index 000000000..75d4734d8
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection2.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection2.atf
+Name=Connection 02
+Name[af]=Verbinding 02
+Name[ar]=إتصال 02
+Name[az]=2. Bağlantı
+Name[bg]=Връзка 02
+Name[br]=Kevreadur 02
+Name[bs]=Veza 02
+Name[ca]=Connexió 02
+Name[cs]=Spoj 02
+Name[cy]=Cysylltiad 02
+Name[da]=Forbindelse 02
+Name[de]=Verbindung 02
+Name[el]=Σύνδεση 02
+Name[eo]=Konektilo 02
+Name[es]=Conexión 02
+Name[et]=Ühendus 02
+Name[eu]=Konexioa 02
+Name[fa]=اتصال ۰۲
+Name[fi]=Yhteys 02
+Name[fo]=Sambinding 02
+Name[fr]=Connexion 02
+Name[fy]=Ferbining 02
+Name[ga]=Nasc 02
+Name[gl]=Conexón 02
+Name[he]=חיבור 02
+Name[hi]=कनेक्शन 02
+Name[hr]=Veza 02
+Name[hu]=2. kapcsolat
+Name[id]=Hubungan 02
+Name[is]=Tenging 02
+Name[it]=Connessione 02
+Name[ja]=接続 02
+Name[km]=តភ្ជាប់ ០២
+Name[lo]=ການເໍື່ອມຕໍ່ທີ 02
+Name[lt]=Prisijungimas 02
+Name[lv]=Savienojums 02
+Name[ms]=Sambungan 02
+Name[mt]=Konnessjoni 02
+Name[nb]=Kobling 02
+Name[nds]=Verbinnen 02
+Name[ne]=जडान ०२
+Name[nl]=Verbinding 02
+Name[nn]=Samband 02
+Name[pl]=Połączenie 02
+Name[pt]=Ligação 02
+Name[pt_BR]=Conexão 02
+Name[ro]=Conexiunea 02
+Name[ru]=Соединение 02
+Name[se]=Oktavuohta 02
+Name[sk]=Spojenie 02
+Name[sl]=Povezava 02
+Name[sr]=Веза 02
+Name[sr@Latn]=Veza 02
+Name[sv]=Anslutning 02
+Name[ta]=இணைப்பு 02
+Name[tg]=Алоқа 02
+Name[th]=การเชื่อมต่อที่ 02
+Name[tr]=2. Bağlantı
+Name[uk]=З'єднання 02
+Name[uz]=Ulanish 02
+Name[uz@cyrillic]=Уланиш 02
+Name[ven]=Vhukwamani ha 02
+Name[wa]=Raloyaedje 02
+Name[xh]=Unxulumano 02
+Name[zh_CN]=连接 02
+Name[zh_TW]=連接 02
+Name[zu]=Uxhumaniso lwesibili 02
+Icon=.icon/Connection2.png
diff --git a/kpresenter/autoforms/Connections/Connection2.png b/kpresenter/autoforms/Connections/Connection2.png
new file mode 100644
index 000000000..e0430eb92
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection2.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection3.atf b/kpresenter/autoforms/Connections/Connection3.atf
new file mode 100644
index 000000000..575684609
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection3.atf
@@ -0,0 +1,131 @@
+####################################
+# Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection3.desktop b/kpresenter/autoforms/Connections/Connection3.desktop
new file mode 100644
index 000000000..1ad29478a
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection3.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection3.atf
+Name=Connection 03
+Name[af]=Verbinding 03
+Name[ar]=إتصال 03
+Name[az]=3. Bağlantı
+Name[bg]=Връзка 03
+Name[br]=Kevreadur 03
+Name[bs]=Veza 03
+Name[ca]=Connexió 03
+Name[cs]=Spoj 03
+Name[cy]=Cysylltiad 03
+Name[da]=Forbindelse 03
+Name[de]=Verbindung 03
+Name[el]=Σύνδεση 03
+Name[eo]=Konektilo 03
+Name[es]=Conexión 03
+Name[et]=Ühendus 03
+Name[eu]=Konexioa 03
+Name[fa]=اتصال ۰۳
+Name[fi]=Yhteys 03
+Name[fo]=Sambinding 03
+Name[fr]=Connexion 03
+Name[fy]=Ferbining 03
+Name[ga]=Nasc 03
+Name[gl]=Conexón 03
+Name[he]=חיבור 03
+Name[hi]=कनेक्शन 03
+Name[hr]=Veza 03
+Name[hu]=3. kapcsolat
+Name[id]=Hubungan 03
+Name[is]=Tenging 03
+Name[it]=Connessione 03
+Name[ja]=接続 03
+Name[km]=តភ្ជាប់ ០៣
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 03
+Name[lt]=Prisijungimas 03
+Name[lv]=Savienojums 03
+Name[ms]=Sambungan 03
+Name[mt]=Konnessjoni 03
+Name[nb]=Kobling 03
+Name[nds]=Verbinnen 03
+Name[ne]=जडान ०३
+Name[nl]=Verbinding 03
+Name[nn]=Samband 03
+Name[pl]=Połączenie 03
+Name[pt]=Ligação 03
+Name[pt_BR]=Conexão 03
+Name[ro]=Conexiunea 03
+Name[ru]=Соединение 03
+Name[se]=Oktavuohta 03
+Name[sk]=Spojenie 03
+Name[sl]=Povezava 03
+Name[sr]=Веза 03
+Name[sr@Latn]=Veza 03
+Name[sv]=Anslutning 03
+Name[ta]=இணைப்பு 03
+Name[tg]=Алоқа 03
+Name[th]=การเชื่อมต่อที่ 03
+Name[tr]=03. Bağlantı
+Name[uk]=З'єднання 03
+Name[uz]=Ulanish 03
+Name[uz@cyrillic]=Уланиш 03
+Name[ven]=Vhukwamani ha 03
+Name[wa]=Raloyaedje 03
+Name[xh]=Unxulumano 03
+Name[zh_CN]=连接 03
+Name[zh_TW]=連接 03
+Name[zu]=Uxhumaniso lwesithathu 03
+Icon=.icon/Connection3.png
diff --git a/kpresenter/autoforms/Connections/Connection3.png b/kpresenter/autoforms/Connections/Connection3.png
new file mode 100644
index 000000000..a8409488a
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection3.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection4.atf b/kpresenter/autoforms/Connections/Connection4.atf
new file mode 100644
index 000000000..7c8dbfd62
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection4.atf
@@ -0,0 +1,131 @@
+####################################
+# Autoform
+# Generated with atoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection4.desktop b/kpresenter/autoforms/Connections/Connection4.desktop
new file mode 100644
index 000000000..c83955123
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection4.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection4.atf
+Name=Connection 04
+Name[af]=Verbinding 04
+Name[ar]=إتصال 04
+Name[az]=4. Bağlantı
+Name[bg]=Връзка 04
+Name[br]=Kevreadur 04
+Name[bs]=Veza 04
+Name[ca]=Connexió 04
+Name[cs]=Spoj 04
+Name[cy]=Cysylltiad 04
+Name[da]=Forbindelse 04
+Name[de]=Verbindung 04
+Name[el]=Σύνδεση 04
+Name[eo]=Konektilo 04
+Name[es]=Conexión 04
+Name[et]=Ühendus 04
+Name[eu]=Konexioa 04
+Name[fa]=اتصال ۰۴
+Name[fi]=Yhteys 04
+Name[fo]=Sambinding 04
+Name[fr]=Connexion 04
+Name[fy]=Ferbining 04
+Name[ga]=Nasc 04
+Name[gl]=Conexón 04
+Name[he]=חיבור 04
+Name[hi]=कनेक्शन 04
+Name[hr]=Veza 04
+Name[hu]=4. kapcsolat
+Name[id]=Hubungan 04
+Name[is]=Tenging 04
+Name[it]=Connessione 04
+Name[ja]=接続 04
+Name[km]=តភ្ជាប់ ០៤
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 04
+Name[lt]=Prisijungimas 04
+Name[lv]=Savienojums 04
+Name[ms]=Sambungan 04
+Name[mt]=Konnessjoni 04
+Name[nb]=Kobling 04
+Name[nds]=Verbinnen 04
+Name[ne]=जडान ०४
+Name[nl]=Verbinding 04
+Name[nn]=Samband 04
+Name[pl]=Połączenie 04
+Name[pt]=Ligação 04
+Name[pt_BR]=Conexão 04
+Name[ro]=Conexiunea 04
+Name[ru]=Соединение 04
+Name[se]=Oktavuohta 04
+Name[sk]=Spojenie 04
+Name[sl]=Povezava 04
+Name[sr]=Веза 04
+Name[sr@Latn]=Veza 04
+Name[sv]=Anslutning 04
+Name[ta]=இணைப்பு 04
+Name[tg]=Алоқа 04
+Name[th]=การเชื่อมต่อที่ 04
+Name[tr]=04. Bağlantı
+Name[uk]=З'єднання 04
+Name[uz]=Ulanish 04
+Name[uz@cyrillic]=Уланиш 04
+Name[ven]=Vhukwamani ha 04
+Name[wa]=Raloyaedje 04
+Name[xh]=Unxulumano 04
+Name[zh_CN]=连接 04
+Name[zh_TW]=連接 04
+Name[zu]=Uxhumaniso lwesine 04
+Icon=.icon/Connection4.png
diff --git a/kpresenter/autoforms/Connections/Connection4.png b/kpresenter/autoforms/Connections/Connection4.png
new file mode 100644
index 000000000..d30fc12a2
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection4.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection5.atf b/kpresenter/autoforms/Connections/Connection5.atf
new file mode 100644
index 000000000..74d5fc9ca
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection5.atf
@@ -0,0 +1,224 @@
+####################################
+# Autoform
+# Generated with KAutoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection5.desktop b/kpresenter/autoforms/Connections/Connection5.desktop
new file mode 100644
index 000000000..cbb6993a6
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection5.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection5.atf
+Name=Connection 05
+Name[af]=Verbinding 05
+Name[ar]=إتصال 05
+Name[az]=5. Bağlantı
+Name[bg]=Връзка 05
+Name[br]=Kevreadur 05
+Name[bs]=Veza 05
+Name[ca]=Connexió 05
+Name[cs]=Spoj 05
+Name[cy]=Cysylltiad 05
+Name[da]=Forbindelse 05
+Name[de]=Verbindung 05
+Name[el]=Σύνδεση 05
+Name[eo]=Konektilo 05
+Name[es]=Conexión 05
+Name[et]=Ühendus 05
+Name[eu]=Konexioa 05
+Name[fa]=اتصال ۰۵
+Name[fi]=Yhteys 05
+Name[fo]=Sambinding 05
+Name[fr]=Connexion 05
+Name[fy]=Ferbining 05
+Name[ga]=Nasc 05
+Name[gl]=Conexón 05
+Name[he]=חיבור 05
+Name[hi]=कनेक्शन 05
+Name[hr]=Veza 05
+Name[hu]=5. kapcsolat
+Name[id]=Hubungan 05
+Name[is]=Tenging 05
+Name[it]=Connessione 05
+Name[ja]=接続 05
+Name[km]=តភ្ជាប់ ០៥
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 05
+Name[lt]=Prisijungimas 05
+Name[lv]=Savienojums 05
+Name[ms]=Sambungan 05
+Name[mt]=Konnessjoni 05
+Name[nb]=Kobling 05
+Name[nds]=Verbinnen 05
+Name[ne]=जडान ०५
+Name[nl]=Verbinding 05
+Name[nn]=Samband 05
+Name[pl]=Połączenie 05
+Name[pt]=Ligação 05
+Name[pt_BR]=Conexão 05
+Name[ro]=Conexiunea 05
+Name[ru]=Соединение 05
+Name[se]=Oktavuohta 05
+Name[sk]=Spojenie 05
+Name[sl]=Povezava 05
+Name[sr]=Веза 05
+Name[sr@Latn]=Veza 05
+Name[sv]=Anslutning 05
+Name[ta]=இணைப்பு 05
+Name[tg]=Алоқа 05
+Name[th]=การเชื่อมต่อที่ 05
+Name[tr]=05. Bağlantı
+Name[uk]=З'єднання 05
+Name[uz]=Ulanish 05
+Name[uz@cyrillic]=Уланиш 05
+Name[ven]=Vhukwamani 05
+Name[wa]=Raloyaedje 05
+Name[xh]=Unxulumano 05
+Name[zh_CN]=连接 05
+Name[zh_TW]=連接 05
+Name[zu]=Uxhumaniso lwesihlanu 05
+Icon=.icon/Connection5.png
diff --git a/kpresenter/autoforms/Connections/Connection5.png b/kpresenter/autoforms/Connections/Connection5.png
new file mode 100644
index 000000000..66e4a8c49
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection5.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection6.atf b/kpresenter/autoforms/Connections/Connection6.atf
new file mode 100644
index 000000000..2b99866d5
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection6.atf
@@ -0,0 +1,224 @@
+####################################
+# Autoform
+# Generated with KAutoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection6.desktop b/kpresenter/autoforms/Connections/Connection6.desktop
new file mode 100644
index 000000000..df10857f1
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection6.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection6.atf
+Name=Connection 06
+Name[af]=Verbinding 06
+Name[ar]=إتصال 06
+Name[az]=6. Bağlantı
+Name[bg]=Връзка 06
+Name[br]=Kevreadur 06
+Name[bs]=Veza 06
+Name[ca]=Connexió 06
+Name[cs]=Spoj 06
+Name[cy]=Cysylltiad 06
+Name[da]=Forbindelse 06
+Name[de]=Verbindung 06
+Name[el]=Σύνδεση 06
+Name[eo]=Konektilo 06
+Name[es]=Conexión 06
+Name[et]=Ühendus 06
+Name[eu]=Konexioa 06
+Name[fa]=اتصال ۰۶
+Name[fi]=Yhteys 06
+Name[fo]=Sambinding 06
+Name[fr]=Connexion 06
+Name[fy]=Ferbining 06
+Name[ga]=Nasc 06
+Name[gl]=Conexón 06
+Name[he]=חיבור 06
+Name[hi]=कनेक्शन 06
+Name[hr]=Veza 06
+Name[hu]=6. kapcsolat
+Name[id]=Hubungan 06
+Name[is]=Tenging 06
+Name[it]=Connessione 06
+Name[ja]=接続 06
+Name[km]=តភ្ជាប់ ០៦
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 06
+Name[lt]=Prisijungimas 06
+Name[lv]=Savienojums 06
+Name[ms]=Sambungan 06
+Name[mt]=Konnessjoni 06
+Name[nb]=Kobling 06
+Name[nds]=Verbinnen 06
+Name[ne]=जडान ०६
+Name[nl]=Verbinding 06
+Name[nn]=Samband 06
+Name[pl]=Połączenie 06
+Name[pt]=Ligação 06
+Name[pt_BR]=Conexão 06
+Name[ro]=Conexiunea 06
+Name[ru]=Соединение 06
+Name[se]=Oktavuohta 06
+Name[sk]=Spojenie 06
+Name[sl]=Povezava 06
+Name[sr]=Веза 06
+Name[sr@Latn]=Veza 06
+Name[sv]=Anslutning 06
+Name[ta]=இணைப்பு 06
+Name[tg]=Алоқа 06
+Name[th]=การเชื่อมต่อที่ 06
+Name[tr]=06. Bağlantı
+Name[uk]=З'єднання 06
+Name[uz]=Ulanish 06
+Name[uz@cyrillic]=Уланиш 06
+Name[ven]=Vhukwamani ha 06
+Name[wa]=Raloyaedje 06
+Name[xh]=Unxulumano 06
+Name[zh_CN]=连接 06
+Name[zh_TW]=連接 06
+Name[zu]=Uxhumaniso lwesithupha 06
+Icon=.icon/Connection6.png
diff --git a/kpresenter/autoforms/Connections/Connection6.png b/kpresenter/autoforms/Connections/Connection6.png
new file mode 100644
index 000000000..1a7a960ee
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection6.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection7.atf b/kpresenter/autoforms/Connections/Connection7.atf
new file mode 100644
index 000000000..7deeedd12
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection7.atf
@@ -0,0 +1,224 @@
+####################################
+# Autoform
+# Generated with KAutoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection7.desktop b/kpresenter/autoforms/Connections/Connection7.desktop
new file mode 100644
index 000000000..43ed8625e
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection7.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection7.atf
+Name=Connection 07
+Name[af]=Verbinding 07
+Name[ar]=إتصال 07
+Name[az]=7. Bağlantı
+Name[bg]=Връзка 07
+Name[br]=Kevreadur 07
+Name[bs]=Veza 07
+Name[ca]=Connexió 07
+Name[cs]=Spoj 07
+Name[cy]=Cysylltiad 07
+Name[da]=Forbindelse 07
+Name[de]=Verbindung 07
+Name[el]=Σύνδεση 07
+Name[eo]=Konektilo 07
+Name[es]=Conexión 07
+Name[et]=Ühendus 07
+Name[eu]=Konexioa 07
+Name[fa]=اتصال ۰۷
+Name[fi]=Yhteys 07
+Name[fo]=Sambinding 07
+Name[fr]=Connexion 07
+Name[fy]=Ferbining 07
+Name[ga]=Nasc 07
+Name[gl]=Conexón 07
+Name[he]=חיבור 07
+Name[hi]=कनेक्शन 07
+Name[hr]=Veza 07
+Name[hu]=7. kapcsolat
+Name[id]=Hubungan 07
+Name[is]=Tenging 07
+Name[it]=Connessione 07
+Name[ja]=接続 07
+Name[km]=តភ្ជាប់ ០៧
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 07
+Name[lt]=Prisijungimas 07
+Name[lv]=Savienojums 07
+Name[ms]=Sambungan 07
+Name[mt]=Konnessjoni 07
+Name[nb]=Kobling 07
+Name[nds]=Verbinnen 07
+Name[ne]=जडान ०७
+Name[nl]=Verbinding 07
+Name[nn]=Samband 07
+Name[pl]=Połączenie 07
+Name[pt]=Ligação 07
+Name[pt_BR]=Conexão 07
+Name[ro]=Conexiunea 07
+Name[ru]=Соединение 07
+Name[se]=Oktavuohta 07
+Name[sk]=Spojenie 07
+Name[sl]=Povezava 07
+Name[sr]=Веза 07
+Name[sr@Latn]=Veza 07
+Name[sv]=Anslutning 07
+Name[ta]=இணைப்பு 07
+Name[tg]=Алоқа 07
+Name[th]=การเชื่อมต่อที่ 07
+Name[tr]=07. Bağlantı
+Name[uk]=З'єднання 07
+Name[uz]=Ulanish 07
+Name[uz@cyrillic]=Уланиш 07
+Name[ven]=Vhukwamani ha 07
+Name[wa]=Raloyaedje 07
+Name[xh]=Unxulumano 07
+Name[zh_CN]=连接 07
+Name[zh_TW]=連接 07
+Name[zu]=Uxhumaniso lwesikhombisa 07
+Icon=.icon/Connection7.png
diff --git a/kpresenter/autoforms/Connections/Connection7.png b/kpresenter/autoforms/Connections/Connection7.png
new file mode 100644
index 000000000..885977af7
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection7.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection8.atf b/kpresenter/autoforms/Connections/Connection8.atf
new file mode 100644
index 000000000..3b1715d3e
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection8.atf
@@ -0,0 +1,224 @@
+####################################
+# Autoform
+# Generated with KAutoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 5. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 6. Point
+
+POINT {
+
+ X {
+a = w / 2
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 7. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection8.desktop b/kpresenter/autoforms/Connections/Connection8.desktop
new file mode 100644
index 000000000..2e640116b
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection8.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection8.atf
+Name=Connection 08
+Name[af]=Verbinding 08
+Name[ar]=إتصال 08
+Name[az]=8. Bağlantı
+Name[bg]=Връзка 08
+Name[br]=Kevreadur 08
+Name[bs]=Veza 08
+Name[ca]=Connexió 08
+Name[cs]=Spoj 08
+Name[cy]=Cysylltiad 08
+Name[da]=Forbindelse 08
+Name[de]=Verbindung 08
+Name[el]=Σύνδεση 08
+Name[eo]=Konektilo 08
+Name[es]=Conexión 08
+Name[et]=Ühendus 08
+Name[eu]=Konexioa 08
+Name[fa]=اتصال ۰۸
+Name[fi]=Yhteys 08
+Name[fo]=Sambinding 08
+Name[fr]=Connexion 08
+Name[fy]=Ferbining 08
+Name[ga]=Nasc 08
+Name[gl]=Conexón 08
+Name[he]=חיבור 08
+Name[hi]=कनेक्शन 08
+Name[hr]=Veza 08
+Name[hu]=8. kapcsolat
+Name[id]=Hubungan 08
+Name[is]=Tenging 08
+Name[it]=Connessione 08
+Name[ja]=接続 08
+Name[km]=តភ្ជាប់ ០៨
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 08
+Name[lt]=Prisijungimas 08
+Name[lv]=Savienojums 08
+Name[ms]=Sambungan 08
+Name[mt]=Konnessjoni 08
+Name[nb]=Kobling 08
+Name[nds]=Verbinnen 08
+Name[ne]=जडान ०८
+Name[nl]=Verbinding 08
+Name[nn]=Samband 08
+Name[pl]=Połączenie 08
+Name[pt]=Ligação 08
+Name[pt_BR]=Conexão 08
+Name[ro]=Conexiunea 08
+Name[ru]=Соединение 08
+Name[se]=Oktavuohta 08
+Name[sk]=Spojenie 08
+Name[sl]=Povezava 08
+Name[sr]=Веза 08
+Name[sr@Latn]=Veza 08
+Name[sv]=Anslutning 08
+Name[ta]=இணைப்பு 08
+Name[tg]=Алоқа 08
+Name[th]=การเชื่อมต่อที่ 08
+Name[tr]=08. Bağlantı
+Name[uk]=З'єднання 08
+Name[uz]=Ulanish 08
+Name[uz@cyrillic]=Уланиш 08
+Name[ven]=Vhukwamani ha 08
+Name[wa]=Raloyaedje 08
+Name[xh]=Unxulumano 08
+Name[zh_CN]=连接 08
+Name[zh_TW]=連接 08
+Name[zu]=Uxhumaniso lwesishagalombili 08
+Icon=.icon/Connection8.png
diff --git a/kpresenter/autoforms/Connections/Connection8.png b/kpresenter/autoforms/Connections/Connection8.png
new file mode 100644
index 000000000..615c4de9e
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection8.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Connection9.atf b/kpresenter/autoforms/Connections/Connection9.atf
new file mode 100644
index 000000000..25e97c4cf
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection9.atf
@@ -0,0 +1,131 @@
+####################################
+# Autoform
+# Generated with KAutoformEdit
+# (c) by Reginald Stadlbauer 1998
+# E-Mail: reggie@kde.org
+####################################
+
+################ 1. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 2. Point
+
+POINT {
+
+ X {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 3. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = h
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
+################ 4. Point
+
+POINT {
+
+ X {
+a = w
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+x = a
+ }
+
+ Y {
+a = 0
+b = 0
+c = 0
+d = 0
+e = 0
+f = 0
+y = a
+ }
+
+ ATTRIB {
+v = 0
+p = 1
+ }
+
+}
+
diff --git a/kpresenter/autoforms/Connections/Connection9.desktop b/kpresenter/autoforms/Connections/Connection9.desktop
new file mode 100644
index 000000000..8b8e9d354
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection9.desktop
@@ -0,0 +1,71 @@
+[Desktop Entry]
+Type=Link
+URL=.source/Connection9.atf
+Name=Connection 09
+Name[af]=Verbinding 09
+Name[ar]=إتصال 09
+Name[az]=9. Bağlantı
+Name[bg]=Връзка 09
+Name[br]=Kevreadur 09
+Name[bs]=Veza 09
+Name[ca]=Connexió 09
+Name[cs]=Spoj 09
+Name[cy]=Cysylltiad 09
+Name[da]=Forbindelse 09
+Name[de]=Verbindung 09
+Name[el]=Σύνδεση 09
+Name[eo]=Konektilo 09
+Name[es]=Conexión 09
+Name[et]=Ühendus 09
+Name[eu]=Konexioa 09
+Name[fa]=اتصال ۰۹
+Name[fi]=Yhteys 09
+Name[fo]=Sambinding 09
+Name[fr]=Connexion 09
+Name[fy]=Ferbining 09
+Name[ga]=Nasc 09
+Name[gl]=Conexón 09
+Name[he]=חיבור 09
+Name[hi]=कनेक्शन 09
+Name[hr]=Veza 09
+Name[hu]=9. kapcsolat
+Name[id]=hubungan 09
+Name[is]=Tenging 09
+Name[it]=Connessione 09
+Name[ja]=接続 09
+Name[km]=តភ្ជាប់ ០៩
+Name[lo]=ການເຊື່ອມຕໍ່ທີ 09
+Name[lt]=Prisijungimas 09
+Name[lv]=Savienojums 09
+Name[ms]=Sambungan 09
+Name[mt]=Konnessjoni 09
+Name[nb]=Kobling 09
+Name[nds]=Verbinnen 09
+Name[ne]=जडान ०९
+Name[nl]=Verbinding 09
+Name[nn]=Samband 09
+Name[pl]=Połączenie 09
+Name[pt]=Ligação 09
+Name[pt_BR]=Conexão 09
+Name[ro]=Conexiunea 09
+Name[ru]=Соединение 09
+Name[se]=Oktavuohta 09
+Name[sk]=Spojenie 09
+Name[sl]=Povezava 09
+Name[sr]=Веза 09
+Name[sr@Latn]=Veza 09
+Name[sv]=Anslutning 09
+Name[ta]=இணைப்பு 09
+Name[tg]=Алоқа 09
+Name[th]=การเชื่อมต่อที่ 09
+Name[tr]=09. Bağlantı
+Name[uk]=З'єднання 09
+Name[uz]=Ulanish 09
+Name[uz@cyrillic]=Уланиш 09
+Name[ven]=Vhukwamani ha 09
+Name[wa]=Raloyaedje 09
+Name[xh]=Unxulumano 09
+Name[zh_CN]=连接 09
+Name[zh_TW]=連接 09
+Name[zu]=Uxhumaniso lwesishagalolunye 09
+Icon=.icon/Connection9.png
diff --git a/kpresenter/autoforms/Connections/Connection9.png b/kpresenter/autoforms/Connections/Connection9.png
new file mode 100644
index 000000000..0fb7e6e34
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Connection9.png
Binary files differ
diff --git a/kpresenter/autoforms/Connections/Makefile.am b/kpresenter/autoforms/Connections/Makefile.am
new file mode 100644
index 000000000..d04e07d1b
--- /dev/null
+++ b/kpresenter/autoforms/Connections/Makefile.am
@@ -0,0 +1,24 @@
+
+autoforms_DATA = .directory Connection1.desktop Connection2.desktop \
+ Connection3.desktop Connection4.desktop \
+ Connection5.desktop Connection6.desktop \
+ Connection7.desktop Connection8.desktop \
+ Connection9.desktop Connection10.desktop \
+ Connection11.desktop Connection12.desktop
+autoformsdir = $(kde_datadir)/kpresenter/autoforms/Connections
+
+autoformsrc_DATA = Connection1.atf Connection2.atf \
+ Connection3.atf Connection4.atf \
+ Connection5.atf Connection6.atf \
+ Connection7.atf Connection8.atf \
+ Connection9.atf Connection10.atf \
+ Connection11.atf Connection12.atf
+autoformsrcdir = $(kde_datadir)/kpresenter/autoforms/Connections/.source
+
+autoformsicons_DATA = Connection1.png Connection2.png \
+ Connection3.png Connection4.png \
+ Connection5.png Connection6.png \
+ Connection7.png Connection8.png \
+ Connection9.png Connection10.png \
+ Connection11.png Connection12.png
+autoformsiconsdir = $(kde_datadir)/kpresenter/autoforms/Connections/.icon
diff --git a/kpresenter/autoforms/Makefile.am b/kpresenter/autoforms/Makefile.am
new file mode 100644
index 000000000..c5625e559
--- /dev/null
+++ b/kpresenter/autoforms/Makefile.am
@@ -0,0 +1,6 @@
+
+SUBDIRS = Arrows Connections
+
+autoforms_DATA = .autoforms
+autoformsdir = $(kde_datadir)/kpresenter/autoforms
+
diff --git a/kpresenter/brushpropertyui.ui b/kpresenter/brushpropertyui.ui
new file mode 100644
index 000000000..639bb06bb
--- /dev/null
+++ b/kpresenter/brushpropertyui.ui
@@ -0,0 +1,86 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>BrushPropertyUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>BrushPropertyUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>268</width>
+ <height>186</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Brush</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>styleLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Style:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>styleCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>styleCombo</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the style or the pattern.</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>colorChooser</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the color (white is the default). Clicking on the color will display the standard KDE color chooser dialog.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>colorLabel</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;olor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>colorChooser</cstring>
+ </property>
+ </widget>
+ <widget class="QFrame" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>previewPanel</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/configure.in.in b/kpresenter/configure.in.in
new file mode 100644
index 000000000..7c9f247da
--- /dev/null
+++ b/kpresenter/configure.in.in
@@ -0,0 +1 @@
+AC_HAVE_DPMS()
diff --git a/kpresenter/dtd/Makefile.am b/kpresenter/dtd/Makefile.am
new file mode 100644
index 000000000..02970de52
--- /dev/null
+++ b/kpresenter/dtd/Makefile.am
@@ -0,0 +1,4 @@
+dtd_DATA = kpresenter.dtd
+
+dtddir = $(kde_datadir)/kpresenter/dtd
+
diff --git a/kpresenter/dtd/kpresenter.dtd b/kpresenter/dtd/kpresenter.dtd
new file mode 100644
index 000000000..c5403c3fe
--- /dev/null
+++ b/kpresenter/dtd/kpresenter.dtd
@@ -0,0 +1,777 @@
+<!-- $Id: kpresenter.dtd 470799 2005-10-15 09:45:09Z mlaurent $
+
+ This is an XML document type definition (DTD) for the
+ KPresenter document format.
+ Written by Kalle Dalheimer <kalle@kde.org> with (obviously) input from
+ KPresenter's author Reginald Stadlbauer <reggie@kde.org>.
+-->
+
+<!-- Entity for <KEY>, <BACKPIXKEY>, <BACKCLIPKEY> and <BACKPICTUREKEY> -->
+<!ENTITY % key "day NMTOKEN #REQUIRED
+ filename CDATA #REQUIRED
+ hour NMTOKEN #REQUIRED
+ minute NMTOKEN #REQUIRED
+ month NMTOKEN #REQUIRED
+ msec NMTOKEN #REQUIRED
+ second NMTOKEN #REQUIRED
+ year NMTOKEN #REQUIRED" >
+
+
+
+<!-- A KPresenter document consists of a paper description, a
+ background description, a number of objects and information
+ about the screen presentation.
+
+ Attributes:
+
+ author: The document's author
+ email: The document's author's email address
+ editor: The program this file was written with
+ syntaxVersion: Integer version of the syntax. Currently 2.
+ mime: The MIME type (must always have the value application/x-kpresenter)
+-->
+<!ELEMENT DOC (PAPER | BACKGROUND | VARIABLESETTINGS | HEADER | FOOTER | PAGETITLES | PAGENOTES | OBJECTS | INFINITLOOP | MANUALSWITCH | PRESSPEED | PIXMAPS | SELSLIDES | STYLES | PICTURES | PIXMAPS | CLIPARTS | SHOWPRESENTATIONDURATION | HELPLINES | SPELLCHECKIGNORELIST | HEADERFOOTERBYPAGE)* >
+<!ATTLIST DOC author CDATA #IMPLIED
+ email CDATA #IMPLIED
+ editor CDATA #IMPLIED
+ syntaxVersion NMTOKEN #IMPLIED
+ mime CDATA "application/x-kpresenter">
+
+<!-- Describes the page format. Can have no or one PAPERBORDERS child that
+ describes the margins.
+
+ Attributes:
+
+ format: integer value for the page format
+ width: width in millimeters
+ height: height in millimeters
+ orientation: 0 for landscape, 1 for portrait
+-->
+<!ELEMENT PAPER (PAPERBORDERS?)>
+<!ATTLIST PAPER format NMTOKEN #REQUIRED
+ ptWidth NMTOKEN #REQUIRED
+ ptHeight NMTOKEN #REQUIRED
+ unit NMTOKEN #REQUIRED
+ orientation NMTOKEN #REQUIRED
+ tabStopValue NMTOKEN #REQUIRED>
+
+<!-- Describes the margins of the page.
+
+ Attributes:
+
+ left: left margin in pixels
+ right: right margin in pixels
+ top: top margin in pixels
+ bottom: bottom margin in pixels
+-->
+<!ELEMENT PAPERBORDERS EMPTY>
+<!ATTLIST PAPERBORDERS ptLeft NMTOKEN #REQUIRED
+ ptRight NMTOKEN #REQUIRED
+ ptTop NMTOKEN #REQUIRED
+ ptBottom NMTOKEN #REQUIRED>
+
+
+<!-- Contains general attributes variables. Has no children.
+
+ Attributes:
+ startingPageNumber: to the starting page number.
+-->
+<!ELEMENT VARIABLESETTINGS
+ EMPTY>
+<!ATTLIST VARIABLESETTINGS
+ startingPageNumber CDATA #REQUIRED>
+
+
+<!-- Contains general attributes. Has no children.
+
+ Attributes:
+ activePage: select active page.
+ gridx: distance between two points in grid (X value )
+ gridy: distance between two points in grid (Y value )
+ snaptogrid: 0 don't snap to grid 1 snap to grid
+
+-->
+<!ELEMENT ATTRIBUTES
+ EMPTY>
+<!ATTLIST ATTRIBUTES
+ activePage CDATA #REQUIRED
+ gridx CDATA #REQUIRED
+ gridy CDATA #REQUIRED
+ snaptogrid CDATA #REQUIRED>
+
+<!-- Contains all the objects on the pages.
+-->
+<!ELEMENT OBJECTS (OBJECT)*>
+
+
+<!-- Describes one object on the page.
+
+ Attributes:
+
+ type 0... picture
+ 1... line
+ 2... rect
+ 3... ellipse
+ 4... text
+ 5... autoform
+ 6... clipart
+ 7... undefined (never happens in a file)
+ 8... pie
+ 9... part
+ 10.. group
+ 11.. freehand
+ 12.. polyline
+ 13.. quadric bezier curve
+ 14.. cubic bezier curve
+ 15.. polygon
+ 16.. closed line
+
+ sticky 0... not sticky (default)
+ 1... sticky object
+
+-->
+<!ELEMENT OBJECT (ORIG|SIZE|SHADOW|EFFECTS|ANGLE|TEXTOBJ|PEN|BRUSH|RNDS|PRESNUM|FILLTYPE|GRADIENT|KEY|LINETYPE|LINEEND|LINEBEGIN|PRESNUM|FILENAME|DISAPPEAR|TIMER|APPEARSOUNDEFFECT|DISAPPEARSOUNDEFFECT|OBJECTNAME|POINTS|SETTINGS|PICTURESETTINGS|PROTECT|RATIO|OBJECTSNAME)*>
+<!ATTLIST OBJECT
+ type NMTOKEN #REQUIRED
+ sticky NMTOKEN #IMPLIED>
+
+<!-- The position of an object in the document.
+ Note that this is an absolute position, from the topleft corner
+ of the first page. The page on which the object is can be determined by
+ the formula: y / paper.height (in pt)
+
+ Attributes:
+
+ x the x position
+ y the y position
+-->
+<!ELEMENT ORIG EMPTY>
+<!ATTLIST ORIG
+ x NMTOKEN #REQUIRED
+ y NMTOKEN #REQUIRED>
+
+
+<!-- The object's size.
+
+ Attributes:
+
+ width the object's width
+ height the object's height
+-->
+<!ELEMENT SIZE EMPTY>
+<!ATTLIST SIZE
+ width NMTOKEN #REQUIRED
+ height NMTOKEN #REQUIRED>
+
+<!-- The effects for moving from page to page.
+
+ Attributes:
+
+ effect: first effect
+ effect2: second effect
+-->
+<!ELEMENT EFFECTS EMPTY>
+<!ATTLIST EFFECTS
+ effect NMTOKEN #REQUIRED
+ effect2 NMTOKEN #REQUIRED>
+
+<!-- The timer of effect object
+ Attributes:
+ appearTimer appear effect object's timer
+ disappearTimer disappear effect object's timer
+-->
+
+<!ELEMENT TIMER EMPTY>
+<!ATTLIST TIMER
+ appearTimer NMTOKEN #REQUIRED
+ disappearTimer NMTOKEN #REQUIRED>
+
+<!-- The effect to play sound
+ Attributes:
+ appearSoundFileName sound name (URL)
+ appearSoundEffect use or don't use sound with appear object
+-->
+
+
+<!ELEMENT APPEARSOUNDEFFECT EMPTY>
+<!ATTLIST APPEARSOUNDEFFECT
+ appearSoundFileName CDATA #REQUIRED
+ appearSoundEffect ( 0 | 1 ) #REQUIRED>
+
+<!-- The effect to play sound
+ Attributes:
+ disappearSoundFileName sound name (URL)
+ disappearSoundEffect use or don't use sound with disappear object
+-->
+
+
+<!ELEMENT DISAPPEARSOUNDEFFECT EMPTY>
+<!ATTLIST DISAPPEARSOUNDEFFECT
+ disappearSoundFileName CDATA #REQUIRED
+ disappearSoundEffect ( 0 | 1 ) #REQUIRED>
+
+<!-- The name of a object
+ Attributes:
+ objectName name of the object
+-->
+
+
+<!ELEMENT OBJECTNAME EMPTY>
+<!ATTLIST OBJECTNAME
+ objectName CDATA #REQUIRED>
+
+<!-- The "step" number in which the object appears, while showing the presentation.
+ This is relative to the current page.
+
+ Attributes:
+
+ value the "step" number in the presentation.
+-->
+<!ELEMENT PRESNUM EMPTY>
+<!ATTLIST PRESNUM value NMTOKEN #REQUIRED>
+
+
+<!-- The angle of the page
+
+ Attributes:
+
+ value the angle of the page
+-->
+<!ELEMENT ANGLE EMPTY>
+<!ATTLIST ANGLE value CDATA #REQUIRED>
+
+<!ELEMENT PROTECT EMPTY>
+<!ATTLIST PROTECT state CDATA #REQUIRED>
+
+<!ELEMENT RATIO EMPTY>
+<!ATTLIST RATIO ratio CDATA #REQUIRED>
+
+
+<!-- Describes a text object on the page.
+
+ Attributes:
+
+ lineSpacing space between line, in pt
+ paragSpacing space between parags, in pt
+ etc.
+ bleft, bright, btop, bbottom marge in pt
+ verticalAlign type of vertical alignment : center, top, bottom
+ verticalValue value of alignment (to add to top margins )
+
+-->
+<!ELEMENT TEXTOBJ (ENUMLISTTYPE|UNSORTEDLISTTYPE|P)*>
+<!ATTLIST TEXTOBJ
+ lineSpacing NMTOKEN #REQUIRED
+ bulletColor1 CDATA #REQUIRED
+ bulletColor2 CDATA #REQUIRED
+ bulletColor3 CDATA #REQUIRED
+ bulletColor4 CDATA #REQUIRED
+ bulletType1 NMTOKEN #REQUIRED
+ bulletType2 NMTOKEN #REQUIRED
+ bulletType3 NMTOKEN #REQUIRED
+ bulletType4 NMTOKEN #REQUIRED
+ margin NMTOKEN #REQUIRED
+ paragSpacing NMTOKEN #REQUIRED
+ protectcontent NMTOKEN #REQUIRED
+ bleft NMTOKEN #REQUIRED
+ bright NMTOKEN #REQUIRED
+ btop NMTOKEN #REQUIRED
+ bbottom NMTOKEN #REQUIRED
+ verticalAlign NMTOKEN #REQUIRED
+ verticalValue NMTOKEN #REQUIRED>
+
+<!ELEMENT ENUMLISTTYPE EMPTY>
+<!ATTLIST ENUMLISTTYPE
+ type CDATA #REQUIRED
+ before CDATA #IMPLIED
+ after CDATA #IMPLIED
+ start CDATA #REQUIRED
+ family CDATA #REQUIRED
+ pointSize CDATA #REQUIRED
+ bold CDATA #IMPLIED
+ italic CDATA #IMPLIED
+ underline CDATA #IMPLIED
+ red CDATA #IMPLIED
+ green CDATA #IMPLIED
+ blue CDATA #IMPLIED>
+
+<!ELEMENT UNSORTEDLISTTYPE EMPTY>
+<!ATTLIST UNSORTEDLISTTYPE
+ family CDATA #REQUIRED
+ pointSize CDATA #REQUIRED
+ bold CDATA #IMPLIED
+ italic CDATA #IMPLIED
+ underline CDATA #IMPLIED
+ red CDATA #IMPLIED
+ green CDATA #IMPLIED
+ blue CDATA #IMPLIED
+ chr CDATA #REQUIRED>
+
+<!ENTITY % layout "TEXT|COUNTER|INDENTS|OFFSETS|LINESPACING|LEFTBORDER|RIGHTBORDER|TOPBORDER|BOTTOMBORDER|TABULATOR*|SHADOW|NAME">
+
+<!-- Describes a paragraph in a text object
+
+ Attributes:
+
+ align 1=left, 2=right, 4=center 8=justify
+ type 0=normal, 1=bullet-list, 2=enum-list
+ depth list depth
+-->
+<!ELEMENT P (%layout;)*>
+<!ATTLIST P
+ align NMTOKEN #REQUIRED
+ type NMTOKEN #REQUIRED
+ depth NMTOKEN #REQUIRED>
+
+<!-- Describes a text of a text object
+
+ family: font family name
+ pointSize: font size in pt
+ [...]
+ strikeoutstyleline: solid, dash, dot, dashdot, dashdotdot
+ underlinestyleline: solid, dash, dot, dashdot, dashdotdot
+ [...]
+ VERTALIGN: Super/sub script.
+ 0 = Normal
+ 1 = Subscript
+ 2 = Superscript
+ relativetextsize
+ 0.75 means 3/4 of the normal font size.
+ [...]
+ wordbyword: 0 or 1. If 1, spaces are not striked out. Opposite of fo:score-spaces.
+
+ text-shadow:
+ The value is the CSS specification for text-shadow (also used by XSL-FO).
+ http://www.w3.org/TR/REC-CSS2/text.html#text-shadow-props
+ KPresenter only supports a single shadow, and no blur radius, so it amounts to
+ either "none" or "color length length".
+TODO: finish documentation
+
+-->
+<!ELEMENT TEXT (#PCDATA)>
+<!ATTLIST TEXT
+ family CDATA #REQUIRED
+ pointSize NMTOKEN #REQUIRED
+ underline ( 0 | 1 | single | double|single-bold|wave ) #REQUIRED
+ underlinestyleline CDATA #REQUIRED
+ underlinecolor CDATA #REQUIRED
+ bold ( 0 | 1 ) #REQUIRED
+ italic ( 0 | 1 ) #REQUIRED
+ strikeOut (0 | 1| single | double|single-bold) #REQUIRED
+ strikeoutstyleline CDATA #REQUIRED
+ whitespace NMTOKEN #IMPLIED
+ color CDATA #REQUIRED
+ textbackcolor CDATA #REQUIRED
+ VERTALIGN CDATA #REQUIRED
+ relativetextsize CDATA #IMPLIED
+ offsetfrombaseline CDATA #IMPLIED
+ wordbyword CDATA #IMPLIED
+ fontattribute (none | upper | lower)#REQUIRED
+ language CDATA #IMPLIED
+ text-shadow CDATA #IMPLIED>
+
+<!--
+ A paragraph and a style can have counter data.
+ The document will do the counting of the paragraphs that use this.
+
+ type: 0 = None
+ 1 = Numeral
+ 2 = Alphabetical
+ 3 = Alphabetical uppercase
+ 4 = Roman numbering
+ 5 = Roman numbering uppercase
+ 6 = Custom bullet (one char, set by the 'bullet' attribute)
+ 7 = Custom (complex string, see kword's dialog)
+ 8 = Circle bullet (empty circle)
+ 9 = Square bullet (full square)
+ 10 = Disc bullet (full circle)
+ 11 = Box bullet (empty square)
+
+ depth The level of the numbering.
+ Depth of 0 means the major numbering. (1, 2, 3...)
+ Depth of 1 is 1.1, 1.2, 1.3 etc.
+
+ start The first used number in the numbering (usually 1).
+ numberingtype
+ 0 = list numbering, 1 = chapter numbering.
+ List numbering starts at <start> everytime another list is used (everytime a
+ non numbering paragraph has been used)
+ Chapter numbering is used throughout the whole document (in future throughout books)
+ lefttext
+ The text that is printed left of the first numeral
+ righttext
+ The text that is printed right of the last numeral
+ A usual value for this one is "." (dot).
+
+ bullet The unicode character code that is the custom bullet (for type=6)
+ bulletfont
+ The font to use for the custom bullet can be found in (use "symbol" if in doubt)
+ customdef
+ Definition of a custom counter - not supported yet
+ restart
+ If "true" or "1", this paragraph is numbered as specified by start.
+ Otherwise (default) it will extend the current list (with equal type and depth).
+
+ text The text shown by the counter in the document when it was saved.
+ This is redundant information, unused by KPresenter upon loading, but useful
+ for export filters.
+
+ align Counter alignment. Possible values include:
+ int(Qt::AlignAuto), //left for LTR text and right for RTL text
+ int(Qt::AlignLeft),
+ int(Qt::AlignRight).
+-->
+<!ELEMENT COUNTER
+ EMPTY>
+<!ATTLIST COUNTER
+ type CDATA #REQUIRED
+ depth CDATA #REQUIRED
+ bullet CDATA #IMPLIED
+ start CDATA #IMPLIED
+ numberingtype CDATA #REQUIRED
+ lefttext CDATA #IMPLIED
+ righttext CDATA #IMPLIED
+ bulletfont CDATA #IMPLIED
+ customdef CDATA #IMPLIED
+ restart CDATA #IMPLIED
+ text CDATA #IMPLIED
+ align CDATA #IMPLIED>
+
+<!-- INDENTS
+ first: indent (pt) from the left border (of the frame) of the first line of a paragraph
+ left: indent (pt) that is used for the other lines in a paragraph.
+ right: indent (pt) on the right of all lines in the paragraph
+-->
+<!ELEMENT INDENTS
+ EMPTY>
+<!ATTLIST INDENTS
+ first CDATA #REQUIRED
+ left CDATA #REQUIRED
+ right CDATA #REQUIRED>
+
+
+<!--
+ Linespacing defines the height of a line in a paragraph.
+ By default the line height is the height of the biggest character in the line.
+
+ The "type" can be "oneandhalf" for 1.5 * line_height and "double" for 2 * line_height.
+ More generally it can also be "multiple", where spacingvalue=3 means 3 * line_height.
+ Other values for the type are
+ "custom": spacingvalue is the distance between the lines in pt (added to the line height)
+ "atleast": the total line height is at least spacingvalue (in pt)
+ "fixed": spacingvalue is equal to the total line height (in pt).
+
+ See koffice/lib/kotext/koparaglayout.h for more details.
+
+ spacingvalue isn't used if type is "oneandhalf" or "double".
+-->
+<!ELEMENT LINESPACING
+ EMPTY>
+<!ATTLIST LINESPACING
+ type (oneandhalf|double|custom|atleast|multiple|fixed) #IMPLIED
+ spacingvalue CDATA #IMPLIED>
+
+<!--
+ The borders can be used on a frame and on a paragraph.
+ the border has a color, displayed in the RGB value.
+ The width is in points.
+ Style 0 = solid
+ 1 = dashes
+ 2 = dots
+ 3 = dash - dot patterns
+ 4 = dash dot dot patterns
+-->
+<!ELEMENT LEFTBORDER
+ EMPTY>
+<!ATTLIST LEFTBORDER
+ red CDATA #REQUIRED
+ green CDATA #REQUIRED
+ blue CDATA #REQUIRED
+ style CDATA #REQUIRED
+ width CDATA #REQUIRED>
+<!ELEMENT RIGHTBORDER
+ EMPTY>
+<!ATTLIST RIGHTBORDER
+ red CDATA #REQUIRED
+ green CDATA #REQUIRED
+ blue CDATA #REQUIRED
+ style CDATA #REQUIRED
+ width CDATA #REQUIRED>
+<!ELEMENT TOPBORDER
+ EMPTY>
+<!ATTLIST TOPBORDER
+ red CDATA #REQUIRED
+ green CDATA #REQUIRED
+ blue CDATA #REQUIRED
+ style CDATA #REQUIRED
+ width CDATA #REQUIRED>
+<!ELEMENT BOTTOMBORDER
+ EMPTY>
+<!ATTLIST BOTTOMBORDER
+ red CDATA #REQUIRED
+ green CDATA #REQUIRED
+ blue CDATA #REQUIRED
+ style CDATA #REQUIRED
+ width CDATA #REQUIRED>
+
+<!-- OFFSETS
+ before: space before the paragraph, or "head offset" (KWord-0.8), aka "top margin" (KWord-1.0) (pt)
+ after: space after the paragraph, or "foot offset" (KWord-0.8), aka "bottom margin" (KWord-1.0) (pt)
+-->
+<!ELEMENT OFFSETS
+ EMPTY>
+<!ATTLIST OFFSETS
+ before CDATA #IMPLIED
+ after CDATA #IMPLIED>
+
+
+<!-- Defines the position of a tabulation
+ Attributes:
+
+ type: 0 .. left
+ 1 .. center
+ 2 .. right
+ 3 .. alignment of decimal point
+
+ ptpos: Position of the tabulation, in pt
+
+ filling: 0 .. blank
+ 1 .. dots
+ 2 .. line
+ 3 .. dash
+ 4 .. dash-dot
+ 5 .. dash-dot-dot
+
+ width: Width of the filling, in pt
+-->
+<!ELEMENT TABULATOR
+ EMPTY>
+<!ATTLIST TABULATOR
+ type CDATA #REQUIRED
+ ptpos CDATA #REQUIRED
+ filling CDATA #IMPLIED
+ width CDATA #IMPLIED>
+
+<!ELEMENT PEN EMPTY>
+<!ATTLIST PEN color CDATA #REQUIRED
+ width NMTOKEN #REQUIRED
+ style NMTOKEN #REQUIRED>
+
+<!ELEMENT BRUSH EMPTY>
+<!ATTLIST BRUSH color CDATA #REQUIRED
+ style NMTOKEN #REQUIRED>
+
+<!ELEMENT RNDS EMPTY>
+<!ATTLIST RNDS x CDATA #REQUIRED
+ y CDATA #REQUIRED>
+
+<!ELEMENT FILLTYPE EMPTY>
+<!ATTLIST FILLTYPE value CDATA #REQUIRED>
+
+<!ELEMENT GRADIENT EMPTY>
+<!ATTLIST GRADIENT color1 CDATA #REQUIRED
+ color2 CDATA #REQUIRED
+ unbalanced NMTOKEN #REQUIRED
+ xfactor NMTOKEN #REQUIRED
+ yfactor NMTOKEN #REQUIRED
+ type NMTOKEN #REQUIRED>
+
+<!ELEMENT SETTINGS EMPTY>
+<!ATTLIST SETTINGS checkConcavePolygon ( 0 | 1 ) #REQUIRED
+ cornersValue NMTOKEN #REQUIRED
+ sharpnessValue NMTOKEN #REQUIRED>
+
+
+<!ELEMENT INFINITLOOP EMPTY>
+<!ATTLIST INFINITLOOP value NMTOKEN #REQUIRED>
+
+<!ELEMENT MANUALSWITCH EMPTY>
+<!ATTLIST MANUALSWITCH value NMTOKEN #REQUIRED>
+
+<!ELEMENT PRESSPEED EMPTY>
+<!ATTLIST PRESSPEED value NMTOKEN #REQUIRED>
+
+<!ELEMENT SHOWPRESENTATIONDURATION EMPTY>
+<!ATTLIST SHOWPRESENTATIONDURATION value NMTOKEN #REQUIRED>
+
+<!ELEMENT BACKGROUND (PAGE*) >
+<!ATTLIST BACKGROUND rastX NMTOKEN #REQUIRED
+ rastY NMTOKEN #REQUIRED
+ color CDATA #REQUIRED>
+
+<!ELEMENT PAGE (BACKTYPE|BACKMASTER|BACKVIEW|BACKCOLOR1|BACKCOLOR2|BCTYPE|PGEFFECT|PGTIMER|PGSOUNDEFFECT|
+ BACKPIXKEY|BACKCLIPKEY|BACKPICTUREKEY|HEADERFOOTER)*>
+
+<!ELEMENT BACKTYPE EMPTY>
+<!ATTLIST BACKTYPE value CDATA #REQUIRED>
+
+<!ELEMENT BACKMASTER EMPTY>
+<!ATTLIST BACKMASTER useMasterBackground CDATA #REQUIRED
+ displayMasterPageObject CDATA #REQUIRED
+ displayBackground CDATA #REQUIRED>
+
+<!ELEMENT BACKVIEW EMPTY>
+<!ATTLIST BACKVIEW value NMTOKEN #REQUIRED>
+
+<!-- Only for KPresenter 1.1 compactibility, otherwise use BACKPICTUREKEY -->
+<!ELEMENT BACKPIXKEY EMPTY>
+<!ATTLIST BACKPIXKEY %key; >
+
+<!-- Only for KPresenter 1.1 compactibility, otherwise use BACKPICTUREKEY -->
+<!ELEMENT BACKCLIPARTKEY EMPTY>
+<!ATTLIST BACKCLIPARTKEY %key; >
+
+<!ELEMENT BACKPICTUREKEY EMPTY>
+<!ATTLIST BACKPICTUREKEY %key; >
+
+<!ELEMENT BCTYPE EMPTY>
+<!ATTLIST BCTYPE value CDATA #REQUIRED>
+
+<!ELEMENT PGEFFECT EMPTY>
+<!ATTLIST PGEFFECT value NMTOKEN #REQUIRED>
+
+<!ELEMENT BACKCOLOR1 EMPTY>
+<!ATTLIST BACKCOLOR1 color CDATA #REQUIRED>
+
+<!ELEMENT BACKCOLOR2 EMPTY>
+<!ATTLIST BACKCOLOR2 red CDATA #REQUIRED
+ green CDATA #REQUIRED
+ blue CDATA #REQUIRED>
+
+<!ELEMENT PGTIMER EMPTY>
+<!ATTLIST PGTIMER timer NMTOKEN #REQUIRED>
+
+<!ELEMENT PGSOUNDEFFECT EMPTY>
+<!ATTLIST PGSOUNDEFFECT soundEffect ( 0 | 1 ) #REQUIRED
+ soundFileNmae CDATA #REQUIRED>
+
+<!ELEMENT HEADERFOOTER EMPTY>
+<!ATTLIST HEADERFOOTER header ( 0 | 1 ) #REQUIRED
+ footer ( 0 | 1 ) #REQUIRED>
+
+<!ELEMENT DISAPPEAR EMPTY >
+<!ATTLIST DISAPPEAR doit NMTOKEN #REQUIRED
+ effect NMTOKEN #REQUIRED
+ num NMTOKEN #REQUIRED>
+
+
+<!ELEMENT FILENAME EMPTY >
+<!ATTLIST FILENAME value CDATA #REQUIRED >
+
+<!ELEMENT FOOTER ( ORIG, SIZE, PEN, TEXTOBJ ) >
+<!ATTLIST FOOTER show NMTOKEN #REQUIRED >
+
+<!ELEMENT HEADER ( ORIG, SIZE, PEN, TEXTOBJ ) >
+<!ATTLIST HEADER show NMTOKEN #REQUIRED >
+
+<!ELEMENT HEADERFOOTERBYPAGE EMPTY >
+<!ATTLIST HEADERFOOTERBYPAGE value CDATA #REQUIRED >
+
+<!ELEMENT KEY EMPTY >
+<!ATTLIST KEY %key;
+ name CDATA #IMPLIED >
+
+<!ELEMENT LINEBEGIN EMPTY >
+<!ATTLIST LINEBEGIN value NMTOKEN #REQUIRED >
+
+<!ELEMENT LINEEND EMPTY >
+<!ATTLIST LINEEND value NMTOKEN #REQUIRED >
+
+<!ELEMENT LINETYPE EMPTY >
+<!ATTLIST LINETYPE value NMTOKEN #REQUIRED >
+
+<!--
+ A style is a global setting that is used for all paragraphs which use that
+ style. As the markup is stored in one place (the style) changing the markup
+ throughout the document is simply a task of changing one or two styles.
+ Highly recommended for structured documents.
+
+ A style element contains the same child elements as the P tag
+ (all the paragraph properties), as well as a text format in the FORMAT tag.
+ It also contains the name of the following style, i.e. the one used when
+ the user presses Enter in a paragraph using this style.
+
+ Attributes:
+ outline if "true", this style is part of the Table Of Contents.
+ (by default it is not).
+-->
+<!ELEMENT STYLES
+ (STYLE*)>
+<!ELEMENT STYLE
+ (%layout;|FORMAT|FOLLOWING)*>
+<!ATTLIST STYLE
+ outline CDATA #IMPLIED>
+
+<!-- Description of text format inside a style -->
+<!ELEMENT FORMAT EMPTY>
+<!ATTLIST FORMAT
+ <!-- The exact same attributes as TEXT can have.
+ Is it possible to define an entity for a list of attributes? -->
+>
+
+<!ELEMENT PICTURES ( KEY* ) >
+
+<!-- Only for KPresenter 1.1 compactibility -->
+<!ELEMENT CLIPARTS ( KEY* ) >
+
+<!-- Only for KPresenter 1.1 compactibility -->
+<!ELEMENT PIXMAPS ( KEY* ) >
+
+<!ELEMENT PICTURESETTINGS EMPTY>
+<!ATTLIST PICTURESETTINGS mirrorType NMTOKEN #REQUIRED
+ depth NMTOKEN #REQUIRED
+ swapRGB ( 0 | 1 ) #REQUIRED
+ grayscal ( 0 | 1 ) #REQUIRED
+ bright NMTOKEN #REQUIRED>
+
+<!ELEMENT SELSLIDES ( SLIDE+ ) >
+<!ELEMENT SLIDE EMPTY>
+<!ATTLIST SLIDE nr NMTOKEN #REQUIRED
+ show NMTOKEN #REQUIRED>
+
+<!ELEMENT CUSTOMSLIDESHOWCONFIG ( SLIDE+ ) >
+<!ELEMENT CUSTOMSLIDESHOW EMPTY>
+<!ATTLIST CUSTOMSLIDESHOW name NMTOKEN #REQUIRED
+ pages NMTOKEN #REQUIRED>
+
+<!ELEMENT DEFAULTCUSTOMSLIDESHOWNAME ANY>
+<!ATTLIST DEFAULTCUSTOMSLIDESHOWNAME name CDATA #REQUIRED>
+
+
+<!ELEMENT PAGETITLES ( Title+ ) >
+<!ELEMENT Title EMPTY>
+<!ATTLIST Title title CDATA #REQUIRED>
+
+<!ELEMENT PAGENOTES ( Note+ ) >
+<!ELEMENT Note EMPTY>
+<!ATTLIST Note note CDATA #REQUIRED>
+
+<!ELEMENT POINTS ( Point+ ) >
+<!ELEMENT Point EMPTY>
+<!ATTLIST Point point_x NMTOKEN #REQUIRED
+ point_y NMTOKEN #REQUIRED>
+
+<!ELEMENT HELPLINES (Vertical | Horizontal | HelpPoint)* >
+<!ATTLIST HELPLINES show NMTOKEN #REQUIRED >
+<!ELEMENT Vertical EMPTY>
+<!ATTLIST Vertical value NMTOKEN #REQUIRED >
+<!ELEMENT Horizontal EMPTY>
+<!ATTLIST Horizontal value NMTOKEN #REQUIRED >
+<!ELEMENT HelpPoint EMPTY>
+<!ATTLIST HelpPoint posX NMTOKEN #REQUIRED
+ posY NMTOKEN #REQUIRED>
+
+<!ELEMENT SPELLCHECKIGNORELIST ( SPELLCHECKIGNOREWORD+ )>
+<!ATTLIST SPELLCHECKIGNORELIST >
+<!ELEMENT SPELLCHECKIGNOREWORD EMPTY>
+<!ATTLIST SPELLCHECKIGNOREWORD word NMTOKEN #REQUIRED >
+
+<!-- ### TODO: please verify! -->
+<!ELEMENT OBJECTSNAME ANY>
+<!ATTLIST OBJECTSNAME NAME CDATA #REQUIRED>
+
+<!--
+ Name of the style used by this paragraph
+-->
+<!ELEMENT NAME EMPTY>
+<!ATTLIST NAME value CDATA #REQUIRED>
diff --git a/kpresenter/generalpropertyui.ui b/kpresenter/generalpropertyui.ui
new file mode 100644
index 000000000..6e3728b2e
--- /dev/null
+++ b/kpresenter/generalpropertyui.ui
@@ -0,0 +1,193 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>GeneralPropertyUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>GeneralPropertyUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>292</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>General</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>nameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Na&amp;me:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>nameInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>nameInput</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>protect</cstring>
+ </property>
+ <property name="text">
+ <string>Protect si&amp;ze and position</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>keepRatio</cstring>
+ </property>
+ <property name="text">
+ <string>Keep &amp;aspect ratio</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="3" column="0">
+ <property name="name">
+ <cstring>positionGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Position</string>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>widthLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Width:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>widthInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>heightLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Height:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>heightInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>topLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Top:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>yInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>leftLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Left:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>xInput</cstring>
+ </property>
+ </widget>
+ <widget class="KoUnitDoubleSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>xInput</cstring>
+ </property>
+ </widget>
+ <widget class="KoUnitDoubleSpinBox" row="0" column="3">
+ <property name="name">
+ <cstring>yInput</cstring>
+ </property>
+ </widget>
+ <widget class="KoUnitDoubleSpinBox" row="1" column="3">
+ <property name="name">
+ <cstring>heightInput</cstring>
+ </property>
+ </widget>
+ <widget class="KoUnitDoubleSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>widthInput</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="4" column="0">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>KoUnitDoubleSpinBox</class>
+ <header location="local">KoUnitWidgets.h</header>>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="PNG" length="1008">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b749444154388db59541681d551486bf49aef55c4965061b98815a5e20a5790b912c0d66d12c0381361004219bae0a45041111a92d28086a4110eaa68a8bd8b8a97121348b96b810cca6988281111a9c27446720afcc8516efa94e3b2e665e6244832e3c70b8cce5f2cf77cffc734e50d735830882600818060c3004046d1e14759b8f800a7858d7f5a360207cfe8df34f7627ba679d7367f27e7ea27425168bc71fb896ae24bd936eaddf5a5fa6e213e02ef0c00c48af5dbd76364a7837390e9d4a5b98128c0025d608e0f7f6d97b4eefc8389f8617d66f3a0b7c0894a63d395cf48b33d1d390f5bf40ef65f84ab116fcefe00a212f1441b04760ec38882854a0801c866854015e00aeee1203a6ec97273c0ebd57e02b873d1c926dc0daaab271ab400c68a5880989c785d98588a9698fd0ec872302e83120fa33f150ee7226517c95636dc8b73794e52b0e2a08432119174420ef29bd2de5a3b7338ac598f9451069c4dbb0c0a18170608d05147b58c83660a5159d3d1573720e92c482f1a846acad7a56ae3856967ac4719799d316314a53188681606820ec2b0f08dec3f5af1c5a29b3a762e6cf4094286a72dc8ee5fa9725b30b112fbe148211969772b4bfcf7e01100c88b1c682297145447a3b230c1b5291e68aee7ec2e5f74bb24d47b903e75e4b58bfe1c87e50d2d423b2dfdc03627ce5b146c88b120c241d884641519c8bb8fc564ebae99050989a8e60a4a43b19a295926f8356ff20dcd41804814a0947da8fb29370f99d926cb3b157382224472112c08018412b90bf20ef2306b047001392f61455cbda4ddf908e08f1d1905eafe0d2c59c742322cf14ad94b18e853d5734fedd4f5cd23d0e9d8e50f494b555cffc6244b9a34c9d8c4862b874117a5b05e75fced1fb8e380ee94e425e1c50631010657641d04a59b9e2585b2d39f74ac2e4b4a733e979f5cd84380e71fd022a989a0b199bd8e7e3bf23f6500953d3506cc7ac2cf558fe00d66f38bacf846020cf4a5c5f9bdaa2a4df28e96d4b2842ebe37dc275d92fdb7f5f11607e5188e32e2b9fe7a49b4a7abbd79cae203c1232733ae4bbaf95fcbe43ab88a2bf2b5a03f5ae707a27dd4a331997a821110333739ea9e98434f5e4db8d68d2b17427616c02d2390b5502a624fb1e805f8087401dd4754d100416c3ebcf3d2f17a2a4b194aa3270bdb4af17d37633da9b19c139483794bc505cc155e063e047da46ff18700c780ff889bda9f06ff367e033e034f02c303a201ea2e94a11f054bb5ada86c2c151b7d7f73413e02e50ee8ea620080cf038f0442b7a88ff36f37e6bc57f051e04ffd730fd03ef8bd61b5b2ca6900000000049454e44ae426082</data>
+ </image>
+</images>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kpresenter/global.h b/kpresenter/global.h
new file mode 100644
index 000000000..e7d9b044d
--- /dev/null
+++ b/kpresenter/global.h
@@ -0,0 +1,299 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef GLOBAL_H
+#define GLOBAL_H
+
+#include <kiconloader.h>
+#include "KPrFactory.h"
+
+class KPrPage;
+
+#define KPBarIcon( x ) BarIcon( x, KPrFactory::global() )
+
+#define MAX_UNDO_REDO 100
+
+// types
+enum AlignType {
+ AT_LEFT = 0,
+ AT_TOP,
+ AT_RIGHT,
+ AT_BOTTOM,
+ AT_HCENTER,
+ AT_VCENTER
+};
+
+enum BackType {
+ BT_COLOR = 0,
+ BT_PICTURE = 1,
+ BT_CLIPART = 2,
+ BT_BRUSH = 3
+};
+
+enum BackView {
+ BV_ZOOM = 0,
+ BV_CENTER = 1,
+ BV_TILED = 2
+};
+
+enum ObjType {
+ OT_PICTURE = 0,
+ OT_LINE = 1,
+ OT_RECT = 2,
+ OT_ELLIPSE = 3,
+ OT_TEXT = 4,
+ OT_AUTOFORM = 5,
+ OT_CLIPART = 6,
+ OT_UNDEFINED = 7,
+ OT_PIE = 8,
+ OT_PART = 9,
+ OT_GROUP = 10,
+ OT_FREEHAND = 11,
+ OT_POLYLINE = 12,
+ OT_QUADRICBEZIERCURVE = 13,
+ OT_CUBICBEZIERCURVE = 14,
+ OT_POLYGON = 15,
+ OT_CLOSED_LINE = 16
+};
+enum SelectionMode {
+ SM_NONE = 0,
+ SM_MOVERESIZE = 1,
+ SM_ROTATE = 2,
+ SM_PROTECT = 3
+};
+enum LineType {
+ LT_HORZ = 0,
+ LT_VERT,
+ LT_LU_RD,
+ LT_LD_RU
+};
+enum RectType {
+ RT_NORM = 0,
+ RT_ROUND
+};
+enum ModifyType {
+ MT_NONE = 0,
+ MT_MOVE,
+ MT_RESIZE_UP,
+ MT_RESIZE_DN,
+ MT_RESIZE_LF,
+ MT_RESIZE_RT,
+ MT_RESIZE_LU,
+ MT_RESIZE_LD,
+ MT_RESIZE_RU,
+ MT_RESIZE_RD
+};
+enum Effect {
+ EF_NONE = 0,
+ EF_COME_RIGHT = 1,
+ EF_COME_LEFT = 2,
+ EF_COME_TOP = 3,
+ EF_COME_BOTTOM = 4,
+ EF_COME_RIGHT_TOP = 5,
+ EF_COME_RIGHT_BOTTOM = 6,
+ EF_COME_LEFT_TOP = 7,
+ EF_COME_LEFT_BOTTOM = 8,
+ EF_WIPE_LEFT = 9,
+ EF_WIPE_RIGHT = 10,
+ EF_WIPE_TOP = 11,
+ EF_WIPE_BOTTOM = 12
+};
+enum Effect2 {
+ EF2_NONE = 0,
+ EF2T_PARA = 1
+};
+enum Effect3 {
+ EF3_NONE = 0,
+ EF3_GO_RIGHT = 1,
+ EF3_GO_LEFT = 2,
+ EF3_GO_TOP = 3,
+ EF3_GO_BOTTOM = 4,
+ EF3_GO_RIGHT_TOP = 5,
+ EF3_GO_RIGHT_BOTTOM = 6,
+ EF3_GO_LEFT_TOP = 7,
+ EF3_GO_LEFT_BOTTOM = 8,
+ EF3_WIPE_LEFT = 9,
+ EF3_WIPE_RIGHT = 10,
+ EF3_WIPE_TOP = 11,
+ EF3_WIPE_BOTTOM = 12
+};
+enum PageEffect {
+ PEF_NONE = 0,
+ PEF_CLOSE_HORZ = 1,
+ PEF_CLOSE_VERT = 2,
+ PEF_CLOSE_ALL = 3,
+ PEF_OPEN_HORZ = 4,
+ PEF_OPEN_VERT = 5,
+ PEF_OPEN_ALL = 6,
+ PEF_INTERLOCKING_HORZ_1 = 7,
+ PEF_INTERLOCKING_HORZ_2 = 8,
+ PEF_INTERLOCKING_VERT_1 = 9,
+ PEF_INTERLOCKING_VERT_2 = 10,
+ PEF_SURROUND1 = 11,
+ PEF_FLY1 = 12,
+ PEF_BLINDS_HOR = 13,
+ PEF_BLINDS_VER = 14,
+ PEF_BOX_IN = 15,
+ PEF_BOX_OUT = 16,
+ PEF_CHECKBOARD_ACROSS = 17,
+ PEF_CHECKBOARD_DOWN = 18,
+ PEF_COVER_DOWN = 19,
+ PEF_UNCOVER_DOWN = 20,
+ PEF_COVER_UP = 21,
+ PEF_UNCOVER_UP = 22,
+ PEF_COVER_LEFT = 23,
+ PEF_UNCOVER_LEFT = 24,
+ PEF_COVER_RIGHT = 25,
+ PEF_UNCOVER_RIGHT = 26,
+ PEF_COVER_LEFT_UP = 27,
+ PEF_UNCOVER_LEFT_UP = 28,
+ PEF_COVER_LEFT_DOWN = 29,
+ PEF_UNCOVER_LEFT_DOWN = 30,
+ PEF_COVER_RIGHT_UP = 31,
+ PEF_UNCOVER_RIGHT_UP = 32,
+ PEF_COVER_RIGHT_DOWN = 33,
+ PEF_UNCOVER_RIGHT_DOWN = 34,
+ PEF_DISSOLVE = 35,
+ PEF_STRIPS_LEFT_UP = 36,
+ PEF_STRIPS_LEFT_DOWN = 37,
+ PEF_STRIPS_RIGHT_UP = 38,
+ PEF_STRIPS_RIGHT_DOWN = 39,
+ PEF_MELTING = 40,
+ PEF_LAST_MARKER = 41, // only marker, don't use this !
+ PEF_RANDOM = -1
+};
+
+enum ImageEffect {
+ IE_NONE = -1,
+ IE_CHANNEL_INTENSITY = 0,
+ IE_FADE = 1,
+ IE_FLATTEN = 2,
+ IE_INTENSITY = 3,
+ IE_DESATURATE = 4,
+ IE_CONTRAST = 5,
+ IE_NORMALIZE = 6,
+ IE_EQUALIZE = 7,
+ IE_THRESHOLD = 8,
+ IE_SOLARIZE = 9,
+ IE_EMBOSS = 10,
+ IE_DESPECKLE = 11,
+ IE_CHARCOAL = 12,
+ IE_NOISE = 13,
+ IE_BLUR = 14,
+ IE_EDGE = 15,
+ IE_IMPLODE = 16,
+ IE_OIL_PAINT = 17,
+ IE_SHARPEN = 18,
+ IE_SPREAD = 19,
+ IE_SHADE = 20,
+ IE_SWIRL = 21,
+ IE_WAVE = 22
+};
+
+enum LineEnd {
+ L_NORMAL = 0,
+ L_ARROW,
+ L_SQUARE,
+ L_CIRCLE,
+ L_LINE_ARROW,
+ L_DIMENSION_LINE,
+ L_DOUBLE_ARROW,
+ L_DOUBLE_LINE_ARROW
+};
+enum ShadowDirection {
+ SD_LEFT_UP = 1,
+ SD_UP = 2,
+ SD_RIGHT_UP = 3,
+ SD_RIGHT = 4,
+ SD_RIGHT_BOTTOM = 5,
+ SD_BOTTOM = 6,
+ SD_LEFT_BOTTOM = 7,
+ SD_LEFT = 8
+};
+
+typedef int PresSpeed;
+
+enum EffectSpeed {
+ ES_SLOW = 0,
+ ES_MEDIUM = 1,
+ ES_FAST = 2
+};
+
+enum InsertPos {
+ IP_BEFORE = 0,
+ IP_AFTER = 1
+};
+enum PieType {
+ PT_PIE = 0,
+ PT_ARC = 1,
+ PT_CHORD = 2
+};
+enum ToolEditMode {
+ TEM_MOUSE = 0,
+ INS_RECT = 1,
+ INS_ELLIPSE = 2,
+ INS_TEXT = 3,
+ INS_PIE = 4,
+ INS_OBJECT = 5,
+ INS_LINE = 6,
+ INS_DIAGRAMM = 7,
+ INS_TABLE = 8,
+ INS_FORMULA = 9,
+ INS_AUTOFORM = 10,
+ INS_FREEHAND = 11,
+ INS_POLYLINE = 12,
+ INS_QUADRICBEZIERCURVE = 13,
+ INS_CUBICBEZIERCURVE = 14,
+ INS_POLYGON = 15,
+ INS_PICTURE = 16,
+ INS_CLIPART = 17,
+ TEM_ROTATE = 18,
+ TEM_ZOOM = 19,
+ INS_CLOSED_FREEHAND = 20,
+ INS_CLOSED_POLYLINE = 21,
+ INS_CLOSED_QUADRICBEZIERCURVE = 22,
+ INS_CLOSED_CUBICBEZIERCURVE = 23
+};
+
+enum PictureMirrorType {
+ PM_NORMAL = 0,
+ PM_HORIZONTAL = 1,
+ PM_VERTICAL = 2,
+ PM_HORIZONTALANDVERTICAL = 3
+};
+
+enum PropValue {
+ STATE_ON = 0,
+ STATE_OFF = 1,
+ STATE_UNDEF = 2
+};
+
+enum VerticalAlignmentType {
+ KP_CENTER=0,
+ KP_TOP=1,
+ KP_BOTTOM=2
+};
+
+
+// offsets of the effects in the Effect2 enum accoording to a objType
+const int TxtObjOffset = 0;
+
+typedef QMap<QString, QValueList<KPrPage *> > CustomSlideShowMap;
+
+#endif //GLOBAL_H
diff --git a/kpresenter/gradientpropertyui.ui b/kpresenter/gradientpropertyui.ui
new file mode 100644
index 000000000..92411fcd9
--- /dev/null
+++ b/kpresenter/gradientpropertyui.ui
@@ -0,0 +1,178 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>GradientPropertyUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>GradientPropertyUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>203</width>
+ <height>181</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Gradient</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KColorButton" row="1" column="2">
+ <property name="name">
+ <cstring>color2Chooser</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>styleCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>styleLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Gradient:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>styleCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>colorLabel</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;olors:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>color1Chooser</cstring>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>color1Chooser</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout17</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>xFactorLabel</cstring>
+ </property>
+ <property name="text">
+ <string>X-fac&amp;tor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>xSlider</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>unbalancedCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Un&amp;balanced:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>yFactorLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Y-factor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>ySlider</cstring>
+ </property>
+ </widget>
+ <widget class="QSlider" row="2" column="1">
+ <property name="name">
+ <cstring>ySlider</cstring>
+ </property>
+ <property name="minValue">
+ <number>-200</number>
+ </property>
+ <property name="maxValue">
+ <number>200</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QSlider" row="1" column="1">
+ <property name="name">
+ <cstring>xSlider</cstring>
+ </property>
+ <property name="minValue">
+ <number>-200</number>
+ </property>
+ <property name="maxValue">
+ <number>200</number>
+ </property>
+ <property name="value">
+ <number>100</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>previewPanel</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<tabstops>
+ <tabstop>styleCombo</tabstop>
+ <tabstop>color1Chooser</tabstop>
+ <tabstop>color2Chooser</tabstop>
+ <tabstop>unbalancedCheckBox</tabstop>
+ <tabstop>xSlider</tabstop>
+ <tabstop>ySlider</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/imageEffectBase.ui b/kpresenter/imageEffectBase.ui
new file mode 100644
index 000000000..2495e5aac
--- /dev/null
+++ b/kpresenter/imageEffectBase.ui
@@ -0,0 +1,1480 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>EffectBrowserBase</class>
+<author>Lukas Tinkl &lt;lukas@kde.org&gt;</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>636</width>
+ <height>314</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="1">
+ <property name="name">
+ <cstring>gbPreview</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Preview</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_previewLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>300</width>
+ <height>200</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Image &amp;effect:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_effectCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Channel Intensity</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Fade</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Flatten</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Intensity</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Desaturate</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Contrast</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Normalize</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Equalize</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Threshold</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Solarize</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Emboss</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Despeckle</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Charcoal</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Noise</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Blur</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Edge</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Implode</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Oil Paint</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Sharpen</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Spread</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Shade</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Swirl</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Wave</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_effectCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="insertionPolicy">
+ <enum>NoInsertion</enum>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>Line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QWidgetStack">
+ <property name="name">
+ <cstring>m_widgetStack</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Value:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>chanInt_value</cstring>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ <property name="maxValue">
+ <number>100</number>
+ </property>
+ <property name="minValue">
+ <number>-100</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Color component:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Red</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Green</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Blue</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Gray</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>All</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>chanInt_component</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>130</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>1</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>Value:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel6</cstring>
+ </property>
+ <property name="text">
+ <string>Color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="3" column="0">
+ <property name="name">
+ <cstring>fade_color</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput" row="1" column="0">
+ <property name="name">
+ <cstring>fade_value</cstring>
+ </property>
+ <property name="value">
+ <number>0.3</number>
+ </property>
+ <property name="maxValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <spacer row="4" column="0">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>130</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>2</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Color 1:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton">
+ <property name="name">
+ <cstring>flatten_color1</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Color 2:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton">
+ <property name="name">
+ <cstring>flatten_color2</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>81</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>3</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Intensity:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>intensity_value</cstring>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ <property name="maxValue">
+ <number>100</number>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>71</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>4</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel4_2</cstring>
+ </property>
+ <property name="text">
+ <string>Value:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>desaturate_value</cstring>
+ </property>
+ <property name="value">
+ <number>0.3</number>
+ </property>
+ <property name="maxValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer8</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>111</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>5</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel5_2</cstring>
+ </property>
+ <property name="text">
+ <string>Value:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>contrast_value</cstring>
+ </property>
+ <property name="maxValue">
+ <number>255</number>
+ </property>
+ <property name="minValue">
+ <number>-255</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>71</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>6</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel8</cstring>
+ </property>
+ <property name="text">
+ <string>This effect has no options.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>7</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel9</cstring>
+ </property>
+ <property name="text">
+ <string>This effect has no options.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>8</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel7</cstring>
+ </property>
+ <property name="text">
+ <string>Value:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>threshold_value</cstring>
+ </property>
+ <property name="maxValue">
+ <number>256</number>
+ </property>
+ <property name="value">
+ <number>128</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>111</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>9</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel10</cstring>
+ </property>
+ <property name="text">
+ <string>Factor:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>solarize_value</cstring>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ <property name="maxValue">
+ <number>99.9</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>121</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>10</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel9_2</cstring>
+ </property>
+ <property name="text">
+ <string>This effect has no options.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>11</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel9_3</cstring>
+ </property>
+ <property name="text">
+ <string>This effect has no options.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>12</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>Factor:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>charcoal_value</cstring>
+ </property>
+ <property name="value">
+ <number>50</number>
+ </property>
+ <property name="maxValue">
+ <number>99.9</number>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>13</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel2_3</cstring>
+ </property>
+ <property name="text">
+ <string>Type:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Uniform</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Gaussian</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Multiplicative Gaussian</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Impulse</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>LaPlace</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Poisson</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>noise_type</cstring>
+ </property>
+ <property name="currentItem">
+ <number>1</number>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>14</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel3_2</cstring>
+ </property>
+ <property name="text">
+ <string>Factor:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>blur_value</cstring>
+ </property>
+ <property name="value">
+ <number>50</number>
+ </property>
+ <property name="maxValue">
+ <number>99.9</number>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>15</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel3_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Factor:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>edge_value</cstring>
+ </property>
+ <property name="value">
+ <number>50</number>
+ </property>
+ <property name="maxValue">
+ <number>99.9</number>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>181</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>16</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel3_2_3</cstring>
+ </property>
+ <property name="text">
+ <string>Factor:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>implode_value</cstring>
+ </property>
+ <property name="value">
+ <number>30</number>
+ </property>
+ <property name="maxValue">
+ <number>99.9</number>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>181</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>17</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel4_3</cstring>
+ </property>
+ <property name="text">
+ <string>Radius:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>oilPaint_radius</cstring>
+ </property>
+ <property name="value">
+ <number>3</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer15</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>71</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>18</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel3_2_4</cstring>
+ </property>
+ <property name="text">
+ <string>Factor:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>sharpen_value</cstring>
+ </property>
+ <property name="value">
+ <number>30</number>
+ </property>
+ <property name="maxValue">
+ <number>99.9</number>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12_4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>181</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>19</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel4_3_2</cstring>
+ </property>
+ <property name="text">
+ <string>Value:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>spread_value</cstring>
+ </property>
+ <property name="value">
+ <number>3</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer15_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>183</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>20</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>shade_color</cstring>
+ </property>
+ <property name="text">
+ <string>Color Shading</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel5_3</cstring>
+ </property>
+ <property name="text">
+ <string>Azimuth:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Determines the light source and direction.</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>shade_azimuth</cstring>
+ </property>
+ <property name="value">
+ <number>30</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel6_2</cstring>
+ </property>
+ <property name="text">
+ <string>Elevation:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Determines the light source and direction.</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>shade_elevation</cstring>
+ </property>
+ <property name="value">
+ <number>30</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer18</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>41</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>21</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel7_2</cstring>
+ </property>
+ <property name="text">
+ <string>Angle:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>swirl_value</cstring>
+ </property>
+ <property name="value">
+ <number>50</number>
+ </property>
+ <property name="maxValue">
+ <number>359.9</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer19</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>81</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>22</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel9_4</cstring>
+ </property>
+ <property name="text">
+ <string>Amplitude:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>wave_amplitude</cstring>
+ </property>
+ <property name="value">
+ <number>25</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel10_2</cstring>
+ </property>
+ <property name="text">
+ <string>Wave length:</string>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>wave_length</cstring>
+ </property>
+ <property name="value">
+ <number>150</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer20</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>91</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_effectCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>m_widgetStack</receiver>
+ <slot>raiseWidget(int)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/insertpagedia.ui b/kpresenter/insertpagedia.ui
new file mode 100644
index 000000000..b34963893
--- /dev/null
+++ b/kpresenter/insertpagedia.ui
@@ -0,0 +1,185 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>InsertPageDia</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>InsertPageDia</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>290</width>
+ <height>157</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Insert Slide</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QComboBox" row="0" column="1">
+ <item>
+ <property name="text">
+ <string>Before Current Slide</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>After Current Slide</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>locationCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentItem">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Insert &amp;new slide:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>locationCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioDefault</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;default template</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioCurrentDefault</cstring>
+ </property>
+ <property name="text">
+ <string>Use cu&amp;rrent slide as default</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioDifferent</cstring>
+ </property>
+ <property name="text">
+ <string>Choose di&amp;fferent template</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>InsertPageDia</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>InsertPageDia</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kpresenter/kprconverter.pl b/kpresenter/kprconverter.pl
new file mode 100644
index 000000000..524b3d8df
--- /dev/null
+++ b/kpresenter/kprconverter.pl
@@ -0,0 +1,174 @@
+#!/usr/bin/perl -w
+
+# converts a KPresenter document from the old format to the new one (v2)
+# due to the new text object
+
+use Time::Local;
+
+open(INPUT, "<$ARGV[0]") || die "Cannot open $ARGV[0]";
+open(OUTPUT, ">$ARGV[1]") || die "Cannot create $ARGV[1]";
+$objType="";
+$insideParag=0;
+$insideObj=0;
+$insidePixmaps=0; # are we inside the <PIXMAPS> tags?
+$currentText="";
+$currentTextType=0;
+while (<INPUT>)
+{
+ study; # This speeds up the whole RE stuff because Perl creates some hash for the string
+ if (/<DOC/)
+ {
+ # store the url because this is a prart of the "path" for the images
+ $url=$1 if(m/url=\"(.*?)\"/);
+ s/>$/ syntaxVersion=\"2\">/;
+ }
+ elsif (/<PIXMAPS>/)
+ {
+ $insidePixmaps=1;
+ }
+ elsif (/<\/PIXMAPS>/)
+ {
+ $insidePixmaps=0;
+ }
+ elsif (/<TEXTOBJ/)
+ {
+ # Save object type of the TEXTOBJ tag
+ $objType=$1 if (m/objType=(\"[0-9]+\")/);
+ s/gap=/margin=/;
+ }
+ elsif (/<PARAGRAPH/)
+ {
+ $insideParag=1;
+ s/<PARAGRAPH /<P /;
+ # In the old format we had horzAlign="[0|1|2]" 0=left, 1=center, 2=right
+ # In the new one it's align="..." and uses the Qt::AlignmentFlags enums.
+ # Qt::AlignLeft=1, AlignRight=2, AlignHCenter=4
+ $alignment=$1 if(/horzAlign=(\"[0-2]+\")/);
+ $alignment =~ tr/01/14/;
+ s/horzAlign=\"[0-2]+\"/align=$alignment/;
+ s/>$/ type=$objType>/;
+ }
+ elsif (/<\/PARAGRAPH>/)
+ {
+ $insideParag=0;
+ s/<\/PARAGRAPH/<\/P/;
+ # Flush last text tag
+ $_ = $currentText . "</TEXT>\n" . $_ if ($currentText);
+ $currentText="";
+ }
+ elsif (/<LINE/ || /<\/LINE/)
+ {
+ $_ = "" if ($insideParag); # ignore
+ }
+ elsif (/<OBJ>/)
+ {
+ $insideObj=1;
+ $_ = ""; # ignore
+ }
+ elsif (/<\/OBJ>/)
+ {
+ $insideObj=0;
+ $_ = ""; # ignore
+ }
+ elsif ($insideObj)
+ {
+ $toprint="";
+ if (m/<TYPE value="([0-9]+)"/)
+ {
+ $currentTextType=$1;
+ if ($currentTextType) # 1 -> this is a white space
+ {
+ # If we have a previous text element, we keep it (merging)
+ # Otherwise this white space is the first one in the object -> cheat
+ $currentTextType=0 if (!$currentText);
+ }
+ if (!$currentTextType) # 0 -> normal text
+ {
+ # If we have a previous text element, write it out
+ $toprint = $currentText . "</TEXT>\n" if ($currentText);
+ # Start a new text element
+ $currentText = " <TEXT ";
+ }
+ }
+ elsif (/<FONT/ && !$currentTextType) # normal text
+ {
+ s/\s*<FONT //;
+ s/\/>//;
+ chomp;
+ # Append all attributes
+ $currentText .= $_; # the same as $currentText = $currentText . $_, but faster
+ }
+ elsif (/<COLOR/ && !$currentTextType) # normal text
+ {
+ $red=$1 if (m/red=\"([0-9]+)\"/);
+ $green=$1 if (m/green=\"([0-9]+)\"/);
+ $blue=$1 if (m/blue=\"([0-9]+)\"/);
+ # Convert color to HTML representation
+ $currentText .= sprintf(" color=\"#%02x%02x%02x\"", $red, $green, $blue );
+ }
+ elsif (m/<TEXT>(.*)<\/TEXT>/)
+ {
+ if (!$currentTextType) # normal text
+ {
+ # Close opening tag and append the text - but don t do more yet
+ @entities=split( "(&[a-z]+;)", $1);
+ $text="";
+ foreach ( @entities )
+ {
+ if (!/&lt;/ && !/&gt;/ )
+ {
+ # Replace & by &amp; but only if not in an entity
+ s/\&/\&amp;/g;
+ }
+ $text .= $_;
+ }
+ $currentText .= ">" . $text;
+ }
+ else
+ {
+ # White space. Simply appending, closing the text tag.
+ $toprint = $currentText . $1 . "</TEXT>\n";
+ $currentText = ""; # reset
+ }
+ }
+ $_=$toprint;
+ }
+ elsif ($insidePixmaps)
+ {
+ if(/\s+name=\"/)
+ {
+ # Aha - this file is not version 2 but was created as "proper" tgz storage... medieval times :)
+ print "Found a name attribute, no need to create one.\n";
+ }
+ elsif (/<KEY(.*)\/>/)
+ {
+ # Okay - plain old kpresenter magic...
+ $key=$1;
+ study($key); # should be faster ;)
+ # Note: The .*? is needed because it would be too greedy otherwise
+ $filename=$1 if($key =~ /filename=\"(.*?)\"/);
+ # Get the values - really straightforward
+ $year=$1 if($key =~ /year=\"(\d+)\"/);
+ $month=$1 if($key =~ /month=\"(\d+)\"/);
+ $day=$1 if($key =~ /day=\"(\d+)\"/);
+ $hour=$1 if($key =~ /hour=\"(\d+)\"/);
+ $minute=$1 if($key =~ /minute=\"(\d+)\"/);
+ $second=$1 if($key =~ /second=\"(\d+)\"/);
+ # In Perl the month is <0...11>!!!
+ $timestamp=timegm($second, $minute, $hour, $day, $month-1, $year);
+ # Unfortunately we even have to mess with that string...
+ $timestring=scalar gmtime($timestamp);
+ # There are still some spaces too much when day<10
+ $timestring =~ s/ / /;
+ # Okay. Now let's cat the whole caboodle...
+ $nameattrib=$url . $filename . "_" . $timestring;
+ # ...and put it in place.
+ s/\/>/ name=\"$nameattrib\" \/>/;
+ }
+ }
+
+ print OUTPUT $_;
+}
+
+close(INPUT);
+close(OUTPUT);
diff --git a/kpresenter/kpresenter.desktop b/kpresenter/kpresenter.desktop
new file mode 100644
index 000000000..514d56f31
--- /dev/null
+++ b/kpresenter/kpresenter.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Name=KPresenter
+Name[af]=Kpresenter
+Name[cy]=KCyflwynydd
+Name[fo]=KFramvísari
+Name[hi]=के-प्रेज़ेन्टर
+Name[lo]=ການນຳສະເຫນີຊໍ້ມູນ
+Name[mk]=K-презентација
+Name[ne]=केडीई प्रस्तुतकर्ता
+Name[nl]=Kpresenter
+Name[sv]=Kpresenter
+Name[th]=การนำเสนอข้อมูล
+Name[tr]=Kpresenter
+Name[ven]=Mulanguli wa K
+Name[zu]=Umbonikeleli we K
+Exec=kpresenter %u
+GenericName=Slide Presentations
+GenericName[af]=Skuif Voorleggings
+GenericName[ar]=تقديم الشَّرائح
+GenericName[az]=Dilim Tamaşası
+GenericName[bg]=Презентации
+GenericName[br]=Emginnigoù skeudenn
+GenericName[bs]=Prezentacije slajdova
+GenericName[ca]=Presentacions de diapositives
+GenericName[cs]=Prezentace
+GenericName[cy]=Cyflwyniadau Tryloywder
+GenericName[da]=Diaspræsentationer
+GenericName[de]=Präsentation
+GenericName[el]=Παρουσιάσεις σε σλάιντ
+GenericName[eo]=Prezentilo por informfolioj
+GenericName[es]=Presentación de diapositivas
+GenericName[et]=Esitlused
+GenericName[eu]=Diapositiba-aurkezkpenak
+GenericName[fa]=ارائۀ اسلاید
+GenericName[fi]=Diaesitykset
+GenericName[fr]=Présentations par diapositives
+GenericName[fy]=Dia-presintaasjes
+GenericName[gl]=Presentacións en Diapositivas
+GenericName[he]=מצגות שקופיות
+GenericName[hr]=Prezentacije u slajdovima
+GenericName[hu]=Bemutatókészítő
+GenericName[is]=Skyggnusýning
+GenericName[it]=Presentazioni
+GenericName[ja]=スライドプレゼンテーション
+GenericName[km]=បញ្ចាំងស្លាយ
+GenericName[lo]=ການນຳສະເຫນີພາບນື່ງ
+GenericName[lt]=Skaidrių pristatymai
+GenericName[lv]=Slaidu prezentācijas
+GenericName[ms]=Persembahan Slid
+GenericName[mt]=Preżentazzjonijiet bi slajds
+GenericName[nb]=Presentasjoner
+GenericName[nds]=Bildfolg-Presentatschoon
+GenericName[ne]=स्लाइड प्रस्तुतिकरण
+GenericName[nl]=Diapresentaties
+GenericName[nn]=Presentasjonar
+GenericName[pl]=Prezentacje w postaci slajdów
+GenericName[pt]=Apresentações
+GenericName[pt_BR]=Apresentação
+GenericName[ro]=Prezentare secvenţială
+GenericName[ru]=Презентации
+GenericName[se]=Presentašuvnnat
+GenericName[sk]=Prezentácia
+GenericName[sl]=Predstavitve na diapozitivih
+GenericName[sr]=Презентације у слајдовима
+GenericName[sr@Latn]=Prezentacije u slajdovima
+GenericName[sv]=Stordiabildspresentationer
+GenericName[ta]=தட்டு முன் வைப்பிலிருந்து
+GenericName[tg]=Тақдимҳо Слайд
+GenericName[th]=การนำเสนอภาพนิ่ง
+GenericName[tr]=Slayt Sunumları
+GenericName[uk]=Презентації слайдів
+GenericName[uz]=Slayd namoyishlari
+GenericName[uz@cyrillic]=Слайд намойишлари
+GenericName[xh]=Iziboniso Ezityibilikayo
+GenericName[zh_CN]=幻灯片演示
+GenericName[zh_TW]=自動撥放
+MimeType=application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/x-kpresenter;application/mspowerpoint
+Type=Application
+Icon=kpresenter
+X-KDE-NativeMimeType=application/vnd.oasis.opendocument.presentation
+#X-KDE-NativeMimeType=application/x-kpresenter
+X-DCOP-ServiceType=multi
+DocPath=kpresenter/index.html
+X-KDE-StartupNotify=true
+Categories=Qt;KDE;Office;
diff --git a/kpresenter/kpresenter.rc b/kpresenter/kpresenter.rc
new file mode 100644
index 000000000..b080058c0
--- /dev/null
+++ b/kpresenter/kpresenter.rc
@@ -0,0 +1,682 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"><kpartgui name="KPresenter" version="115">
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Separator/>
+ <Action name="extra_webpres"/>
+ <Action name="extra_mspres"/>
+ <Action name="extra_template"/>
+ <Action name="extra_defaulttemplate"/>
+ </Menu>
+ <Menu name="Edit"><text>&amp;Edit</text>
+ <Action name="koffice_undo"/>
+ <Action name="koffice_redo"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="edit_selectall"/>
+ <Action name="edit_deselectall"/>
+ <Separator/>
+ <Action name="edit_find"/>
+ <Action name="edit_findnext"/>
+ <Action name="edit_findprevious"/>
+ <Action name="edit_replace"/>
+ <Separator/>
+ <Action name="edit_copypage"/>
+ <Action name="edit_duplicatepage"/>
+ <Action name="edit_delpage"/>
+ <Separator/>
+ <Action name="duplicate_obj"/>
+ </Menu>
+ <Menu name="View"><text>&amp;View</text>
+ <Action name="view_newview"/>
+ <ActionList name="view_closeallviews"/>
+ <Separator/>
+ <ActionList name="view_split"/>
+ <Action name="view_showsidebar"/>
+ <Action name="view_shownotebar"/>
+ <Separator/>
+ <Action name="view_master"/>
+ <Separator/>
+ <Action name="view_formattingchars"/>
+ <Separator/>
+ <Action name="view_guidelines"/>
+ <Action name="add_guideline"/>
+ <Action name="view_grid"/>
+ <Action name="view_snaptogrid"/>
+ <Separator/>
+ <Action name="view_zoom"/>
+ </Menu>
+ <Menu name="Insert"><text>&amp;Insert</text>
+ <Action name="insert_specialchar"/>
+ <Action name="insert_variable"/> <!-- menu -->
+ <Action name="insert_expression"/> <!-- menu -->
+ <Action name="insert_link"/>
+ <Action name="insert_comment"/>
+ <Separator/>
+ <Action name="insert_page"/>
+ <Action name="insert_file"/>
+ <Separator/>
+ <Action name="tools_text"/>
+ <Action name="tools_diagramm"/>
+ <Action name="tools_table"/>
+ <Action name="tools_object"/>
+ <Separator/>
+ <Action name="insert_picture"/>
+ <Action name="insert_clipart"/>
+ <Separator/>
+ <Menu name="Insert Line"><text>Line</text>
+ <Action name="tools_line"/>
+ <Action name="tools_freehand"/>
+ <Action name="tools_polyline"/>
+ <Action name="tools_quadricbeziercurve"/>
+ <Action name="tools_cubicbeziercurve"/>
+ </Menu>
+ <Menu name="Insert Shape"><text>Shape</text>
+ <Action name="tools_rectangle"/>
+ <Action name="tools_circle"/>
+ <Action name="tools_pie"/>
+ <Action name="tools_polygon"/>
+ <Action name="tools_closed_freehand"/>
+ <Action name="tools_closed_polyline"/>
+ <Action name="tools_closed_quadricbeziercurve"/>
+ <Action name="tools_closed_cubicbeziercurve"/>
+ <Action name="tools_autoform"/>
+ </Menu>
+ </Menu>
+ <Menu name="Format"><text>F&amp;ormat</text>
+ <Action name="tools_mouse"/>
+ <Action name="tools_rotate"/>
+ <Action name="tools_zoom"/>
+ <Action name="extra_properties"/>
+ <Separator/>
+ <Menu name="Arrange Objects"><text>Arra&amp;nge Objects</text>
+ <Action name="extra_lower"/>
+ <Action name="extra_send_backward"/>
+ <Action name="extra_bring_forward"/>
+ <Action name="extra_raise"/>
+ </Menu>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Action name="extra_group"/>
+ <Action name="extra_ungroup"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="extra_layout"/>
+ <Separator/>
+ <Action name="extra_header"/>
+ <Action name="extra_footer"/>
+ <Separator/>
+ <Action name="extra_background"/>
+ </Menu>
+ <Menu name="Text"><text>Te&amp;xt</text>
+ <Action name="text_default"/>
+ <Action name="text_font"/>
+ <Action name="format_paragraph"/>
+ <Action name="text_color"/>
+ <Separator/>
+ <Action name="format_stylist"/>
+ <Action name="import_style"/>
+ <Action name="format_stylemenu"/>
+ <Action name="create_style"/>
+ <Separator/>
+ <Menu name="Align"><text>&amp;Align</text>
+ <Action name="text_alignleft"/>
+ <Action name="text_aligncenter"/>
+ <Action name="text_alignright"/>
+ <Action name="text_alignblock"/>
+ </Menu>
+ <Separator/>
+ <Menu name="Type"><text>T&amp;ype</text>
+ <Action name="text_normalText"/>
+ <Action name="format_number"/>
+ <Action name="format_bullet"/>
+ </Menu>
+ <Separator/>
+ <Action name="text_depthPlus"/>
+ <Action name="text_depthMinus"/>
+ <Separator/>
+ <Action name="text_con2hei"/>
+ <Action name="text_obj2cont"/>
+ <Action name="text_inspgnum"/>
+ <Separator/>
+ <Action name="change_case"/>
+ <Separator/>
+ <Menu name="SpellCheck"><text>Spellcheck</text>
+ <Action name="tool_auto_spellcheck"/>
+ <Action name="extra_spellcheck"/>
+ </Menu>
+ <Separator/>
+ <Menu name="AutoFormat"><text>Autocorrection</text>
+ <Action name="enable_autocorrection"/>
+ <Action name="apply_autoformat"/>
+ </Menu>
+ </Menu>
+ <Menu name="Slide Show"><text>Sli&amp;de Show</text>
+ <Action name="screen_configpages"/>
+ <Action name="screen_assigneffect"/>
+ <Action name="screen_transeffect"/>
+ <Separator/>
+ <Action name="screen_start"/>
+ <Action name="screen_startfromfirst"/>
+ <Separator/>
+ <Action name="custom_slide_show"/>
+ <Separator/>
+ <Action name="screen_first"/>
+ <Action name="screen_prev"/>
+ <Action name="screen_next"/>
+ <Action name="screen_last"/>
+ </Menu>
+ <Menu name="settings"><text>&amp;Settings</text>
+ <Separator group="settings_show"/>
+ <Action name="direct_cursor" group="settings_show"/>
+ <Separator group="settings_show"/>
+ <Action name="extra_autocorrection" group="settings_show"/>
+ <Action name="configure_completion" group="settings_show"/>
+ <Separator group="settings_show"/>
+ <Action name="extra_configure" group="settings_configure"/>
+ </Menu>
+</MenuBar>
+<StatusBar/>
+<ToolBar name="mainToolBar"><Text>File</Text>
+</ToolBar>
+<ToolBar name="editToolBar" position="top" fullWidth="false"><Text>Edit</Text>
+ <Action name="koffice_undo"/>
+ <Action name="koffice_redo"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Separator/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="view_zoom"/>
+</ToolBar>
+<ToolBar name="insertToolBar" position="top" fullWidth="false"><Text>Insert</Text>
+ <Action name="tools_mouse"/>
+ <Separator/>
+ <Action name="tools_text"/>
+ <Action name="tools_autoform"/>
+ <Action name="tools_diagramm"/>
+ <Action name="tools_table"/>
+ <Action name="tools_formula"/>
+ <Action name="tools_object"/>
+ <Separator/>
+ <Action name="insert_picture"/>
+ <Action name="insert_clipart"/>
+ <Separator/>
+ <Action name="tools_linepopup"/>
+ <Action name="tools_closed_linepopup"/>
+ <Action name="tools_shapepopup"/>
+</ToolBar>
+<ToolBar name="toolsToolBar" position="left" fullWidth="false" hidden="true"><Text>Tools</Text>
+ <Action name="tools_rotate"/>
+ <Action name="tools_zoom"/>
+ <Separator/>
+ <Action name="extra_arrangepopup"/>
+ <Action name="extra_alignobjs"/>
+ <Separator/>
+ <Action name="extra_group"/>
+ <Action name="extra_ungroup"/>
+</ToolBar>
+<ToolBar name="extraToolBar" position="top" fullWidth="false"><Text>Format</Text>
+ <Action name="extra_properties"/>
+ <Action name="extra_linebegin"/>
+ <Action name="extra_lineend"/>
+ <Action name="extra_penstyle"/>
+ <Action name="extra_penwidth"/>
+ <Action name="brush_color"/>
+ <Action name="pen_color"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+</ToolBar>
+<ToolBar name="textToolBar" position="top" fullWidth="false"><Text>Text</Text>
+ <Action name="format_style"/>
+ <Action name="text_fontfamily"/>
+ <Action name="text_fontsize"/>
+ <Separator/>
+ <Action name="text_bold"/>
+ <Action name="text_italic"/>
+ <Action name="text_underline"/>
+ <Separator/>
+ <Action name="text_alignleft"/>
+ <Action name="text_aligncenter"/>
+ <Action name="text_alignright"/>
+ <Action name="text_alignblock"/>
+ <Separator/>
+ <Action name="format_number"/>
+ <Action name="format_bullet"/>
+ <Separator/>
+ <Action name="text_depthMinus"/>
+ <Action name="text_depthPlus"/>
+ <Separator/>
+ <Action name="text_color"/>
+</ToolBar>
+<ToolBar name="slideShowToolBar" position="top" fullWidth="false"><Text>Slide Show</Text>
+ <Action name="screen_configpages"/>
+ <Action name="screen_assigneffect"/>
+ <Action name="screen_transeffect"/>
+ <Action name="screen_start"/>
+ <Action name="screen_startfromfirst"/>
+</ToolBar>
+<ToolBar name="navigationToolBar" position="top" hidden="true" fullWidth="false"><Text>Navigation</Text>
+ <Action name="screen_first"/>
+ <Action name="screen_prev"/>
+ <Action name="screen_next"/>
+ <Action name="screen_last"/>
+</ToolBar>
+<Menu name="menupage_popup">
+ <Action name="extra_layout"/>
+ <Action name="extra_background"/>
+ <Separator/>
+ <Action name="view_guidelines"/>
+ <Action name="add_guideline"/>
+ <Action name="view_grid"/>
+ <Action name="view_snaptogrid"/>
+ <Separator/>
+ <Action name="insert_page_popup"/>
+ <Action name="extra_defaulttemplate"/>
+ <Action name="edit_duplicatepage"/>
+ <Action name="edit_delpage"/>
+ <Separator/>
+ <Action name="display_object_from_master_page"/>
+ <Action name="display_background"/>
+ <Separator/>
+ <Action name="extra_header"/>
+ <Action name="extra_footer"/>
+ <Separator/>
+ <Action name="edit_paste"/>
+ <ActionList name="picture_action"/>
+</Menu>
+<Menu name="textobject_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Separator/>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Menu name="Vertical Alignment"><text>Vertical Alignment</text>
+ <Action name="align_top"/>
+ <Action name="align_center"/>
+ <Action name="align_bottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="extendobjectheight"/>
+ <Action name="resizetextobject"/>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="partobject_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Separator/>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="rectangleobject_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Separator/>
+ <Menu name="Flip Objects"><text>Flip Objects</text>
+ <Action name="horizontal_flip"/>
+ <Action name="vertical_flip"/>
+ </Menu>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="graphmenu_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Separator/>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="flip_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Separator/>
+ <Menu name="Flip Objects"><text>Flip Objects</text>
+ <Action name="horizontal_flip"/>
+ <Action name="vertical_flip"/>
+ </Menu>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="closed_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Separator/>
+ <Action name="close_object"/>
+ <Separator/>
+ <Menu name="Flip Objects"><text>Flip Objects</text>
+ <Action name="horizontal_flip"/>
+ <Action name="vertical_flip"/>
+ </Menu>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="piemenu_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Separator/>
+ <Menu name="Flip Objects"><text>Flip Objects</text>
+ <Action name="horizontal_flip"/>
+ <Action name="vertical_flip"/>
+ </Menu>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="clipmenu_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="change_clipart"/>
+ <Action name="save_clipart"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Separator/>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="picmenu_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="change_picture"/>
+ <Action name="save_picture"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Action name="image_effect"/>
+ <Separator/>
+ <Menu name="Flip Objects"><text>Flip Objects</text>
+ <Action name="horizontal_flip"/>
+ <Action name="vertical_flip"/>
+ </Menu>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="pic_original_size"/>
+ <Menu name="Scale Picture"><text>&amp;Scale to Show the Picture 1:1 In</text>
+ <Action name="pic_640_480"/>
+ <Action name="pic_800_600"/>
+ <Action name="pic_1024_768"/>
+ <Action name="pic_1280_1024"/>
+ <Action name="pic_1600_1200"/>
+ </Menu>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="sidebarmenu_popup">
+ <Action name="insert_page_popup"/>
+ <Action name="edit_duplicatepage"/>
+ <Action name="edit_delpage"/>
+ <Action name="rename_page"/>
+ <Action name="edit_copypage"/>
+</Menu>
+<Menu name="variable_popup">
+ <ActionList name="variable_action"/>
+</Menu>
+<Menu name="text_popup">
+ <Action name="text_default"/>
+ <Action name="text_font"/>
+ <Action name="format_paragraph"/>
+ <Separator/>
+ <Action name="brush_color"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <ActionList name="datatools"/>
+</Menu>
+<Menu name="text_popup_spell">
+ <Action name="text_default"/>
+ <Action name="text_font"/>
+ <Action name="format_paragraph"/>
+ <Separator/>
+ <Action name="brush_color"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <ActionList name="datatools"/>
+ <Action name="ignore_all"/>
+ <Action name="add_word_to_dictionary"/>
+</Menu>
+<Menu name="text_popup_spell_with_result">
+ <Action name="text_default"/>
+ <Action name="format_font"/>
+ <Action name="format_paragraph"/>
+ <Separator/>
+ <Action name="border_backgroundcolor"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <ActionList name="datatools"/>
+ <Action name="ignore_all"/>
+ <Action name="add_word_to_dictionary"/>
+ <Separator/>
+ <Menu name="check_spell_list"><text>Spell Check Result</text>
+ <ActionList name="spell_result_action"/>
+ </Menu>
+</Menu>
+<Menu name="custom_var_popup">
+ <Action name="text_default"/>
+ <Action name="format_font"/>
+ <Action name="format_paragraph"/>
+ <Separator/>
+ <Action name="brush_color"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Separator/>
+ <Action name="edit_customvars"/>
+ <ActionList name="datatools"/>
+</Menu>
+<Menu name="text_popup_link">
+ <Action name="text_default"/>
+ <Action name="format_font"/>
+ <Action name="format_paragraph"/>
+ <Separator/>
+ <Action name="brush_color"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Separator/>
+ <Action name="open_link"/>
+ <Action name="change_link"/>
+ <Action name="copy_link"/>
+ <Action name="remove_link"/>
+ <Action name="add_to_bookmark"/>
+ <ActionList name="datatools_link"/>
+</Menu>
+<Menu name="note_popup">
+ <Action name="text_default"/>
+ <Action name="format_font"/>
+ <Action name="format_paragraph"/>
+ <Separator/>
+ <Action name="brush_color"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Separator/>
+ <Action name="edit_comment"/>
+ <Action name="remove_comment"/>
+ <Action name="copy_text_comment"/>
+ <ActionList name="datatools"/>
+</Menu>
+<Menu name="polygonobject_popup">
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+ <Action name="edit_delete"/>
+ <Separator/>
+ <Action name="extra_rotate"/>
+ <Action name="extra_shadow"/>
+ <Separator/>
+ <Action name="screen_assigneffect"/>
+ <Separator/>
+ <Menu name="Flip Objects"><text>Flip Objects</text>
+ <Action name="horizontal_flip"/>
+ <Action name="vertical_flip"/>
+ </Menu>
+ <Menu name="Align Objects"><text>&amp;Align Objects</text>
+ <Action name="extra_alignleft"/>
+ <Action name="extra_aligncenterh"/>
+ <Action name="extra_alignright"/>
+ <Action name="extra_aligntop"/>
+ <Action name="extra_aligncenterv"/>
+ <Action name="extra_alignbottom"/>
+ </Menu>
+ <Separator/>
+ <Action name="extra_properties"/>
+</Menu>
+<Menu name="zoom_popup">
+ <Action name="zoom_plus"/>
+ <Action name="zoom_minus"/>
+ <Separator/>
+ <Action name="zoom_entire_page"/>
+ <Action name="zoom_page_width"/>
+ <Action name="zoom_page_height"/>
+ <Separator/>
+ <Action name="zoom_selected_object"/>
+ <Action name="zoom_all_object"/>
+</Menu>
+</kpartgui>
diff --git a/kpresenter/kpresenter_readonly.rc b/kpresenter/kpresenter_readonly.rc
new file mode 100644
index 000000000..73c743b0f
--- /dev/null
+++ b/kpresenter/kpresenter_readonly.rc
@@ -0,0 +1,82 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"><kpartgui name="KPresenter" version="6">
+<MenuBar>
+ <Menu name="view"><text>&amp;View</text>
+ <Action name="view_formattingchars"/>
+ <Action name="view_zoom"/>
+ </Menu>
+ <Menu name="edit"><text>&amp;Edit</text>
+ <Action name="edit_copy"/>
+ <Separator/>
+ <Action name="edit_find"/>
+ </Menu>
+ <Menu name="Slide Show"><text>Sli&amp;de Show</text>
+ <Action name="screen_first"/>
+ <Action name="screen_prev"/>
+ <Action name="screen_next"/>
+ <Action name="screen_last"/>
+ </Menu>
+</MenuBar>
+<StatusBar/>
+<ToolBar name="editToolBar" position="top" fullWidth="false"><Text>Edit</Text>
+ <Action name="edit_copy"/>
+ <Separator/>
+ <Action name="view_zoom"/>
+</ToolBar>
+<ToolBar name="screenToolBar" position="top" fullWidth="false"><Text>Presentation</Text>
+ <Action name="screen_first"/>
+ <Action name="screen_prev"/>
+ <Action name="screen_next"/>
+ <Action name="screen_last"/>
+</ToolBar>
+<Menu name="zoom_popup">
+ <Action name="zoom_plus"/>
+ <Action name="zoom_minus"/>
+ <Separator/>
+ <Action name="zoom_entire_page"/>
+ <Action name="zoom_page_width"/>
+ <Action name="zoom_page_height"/>
+ <Separator/>
+ <Action name="zoom_selected_object"/>
+ <Action name="zoom_all_object"/>
+</Menu>
+<Menu name="menupage_popup">
+</Menu>
+<Menu name="textobject_popup">
+</Menu>
+<Menu name="partobject_popup">
+</Menu>
+<Menu name="rectangleobject_popup">
+</Menu>
+<Menu name="graphmenu_popup">
+</Menu>
+<Menu name="flip_popup">
+</Menu>
+<Menu name="closed_popup">
+</Menu>
+<Menu name="piemenu_popup">
+</Menu>
+<Menu name="clipmenu_popup">
+</Menu>
+<Menu name="picmenu_popup">
+</Menu>
+<Menu name="sidebarmenu_popup">
+</Menu>
+<Menu name="variable_popup">
+</Menu>
+<Menu name="text_popup">
+</Menu>
+<Menu name="custom_var_popup">
+</Menu>
+<Menu name="text_popup_link">
+</Menu>
+<Menu name="note_popup">
+</Menu>
+<Menu name="polygonobject_popup">
+</Menu>
+<Menu name="helpline_popup">
+</Menu>
+<Menu name="helppoint_popup">
+</Menu>
+<Menu name="zoom_popup">
+</Menu>
+</kpartgui>
diff --git a/kpresenter/kpresenterpart.desktop b/kpresenter/kpresenterpart.desktop
new file mode 100644
index 000000000..22016ee39
--- /dev/null
+++ b/kpresenter/kpresenterpart.desktop
@@ -0,0 +1,83 @@
+[Desktop Entry]
+Name=KPresenter
+Name[af]=Kpresenter
+Name[cy]=KCyflwynydd
+Name[fo]=KFramvísari
+Name[hi]=के-प्रेज़ेन्टर
+Name[lo]=ການນຳສະເຫນີຊໍ້ມູນ
+Name[mk]=K-презентација
+Name[ne]=केडीई प्रस्तुतकर्ता
+Name[nl]=Kpresenter
+Name[sv]=Kpresenter
+Name[th]=การนำเสนอข้อมูล
+Name[tr]=Kpresenter
+Name[ven]=Mulanguli wa K
+Name[zu]=Umbonikeleli we K
+X-KDE-Library=libkpresenterpart
+MimeType=application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/x-kpresenter;application/mspowerpoint
+Type=Service
+ServiceTypes=KOfficePart,KParts/ReadOnlyPart,KParts/ReadWritePart
+X-KDE-NativeMimeType=application/vnd.oasis.opendocument.presentation
+X-KDE-NativeOasisMimeType=application/vnd.oasis.opendocument.presentation
+X-KDE-ExtraNativeMimeTypes=application/x-kpresenter,application/vnd.oasis.opendocument.presentation-template
+GenericName=Slide Presentations
+GenericName[af]=Skuif Voorleggings
+GenericName[ar]=تقديم الشَّرائح
+GenericName[az]=Dilim Tamaşası
+GenericName[bg]=Презентации
+GenericName[br]=Emginnigoù skeudenn
+GenericName[bs]=Prezentacije slajdova
+GenericName[ca]=Presentacions de diapositives
+GenericName[cs]=Prezentace
+GenericName[cy]=Cyflwyniadau Tryloywder
+GenericName[da]=Diaspræsentationer
+GenericName[de]=Präsentation
+GenericName[el]=Παρουσιάσεις σε σλάιντ
+GenericName[eo]=Prezentilo por informfolioj
+GenericName[es]=Presentación de diapositivas
+GenericName[et]=Esitlused
+GenericName[eu]=Diapositiba-aurkezkpenak
+GenericName[fa]=ارائۀ اسلاید
+GenericName[fi]=Diaesitykset
+GenericName[fr]=Présentations par diapositives
+GenericName[fy]=Dia-presintaasjes
+GenericName[gl]=Presentacións en Diapositivas
+GenericName[he]=מצגות שקופיות
+GenericName[hr]=Prezentacije u slajdovima
+GenericName[hu]=Bemutatókészítő
+GenericName[is]=Skyggnusýning
+GenericName[it]=Presentazioni
+GenericName[ja]=スライドプレゼンテーション
+GenericName[km]=បញ្ចាំងស្លាយ
+GenericName[lo]=ການນຳສະເຫນີພາບນື່ງ
+GenericName[lt]=Skaidrių pristatymai
+GenericName[lv]=Slaidu prezentācijas
+GenericName[ms]=Persembahan Slid
+GenericName[mt]=Preżentazzjonijiet bi slajds
+GenericName[nb]=Presentasjoner
+GenericName[nds]=Bildfolg-Presentatschoon
+GenericName[ne]=स्लाइड प्रस्तुतिकरण
+GenericName[nl]=Diapresentaties
+GenericName[nn]=Presentasjonar
+GenericName[pl]=Prezentacje w postaci slajdów
+GenericName[pt]=Apresentações
+GenericName[pt_BR]=Apresentação
+GenericName[ro]=Prezentare secvenţială
+GenericName[ru]=Презентации
+GenericName[se]=Presentašuvnnat
+GenericName[sk]=Prezentácia
+GenericName[sl]=Predstavitve na diapozitivih
+GenericName[sr]=Презентације у слајдовима
+GenericName[sr@Latn]=Prezentacije u slajdovima
+GenericName[sv]=Stordiabildspresentationer
+GenericName[ta]=தட்டு முன் வைப்பிலிருந்து
+GenericName[tg]=Тақдимҳо Слайд
+GenericName[th]=การนำเสนอภาพนิ่ง
+GenericName[tr]=Slayt Sunumları
+GenericName[uk]=Презентації слайдів
+GenericName[uz]=Slayd namoyishlari
+GenericName[uz@cyrillic]=Слайд намойишлари
+GenericName[xh]=Iziboniso Ezityibilikayo
+GenericName[zh_CN]=幻灯片演示
+GenericName[zh_TW]=自動撥放
+Icon=kpresenter
diff --git a/kpresenter/main.cpp b/kpresenter/main.cpp
new file mode 100644
index 000000000..91517ebd6
--- /dev/null
+++ b/kpresenter/main.cpp
@@ -0,0 +1,46 @@
+/* This file is part of the KDE project
+ Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#include "KPrAboutData.h"
+
+#include <KoApplication.h>
+
+#include <dcopclient.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+
+static const KCmdLineOptions options[]=
+{
+ {"+[file]", I18N_NOOP("File to open"),0},
+ KCmdLineLastOption
+};
+
+extern "C" KPRESENTER_EXPORT int kdemain( int argc, char **argv )
+{
+ KCmdLineArgs::init( argc, argv, newKPresenterAboutData() );
+ KCmdLineArgs::addCmdLineOptions( options );
+
+ KoApplication app;
+
+ if (!app.start())
+ return 1;
+
+ return app.exec();
+}
diff --git a/kpresenter/marginui.ui b/kpresenter/marginui.ui
new file mode 100644
index 000000000..98a283b04
--- /dev/null
+++ b/kpresenter/marginui.ui
@@ -0,0 +1,167 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>MarginUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>MarginUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>287</width>
+ <height>122</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Margin</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>margins</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Margins</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>synchronize</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;ynchronize changes</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KoUnitDoubleSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>leftInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>rightLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Rig&amp;ht:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>rightInput</cstring>
+ </property>
+ </widget>
+ <widget class="KoUnitDoubleSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>rightInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>topLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Top:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>topInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>bottomLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Bottom:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>bottomInput</cstring>
+ </property>
+ </widget>
+ <widget class="KoUnitDoubleSpinBox" row="1" column="3">
+ <property name="name">
+ <cstring>bottomInput</cstring>
+ </property>
+ </widget>
+ <widget class="KoUnitDoubleSpinBox" row="0" column="3">
+ <property name="name">
+ <cstring>topInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>leftLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Left:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>leftInput</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>KoUnitDoubleSpinBox</class>
+ <header location="local">KoUnitWidgets.h</header>>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="PNG" length="1008">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b749444154388db59541681d551486bf49aef55c4965061b98815a5e20a5790b912c0d66d12c0381361004219bae0a45041111a92d28086a4110eaa68a8bd8b8a97121348b96b810cca6988281111a9c27446720afcc8516efa94e3b2e665e6244832e3c70b8cce5f2cf77cffc734e50d735830882600818060c3004046d1e14759b8f800a7858d7f5a360207cfe8df34f7627ba679d7367f27e7ea27425168bc71fb896ae24bd936eaddf5a5fa6e213e02ef0c00c48af5dbd76364a7837390e9d4a5b98128c0025d608e0f7f6d97b4eefc8389f8617d66f3a0b7c0894a63d395cf48b33d1d390f5bf40ef65f84ab116fcefe00a212f1441b04760ec38882854a0801c866854015e00aeee1203a6ec97273c0ebd57e02b873d1c926dc0daaab271ab400c68a5880989c785d98588a9698fd0ec872302e83120fa33f150ee7226517c95636dc8b73794e52b0e2a08432119174420ef29bd2de5a3b7338ac598f9451069c4dbb0c0a18170608d05147b58c83660a5159d3d1573720e92c482f1a846acad7a56ae3856967ac4719799d316314a53188681606820ec2b0f08dec3f5af1c5a29b3a762e6cf4094286a72dc8ee5fa9725b30b112fbe148211969772b4bfcf7e01100c88b1c682297145447a3b230c1b5291e68aee7ec2e5f74bb24d47b903e75e4b58bfe1c87e50d2d423b2dfdc03627ce5b146c88b120c241d884641519c8bb8fc564ebae99050989a8e60a4a43b19a295926f8356ff20dcd41804814a0947da8fb29370f99d926cb3b157382224472112c08018412b90bf20ef2306b047001392f61455cbda4ddf908e08f1d1905eafe0d2c59c742322cf14ad94b18e853d5734fedd4f5cd23d0e9d8e50f494b555cffc6244b9a34c9d8c4862b874117a5b05e75fced1fb8e380ee94e425e1c50631010657641d04a59b9e2585b2d39f74ac2e4b4a733e979f5cd84380e71fd022a989a0b199bd8e7e3bf23f6500953d3506cc7ac2cf558fe00d66f38bacf846020cf4a5c5f9bdaa2a4df28e96d4b2842ebe37dc275d92fdb7f5f11607e5188e32e2b9fe7a49b4a7abbd79cae203c1232733ae4bbaf95fcbe43ab88a2bf2b5a03f5ae707a27dd4a331997a821110333739ea9e98434f5e4db8d68d2b17427616c02d2390b5502a624fb1e805f8087401dd4754d100416c3ebcf3d2f17a2a4b194aa3270bdb4af17d37633da9b19c139483794bc505cc155e063e047da46ff18700c780ff889bda9f06ff367e033e034f02c303a201ea2e94a11f054bb5ada86c2c151b7d7f73413e02e50ee8ea620080cf038f0442b7a88ff36f37e6bc57f051e04ffd730fd03ef8bd61b5b2ca6900000000049454e44ae426082</data>
+ </image>
+</images>
+<tabstops>
+ <tabstop>synchronize</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kpresenter/penstyle.ui b/kpresenter/penstyle.ui
new file mode 100644
index 000000000..6e0387853
--- /dev/null
+++ b/kpresenter/penstyle.ui
@@ -0,0 +1,199 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>PenStyleUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>PenStyleUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>334</width>
+ <height>357</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Pen</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The settings in this tab are used in the Insert-&gt;Line menu.</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>arrowGroup</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Arrow Style</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set the styles of the beginning and end of your line. For example, you can choose a square dot at the beginning and an arrow at the end.</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>lineBeginLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Begin:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>lineBeginCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>lineBeginCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>lineEndLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;End:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>lineEndCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>lineEndCombo</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="KPrPBPreview" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>pbPreview</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This displays a preview of your choices.</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>styleCombo</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the line style. This can range from No Outline, which will not draw any lines, to dotted and plain lines.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>widthLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Width:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>widthInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>styleLabel</cstring>
+ </property>
+ <property name="text">
+ <string>St&amp;yle:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>styleCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="0" column="1">
+ <property name="name">
+ <cstring>colorChooser</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set the color of the line. Clicking on the color will bring the standard KDE Select Color dialog.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>colorLabel</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;olor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>colorChooser</cstring>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput" row="2" column="1">
+ <property name="name">
+ <cstring>widthInput</cstring>
+ </property>
+ <property name="suffix">
+ <string> pt</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set the width of the line.</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>KPrPBPreview</class>
+ <header location="global">KPrPBPreview.h</header>
+ <sizehint>
+ <width>80</width>
+ <height>40</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="PNG" length="824">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000002ff49444154388db59531681c4714863f992dde820cb370815b50600f54e8ca0ba43970712a8fb838438a3895634813d238a5ab80e314ae4d0a812060a4226017c27221c8a9da6b8c4fe0e00d28b0571cec82043b85611f78c12966efa4bb8bc085f29a6567df7cef9f7fdeccaec571cc2cbaddee47ae21e2385e5b9b815f1ebcfcd8de6a63ad25cb338af7c52741acb5a4a729a3d723a82ec6bd99d267bf3f23fc1c4cab2442d14a915986e792fdfa59569766573049417784f1b12e8267954dab24b78714450a28beaf941f847c2a14e70a0841035a2d45d641eb027213c210c69756320767794684d6508bef0befde1a860796e4c402333542b4256c0f0cdd1e50b97191458be6e0e27d81563a87c643d8fb2d7793d685d696413cc8a6cae46f65f7d79c7c62b87b4f2e15fd0fb0d302be0fefde4a0d557a5f35e90f84e0334014d590f855c9de4ecee17e4eb319d1ff3a00ec02f8c67299f283307c61e7d06fbf1782d082588a33e1cf1705fd81cf773f3601e1f9bec59e2f4b5c7ef5209f0ac95f16630cfd818067c103b586dd274a726229cee0fe8380d191cb4d1267d3d58aa1de7d258ceae5d7d0a78fdd269a86f0c52d414c49bbe3762c9b686de41560d7a72e41c4795a6486a78f95e4c4151481d686efbe7b3398ac58b1a23868b8c474aaa8068c8e714a8dd06c1af2a9e5d1c38c641c909dba6e08237f19b358a7ac5cf3479bc2e41f257e55d2ffc6a73833746f09e186cfa387904f2cbffc90a2aa9886d0e99464d3c5965b512cebd01f1800f67672e2a392fb0f023a3d883a053ffddcc2340dd65ab452b6074dc2cd15c1cbceb863daed413e353cdfcfd97d92333a12da6d0181ec3443cf753ef3cdd092de0e116ff1a02cdc157338ca9d7b8269461cfee1ba2139b9286e1a427f10110f2d561555b076d18a39383d4d99a4c0cd0b787f20747b214962c8266e3cdcf0e97c59126ec2f6edd089f40a92f115e0d1eb11ba238461dd6a15f32b53666de841965bb203575a3cc15a48c64a965fe57105e3635db8fa96dcffc431172b5d715d7103dc3fea7f015f373c8ee3b57f0135105a0fae7717960000000049454e44ae426082</data>
+ </image>
+</images>
+<tabstops>
+ <tabstop>colorChooser</tabstop>
+ <tabstop>styleCombo</tabstop>
+ <tabstop>lineBeginCombo</tabstop>
+ <tabstop>lineEndCombo</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/pics/Makefile.am b/kpresenter/pics/Makefile.am
new file mode 100644
index 000000000..cd32a3d6b
--- /dev/null
+++ b/kpresenter/pics/Makefile.am
@@ -0,0 +1,6 @@
+pics_DATA = webslideshow-sidebar.png
+picsdir = $(kde_datadir)/kpresenter/pics
+
+KDE_ICON = kpresenter
+
+SUBDIRS = rotate
diff --git a/kpresenter/pics/hi16-app-kpresenter.png b/kpresenter/pics/hi16-app-kpresenter.png
new file mode 100644
index 000000000..dc1b2148c
--- /dev/null
+++ b/kpresenter/pics/hi16-app-kpresenter.png
Binary files differ
diff --git a/kpresenter/pics/hi22-app-kpresenter.png b/kpresenter/pics/hi22-app-kpresenter.png
new file mode 100644
index 000000000..6148e812e
--- /dev/null
+++ b/kpresenter/pics/hi22-app-kpresenter.png
Binary files differ
diff --git a/kpresenter/pics/hi32-app-kpresenter.png b/kpresenter/pics/hi32-app-kpresenter.png
new file mode 100644
index 000000000..8f0959400
--- /dev/null
+++ b/kpresenter/pics/hi32-app-kpresenter.png
Binary files differ
diff --git a/kpresenter/pics/hi48-app-kpresenter.png b/kpresenter/pics/hi48-app-kpresenter.png
new file mode 100644
index 000000000..71c6af478
--- /dev/null
+++ b/kpresenter/pics/hi48-app-kpresenter.png
Binary files differ
diff --git a/kpresenter/pics/rotate/Makefile.am b/kpresenter/pics/rotate/Makefile.am
new file mode 100644
index 000000000..fb75c95f1
--- /dev/null
+++ b/kpresenter/pics/rotate/Makefile.am
@@ -0,0 +1,4 @@
+pics_DATA = bl.png bldn.png bm.png bmdn.png br.png brdn.png ml.png mldn.png \
+ mr.png mrdn.png tl.png tldn.png tm.png tmdn.png tr.png trdn.png
+
+picsdir = $(kde_datadir)/kpresenter/pics/rotate
diff --git a/kpresenter/pics/rotate/bl.png b/kpresenter/pics/rotate/bl.png
new file mode 100644
index 000000000..726e40593
--- /dev/null
+++ b/kpresenter/pics/rotate/bl.png
Binary files differ
diff --git a/kpresenter/pics/rotate/bldn.png b/kpresenter/pics/rotate/bldn.png
new file mode 100644
index 000000000..5b244ab48
--- /dev/null
+++ b/kpresenter/pics/rotate/bldn.png
Binary files differ
diff --git a/kpresenter/pics/rotate/bm.png b/kpresenter/pics/rotate/bm.png
new file mode 100644
index 000000000..efcef4d42
--- /dev/null
+++ b/kpresenter/pics/rotate/bm.png
Binary files differ
diff --git a/kpresenter/pics/rotate/bmdn.png b/kpresenter/pics/rotate/bmdn.png
new file mode 100644
index 000000000..319deb214
--- /dev/null
+++ b/kpresenter/pics/rotate/bmdn.png
Binary files differ
diff --git a/kpresenter/pics/rotate/br.png b/kpresenter/pics/rotate/br.png
new file mode 100644
index 000000000..4742520ce
--- /dev/null
+++ b/kpresenter/pics/rotate/br.png
Binary files differ
diff --git a/kpresenter/pics/rotate/brdn.png b/kpresenter/pics/rotate/brdn.png
new file mode 100644
index 000000000..886387dfb
--- /dev/null
+++ b/kpresenter/pics/rotate/brdn.png
Binary files differ
diff --git a/kpresenter/pics/rotate/ml.png b/kpresenter/pics/rotate/ml.png
new file mode 100644
index 000000000..07cea83c9
--- /dev/null
+++ b/kpresenter/pics/rotate/ml.png
Binary files differ
diff --git a/kpresenter/pics/rotate/mldn.png b/kpresenter/pics/rotate/mldn.png
new file mode 100644
index 000000000..249069686
--- /dev/null
+++ b/kpresenter/pics/rotate/mldn.png
Binary files differ
diff --git a/kpresenter/pics/rotate/mr.png b/kpresenter/pics/rotate/mr.png
new file mode 100644
index 000000000..5f7df7591
--- /dev/null
+++ b/kpresenter/pics/rotate/mr.png
Binary files differ
diff --git a/kpresenter/pics/rotate/mrdn.png b/kpresenter/pics/rotate/mrdn.png
new file mode 100644
index 000000000..cf415414c
--- /dev/null
+++ b/kpresenter/pics/rotate/mrdn.png
Binary files differ
diff --git a/kpresenter/pics/rotate/tl.png b/kpresenter/pics/rotate/tl.png
new file mode 100644
index 000000000..f78f1eb29
--- /dev/null
+++ b/kpresenter/pics/rotate/tl.png
Binary files differ
diff --git a/kpresenter/pics/rotate/tldn.png b/kpresenter/pics/rotate/tldn.png
new file mode 100644
index 000000000..016c2435e
--- /dev/null
+++ b/kpresenter/pics/rotate/tldn.png
Binary files differ
diff --git a/kpresenter/pics/rotate/tm.png b/kpresenter/pics/rotate/tm.png
new file mode 100644
index 000000000..c4fc31b71
--- /dev/null
+++ b/kpresenter/pics/rotate/tm.png
Binary files differ
diff --git a/kpresenter/pics/rotate/tmdn.png b/kpresenter/pics/rotate/tmdn.png
new file mode 100644
index 000000000..38ad7e893
--- /dev/null
+++ b/kpresenter/pics/rotate/tmdn.png
Binary files differ
diff --git a/kpresenter/pics/rotate/tr.png b/kpresenter/pics/rotate/tr.png
new file mode 100644
index 000000000..046eefebe
--- /dev/null
+++ b/kpresenter/pics/rotate/tr.png
Binary files differ
diff --git a/kpresenter/pics/rotate/trdn.png b/kpresenter/pics/rotate/trdn.png
new file mode 100644
index 000000000..3d48260eb
--- /dev/null
+++ b/kpresenter/pics/rotate/trdn.png
Binary files differ
diff --git a/kpresenter/pics/webslideshow-sidebar.png b/kpresenter/pics/webslideshow-sidebar.png
new file mode 100644
index 000000000..88949b830
--- /dev/null
+++ b/kpresenter/pics/webslideshow-sidebar.png
Binary files differ
diff --git a/kpresenter/picturepropertyui.ui b/kpresenter/picturepropertyui.ui
new file mode 100644
index 000000000..2e74cb2eb
--- /dev/null
+++ b/kpresenter/picturepropertyui.ui
@@ -0,0 +1,180 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>PicturePropertyUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>PicturePropertyUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>263</width>
+ <height>457</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Picture</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>depthGroup</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Depth</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>depth1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;1 bit color mode</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>depth8</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;8 bit color mode</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="3" column="0">
+ <property name="name">
+ <cstring>depth16</cstring>
+ </property>
+ <property name="text">
+ <string>1&amp;6 bit color mode</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="4" column="0">
+ <property name="name">
+ <cstring>depth32</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;32 bit color mode</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>depth0</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Default color mode</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="KIntNumInput" row="3" column="1">
+ <property name="name">
+ <cstring>brightnessInput</cstring>
+ </property>
+ <property name="value">
+ <number>0</number>
+ </property>
+ <property name="minValue">
+ <number>-1000</number>
+ </property>
+ <property name="maxValue">
+ <number>1000</number>
+ </property>
+ <property name="suffix">
+ <string>%</string>
+ </property>
+ <property name="prefix">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>swapRGB</cstring>
+ </property>
+ <property name="text">
+ <string>Conv&amp;ert from RGB image to BRG image</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>grayscale</cstring>
+ </property>
+ <property name="text">
+ <string>Gra&amp;yscale</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>brightnessLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Brightness:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>brightnessInput</cstring>
+ </property>
+ </widget>
+ <widget class="KPrPicturePreview" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>picturePreview</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>200</height>
+ </size>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>KPrPicturePreview</class>
+ <header location="global">KPrPicturePreview.h</header>>
+ <sizehint>
+ <width>200</width>
+ <height>200</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="PNG" length="826">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b00000301494441541895b59531681b5718c77f0e377c070e3c810a3a70e0041eac51852e0a19e45134830a1d9a4c69a04bc8928e990a693a640e1d0c8642b08742321894c1507991b484c890902bb8701a047760c3bd21701fe4201dde49b6a41a32b8df72dcbbeffdbefffbbfefbd5b1b0c07cce266ebe667ae2006c3c1dada0cdc3be87d6e6c35b0d692a409d9c7ec8b20d65ae29398d19b1114e7e3de4ce98b3f5e10dc0053cf0951b4506496e1b964bf7ce6c585d9054c62d01d617ca48be0596553cf496d8f2c8b01c5f795fc93904e85ec4c01a152857a5d9175d0b2805c872080f18595ccc1499a10a225d4e2fbc2877786fe81253ab6c04c8d106e09db5d43ab0d146e5c64d1a23938fb98a185cea1c33eecfd9eba49eb427dcb201e245365f2b7b2fb5b4a3a31dcb927178afe07d86901df870fefa4842aed6f6b74ba42e52b4014d580e1eb9cbd9d94de7e4aad16d2f9be02d805f0b5e532f927a1ffcacea1777f122a8105b164a7c25faf323a5d9f1f1fd600e1e5bec59e2d4b5c7ef5209d0ad17b8b31864e57c0b3e0815ac3ee33253ab664a770ff5185d1a1cb8d2267d3e58aa1dc7d2508cbe597d0e74fdd269aaaf0f52d414c4ea3e9762c996869e42560d7a72e41c4799a2586e74f95e8d8151481fa86efbe7b3398ac58b1a2b8527589f15451ad303ac2293542ad6648a796278f13a27185e4c4754310facb98c53a79e19a3fdc1426ff28c3d7399d1f7cb25343eb96106cf83c790ce9c4f2eb831855c55485663327992eb6dc8a6259874ed700b0b793323cccb9ffa842b30d6133e3e75fea989ac15a8b16ca76b746b0b92278d919774c5b6d48a78697fb29bbcf52468742a32120909c24e899ce67beed5be2db01e22d1e9485bb620e47f9ee9e606a21bd3f5d3744c7e7c54d55e87443867d8b554515ac5db4620e8e4f62263170fd1cdee90aad7640141992891b0f367c9adfe4049bb07d3b7022bd8c687c0978f46684ee084150b65ac1fcca94591b7a90a496e4c095164fb016a2b192a497795cc0f84817aebe25f7bf70ccc54a575c555c03f78ffa5fc0570d1f0c076bff0232285a09283782c80000000049454e44ae426082</data>
+ </image>
+</images>
+<tabstops>
+ <tabstop>depth0</tabstop>
+ <tabstop>depth1</tabstop>
+ <tabstop>depth8</tabstop>
+ <tabstop>depth16</tabstop>
+ <tabstop>depth32</tabstop>
+ <tabstop>swapRGB</tabstop>
+ <tabstop>grayscale</tabstop>
+ <tabstop>brightnessInput</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/piepropertyui.ui b/kpresenter/piepropertyui.ui
new file mode 100644
index 000000000..a8624c7ed
--- /dev/null
+++ b/kpresenter/piepropertyui.ui
@@ -0,0 +1,146 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>PiePropertyUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>PiePropertyUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>222</width>
+ <height>307</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Pie</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>These settings are used in the Insert-&gt;Shape-&gt;Pie/Arc/Chord menu.</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>typeCombo</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>You can choose among three options in the dropdown box: Pie, Arc or Chord.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>typeLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Type:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>typeCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>lengthLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Length:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>lengthInput</cstring>
+ </property>
+ </widget>
+ <widget class="KPrPiePreview" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>piePreview</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>200</height>
+ </size>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This displays a preview of your choices.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>angleInput</cstring>
+ </property>
+ <property name="suffix">
+ <string> °</string>
+ </property>
+ <property name="maxValue">
+ <number>360</number>
+ </property>
+ <property name="lineStep">
+ <number>6</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set here the start position.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="2" column="1">
+ <property name="name">
+ <cstring>lengthInput</cstring>
+ </property>
+ <property name="suffix">
+ <string> °</string>
+ </property>
+ <property name="maxValue">
+ <number>360</number>
+ </property>
+ <property name="lineStep">
+ <number>6</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set the arc length of your pie.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>angleLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Start position:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>angleInput</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>KPrPiePreview</class>
+ <header location="global">KPrPiePreview.h</header>>
+ <sizehint>
+ <width>200</width>
+ <height>200</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="PNG" length="824">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000002ff49444154388db59531681c4714863f992dde820cb370815b50600f54e8ca0ba43970712a8fb838438a3895634813d238a5ab80e314ae4d0a812060a4226017c27221c8a9da6b8c4fe0e00d28b0571cec82043b85611f78c12966efa4bb8bc085f29a6567df7cef9f7fdeccaec571cc2cbaddee47ae21e2385e5b9b815f1ebcfcd8de6a63ad25cb338af7c52741acb5a4a729a3d723a82ec6bd99d267bf3f23fc1c4cab2442d14a915986e792fdfa59569766573049417784f1b12e8267954dab24b78714450a28beaf941f847c2a14e70a0841035a2d45d641eb027213c210c69756320767794684d6508bef0befde1a860796e4c402333542b4256c0f0cdd1e50b97191458be6e0e27d81563a87c643d8fb2d7793d685d696413cc8a6cae46f65f7d79c7c62b87b4f2e15fd0fb0d302be0fefde4a0d557a5f35e90f84e0334014d590f855c9de4ecee17e4eb319d1ff3a00ec02f8c67299f283307c61e7d06fbf1782d082588a33e1cf1705fd81cf773f3601e1f9bec59e2f4b5c7ef5209f0ac95f16630cfd818067c103b586dd274a726229cee0fe8380d191cb4d1267d3d58aa1de7d258ceae5d7d0a78fdd269a86f0c52d414c49bbe3762c9b686de41560d7a72e41c4795a6486a78f95e4c4151481d686efbe7b3398ac58b1a23868b8c474aaa8068c8e714a8dd06c1af2a9e5d1c38c641c909dba6e08237f19b358a7ac5cf3479bc2e41f257e55d2ffc6a73833746f09e186cfa387904f2cbffc90a2aa9886d0e99464d3c5965b512cebd01f1800f67672e2a392fb0f023a3d883a053ffddcc2340dd65ab452b6074dc2cd15c1cbceb863daed413e353cdfcfd97d92333a12da6d0181ec3443cf753ef3cdd092de0e116ff1a02cdc157338ca9d7b8269461cfee1ba2139b9286e1a427f10110f2d561555b076d18a39383d4d99a4c0cd0b787f20747b214962c8266e3cdcf0e97c59126ec2f6edd089f40a92f115e0d1eb11ba238461dd6a15f32b53666de841965bb203575a3cc15a48c64a965fe57105e3635db8fa96dcffc431172b5d715d7103dc3fea7f015f373c8ee3b57f0135105a0fae7717960000000049454e44ae426082</data>
+ </image>
+</images>
+<tabstops>
+ <tabstop>typeCombo</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/polygonpropertyui.ui b/kpresenter/polygonpropertyui.ui
new file mode 100644
index 000000000..e5f4574b4
--- /dev/null
+++ b/kpresenter/polygonpropertyui.ui
@@ -0,0 +1,151 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>PolygonPropertyUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>PolygonPropertyUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>224</width>
+ <height>309</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Polygon</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>These settings are used in the Insert-&gt;Shape-&gt;Convex/Concave Polygon menu.</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>typeCombo</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>You can choose Polygon or Convex/Concave as a type.</string>
+ </property>
+ </widget>
+ <widget class="KPrPolygonPreview" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>polygonPreview</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>200</height>
+ </size>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This displays a preview of your choices.</string>
+ </property>
+ </widget>
+ <widget class="KIntNumInput" row="1" column="1">
+ <property name="name">
+ <cstring>cornersInput</cstring>
+ </property>
+ <property name="minValue">
+ <number>3</number>
+ </property>
+ <property name="maxValue">
+ <number>100</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set here the number of corners of the polygon.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>typebLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Type:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>typeCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Sharpness:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>sharpnessInput</cstring>
+ </property>
+ </widget>
+ <widget class="KIntNumInput" row="2" column="1">
+ <property name="name">
+ <cstring>sharpnessInput</cstring>
+ </property>
+ <property name="minValue">
+ <number>0</number>
+ </property>
+ <property name="maxValue">
+ <number>100</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Increase or decrease the sharpness of the polygon.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Corn&amp;ers:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cornersInput</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>KPrPolygonPreview</class>
+ <header location="global">KPrPolygonPreview.h</header>>
+ <sizehint>
+ <width>200</width>
+ <height>200</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="PNG" length="826">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000030149444154388db59531681b5718c77f0e377c070e3c810a3a70e0041eac51852e0a19e45134830a1d9a4c69a04bc8928e990a693a640e1d0c8642b08742321894c1507991b484c890902bb8701a047760c3bd21701fe4201dde49b6a41a32b8df72dcbbeffdbefffbbfefbd5b1b0c07cce266ebe667ae2006c3c1dada0cdc3be87d6e6c35b0d692a409d9c7ec8b20d65ae29398d19b1114e7e3de4ce98b3f5e10dc0053cf0951b4506496e1b964bf7ce6c585d9054c62d01d617ca48be0596553cf496d8f2c8b01c5f795fc93904e85ec4c01a152857a5d9175d0b2805c872080f18595ccc1499a10a225d4e2fbc2877786fe81253ab6c04c8d106e09db5d43ab0d146e5c64d1a23938fb98a185cea1c33eecfd9eba49eb427dcb201e245365f2b7b2fb5b4a3a31dcb927178afe07d86901df870fefa4842aed6f6b74ba42e52b4014d580e1eb9cbd9d94de7e4aad16d2f9be02d805f0b5e532f927a1ffcacea1777f122a8105b164a7c25faf323a5d9f1f1fd600e1e5bec59e2d4b5c7ef5209d0ad17b8b31864e57c0b3e0815ac3ee33253ab664a770ff5185d1a1cb8d2267d3e58aa1dc7d2508cbe597d0e74fdd269aaaf0f52d414c4ea3e9762c996869e42560d7a72e41c4799a2586e74f95e8d8151481fa86efbe7b3398ac58b1a2b8527589f15451ad303ac2293542ad6648a796278f13a27185e4c4754310facb98c53a79e19a3fdc1426ff28c3d7399d1f7cb25343eb96106cf83c790ce9c4f2eb831855c55485663327992eb6dc8a6259874ed700b0b793323cccb9ffa842b30d6133e3e75fea989ac15a8b16ca76b746b0b92278d919774c5b6d48a78697fb29bbcf52468742a32120909c24e899ce67beed5be2db01e22d1e9485bb620e47f9ee9e606a21bd3f5d3744c7e7c54d55e87443867d8b554515ac5db4620e8e4f62263170fd1cdee90aad7640141992891b0f367c9adfe4049bb07d3b7022bd8c687c0978f46684ee084150b65ac1fcca94591b7a90a496e4c095164fb016a2b192a497795cc0f84817aebe25f7bf70ccc54a575c555c03f78ffa5fc0570d1f0c076bff0232285a09643cc7ce0000000049454e44ae426082</data>
+ </image>
+</images>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/presstep.h b/kpresenter/presstep.h
new file mode 100644
index 000000000..24585bac5
--- /dev/null
+++ b/kpresenter/presstep.h
@@ -0,0 +1,52 @@
+// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
+/* This file is part of the KDE project
+ Copyright (C) 2004 Thorsten Zachmann <zachmann@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PRESSTEP_H
+#define PRESSTEP_H
+
+/**
+ * Class for keeping a presentation step
+ * m_pageNumber the current page number 0 based
+ * m_step the current effect step 0 based
+ * m_subStep the current sub step 0 based for text animation
+ * m_animate true if the current step should be animated
+ * m_animateSub true if the current sub step should be animated
+ */
+class PresStep
+{
+public:
+ PresStep()
+ : m_pageNumber( 0 ), m_step( 0 ), m_subStep( 0 ),
+ m_animate( false ), m_animateSub( false )
+ {};
+ PresStep( unsigned int pageNumber, unsigned int step, unsigned int subStep,
+ bool animate = false, bool animateSub = false )
+ : m_pageNumber( pageNumber ), m_step( step ), m_subStep( subStep ),
+ m_animate( animate ), m_animateSub( animateSub )
+ {};
+
+ int m_pageNumber;
+ int m_step;
+ int m_subStep;
+ bool m_animate;
+ bool m_animateSub;
+};
+
+#endif /* PRESSTEP_H */
diff --git a/kpresenter/rectpropertyui.ui b/kpresenter/rectpropertyui.ui
new file mode 100644
index 000000000..4730712c2
--- /dev/null
+++ b/kpresenter/rectpropertyui.ui
@@ -0,0 +1,181 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>RectPropertyUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>RectPropertyUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>271</width>
+ <height>297</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Rect</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>All these settings are used in the Insert-&gt;Shape-&gt;Rectangle menu.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>xRndLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Vertical declination:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>xRndInput</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>yRndLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Horizontal declination:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>yRndInput</cstring>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>yRndInput</cstring>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ <property name="maxValue">
+ <number>100</number>
+ </property>
+ <property name="lineStep">
+ <number>4</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set the horizontal declination.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>xRndInput</cstring>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ <property name="maxValue">
+ <number>100</number>
+ </property>
+ <property name="lineStep">
+ <number>4</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set the vertical declination.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>combineButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>16</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toggleButton">
+ <bool>true</bool>
+ </property>
+ <property name="on">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>You can choose whether or not to keep the same declination for both vertical and horizontal using this button.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KPrRectPreview">
+ <property name="name">
+ <cstring>rectPreview</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This displays a preview of your choices.</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>KPrRectPreview</class>
+ <header location="global">KPrRectPreview.h</header>>
+ <sizehint>
+ <width>100</width>
+ <height>50</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="PNG" length="824">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000002ff49444154388db59531681c4714863f992dde820cb370815b50600f54e8ca0ba43970712a8fb838438a3895634813d238a5ab80e314ae4d0a812060a4226017c27221c8a9da6b8c4fe0e00d28b0571cec82043b85611f78c12966efa4bb8bc085f29a6567df7cef9f7fdeccaec571cc2cbaddee47ae21e2385e5b9b815f1ebcfcd8de6a63ad25cb338af7c52741acb5a4a729a3d723a82ec6bd99d267bf3f23fc1c4cab2442d14a915986e792fdfa59569766573049417784f1b12e8267954dab24b78714450a28beaf941f847c2a14e70a0841035a2d45d641eb027213c210c69756320767794684d6508bef0befde1a860796e4c402333542b4256c0f0cdd1e50b97191458be6e0e27d81563a87c643d8fb2d7793d685d696413cc8a6cae46f65f7d79c7c62b87b4f2e15fd0fb0d302be0fefde4a0d557a5f35e90f84e0334014d590f855c9de4ecee17e4eb319d1ff3a00ec02f8c67299f283307c61e7d06fbf1782d082588a33e1cf1705fd81cf773f3601e1f9bec59e2f4b5c7ef5209f0ac95f16630cfd818067c103b586dd274a726229cee0fe8380d191cb4d1267d3d58aa1de7d258ceae5d7d0a78fdd269a86f0c52d414c49bbe3762c9b686de41560d7a72e41c4795a6486a78f95e4c4151481d686efbe7b3398ac58b1a23868b8c474aaa8068c8e714a8dd06c1af2a9e5d1c38c641c909dba6e08237f19b358a7ac5cf3479bc2e41f257e55d2ffc6a73833746f09e186cfa387904f2cbffc90a2aa9886d0e99464d3c5965b512cebd01f1800f67672e2a392fb0f023a3d883a053ffddcc2340dd65ab452b6074dc2cd15c1cbceb863daed413e353cdfcfd97d92333a12da6d0181ec3443cf753ef3cdd092de0e116ff1a02cdc157338ca9d7b8269461cfee1ba2139b9286e1a427f10110f2d561555b076d18a39383d4d99a4c0cd0b787f20747b214962c8266e3cdcf0e97c59126ec2f6edd089f40a92f115e0d1eb11ba238461dd6a15f32b53666de841965bb203575a3cc15a48c64a965fe57105e3635db8fa96dcffc431172b5d715d7103dc3fea7f015f373c8ee3b57f0135105a0fae7717960000000049454e44ae426082</data>
+ </image>
+</images>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kpresenter/rotationpropertyui.ui b/kpresenter/rotationpropertyui.ui
new file mode 100644
index 000000000..169324fb0
--- /dev/null
+++ b/kpresenter/rotationpropertyui.ui
@@ -0,0 +1,166 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>RotationPropertyUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>RotationPropertyUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>356</width>
+ <height>162</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Rotation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QSlider" row="1" column="0">
+ <property name="name">
+ <cstring>angleSlider</cstring>
+ </property>
+ <property name="minValue">
+ <number>-180</number>
+ </property>
+ <property name="maxValue">
+ <number>180</number>
+ </property>
+ <property name="lineStep">
+ <number>5</number>
+ </property>
+ <property name="pageStep">
+ <number>15</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>Below</enum>
+ </property>
+ <property name="tickInterval">
+ <number>90</number>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;ngle:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>angleSpinbox</cstring>
+ </property>
+ </widget>
+ <widget class="KDoubleNumInput">
+ <property name="name">
+ <cstring>angleSpinbox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="value">
+ <number>0</number>
+ </property>
+ <property name="minValue">
+ <number>-180</number>
+ </property>
+ <property name="maxValue">
+ <number>180</number>
+ </property>
+ <property name="suffix">
+ <string> °</string>
+ </property>
+ <property name="precision">
+ <number>1</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer16</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>31</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QFrame" row="0" column="1" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>previewPanel</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>160</width>
+ <height>160</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>Panel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ </widget>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>spacer17</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QFrame" row="0" column="0">
+ <property name="name">
+ <cstring>angleFrame</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/scripts/automate_presentation.sh b/kpresenter/scripts/automate_presentation.sh
new file mode 100755
index 000000000..1f91f6412
--- /dev/null
+++ b/kpresenter/scripts/automate_presentation.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# This script uses KPresenter's DCOP interface to automate a presentation
+# Every 10 seconds, it goes to the next sequence or page (just as if
+# 'space' was pressed)
+#
+# Idea from Christopher Molnar <molnarc@mandrakesoft.com>
+# Implementation by David Faure <faure@kde.org> using Matthias Ettrich dcop shell
+#
+# Open the presentation in kpresenter, then launch this script
+#
+appname=`dcop | grep -m 1 ^kpresenter`
+#echo $appname
+
+viewname=`dcop $appname | grep ^View`
+#echo $viewname
+
+dcop $appname $viewname screenStart
+
+sleep 5;
+
+while true; do
+ sleep 10;
+ dcop $appname $viewname screenNext
+done
diff --git a/kpresenter/scripts/mkstandalone.sh b/kpresenter/scripts/mkstandalone.sh
new file mode 100755
index 000000000..ebd2fd8a6
--- /dev/null
+++ b/kpresenter/scripts/mkstandalone.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+# This script copies everything that is needed to run kpresenter on a
+# computer where KDE isn't installed.
+# Relies on kpresenter being installed on the local machine, in $KDEDIR
+#
+# The script copies everything into a directory. You just need to tar it up,
+# transfer it (CD-ROM or via Internet), untar it, cd into it,
+# and run the script "go.sh" with your presentation as argument.
+# Debug output goes to kpresenter.out to avoid cluttering the terminal
+# with our junk :-) Check it out in case of problems.
+#
+# (C) David Faure <faure@kde.org>
+
+# Pass output dir as argument
+if [ $# -ne 1 ]; then
+ echo "Usage : $0 <outputdir>"
+else
+ out=$1
+########### Data
+ mkdir -p $out
+ mkdir -p $out/share
+ mkdir -p $out/share/apps
+ cp -r $KDEDIR/share/apps/kpresenter $out/share/apps/
+ cp -r $KDEDIR/share/apps/koffice $out/share/apps/
+ cp -r $KDEDIR/share/apps/kstyle $out/share/apps/
+ mkdir -p $out/share/config
+ cp $KDEDIR/share/config/kdebug.areas $out/share/config/
+ cp ~/.kde/share/config/kdeglobals $out/share/config/
+ cp ~/.kde/share/config/kpresenterrc $out/share/config/
+ ### cp $KDEDIR/share/icons $out/share/
+ cp -r $KDEDIR/share/toolbar $out/share/
+ mkdir -p $out/share/servicetypes
+ cp $KDEDIR/share/servicetypes/kofficepart.desktop $out/share/servicetypes
+ mkdir -p $out/share/applnk
+ cp $KDEDIR/share/applnk/KOffice/kpresenter.desktop $out/share/applnk/
+
+########### Libraries (warning, using Linux specific ldd !)
+ TMPFILE=/tmp/__kpresenter_ldd.tmp
+ mkdir -p $out/lib
+ ldd $KDEDIR/bin/kpresenter | sed -e 's/.*=> \([^ ]*\).*/\1/' > $TMPFILE
+ # Add style libs
+ echo $KDEDIR/lib/basicstyle.so >> $TMPFILE
+ echo $KDEDIR/lib/kstepstyle.so >> $TMPFILE
+ # Add image handler libs
+ echo $KDEDIR/lib/kimg_jpeg.so >> $TMPFILE
+ echo $KDEDIR/lib/kimg_tiff.so >> $TMPFILE
+ # Add libs for embedded parts here
+
+ cat $TMPFILE | while read libfile; do
+ # ldd shows the fullpath to a link.
+ # Extract the directory from the fullpath
+ origdir=`dirname $libfile`
+ libfile=`basename $libfile`
+ while [ -L $origdir/$libfile ]; do
+ # Follow the symlink and create the same in $out/lib
+ pointsto=`readlink $origdir/$libfile`
+ echo "ln -s $out/$libfile $pointsto"
+ ln -s $pointsto $out/lib/$libfile
+ libfile=$pointsto;
+ done
+ # Copy the library itself
+ echo "cp $origdir/$libfile $out/lib"
+ cp $origdir/$libfile $out/lib
+ # Copy the .la file as well
+ lafile=`echo $libfile | sed -e 's/\.so.*/\.la/'`
+ if [ -f $origdir/$lafile ]; then cp $origdir/$lafile $out/lib ; fi
+ done
+ rm -f $TMPFILE
+
+########### Binaries
+ mkdir -p $out/bin
+ cp $KDEDIR/bin/kpresenter $out/bin/
+ cp $KDEDIR/bin/dcopserver $out/bin/
+ # Take kded as well - we could copy the ksycoca file but we would have
+ # to install it in ~/.kde ...
+ cp $KDEDIR/bin/kded $out/bin/
+
+########### Startup script
+ echo '#!/bin/sh' > $out/go.sh
+ echo 'export KDEDIR=`pwd`' >> $out/go.sh
+ echo 'export LD_LIBRARY_PATH=$KDEDIR/lib' >> $out/go.sh
+ echo 'mkdir -p ~/.kde 2>/dev/null' >> $out/go.sh
+ echo 'mkdir -p ~/.kde/share 2>/dev/null' >> $out/go.sh
+ echo 'mkdir -p ~/.kde/share/config 2>/dev/null' >> $out/go.sh
+ echo 'cp share/config/* ~/.kde/share/config' >> $out/go.sh
+ echo 'bin/dcopserver 2>/dev/null' >> $out/go.sh
+ echo 'sleep 1 ; bin/kded 2>/dev/null' >> $out/go.sh
+ echo 'sleep 1 ; bin/kpresenter $* 1>/dev/null 2>kpresenter.out &' >> $out/go.sh
+ chmod u+x $out/go.sh
+fi
+
diff --git a/kpresenter/shadowdialog.ui b/kpresenter/shadowdialog.ui
new file mode 100644
index 000000000..a50a1a175
--- /dev/null
+++ b/kpresenter/shadowdialog.ui
@@ -0,0 +1,499 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ShadowDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ShadowDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>436</width>
+ <height>280</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Shadow</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout9</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>colorgroup</cstring>
+ </property>
+ <property name="title">
+ <string>Color &amp;&amp; Distance</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>colorLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton">
+ <property name="name">
+ <cstring>colorButton</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>distanceLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Distance:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>distanceSpinBox</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>directionGroup</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Direction</string>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>lButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toggleButton">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>8</number>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="0">
+ <property name="name">
+ <cstring>lbButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toggleButton">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>7</number>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>bButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toggleButton">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>6</number>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="2">
+ <property name="name">
+ <cstring>rbButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toggleButton">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>5</number>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>rButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toggleButton">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>4</number>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>ltButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toggleButton">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="2">
+ <property name="name">
+ <cstring>rtButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toggleButton">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>3</number>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>tButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toggleButton">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>2</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>previewPanel</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>160</width>
+ <height>160</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>Panel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>Line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>applyButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ShadowDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>distanceSpinBox</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>ShadowDialogBase</receiver>
+ <slot>distanceChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>directionGroup</sender>
+ <signal>clicked(int)</signal>
+ <receiver>ShadowDialogBase</receiver>
+ <slot>directionChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ShadowDialogBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>applyButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ShadowDialogBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>distanceSpinBox</tabstop>
+ <tabstop>ltButton</tabstop>
+ <tabstop>tButton</tabstop>
+ <tabstop>rtButton</tabstop>
+ <tabstop>lButton</tabstop>
+ <tabstop>rButton</tabstop>
+ <tabstop>lbButton</tabstop>
+ <tabstop>bButton</tabstop>
+ <tabstop>rbButton</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>applyButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">kcolorbutton.h</include>
+</includes>
+<slots>
+ <slot access="protected">colorChanged( const QColor &amp; )</slot>
+ <slot access="protected">directionChanged( int )</slot>
+ <slot access="protected">distanceChanged( int )</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">okClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/slideshow/Makefile.am b/kpresenter/slideshow/Makefile.am
new file mode 100644
index 000000000..6a7b8d05a
--- /dev/null
+++ b/kpresenter/slideshow/Makefile.am
@@ -0,0 +1,5 @@
+
+slideshow_DATA = home.png first.png prev.png next.png last.png
+
+slideshowdir = $(kde_datadir)/kpresenter/slideshow
+
diff --git a/kpresenter/slideshow/first.bmp b/kpresenter/slideshow/first.bmp
new file mode 100644
index 000000000..4fcc4cb90
--- /dev/null
+++ b/kpresenter/slideshow/first.bmp
Binary files differ
diff --git a/kpresenter/slideshow/first.jpeg b/kpresenter/slideshow/first.jpeg
new file mode 100644
index 000000000..c9e4321b8
--- /dev/null
+++ b/kpresenter/slideshow/first.jpeg
Binary files differ
diff --git a/kpresenter/slideshow/first.png b/kpresenter/slideshow/first.png
new file mode 100644
index 000000000..95cd61cc6
--- /dev/null
+++ b/kpresenter/slideshow/first.png
Binary files differ
diff --git a/kpresenter/slideshow/home.bmp b/kpresenter/slideshow/home.bmp
new file mode 100644
index 000000000..729571e2a
--- /dev/null
+++ b/kpresenter/slideshow/home.bmp
Binary files differ
diff --git a/kpresenter/slideshow/home.jpeg b/kpresenter/slideshow/home.jpeg
new file mode 100644
index 000000000..165868ef5
--- /dev/null
+++ b/kpresenter/slideshow/home.jpeg
Binary files differ
diff --git a/kpresenter/slideshow/home.png b/kpresenter/slideshow/home.png
new file mode 100644
index 000000000..e98501156
--- /dev/null
+++ b/kpresenter/slideshow/home.png
Binary files differ
diff --git a/kpresenter/slideshow/last.bmp b/kpresenter/slideshow/last.bmp
new file mode 100644
index 000000000..ec922bb0b
--- /dev/null
+++ b/kpresenter/slideshow/last.bmp
Binary files differ
diff --git a/kpresenter/slideshow/last.jpeg b/kpresenter/slideshow/last.jpeg
new file mode 100644
index 000000000..4bf299cea
--- /dev/null
+++ b/kpresenter/slideshow/last.jpeg
Binary files differ
diff --git a/kpresenter/slideshow/last.png b/kpresenter/slideshow/last.png
new file mode 100644
index 000000000..4568992f0
--- /dev/null
+++ b/kpresenter/slideshow/last.png
Binary files differ
diff --git a/kpresenter/slideshow/next.bmp b/kpresenter/slideshow/next.bmp
new file mode 100644
index 000000000..40fd2c982
--- /dev/null
+++ b/kpresenter/slideshow/next.bmp
Binary files differ
diff --git a/kpresenter/slideshow/next.jpeg b/kpresenter/slideshow/next.jpeg
new file mode 100644
index 000000000..b7317189f
--- /dev/null
+++ b/kpresenter/slideshow/next.jpeg
Binary files differ
diff --git a/kpresenter/slideshow/next.png b/kpresenter/slideshow/next.png
new file mode 100644
index 000000000..41aabbcff
--- /dev/null
+++ b/kpresenter/slideshow/next.png
Binary files differ
diff --git a/kpresenter/slideshow/prev.bmp b/kpresenter/slideshow/prev.bmp
new file mode 100644
index 000000000..e9b170e9a
--- /dev/null
+++ b/kpresenter/slideshow/prev.bmp
Binary files differ
diff --git a/kpresenter/slideshow/prev.jpeg b/kpresenter/slideshow/prev.jpeg
new file mode 100644
index 000000000..4d05dfe15
--- /dev/null
+++ b/kpresenter/slideshow/prev.jpeg
Binary files differ
diff --git a/kpresenter/slideshow/prev.png b/kpresenter/slideshow/prev.png
new file mode 100644
index 000000000..4825780ad
--- /dev/null
+++ b/kpresenter/slideshow/prev.png
Binary files differ
diff --git a/kpresenter/slidetransitionwidget.ui b/kpresenter/slidetransitionwidget.ui
new file mode 100644
index 000000000..65f8cb03f
--- /dev/null
+++ b/kpresenter/slidetransitionwidget.ui
@@ -0,0 +1,308 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>SlideTransitionWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SlideTransitionWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>535</width>
+ <height>245</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Slide Transition</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout39</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>previewPixmap</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>240</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>previewButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Preview</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>effectCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>effectLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Effect:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>effectCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>speedCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>speedLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Speed:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>speedCombo</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line8</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>soundCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>So&amp;und effect</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="1">
+ <property name="name">
+ <cstring>soundRequester</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>stopButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>soundLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;File:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>soundRequester</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>playButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line8_2</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>autoTransitionLayout</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Automatic &amp;transition to the next slide after:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>automaticTransitionInput</cstring>
+ </property>
+ </widget>
+ <widget class="KIntNumInput">
+ <property name="name">
+ <cstring>automaticTransitionInput</cstring>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="maxValue">
+ <number>600</number>
+ </property>
+ <property name="suffix">
+ <string> seconds</string>
+ </property>
+ <property name="prefix">
+ <string></string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>29</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<tabstops>
+ <tabstop>effectCombo</tabstop>
+ <tabstop>speedCombo</tabstop>
+ <tabstop>soundCheckBox</tabstop>
+ <tabstop>soundRequester</tabstop>
+ <tabstop>playButton</tabstop>
+ <tabstop>stopButton</tabstop>
+ <tabstop>previewButton</tabstop>
+ <tabstop>automaticTransitionInput</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/templates/A4/.directory b/kpresenter/templates/A4/.directory
new file mode 100644
index 000000000..9d5708220
--- /dev/null
+++ b/kpresenter/templates/A4/.directory
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=A4
+Name[hi]=ए4
+Name[ru]=А4
+Name[sr]=А4
+Name[zu]=u-A4
+X-KDE-DefaultTab=true
diff --git a/kpresenter/templates/A4/Makefile.am b/kpresenter/templates/A4/Makefile.am
new file mode 100644
index 000000000..37a8adef6
--- /dev/null
+++ b/kpresenter/templates/A4/Makefile.am
@@ -0,0 +1,20 @@
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kpresenter/templates/A4
+ for file in OneColumnLandscape.desktop TitleLandscape.desktop \
+ TwoColumnLandscape.desktop emptyLandscape.desktop OneColumnPortrait.desktop \
+ TitlePortrait.desktop TwoColumnPortrait.desktop emptyPortrait.desktop; do \
+ $(INSTALL_DATA) $(srcdir)/../common_desktop/$$file $(DESTDIR)$(kde_datadir)/kpresenter/templates/A4/$$file ;\
+ done
+ $(INSTALL_DATA) $(srcdir)/.directory $(DESTDIR)$(kde_datadir)/kpresenter/templates/A4
+
+templatesrc_DATA = \
+ OneColumnLandscape.kpt \
+ OneColumnPortrait.kpt \
+ TitleLandscape.kpt \
+ TitlePortrait.kpt \
+ TwoColumnLandscape.kpt \
+ TwoColumnPortrait.kpt \
+ emptyLandscape.kpt \
+ emptyPortrait.kpt
+templatesrcdir = $(kde_datadir)/kpresenter/templates/A4/.source
diff --git a/kpresenter/templates/A4/OneColumnLandscape.kpt b/kpresenter/templates/A4/OneColumnLandscape.kpt
new file mode 100644
index 000000000..ef4c11eaa
--- /dev/null
+++ b/kpresenter/templates/A4/OneColumnLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/A4/OneColumnPortrait.kpt b/kpresenter/templates/A4/OneColumnPortrait.kpt
new file mode 100644
index 000000000..b3ec561af
--- /dev/null
+++ b/kpresenter/templates/A4/OneColumnPortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/A4/TitleLandscape.kpt b/kpresenter/templates/A4/TitleLandscape.kpt
new file mode 100644
index 000000000..3cb002d8d
--- /dev/null
+++ b/kpresenter/templates/A4/TitleLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/A4/TitlePortrait.kpt b/kpresenter/templates/A4/TitlePortrait.kpt
new file mode 100644
index 000000000..aae020b36
--- /dev/null
+++ b/kpresenter/templates/A4/TitlePortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/A4/TwoColumnLandscape.kpt b/kpresenter/templates/A4/TwoColumnLandscape.kpt
new file mode 100644
index 000000000..83ca331e2
--- /dev/null
+++ b/kpresenter/templates/A4/TwoColumnLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/A4/TwoColumnPortrait.kpt b/kpresenter/templates/A4/TwoColumnPortrait.kpt
new file mode 100644
index 000000000..6ad2b3309
--- /dev/null
+++ b/kpresenter/templates/A4/TwoColumnPortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/A4/emptyLandscape.kpt b/kpresenter/templates/A4/emptyLandscape.kpt
new file mode 100644
index 000000000..038745c50
--- /dev/null
+++ b/kpresenter/templates/A4/emptyLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/A4/emptyPortrait.kpt b/kpresenter/templates/A4/emptyPortrait.kpt
new file mode 100644
index 000000000..bab17d9f3
--- /dev/null
+++ b/kpresenter/templates/A4/emptyPortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/Makefile.am b/kpresenter/templates/Makefile.am
new file mode 100644
index 000000000..d01a545e5
--- /dev/null
+++ b/kpresenter/templates/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = common_icon Screenpresentations Screen A4 legal letter
diff --git a/kpresenter/templates/README b/kpresenter/templates/README
new file mode 100644
index 000000000..c782226f5
--- /dev/null
+++ b/kpresenter/templates/README
@@ -0,0 +1,9 @@
+The directory common_icons holds the identical icons for the templates of
+the different formats.
+
+The direcory common_desktop holds the identical desktop definitions for the
+different formats for easy translation
+
+
+f.gassauer@aon.at
+
diff --git a/kpresenter/templates/Screen/.directory b/kpresenter/templates/Screen/.directory
new file mode 100644
index 000000000..5d5642741
--- /dev/null
+++ b/kpresenter/templates/Screen/.directory
@@ -0,0 +1,59 @@
+[Desktop Entry]
+Name=Screen
+Name[af]=Skerm
+Name[az]=Ekran
+Name[bg]=Екран
+Name[br]=Skramm
+Name[bs]=Ekran
+Name[ca]=Pantalla
+Name[cy]=Sgrîn
+Name[da]=Skærm
+Name[de]=Folien
+Name[el]=Οθόνη
+Name[eo]=Ekrano
+Name[es]=Pantalla
+Name[et]=Ekraan
+Name[fa]=پرده
+Name[fo]=Skíggi
+Name[fr]=Écran
+Name[fy]=Skerm
+Name[ga]=Scáileán
+Name[gl]=Pantalla
+Name[he]=מסך
+Name[hi]=स्क्रीन
+Name[hr]=Zaslon
+Name[hu]=Képernyő
+Name[is]=Skjár
+Name[it]=Schermo
+Name[ja]=スクリーン
+Name[km]=អេក្រង់​
+Name[lo]=ຫນ້າຈໍ
+Name[lv]=Ekrāns
+Name[mt]=Skrin
+Name[nb]=Skjerm
+Name[nds]=Schirm
+Name[ne]=पर्दा
+Name[nl]=Scherm
+Name[pl]=Ekran
+Name[pt]=Ecrã
+Name[pt_BR]=Tela
+Name[ru]=Экран
+Name[se]=Šearbma
+Name[sk]=Obrazovka
+Name[sl]=Zaslon
+Name[sr]=Екран
+Name[sr@Latn]=Ekran
+Name[sv]=Skärm
+Name[ta]=திரை
+Name[tg]=Экран
+Name[th]=หน้าจอ
+Name[tr]=Ekran
+Name[uk]=Екран
+Name[uz]=Ekran
+Name[uz@cyrillic]=Экран
+Name[ven]=Tshikirini
+Name[wa]=Waitroûle
+Name[xh]=Ikhusi
+Name[zh_CN]=屏幕
+Name[zh_TW]=螢幕
+Name[zu]=Isikrini
diff --git a/kpresenter/templates/Screen/Makefile.am b/kpresenter/templates/Screen/Makefile.am
new file mode 100644
index 000000000..1a45567aa
--- /dev/null
+++ b/kpresenter/templates/Screen/Makefile.am
@@ -0,0 +1,16 @@
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kpresenter/templates/Screen
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kpresenter/templates/Screen/.source
+ for file in OneColumnLandscape.desktop TitleLandscape.desktop \
+ TwoColumnLandscape.desktop emptyLandscape.desktop ; do \
+ $(INSTALL_DATA) $(srcdir)/../common_desktop/$$file $(DESTDIR)$(kde_datadir)/kpresenter/templates/Screen/$$file ;\
+ done
+ $(INSTALL_DATA) $(srcdir)/.directory $(DESTDIR)$(kde_datadir)/kpresenter/templates/Screen
+
+templatesrc_DATA = \
+ OneColumnLandscape.kpt \
+ TitleLandscape.kpt \
+ TwoColumnLandscape.kpt \
+ emptyLandscape.kpt
+templatesrcdir = $(kde_datadir)/kpresenter/templates/Screen/.source
diff --git a/kpresenter/templates/Screen/OneColumnLandscape.kpt b/kpresenter/templates/Screen/OneColumnLandscape.kpt
new file mode 100644
index 000000000..09d1228e2
--- /dev/null
+++ b/kpresenter/templates/Screen/OneColumnLandscape.kpt
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DOC author="Reginald Stadlbauer" email="reggie@kde.org" editor="KPresenter" mime="application/x-kpresenter" syntaxVersion="2">
+ <PAPER format="5" ptWidth="680" ptHeight="510" mmWidth ="240" mmHeight="180" inchWidth ="9.44882" inchHeight="7.08661" orientation="0">
+ <PAPERBORDERS mmLeft="0" mmTop="0" mmRight="0" mmBottom="0" ptLeft="0" ptTop="0" ptRight="0" ptBottom="0" inchLeft="0" inchTop="0" inchRight="0" inchBottom="0"/>
+ </PAPER>
+ <BACKGROUND rastX="10" rastY="10" bred="255" bgreen="255" bblue="255">
+ <PAGE>
+ <BACKTYPE value="0"/>
+ <BACKVIEW value="1"/>
+ <BACKCOLOR1 red="255" green="255" blue="255"/>
+ <BACKCOLOR2 red="255" green="255" blue="255"/>
+ <BCTYPE value="0"/>
+ <BGRADIENT unbalanced="0" xfactor="100" yfactor="100"/>
+ <PGEFFECT value="0"/>
+ </PAGE>
+ </BACKGROUND>
+ <HEADER show="0">
+ <ORIG x="0" y="0"/>
+ <SIZE width="-1" height="-1"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="1" bulletType3="2" bulletType4="3" bulletColor1="#000000" bulletColor2="#000000" bulletColor3="#000000" bulletColor4="#000000">
+ <P align="1" type="0" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="0" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </HEADER>
+ <FOOTER show="0">
+ <ORIG x="0" y="0"/>
+ <SIZE width="-1" height="-1"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="1" bulletType3="2" bulletType4="3" bulletColor1="#000000" bulletColor2="#000000" bulletColor3="#000000" bulletColor4="#000000">
+ <P align="1" type="0" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="0" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </FOOTER>
+ <OBJECTS>
+ <OBJECT type="4">
+ <ORIG x="30" y="30"/>
+ <SIZE width="611" height="61"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="0" bulletType3="0" bulletType4="0" bulletColor1="#ff0000" bulletColor2="#ff0000" bulletColor3="#ff0000" bulletColor4="#ff0000">
+ <P align="0" type="0" depth="0">
+ <TEXT family="utopia" pointSize="48" bold="1" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </OBJECT>
+ <OBJECT type="4">
+ <ORIG x="30" y="130"/>
+ <SIZE width="611" height="341"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="0" bulletType3="0" bulletType4="0" bulletColor1="#000000" bulletColor2="#ff0000" bulletColor3="#ff0000" bulletColor4="#ff0000">
+ <P align="0" type="1" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="1" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </OBJECT>
+ </OBJECTS>
+ <INFINITLOOP value="0"/>
+ <MANUALSWITCH value="1"/>
+ <PRESSLIDES value="0"/>
+ <SELSLIDES>
+ <SLIDE nr="0" show="1"/>
+ </SELSLIDES>
+ <PIXMAPS>
+ </PIXMAPS>
+ <CLIPARTS>
+ </CLIPARTS>
+</DOC>
diff --git a/kpresenter/templates/Screen/TitleLandscape.kpt b/kpresenter/templates/Screen/TitleLandscape.kpt
new file mode 100644
index 000000000..d6a36de8e
--- /dev/null
+++ b/kpresenter/templates/Screen/TitleLandscape.kpt
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DOC author="Reginald Stadlbauer" email="reggie@kde.org" editor="KPresenter" mime="application/x-kpresenter" syntaxVersion="2">
+ <PAPER format="5" ptWidth="680" ptHeight="510" mmWidth ="240" mmHeight="180" inchWidth ="9.44882" inchHeight="7.08661" orientation="0">
+ <PAPERBORDERS mmLeft="0" mmTop="0" mmRight="0" mmBottom="0" ptLeft="0" ptTop="0" ptRight="0" ptBottom="0" inchLeft="0" inchTop="0" inchRight="0" inchBottom="0"/>
+ </PAPER>
+ <BACKGROUND rastX="10" rastY="10" bred="255" bgreen="255" bblue="255">
+ <PAGE>
+ <BACKTYPE value="0"/>
+ <BACKVIEW value="1"/>
+ <BACKCOLOR1 red="255" green="255" blue="255"/>
+ <BACKCOLOR2 red="255" green="255" blue="255"/>
+ <BCTYPE value="0"/>
+ <BGRADIENT unbalanced="0" xfactor="100" yfactor="100"/>
+ <PGEFFECT value="0"/>
+ </PAGE>
+ </BACKGROUND>
+ <HEADER show="0">
+ <ORIG x="0" y="0"/>
+ <SIZE width="-1" height="-1"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="1" bulletType3="2" bulletType4="3" bulletColor1="#000000" bulletColor2="#000000" bulletColor3="#000000" bulletColor4="#000000">
+ <P align="1" type="0" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="0" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </HEADER>
+ <FOOTER show="0">
+ <ORIG x="0" y="0"/>
+ <SIZE width="-1" height="-1"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="1" bulletType3="2" bulletType4="3" bulletColor1="#000000" bulletColor2="#000000" bulletColor3="#000000" bulletColor4="#000000">
+ <P align="1" type="0" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="0" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </FOOTER>
+ <OBJECTS>
+ <OBJECT type="4">
+ <ORIG x="30" y="30"/>
+ <SIZE width="611" height="61"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="0" bulletType3="0" bulletType4="0" bulletColor1="#000000" bulletColor2="#ff0000" bulletColor3="#ff0000" bulletColor4="#ff0000">
+ <P align="0" type="0" depth="0">
+ <TEXT family="utopia" pointSize="48" bold="1" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </OBJECT>
+ </OBJECTS>
+ <INFINITLOOP value="0"/>
+ <MANUALSWITCH value="1"/>
+ <PRESSLIDES value="0"/>
+ <SELSLIDES>
+ <SLIDE nr="0" show="1"/>
+ </SELSLIDES>
+ <PIXMAPS>
+ </PIXMAPS>
+ <CLIPARTS>
+ </CLIPARTS>
+</DOC>
diff --git a/kpresenter/templates/Screen/TwoColumnLandscape.kpt b/kpresenter/templates/Screen/TwoColumnLandscape.kpt
new file mode 100644
index 000000000..df96a837e
--- /dev/null
+++ b/kpresenter/templates/Screen/TwoColumnLandscape.kpt
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DOC author="Reginald Stadlbauer" email="reggie@kde.org" editor="KPresenter" mime="application/x-kpresenter" syntaxVersion="2">
+ <PAPER format="5" ptWidth="680" ptHeight="510" mmWidth ="240" mmHeight="180" inchWidth ="9.44882" inchHeight="7.08661" orientation="0">
+ <PAPERBORDERS mmLeft="0" mmTop="0" mmRight="0" mmBottom="0" ptLeft="0" ptTop="0" ptRight="0" ptBottom="0" inchLeft="0" inchTop="0" inchRight="0" inchBottom="0"/>
+ </PAPER>
+ <BACKGROUND rastX="10" rastY="10" bred="255" bgreen="255" bblue="255">
+ <PAGE>
+ <BACKTYPE value="0"/>
+ <BACKVIEW value="1"/>
+ <BACKCOLOR1 red="255" green="255" blue="255"/>
+ <BACKCOLOR2 red="255" green="255" blue="255"/>
+ <BCTYPE value="0"/>
+ <BGRADIENT unbalanced="0" xfactor="100" yfactor="100"/>
+ <PGEFFECT value="0"/>
+ </PAGE>
+ </BACKGROUND>
+ <HEADER show="0">
+ <ORIG x="0" y="0"/>
+ <SIZE width="-1" height="-1"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="1" bulletType3="2" bulletType4="3" bulletColor1="#000000" bulletColor2="#000000" bulletColor3="#000000" bulletColor4="#000000">
+ <P align="1" type="0" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="0" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </HEADER>
+ <FOOTER show="0">
+ <ORIG x="0" y="0"/>
+ <SIZE width="-1" height="-1"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="1" bulletType3="2" bulletType4="3" bulletColor1="#000000" bulletColor2="#000000" bulletColor3="#000000" bulletColor4="#000000">
+ <P align="1" type="0" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="0" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </FOOTER>
+ <OBJECTS>
+ <OBJECT type="4">
+ <ORIG x="30" y="30"/>
+ <SIZE width="611" height="61"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="0" bulletType3="0" bulletType4="0" bulletColor1="#000000" bulletColor2="#ff0000" bulletColor3="#ff0000" bulletColor4="#ff0000">
+ <P align="0" type="0" depth="0">
+ <TEXT family="utopia" pointSize="48" bold="1" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </OBJECT>
+ <OBJECT type="4">
+ <ORIG x="30" y="110"/>
+ <SIZE width="301" height="371"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="0" bulletType3="0" bulletType4="0" bulletColor1="#000000" bulletColor2="#ff0000" bulletColor3="#ff0000" bulletColor4="#ff0000">
+ <P align="0" type="1" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="1" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </OBJECT>
+ <OBJECT type="4">
+ <ORIG x="340" y="110"/>
+ <SIZE width="301" height="371"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="0" bulletType3="0" bulletType4="0" bulletColor1="#000000" bulletColor2="#ff0000" bulletColor3="#ff0000" bulletColor4="#ff0000">
+ <P align="0" type="1" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="1" italic="0" underline="0" color="#ff0000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </OBJECT>
+ </OBJECTS>
+ <INFINITLOOP value="0"/>
+ <MANUALSWITCH value="1"/>
+ <PRESSLIDES value="0"/>
+ <SELSLIDES>
+ <SLIDE nr="0" show="1"/>
+ </SELSLIDES>
+ <PIXMAPS>
+ </PIXMAPS>
+ <CLIPARTS>
+ </CLIPARTS>
+</DOC>
diff --git a/kpresenter/templates/Screen/emptyLandscape.kpt b/kpresenter/templates/Screen/emptyLandscape.kpt
new file mode 100644
index 000000000..b5a28a575
--- /dev/null
+++ b/kpresenter/templates/Screen/emptyLandscape.kpt
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DOC author="Reginald Stadlbauer" email="reggie@kde.org" editor="KPresenter" mime="application/x-kpresenter" syntaxVersion="2">
+ <PAPER format="5" ptWidth="680" ptHeight="510" mmWidth ="240" mmHeight="180" inchWidth ="9.44882" inchHeight="7.08661" orientation="0">
+ <PAPERBORDERS mmLeft="0" mmTop="0" mmRight="0" mmBottom="0" ptLeft="0" ptTop="0" ptRight="0" ptBottom="0" inchLeft="0" inchTop="0" inchRight="0" inchBottom="0"/>
+ </PAPER>
+ <BACKGROUND rastX="10" rastY="10" bred="255" bgreen="255" bblue="255">
+ <PAGE>
+ <BACKTYPE value="0"/>
+ <BACKVIEW value="1"/>
+ <BACKCOLOR1 red="255" green="255" blue="255"/>
+ <BACKCOLOR2 red="255" green="255" blue="255"/>
+ <BCTYPE value="0"/>
+ <BGRADIENT unbalanced="0" xfactor="100" yfactor="100"/>
+ <PGEFFECT value="0"/>
+ </PAGE>
+ </BACKGROUND>
+ <HEADER show="0">
+ <ORIG x="0" y="0"/>
+ <SIZE width="20" height="20"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="1" bulletType3="2" bulletType4="3" bulletColor1="#000000" bulletColor2="#000000" bulletColor3="#000000" bulletColor4="#000000">
+ <P align="1" type="0" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="0" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </HEADER>
+ <FOOTER show="0">
+ <ORIG x="0" y="0"/>
+ <SIZE width="20" height="20"/>
+ <SHADOW distance="0" direction="5" red="160" green="160" blue="164"/>
+ <EFFECTS effect="0" effect2="0"/>
+ <PRESNUM value="0"/>
+ <ANGLE value="0"/>
+ <FILLTYPE value="0"/>
+ <GRADIENT red1="255" green1="0" blue1="0" red2="0" green2="255" blue2="0" type="1" unbalanced="0" xfactor="100" yfactor="100"/>
+ <PEN red="0" green="0" blue="0" width="1" style="0"/>
+ <BRUSH red="0" green="0" blue="0" style="0"/>
+ <DISAPPEAR effect="0" doit="0" num="1"/>
+ <TEXTOBJ lineSpacing="0" paragSpacing="0" margin="0" bulletType1="0" bulletType2="1" bulletType3="2" bulletType4="3" bulletColor1="#000000" bulletColor2="#000000" bulletColor3="#000000" bulletColor4="#000000">
+ <P align="1" type="0" depth="0">
+ <TEXT family="utopia" pointSize="20" bold="0" italic="0" underline="0" color="#000000"> </TEXT>
+ </P>
+ </TEXTOBJ>
+ </FOOTER>
+ <OBJECTS>
+ </OBJECTS>
+ <INFINITLOOP value="0"/>
+ <MANUALSWITCH value="1"/>
+ <SELSLIDES>
+ <SLIDE nr="0" show="1"/>
+ </SELSLIDES>
+ <PIXMAPS>
+ </PIXMAPS>
+ <CLIPARTS>
+ </CLIPARTS>
+</DOC>
diff --git a/kpresenter/templates/Screenpresentations/.directory b/kpresenter/templates/Screenpresentations/.directory
new file mode 100644
index 000000000..a93f5266e
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/.directory
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Name=Screen Presentations
+Name[ar]=تقديمات على امتداد الشّاشة
+Name[bg]=Екранни презентации
+Name[br]=Emginnigoù srakmm
+Name[ca]=Presentacions per pantalla
+Name[cy]=Cyflwyniadau Sgrîn
+Name[da]=Skærmpræsentationer
+Name[de]=Folien-Präsentationen
+Name[el]=Παρουσιάσεις σε οθόνη
+Name[eo]=Ekranprezentoj
+Name[es]=Presentaciones en pantalla
+Name[et]=Ekraaniesitlused
+Name[fa]=ارائۀ پرده
+Name[fr]=Présentations à l'écran
+Name[fy]=Dia-presintaasjes
+Name[gl]=Presentations na Pantalla
+Name[he]=מסך שקופיות
+Name[hi]=स्क्रीन प्रस्तुतीकरण
+Name[hr]=Prezentacije u slajdovima
+Name[hu]=Képernyőbemutatók
+Name[is]=Kynningar á skjá
+Name[it]=Presentazioni a schermo
+Name[ja]=スクリーンプレゼンテーション
+Name[km]=បញ្ចាំង​លើ​អេក្រង់
+Name[lv]=Ekrāna prezentācijas
+Name[nb]=Skjermpresentasjoner
+Name[nds]=Schirm-Presentatschonen
+Name[ne]=पर्दा प्रस्तुतिकरण
+Name[nl]=Diapresentaties
+Name[pl]=Prezentacje ekranowe
+Name[pt]=Apresentações no Ecrã
+Name[pt_BR]=Apresentações na Tela
+Name[ru]=Экранные презентации
+Name[se]=Šearbmapresentašuvnnat
+Name[sk]=Prezentácie na monitore
+Name[sl]=Zaslonske predstavitve
+Name[sr]=Екранске презентације
+Name[sr@Latn]=Ekranske prezentacije
+Name[sv]=Skärmpresentationer
+Name[ta]=திரை முன்வைப்பு
+Name[tg]=Тақдимҳои Экран
+Name[tr]=Ekran Sunumları
+Name[uk]=Презентації на екрані
+Name[uz]=Ekranda namoyishlar
+Name[uz@cyrillic]=Экранда намойишлар
+Name[zh_CN]=屏幕幻灯片
+Name[zh_TW]=螢幕簡報
+X-KDE-DefaultTab=true
diff --git a/kpresenter/templates/Screenpresentations/BlueBreezeDouble.desktop b/kpresenter/templates/Screenpresentations/BlueBreezeDouble.desktop
new file mode 100644
index 000000000..24e5e8e96
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/BlueBreezeDouble.desktop
@@ -0,0 +1,90 @@
+[Desktop Entry]
+Icon=template_bluebreezedouble
+Name=Blue Breeze Double
+Name[af]=Blou Brisie Dubbel
+Name[ar]=نسيم أزرق مُزدوج
+Name[bg]=Двоен син бриз
+Name[ca]=Blau brisa doble
+Name[cy]=Awel Las Dwbl
+Name[de]=Blaue Brise: Doppel
+Name[el]=Διπλό Blue Breeze
+Name[eo]=Blua venteto -duobla
+Name[es]=Brisa azul doble
+Name[et]=Blue Breeze topelt
+Name[eu]=Haizetxo urdina, bikoitza
+Name[fr]=Brise bleue, double
+Name[gl]=Brisa Azul Coluna Dupla
+Name[he]=כחול כפול
+Name[hr]=Plavi povjetarac, dvostruko
+Name[hu]=Kék árnyalatok, dupla
+Name[is]=Tvöfaldur blár blær
+Name[it]=Brezza blu doppio
+Name[ja]=ブルーブリーズ ダブル
+Name[km]=រងើក​ភ្លើង​ទ្វេរ​ដង
+Name[lo]=ສີຟ້າອ່ອນແບບຄູ່
+Name[lt]=Blue Breeze dvigubas
+Name[lv]=Zilā dubult brīze
+Name[nb]=Dobbel blå bris
+Name[nds]=Blaag Bries, dubbelt
+Name[ne]=नीलो डबल अंगार
+Name[nn]=Blå bris dobbel
+Name[pl]=Podwójna niebieska bryza
+Name[pt]=Brisa Azul Duplo
+Name[pt_BR]=Brisa Azul Dupla
+Name[ro]=Albastru de ardezie dublu
+Name[ru]=Синева (две колонки)
+Name[se]=Alit hiebma duppal
+Name[sl]=Dvojni Blue Breeze
+Name[sr]=Плави поветарац, двоструки
+Name[sr@Latn]=Plavi povetarac, dvostruki
+Name[sv]=Dubbel Blå bris
+Name[tg]=Насими Баҳри Кабуди Дутагӣ
+Name[th]=สีฟ้าอ่อนแบบคู่
+Name[tr]=Mavi Esinti İkili
+Name[uk]=Подвійний океанський бриз
+Name[ven]=Hu dala ha muya muvhe hu vhili
+Name[xh]=Uphinda-phindo lwe Blue Breeze
+Name[zh_CN]=淡淡忧郁 Ⅱ
+Name[zh_TW]=雙頁藍色和風
+Name[zu]=Uphindo kabili lomoya oluhlaza (okwesibhaka-bhaka)
+Comment=A peaceful presentation with a title and two text columns
+Comment[bg]=Семпла презентация със заглавие и две текстови колони
+Comment[ca]=Una presentació plàcida amb un títol i dues columnes de text
+Comment[cy]=Cyflwyniad heddychlon efo teitl a dwy golofn destun
+Comment[da]=En fredfyldt præsentation med en overskrift og to tekstsøjler
+Comment[de]=Eine ruhige Präsentation mit Titel und zwei Textspalten
+Comment[el]=Μια ήρεμη παρουσίαση με τίτλο και δύο στήλες κειμένου
+Comment[es]=Una presentación tranquila con un título y dos columnas de texto
+Comment[et]=Lihtne esitlus pealkirja ja kahe tekstiveeruga
+Comment[fa]=ارائه‌ای آرام با یک عنوان و دو ستون متن
+Comment[fi]=Rauhallinen esitys, joka käyttää otsikkoa ja kahta tekstipalstaa
+Comment[fr]=Une présentation apaisée avec un titre et deux colonnes de texte
+Comment[fy]=In rêstige presintaasje mei in titel en twa tekstkolommen
+Comment[gl]=Unha presentación cun título e duas colunas de texto
+Comment[he]=מצגת שלווה עם כותרת ושתי עמודות
+Comment[hu]=Békés hangulatú bemutató címmel és két oszloppal
+Comment[is]=Einföld kynning með titil og tvo textadálka
+Comment[it]=Una presentazione rilassante con un titolo e due colonne
+Comment[ja]=タイトルとふたつのテキスト欄で構成するおとなしいプレゼンテーション
+Comment[km]=ការ​បង្ហាញ​ស្ងប់ស្ងាត់​ដែល​មាន​ចំណង​ជើង និង​ជួរ​ឈរ​អត្ថបទ​ពីរ
+Comment[lv]=Mierīga prezentācija ar nosaukumu un divām teksta kolonnām
+Comment[nb]=En fredelig presentasjon med en tittel og to tekstspalter
+Comment[nds]=En sinnig Presentatschoon mit en Titel un twee Textstriepen
+Comment[ne]=शीर्षक र दुई वटा पाठ स्तम्भहरूसँग शान्त प्रस्तुतिकरण
+Comment[nl]=Een rustige presentatie met een titel en twee tekstkolommen
+Comment[pl]=Spokojna prezentacja z tytułem oraz dwoma kolumnami na tekst
+Comment[pt]=Uma apresentação pacífica com um título e duas colunas de texto
+Comment[pt_BR]=Uma inofensiva apresentação com um título e duas colunas de texto
+Comment[ru]=Презентация в синих тонах с двумя столбцами
+Comment[se]=Ráfálaš presentašuvnnat mas lea namahus ja guokte teakstabálstta
+Comment[sk]=Prezentácia s titulkou a textom v dvoch stĺpcoch
+Comment[sl]=Spokojna predstavitev z naslovom in dvema stolpcema besedila
+Comment[sr]=Умирујућа презентација са насловном и две текстуалне колоне
+Comment[sr@Latn]=Umirujuća prezentacija sa naslovnom i dve tekstualne kolone
+Comment[sv]=En fridfull presentation med en rubrik och två textkolumner
+Comment[uk]=Презентація зі заголовком і двома стовпчиками тексу
+Comment[zh_CN]=带有一个标题和两个文本框的演示文稿
+Comment[zh_TW]=具標題及兩欄文字的和平展示
+Type=Link
+URL=.source/BlueBreezeDouble.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/Screenpresentations/BlueBreezeDouble.kpt b/kpresenter/templates/Screenpresentations/BlueBreezeDouble.kpt
new file mode 100644
index 000000000..29c0343ee
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/BlueBreezeDouble.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/BlueBreezePicture.desktop b/kpresenter/templates/Screenpresentations/BlueBreezePicture.desktop
new file mode 100644
index 000000000..c9c1c361b
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/BlueBreezePicture.desktop
@@ -0,0 +1,92 @@
+[Desktop Entry]
+Icon=template_bluebreezepicture
+Name=Blue Breeze Picture
+Name[af]=Blou Brisie Prent
+Name[ar]=صورة نسيم أزرق
+Name[bg]=Картина на син бриз
+Name[ca]=Blau brisa amb imatge
+Name[cy]=Llun Awel Las
+Name[da]=Blue Breeze-billede
+Name[de]=Blaue Brise: mit Bild
+Name[el]=Εικόνα Blue Breeze
+Name[eo]=Blua venteto - bildo
+Name[es]=Imagen de brisa azul
+Name[et]=Blue Breeze pildiga
+Name[eu]=Haizetxu urdinaren irudia
+Name[fa]=عکس Blue Breeze
+Name[fr]=Brise bleue, image
+Name[gl]=Brisa Azul con Imaxe
+Name[he]=כחול עם תמונה
+Name[hr]=Plavi povjetarac, slika
+Name[hu]=Kék árnyalatok, kép
+Name[is]=Mynda blár blær
+Name[it]=Brezza blu immagine
+Name[ja]=ブルーブリーズ ピクチャー
+Name[km]=រូបភាព​ពណ៌ខៀវ​
+Name[lo]=ພາບສີຟ້າອ່ອນ
+Name[lt]=Blue Breeze paveiksliukas
+Name[lv]=Zilās brīzes bilde
+Name[nb]=«Blå bris»-bilde
+Name[nds]=Blaag Bries, Bild
+Name[ne]=नीलो अंगार तस्वीर
+Name[nn]=Blå bris-bilete
+Name[pl]=Niebieska bryza z obrazkiem
+Name[pt]=Imagem Brisa Azul
+Name[pt_BR]=Figura da Brisa Azul
+Name[ro]=Imagine albastru de ardezie
+Name[ru]=Синева (рисунок)
+Name[se]=Alit hiebma-govva
+Name[sl]=Slika Blue Breeze
+Name[sr]=Слика са плавим поветарацем
+Name[sr@Latn]=Slika sa plavim povetaracem
+Name[sv]=Blå bris bild
+Name[tg]=Тасвири Насими Баҳри Кабуд
+Name[th]=ภาพสีฟ้าอ่อน
+Name[tr]=Mavi Esinti Resim
+Name[uk]=Зображення океанського бризу
+Name[ven]=Hu dala ha muya muvhe wa tshifanyiso
+Name[xh]=Umfanekiso we Blue Breeze
+Name[zh_CN]=淡淡忧郁 Ⅲ
+Name[zh_TW]=藍色和風圖片
+Name[zu]=Umfanekiso Womoya Oluhlaza (okwesibhaka-bhaka)
+Comment=A peaceful presentation with a title and picture area
+Comment[bg]=Семпла презентация със заглавие и място за снимки
+Comment[ca]=Una presentació plàcida amb un títol i una àrea de dibuix
+Comment[cy]=Cyflwyniad heddychlon efo teitl ac ardal llun
+Comment[da]=En fredfyldt præsentation med en overskrift og et billedområde
+Comment[de]=Eine ruhige Präsentation mit Titel und Bildbereich
+Comment[el]=Μια ήρεμη παρουσίαση με τίτλο και με περιοχή εικόνας
+Comment[es]=Una presentación tranquila con un título y un área de imagen
+Comment[et]=Lihtne esitlus pealkirja ja pildialaga
+Comment[fa]=ارائه‌ای آرام با یک عنوان و ناحیۀ عکس
+Comment[fi]=Rauhallinen esitys, joka käyttää otsikkoa ja kuva-aluetta
+Comment[fr]=Une présentation apaisée avec un titre et une image
+Comment[fy]=In rêstige presintaasje mei in titel en romte foar in ôfbylding
+Comment[gl]=Unha presentación cun título e unha área para imaxe
+Comment[he]=מצגת שלווה עם כותרת ואיזור לתמונה
+Comment[hu]=Békés hangulatú bemutató címmel és egy nagy szöveges területtel
+Comment[is]=Einföld kynning með titli og myndasvæði
+Comment[it]=Una presentazione rilassante con un titolo e un'area per immagini
+Comment[ja]=タイトルと画像領域で構成するおとなしいプレゼンテーション
+Comment[km]=ការ​បង្ហាញ​ចំណង​ជើង​និង​តំបន់​រូបភាព​
+Comment[lv]=Mierīga prezentācija ar nosaukumu un bildes apgabalu
+Comment[nb]=En fredelig presentasjon med en tittel og et bildefelt
+Comment[nds]=En sinnig Presentatschoon mit Titel un Bildrebeet
+Comment[ne]=शीर्षक र चित्र क्षेत्रसँग शान्त प्रस्तुतिकरण
+Comment[nl]=Een rustige presentatie met een titel en ruimte voor een afbeelding
+Comment[pl]=Spokojna prezentacja z tytułem i miejscem na obrazek
+Comment[pt]=Uma apresentação pacífica com um título e uma área de imagem
+Comment[pt_BR]=Uma inofensiva apresentação com um título e uma área de imagem
+Comment[ru]=Презентация в синих тонах с областью рисунка
+Comment[se]=Ráfálaš presentašuvnnat mas lea namahus ja govvagieddi
+Comment[sk]=Prezentácia s titulkou a obrázkom
+Comment[sl]=Spokojna predstavitev z naslovom in območjem za sliko
+Comment[sr]=Умирујућа презентација са насловом и подручјем за слику
+Comment[sr@Latn]=Umirujuća prezentacija sa naslovom i područjem za sliku
+Comment[sv]=En fridfull presentation med en rubrik och bildområde
+Comment[uk]=Презентація з заголовком і ділянкою для зображення
+Comment[zh_CN]=带有一个标题和一个图片区域的演示文稿
+Comment[zh_TW]=具標題及圖片區域的和平展示
+Type=Link
+URL=.source/BlueBreezePicture.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/Screenpresentations/BlueBreezePicture.kpt b/kpresenter/templates/Screenpresentations/BlueBreezePicture.kpt
new file mode 100644
index 000000000..ebc03a66b
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/BlueBreezePicture.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/BlueBreezeSingle.desktop b/kpresenter/templates/Screenpresentations/BlueBreezeSingle.desktop
new file mode 100644
index 000000000..5ce22e5de
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/BlueBreezeSingle.desktop
@@ -0,0 +1,90 @@
+[Desktop Entry]
+Icon=template_bluebreezesingle
+Name=Blue Breeze Single
+Name[af]=Blou Brisie Enkel
+Name[ar]=نسيم أزرق مُفرد
+Name[bg]=Единичен син бриз
+Name[ca]=Blau brisa
+Name[cy]=Awel Las Sengl
+Name[de]=Blaue Brise: Einfach
+Name[el]=Απλό Blue Breeze
+Name[eo]=Blua venteto - unuopa
+Name[es]=Brisa azul simple
+Name[et]=Blue Breeze üksik
+Name[eu]=Haizetxo urdina, sinplea
+Name[fr]=Brise bleue, simple
+Name[gl]=Brisa Azul Coluna Única
+Name[he]=כחול בודד
+Name[hr]=Plavi povjetarac, jednostruko
+Name[hu]=Kék árnyalatok, egyszeres
+Name[is]=Einfaldur blár blær
+Name[it]=Brezza blu singolo
+Name[ja]=ブルーブリーズ シングル
+Name[km]=ពណ៌ខៀវ​តែ​មួយ​
+Name[lo]=ສີຟ້າອ່ອນແບບດ່ຽວ
+Name[lt]=Blue Breeze viengubas
+Name[lv]=Viena zilā brīze
+Name[nb]=Enkel blå bris
+Name[nds]=Blaag Bries, eenfach
+Name[ne]=नीलो एक्लो अंगार
+Name[nn]=Blå bris enkel
+Name[pl]=Pojedyncza niebieska bryza
+Name[pt]=Brisa Azul Simples
+Name[pt_BR]=Brisa Azul Simples
+Name[ro]=Albastru de ardezie simplu
+Name[ru]=Синева (одна колонка)
+Name[se]=Alit hiebma
+Name[sl]=Enojni Blue Breeze
+Name[sr]=Плави поветарац, једноструки
+Name[sr@Latn]=Plavi povetarac, jednostruki
+Name[sv]=Enkel Blå bris
+Name[tg]=Насими Баҳри Кабуди Ягона
+Name[th]=สีฟ้าอ่อนแบบเดี่ยว
+Name[tr]=Mavi Esinti Tekli
+Name[uk]=Простий океанський бриз
+Name[ven]=Hu dala hu thihi
+Name[xh]=Blue Breeze Eyodwa
+Name[zh_CN]=淡淡忧郁 Ⅰ
+Name[zh_TW]=單頁藍色和風
+Name[zu]=Owodwa Umoya Oluhlaza (okwesibhaka-bhaka)
+Comment=A peaceful presentation with a title and single large text area
+Comment[bg]=Семпла презентация със заглавие и място за текст с едър шрифт
+Comment[ca]=Una presentació plàcida amb un títol i una gran àrea de text
+Comment[cy]=Cyflwyniad heddychlon efo teitl ac ardal testun mawr sengl
+Comment[da]=En fredfyldt præsentation med en overskrift og et enkelt stort tekstområde
+Comment[de]=Eine ruhige Präsentation mit Titel und einem einzelnen, großen Textbereich
+Comment[el]=Μια ήρεμη παρουσίαση με τίτλο και μια μεγάλη περιοχή κειμένου
+Comment[es]=Una presentación tranquila con un título y una gran área de texto
+Comment[et]=Lihtne esitlus pealkirja ja ühe suure tekstialaga
+Comment[fa]=ارائه‌ای آرام با یک عنوان و تک‌متن بزرگ
+Comment[fi]=Rauhallinen esitys, joka käyttää otsikkoa ja yhtä suurta tekstikenttää
+Comment[fr]=Une présentation apaisée avec un titre et un seul grand texte
+Comment[fy]=In rêstige presintaasje mei in title en genôch romte foar tekst
+Comment[gl]=Unha presentación cun título e unha única área de texto grande
+Comment[he]=מצגת שלווה עם כותרת ואיזור גדול לתמונה
+Comment[hu]=Békés hangulatú bemutató címmel és egy nagy szövege
+Comment[is]=Einföld kynning með titil og eitt stórt textasvæði
+Comment[it]=Una presentazione rilassante con un titolo e una sola grande area di testo
+Comment[ja]=タイトルとひとつの大きなテキスト欄で構成するおとなしいプレゼンテーション
+Comment[km]=ការបង្ហាញ​មា​ន​ចំណង​ជើង​និង​អត្ថបទ​​ធំ​តែ​មួយ​គត់​
+Comment[lv]=Mierīga prezentācija ar virsrakstu un vienu lielu teksta apgabalu
+Comment[nb]=En fredelig presentasjon med en tittel og ett stort tekstområde
+Comment[nds]=En sinnig Presentatschoon mit Titel un en groot Textrebeet
+Comment[ne]=शीर्षक र एक्लो लामो पाठ क्षेत्रसँग शान्त प्रस्तुतिकरण
+Comment[nl]=Een rustige presentatie met een titel en veel ruimte voor tekst
+Comment[pl]=Spokojna prezentacja z tytułem oraz kolumną na tekst
+Comment[pt]=Uma apresentação pacífica com um título e uma única área de texto grande
+Comment[pt_BR]=Uma inofensiva apresentação com um título e uma única área de texto grande
+Comment[ru]=Презентация в синих тонах с одним столбцом
+Comment[se]=Ráfálaš presentašuvnna mas lea namahus ja stuorra teakstagieddi
+Comment[sk]=Prezentácia s titulkou a jednou textovou oblasťou
+Comment[sl]=Spokojna predstavitev z naslovom in enim samim velikim območjem besedila
+Comment[sr]=Умирујућа презентација са насловом и једним великим подручјем за текст
+Comment[sr@Latn]=Umirujuća prezentacija sa naslovom i jednim velikim područjem za tekst
+Comment[sv]=En fridfull presentation med en rubrik och ett enda stort textområde
+Comment[uk]=Презентація з заголовком і великою ділянкою для тексту
+Comment[zh_CN]=带有一个标题和单个大文本框的演示文稿
+Comment[zh_TW]=具標題及一個大型文字區域的和平展示
+Type=Link
+URL=.source/BlueBreezeSingle.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/Screenpresentations/BlueBreezeSingle.kpt b/kpresenter/templates/Screenpresentations/BlueBreezeSingle.kpt
new file mode 100644
index 000000000..e8f858b38
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/BlueBreezeSingle.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/CopperPlain.desktop b/kpresenter/templates/Screenpresentations/CopperPlain.desktop
new file mode 100644
index 000000000..9c20a71a1
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/CopperPlain.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Icon=template_copperplain
+Name=Copper Plain
+Name[af]=Koper Eenvoudig
+Name[ar]=خام النُّحاس
+Name[bg]=Медно жълто
+Name[br]=Kouevr kriz
+Name[ca]=Coure senzill
+Name[cs]=Měděná
+Name[cy]=Copr Plaen
+Name[de]=Kupfer
+Name[el]=Απλό χάλκινο
+Name[es]=Cobre sencillo
+Name[eu]=Kupre arrunta
+Name[fi]=Pelkistetty kupari
+Name[fr]=Cuivre brut
+Name[gl]=Cobre Simples
+Name[he]=נחושת רגיל
+Name[hr]=Bakar, čisto
+Name[hu]=Egyszerű, rézszínű
+Name[is]=Einfaldur kopar
+Name[it]=Rame semplice
+Name[ja]=カッパープレーン
+Name[km]= ទង់ដែង​ធម្មតា​
+Name[lv]=Tīrs varš
+Name[mt]=Ram sempliċi
+Name[nb]=Vanlig kobber
+Name[nds]=Kopper eenfach
+Name[ne]=सादा तामा
+Name[nn]=Vanleg kopar
+Name[pl]=Zwykła miedź
+Name[pt]=Cobre Simples
+Name[pt_BR]=Cobre
+Name[ro]=Cupru simplu
+Name[ru]=Сахара
+Name[se]=Čabu veaiki
+Name[sl]=Navaden bakreni
+Name[sr]=Обично бакарна
+Name[sr@Latn]=Obično bakarna
+Name[sv]=Vanlig koppar
+Name[ta]=வெற்று செம்பு
+Name[tg]=Якрангаи Мисдор
+Name[tr]=Düz Bakır
+Name[uk]=Мідна проста
+Name[wa]=Keuve
+Name[zh_CN]=金色年华
+Name[zh_TW]=單銅色
+Comment=An elegant, uplifting presentation
+Comment[bg]=Елегантна, раздвижена презентация
+Comment[ca]=Una presentació elegant i inspiradora
+Comment[cy]=Cyflwyniad cain dycrhafol
+Comment[da]=En elegant, opløftende præsentation
+Comment[de]=Eine elegante, erhebende Präsentation
+Comment[el]=Μια κομψή, δυναμική παρουσίαση
+Comment[es]=Una presentación elegante y edificante
+Comment[et]=Elegantne esitlus
+Comment[fa]=ارائه‌ای زیبا و نشاط‌آور
+Comment[fi]=OASIS OpenDocument -esitys
+Comment[fr]=Une présentation élégante et joyeuse
+Comment[fy]=In elegante en Ferheffende presintaasje
+Comment[gl]=Unha presentación elegante
+Comment[hu]=Elegáns, felemelő bemutató
+Comment[is]=Fín kynning
+Comment[it]=Una presentazione elegante e incoraggiante
+Comment[km]=ការបង្ហាញ​លើក​ឡើង​យ៉ាងស្រស់ស្អាត
+Comment[lv]=Eleganta, pacilājoša prezentācija
+Comment[nb]=En elegant, stimulerende presentasjon
+Comment[nds]=En smuck, kommodig Presentatschoon
+Comment[ne]=मनोहर; प्रस्तुतिकरण उत्थान गर्दै
+Comment[nl]=Een elegante en verheffende presentatie
+Comment[pl]=Elegancka, dostojna prezentacja
+Comment[pt]=Uma apresentação elegante e positiva
+Comment[pt_BR]=Uma apresentação elegante e positiva
+Comment[ru]=Элегантная презентация в жёлтых тонах
+Comment[sk]=Elegantná prezentácia
+Comment[sl]=Elegantna, spodbudna predstavitev
+Comment[sr]=Елегантна, оптимистичка презентација
+Comment[sr@Latn]=Elegantna, optimistička prezentacija
+Comment[sv]=En elegant, upplyftande presentation
+Comment[uk]=Елегентна, надихаюча презентація
+Comment[zh_CN]=颇显豪华的演示文稿主题
+Comment[zh_TW]=優雅、提升的展示
+Type=Link
+URL=.source/CopperPlain.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/Screenpresentations/CopperPlain.kpt b/kpresenter/templates/Screenpresentations/CopperPlain.kpt
new file mode 100644
index 000000000..784d6a98f
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/CopperPlain.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/GradientBlueRed.desktop b/kpresenter/templates/Screenpresentations/GradientBlueRed.desktop
new file mode 100644
index 000000000..a49c0b717
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/GradientBlueRed.desktop
@@ -0,0 +1,101 @@
+[Desktop Entry]
+Type=Link
+URL=.source/GradientBlueRed.kpt
+Name=Gradient Blue-Red
+Name[af]=Gradiënt Blou-rooi
+Name[ar]=تدرُّج أزرق-أحمر
+Name[az]=Göy-Qırmızı Keçiş
+Name[bg]=Преливащо синьо-червено
+Name[br]=Kemmesk glas-ruz
+Name[ca]=Degradat blau-roig
+Name[cs]=Přechod modrá-červená
+Name[cy]=Graddliw Glas-goch
+Name[da]=Overgang blå-rød
+Name[de]=Farbverlauf von Blau nach Rot
+Name[el]=Μπλε-κόκκινο με διαβαθμίσεις
+Name[eo]=Transiro blua-ruĝa
+Name[es]=Degradado azul-rojo
+Name[et]=Sinine/punane gradient
+Name[eu]=Urdin-gorri gradientea
+Name[fa]=گرادیان آبی-قرمز
+Name[fi]=Liukuväri Sininen-Punainen
+Name[fr]=Dégradé bleu-rouge
+Name[gl]=Gradiente Azul-Vermello
+Name[he]=עירוב צבעים כחול־אדום
+Name[hr]=Prijelaz plavo-crveno
+Name[hu]=Kék-piros színátmenet
+Name[id]=Gradien Biru-Merah
+Name[is]=Litblönduð blá-rauð
+Name[it]=Sfumatura rossoblù
+Name[ja]=青と赤の濃淡
+Name[km]= ជម្រាល​ពណ៌​ខៀវ - ក្រហម​
+Name[lo]= ໄລ່ເສດສີນຳ້ເງິນ-ແດງ
+Name[lt]=Perėjimas Mėlyna-Raudona
+Name[lv]=Zili-sarkans gradients
+Name[mk]=Градиент: сино-црвено
+Name[mt]=Gradjent Blù-Aħmar
+Name[nb]=Overgang mellom blå og rød
+Name[nds]=Klöörövergang vun Blaag na Root
+Name[ne]=ग्रेडियन्ट नीलो-रातो
+Name[nl]=Blauw-rode kleurverloop
+Name[nn]=Overgang blå-raud
+Name[pl]=Niebiesko-czerwony gradient
+Name[pt]=Gradiente Azul-Vermelho
+Name[pt_BR]=Gradiente Azul-Vermelho
+Name[ro]=Degrade albastru-roşu
+Name[ru]=Закат
+Name[se]=Alit-rukses ivdnerievdadeapmi
+Name[sk]=Modro-červený gradient
+Name[sl]=Modro-rdeči preliv
+Name[sr]=Прелаз црвена-плава
+Name[sr@Latn]=Prelaz crvena-plava
+Name[sv]=Toning blå-röd
+Name[tg]=Градиенти Кабуд-Сурх
+Name[th]=ไล่เฉดสี น้ำเงิน-แดง
+Name[tr]=Kademeli Mavi-Kırmızı
+Name[uk]=Градієнт синій-червоний
+Name[ven]=Hu dala hu tswuku
+Name[wa]=Gradyint bleu-rodje
+Name[xh]=Ithambeka le Blue-Red
+Name[zh_CN]=蓝红渐变
+Name[zh_TW]=漸層 藍-紅
+Name[zu]=Ithambile ngendlela eliluhlaza-bomvu (okwesibhaka-bhaka)
+Comment=A presentation themed for the evening sky
+Comment[bg]=Презентация с тема вечерно небе
+Comment[ca]=Una presentació inspirada en el cel del vespre
+Comment[cy]=Cyflwyniad efo thema awyr y machlud
+Comment[da]=En præsentation med temaet aftenhimmel
+Comment[de]=Eine Präsentation gestaltet für den Abendhimmel
+Comment[el]=Μια παρουσίαση με χρωματικό θέμα τον απογευματινό ουρανό
+Comment[es]=Una presentación cuyo tema es una tarde con nieve
+Comment[et]=Õhtutaeva teemaga esitlus
+Comment[fa]=ارائه‌ای تم‌شده برای آسمان عصر
+Comment[fi]=Iltataivaan mukaan suunniteltu esitys
+Comment[fr]=Une présentation pour le crépuscule
+Comment[fy]=In presintaasje mei as tema in jûnshimel
+Comment[gl]=Unha presentación con cores de solpor
+Comment[he]=מצגת עם ערכת נושא לשמי הערב
+Comment[hu]=Bemutató az esti ég témájával
+Comment[is]=Kynning með kvöldhimni
+Comment[it]=Una presentazione ispirata al cielo serale
+Comment[ja]=夕空のテーマによるプレゼンテーション
+Comment[km]=ការ​បង្ហាញ​ស្បែក​មេឃ​ពេល​ល្ងាច​
+Comment[lv]=Vakara debess stila prezentācija
+Comment[nb]=En presentasjon med kveldshimmelen som tema
+Comment[nds]=En Presentatschoon mit Avendhimmel-Muster
+Comment[ne]=बेलुकी आकाशका लागि प्रस्तुतिकरण विषयवस्तु
+Comment[nl]=Een presentatie met als thema een avondhemel
+Comment[pl]=Prezentacja inspirowana wieczornym niebem
+Comment[pt]=Uma apresentação com o tema do anoitecer
+Comment[pt_BR]=Uma apresentação com o tema do anoitecer
+Comment[ru]=Презентация в тонах заката
+Comment[se]=Presentašuvdna mas lea eahketruođđu fáddán
+Comment[sk]=Prezentácia s témou večernej oblohy
+Comment[sl]=Predstavitev, uglašena z večernim nebom
+Comment[sr]=Презентација са мотивом ноћног неба
+Comment[sr@Latn]=Prezentacija sa motivom noćnog neba
+Comment[sv]=En presentation med temat kvällshimmel
+Comment[uk]=Презентація за темою вечірнього неба
+Comment[zh_CN]=傍晚时分的演示文稿主题
+Comment[zh_TW]=以傍晚的天空為主題的展示
+Icon=template_gradientbluered
diff --git a/kpresenter/templates/Screenpresentations/GradientBlueRed.kpt b/kpresenter/templates/Screenpresentations/GradientBlueRed.kpt
new file mode 100644
index 000000000..1ad1111b4
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/GradientBlueRed.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/Makefile.am b/kpresenter/templates/Screenpresentations/Makefile.am
new file mode 100644
index 000000000..37a77e27b
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/Makefile.am
@@ -0,0 +1,18 @@
+
+template_DATA = .directory GradientBlueRed.desktop \
+ kde.desktop kde2.desktop kde3.desktop classroom.desktop savannah.desktop \
+ SnowyMountains.desktop TotallyNewProduct.desktop \
+ BlueBreezeDouble.desktop BlueBreezePicture.desktop BlueBreezeSingle.desktop CopperPlain.desktop
+
+templatedir = $(kde_datadir)/kpresenter/templates/Screenpresentations
+
+templatesrc_DATA = GradientBlueRed.kpt \
+ kde.kpt kde2.kpt kde3.kpt classroom.kpt savannah.kpt \
+ SnowyMountains.kpt TotallyNewProduct.kpt \
+ BlueBreezeDouble.kpt BlueBreezePicture.kpt BlueBreezeSingle.kpt \
+ CopperPlain.kpt
+
+templatesrcdir = $(kde_datadir)/kpresenter/templates/Screenpresentations/.source
+
+kpricondir = $(kde_datadir)/kpresenter/icons
+kpricon_ICON = AUTO
diff --git a/kpresenter/templates/Screenpresentations/SnowyMountains.desktop b/kpresenter/templates/Screenpresentations/SnowyMountains.desktop
new file mode 100644
index 000000000..2efd444df
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/SnowyMountains.desktop
@@ -0,0 +1,100 @@
+[Desktop Entry]
+Icon=template_snowymountains
+Name=Snowy Mountains
+Name[af]=Sneeu bedekte Berge
+Name[ar]=جبال ثلجيّة
+Name[az]=Qarlı Dağlar
+Name[bg]=Снежни планини
+Name[ca]=Muntanyes nevades
+Name[cs]=Zasněžené hory
+Name[cy]=Mynyddoedd Eira
+Name[da]=Snetildækkede bjerge
+Name[de]=Verschneite Berge
+Name[el]=Χιονισμένα βουνά
+Name[eo]=Neĝaj montoj
+Name[es]=Montañas nevadas
+Name[et]=Lumised mäed
+Name[eu]=Mendi elurreztatuak
+Name[fa]=کوه‌های برفی
+Name[fi]=Lumiset vuoret
+Name[fo]=Fjøll við kavi
+Name[fr]=Montagnes enneigées
+Name[gl]=Montañas Nevadas
+Name[he]=פסגות מושלגות
+Name[hr]=Snježne planine
+Name[hu]=Hófödte csúcsok
+Name[is]=Snjófjöll
+Name[it]=Montagne nevose
+Name[ja]=雪山
+Name[km]=ភ្នំ​ព្រិល​ទឹកកក
+Name[lo]=ພູເຂົາຫິມະ
+Name[lt]=Snieguoti kalnai
+Name[lv]=Sniegotie kalni
+Name[mt]=Muntanji Bis-Silġ
+Name[nb]=Snødekte fjell
+Name[nds]=Bargen mit Snee
+Name[ne]=हिउँ भएको हिमालयहरू
+Name[nl]=Besneeuwde bergen
+Name[nn]=Snødekte fjell
+Name[pl]=Zaśnieżone góry
+Name[pt]=Montanhas Nevadas
+Name[pt_BR]=Montanhas de Neve
+Name[ro]=Munţi înzăpeziţi
+Name[ru]=Снежные горы
+Name[se]=Jahkas várit
+Name[sk]=Zasnežené hory
+Name[sl]=Zasnežene gore
+Name[sr]=Снежне планине
+Name[sr@Latn]=Snežne planine
+Name[sv]=Snöiga berg
+Name[tg]=Кӯҳҳои Барфи
+Name[th]=ภูเขาหิมะ
+Name[tr]=Karlı Dağlar
+Name[uk]=Засніжені гори
+Name[uz]=Qorli togʻlar
+Name[uz@cyrillic]=Қорли тоғлар
+Name[ven]=Thavha dza mahada
+Name[wa]=Montinnes enivêyes
+Name[xh]=Iintaba Ezinekhephu
+Name[zh_CN]=皑皑雪峰
+Name[zh_TW]=雪山
+Name[zu]=Izintaba Ezikhithikayo
+Comment=A cool and smooth presentation
+Comment[bg]=Супер презентация
+Comment[ca]=Una presentació fresca i suau
+Comment[cy]=Cyflwyniad cŵl llyfn
+Comment[da]=En smart og indsmigrende præsentation
+Comment[de]=Eine kalte und weiche Präsentation
+Comment[el]=Μια όμορφη και ομαλή παρουσίαση
+Comment[es]=Una presentación moderna y agradable
+Comment[et]=Külm ja karge esitlus
+Comment[fa]=ارائه‌ای آرام و ملایم
+Comment[fi]=Tyylikäs esitys
+Comment[fr]=Une présentation fraîche et plaisante
+Comment[fy]=In flitsende en strakke presintaasje
+Comment[gl]=Unha presentación novidosa e simples
+Comment[he]=מצגת מגניבה וחלקה
+Comment[hu]=Hideg, sima érzetű bemutató
+Comment[is]=Köld og einföld kynning
+Comment[it]=Una presentazione fresca e pulita
+Comment[km]=ការ​បង្ហាញ​ភាពស្រស់ស្អាត​ និង​ភាព​រលូន​
+Comment[lv]=Forša un gluda prezentācija
+Comment[nb]=En kjølig, rolig presentasjon
+Comment[nds]=Eine koolt un week Presentatschoon
+Comment[ne]=शीतल र महीन प्रस्तुतिकरण
+Comment[nl]=Een flitsende en strakke presentatie
+Comment[pl]=Chłodna i wysublimowana prezentacja
+Comment[pt]=Uma apresentação bonita e suave
+Comment[pt_BR]=Uma apresentação bonita e suave
+Comment[ru]=Презентация на фоне снежных гор
+Comment[sk]=Štýlová prezentácia
+Comment[sl]=Hladna in tekoča predstavitev
+Comment[sr]=Елегантна и глатка презентација
+Comment[sr@Latn]=Elegantna i glatka prezentacija
+Comment[sv]=En häftig och insmickrande presentation
+Comment[uk]=Класна і гладка презентація
+Comment[zh_CN]=绝酷的演示文稿
+Comment[zh_TW]=酷而柔順的展示
+Type=Link
+URL=.source/SnowyMountains.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/Screenpresentations/SnowyMountains.kpt b/kpresenter/templates/Screenpresentations/SnowyMountains.kpt
new file mode 100644
index 000000000..40e6b4a50
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/SnowyMountains.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/TotallyNewProduct.desktop b/kpresenter/templates/Screenpresentations/TotallyNewProduct.desktop
new file mode 100644
index 000000000..06353339e
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/TotallyNewProduct.desktop
@@ -0,0 +1,100 @@
+[Desktop Entry]
+Icon=template_totallynewproduct
+Name=Totally New Product
+Name[af]=Totaal Nuwe Produk
+Name[ar]=منتوج جديد تماماً
+Name[az]=Tamamilə Yeni Məshul
+Name[bg]=Съвсем нов продукт
+Name[bs]=Totalno novi produkt
+Name[ca]=Producte totalment nou
+Name[cs]=Zcela nový produkt
+Name[cy]=Cynnyrch Hollol Newydd
+Name[da]=Fuldstændig nyt produkt
+Name[de]=Völlig neues Produkt
+Name[el]=Εντελώς καινούριο προϊόν
+Name[eo]=Novega produkto
+Name[es]=Producto totalmente nuevo
+Name[et]=Täiesti uus toode
+Name[eu]=Produktu guztiz berria
+Name[fa]=محصول کاملأ جدید
+Name[fi]=Täysin uusi tuote
+Name[fr]=Produit totalement nouveau
+Name[fy]=Totaal nij produkt
+Name[gl]=Produto Totalmente Novo
+Name[he]=מוצר חדיש
+Name[hi]=पूरी तरह नया उत्पाद
+Name[hr]=Potpuno novi proizvod
+Name[hu]=Vadonatúj termék
+Name[is]=Algerlega ný vara
+Name[it]=Prodotto completamente nuovo
+Name[ja]=新商品
+Name[km]=ផលិតផល​ថ្មី​ស្រឡាង
+Name[lo]=ຜລິດຕະພັນໃຫມ່ທັງຫມົດ
+Name[lt]=Visiškai naujas produktas
+Name[lv]=Pilnīgi jauns produkts
+Name[mt]=Prodott Totalment Ġdid
+Name[nb]=Helt nytt produkt
+Name[nds]=Heel nieg Produkt
+Name[ne]=सम्पूर्ण नयाँ उत्पादन
+Name[nl]=Totaal nieuw product
+Name[nn]=Heilt nytt produkt
+Name[pl]=Całkowicie nowy produkt
+Name[pt]=Produto Totalmente Novo
+Name[pt_BR]= Produto Totalmente Novo
+Name[ro]=Un produs total nou
+Name[ru]=Новый продукт
+Name[se]=Aibbas ođđa buvtta
+Name[sk]=Úplne nový produkt
+Name[sl]=Povsem nov izdelek
+Name[sr]=Потпуно нов производ
+Name[sr@Latn]=Potpuno nov proizvod
+Name[sv]=En fullständigt ny produkt
+Name[tg]=Маҳсули Нави Қатъӣ
+Name[th]=ผลิตภัณฑ์ใหม่ทั้งหมด
+Name[tr]=Yeni Bir Ürün
+Name[uk]=Повністю новий товар
+Name[uz]=Umuman yangi mahsulot
+Name[uz@cyrillic]=Умуман янги маҳсулот
+Name[ven]=Tshiitwa tshiswa
+Name[wa]=Prodût totafwaitmint novea
+Name[xh]=Imveliso Entsha Ngokupheleleyo
+Name[zh_CN]=全新产品
+Name[zh_TW]=新產品
+Name[zu]=Entsha sha Iprodakhti
+Comment=An informal, green-swirl presentation
+Comment[bg]=Информационна презентация в зелено
+Comment[ca]=Una presentació informal, remolí verd
+Comment[cy]=Cyflwyniad anffurfiol â throelliadau gwyrdd
+Comment[da]=En uformel, grøn hvirvlende præsentation
+Comment[de]=Eine ungezwungene, grün-wirbelnde Präsentation
+Comment[el]=Μια ανεπίσημη βασισμένη στο πράσινο παρουσίαση
+Comment[es]=Una presentación informal, con una espiral verde
+Comment[et]=Visandlik infoesitlus
+Comment[fa]=ارائه‌ای غیررسمی و green-swirl
+Comment[fi]=OASIS OpenDocument -esitys
+Comment[fr]=Un tourbillon vert, présentation informelle
+Comment[fy]=In ynformele, grienachtige presintaasje
+Comment[gl]=Unha presentación informal, cun remoíño verde
+Comment[hu]=Könnyed stílusú bemutató zöld színű örvényekkel
+Comment[is]=Óformleg kynning með grænum bylgjum
+Comment[it]=Una presentazione informale e coinvolgente
+Comment[km]=ការ​បង្ហាញ​កំនួច​ពណ៌​បៃតង​ធម្មតា​
+Comment[nb]=En uformell presentasjon med grønne hvirvler
+Comment[nds]=En dwangloos, gröön-küselig Presentatschoon
+Comment[ne]=एउटा अनौपचारिक, हरियो-घुमाउरो प्रस्तुतिकरण
+Comment[nl]=Een informele, groenachtige presentatie
+Comment[pl]=Nieformalna, zazieleniona prezentacja
+Comment[pt]=Uma apresentação informal com um remoinho verde
+Comment[pt_BR]=Uma apresentação informal com um remoinho verde
+Comment[ru]=Презентация нового продукта в тёмно-зелёных тонах
+Comment[sk]=Neformálna zelená prezentácia
+Comment[sl]=Neformalna, vrtinčasto zelena predstavitev
+Comment[sr]=Неформална презентација са зеленим вртлогом
+Comment[sr@Latn]=Neformalna prezentacija sa zelenim vrtlogom
+Comment[sv]=En informell, grön virvlande presentation
+Comment[uk]=Неформальна презентація в зелених тонах
+Comment[zh_CN]=适合信息量大的演示文稿
+Comment[zh_TW]=隨意、綠色旋渦的展示
+Type=Link
+URL=.source/TotallyNewProduct.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/Screenpresentations/TotallyNewProduct.kpt b/kpresenter/templates/Screenpresentations/TotallyNewProduct.kpt
new file mode 100644
index 000000000..1675ede0e
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/TotallyNewProduct.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/classroom.desktop b/kpresenter/templates/Screenpresentations/classroom.desktop
new file mode 100644
index 000000000..827a00a85
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/classroom.desktop
@@ -0,0 +1,78 @@
+[Desktop Entry]
+Icon=template_classroom
+Name=Classroom
+Name[bg]=Класна стая
+Name[ca]=Aula
+Name[de]=Klassenraum
+Name[el]=Σχολική τάξη
+Name[eo]=Klasĉambro
+Name[et]=Klassituba
+Name[fa]=کلاس
+Name[fi]=Luokkahuone
+Name[fr]=Salle de classe
+Name[fy]=Skoalboerd
+Name[ga]=Seomra Ranga
+Name[gl]=Aula
+Name[he]=כיתה
+Name[hu]=Osztályterem
+Name[is]=Skólabekkur
+Name[it]=Classe
+Name[ja]=クラスルーム
+Name[km]=ថ្នាក់​រៀន​
+Name[nb]=Klasserom
+Name[nds]=Klassruum
+Name[ne]=कक्षाकोठा
+Name[nl]=Schoolbord
+Name[pl]=Klasa
+Name[pt]=Sala de Aulas
+Name[pt_BR]=Sala de Aula
+Name[ru]=Школа
+Name[se]=Luohkkálatnja
+Name[sk]=Učebňa
+Name[sl]=Učilnica
+Name[sr]=Учионица
+Name[sr@Latn]=Učionica
+Name[sv]=Klassrum
+Name[uk]=Клас
+Name[uz]=Sinf xonasi
+Name[uz@cyrillic]=Синф хонаси
+Name[zh_CN]=教室
+Name[zh_TW]=教室
+Comment=Classroom by dannya
+Comment[bg]=Класна стая на dannya
+Comment[ca]=Aula per dannya
+Comment[da]=Klasseværelse af dannya
+Comment[de]=Klassenraum von dannya
+Comment[el]=Παρουσίαση σχολικής τάξης από dannya
+Comment[eo]=Klasĉambro far dannya
+Comment[es]=Classroom por dannya
+Comment[et]='dannya' loodud klassituba
+Comment[fa]=کلاس با dannya
+Comment[fi]=Luokkahuone, tehnyt dannya
+Comment[fr]=Salle de classe, par Dannya
+Comment[fy]=Skoalboerd troch dannya
+Comment[gl]=Aula por dannya
+Comment[hu]=Osztályterem, készítette: dannya
+Comment[is]=Skólabekkur eftir dannya
+Comment[it]=Classe di dannya
+Comment[km]=ថ្នាក់រៀន​ដោយ​ dannya
+Comment[nb]=Klasserom, av dannya
+Comment[nds]=Klassruum vun dannya
+Comment[ne]=डान्याद्वारा कक्षाकोठा
+Comment[nl]=Schoolbord door dannya
+Comment[pl]=Prezentacja Klasa (autor: dannya)
+Comment[pt]=Sala de aula por dannya
+Comment[pt_BR]=Sala de Aula por dannya
+Comment[ru]=Презентация на фоне школьной доски
+Comment[se]=Luohkkálatnja maid dannya lea ráhkadan
+Comment[sk]=Učebňa - autor dannya
+Comment[sl]=Učilnica od Dannya
+Comment[sr]=Учионица од Данија
+Comment[sr@Latn]=Učionica od Danija
+Comment[sv]=Klassrum av dannya
+Comment[uk]=Клас (автор: dannya)
+Comment[zh_CN]=回味学生时代
+Comment[zh_TW]=dannya 的教室
+Type=Link
+URL=.source/classroom.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/Screenpresentations/classroom.kpt b/kpresenter/templates/Screenpresentations/classroom.kpt
new file mode 100644
index 000000000..88c2fed4c
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/classroom.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezedouble.png b/kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezedouble.png
new file mode 100644
index 000000000..1372c4969
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezedouble.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezepicture.png b/kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezepicture.png
new file mode 100644
index 000000000..3d0a62b0e
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezepicture.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezesingle.png b/kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezesingle.png
new file mode 100644
index 000000000..10e698ed6
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_bluebreezesingle.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_classroom.png b/kpresenter/templates/Screenpresentations/hi48-action-template_classroom.png
new file mode 100644
index 000000000..d9b60d3cb
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_classroom.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_copperplain.png b/kpresenter/templates/Screenpresentations/hi48-action-template_copperplain.png
new file mode 100644
index 000000000..7c0b6a36f
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_copperplain.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_gradientbluered.png b/kpresenter/templates/Screenpresentations/hi48-action-template_gradientbluered.png
new file mode 100644
index 000000000..78877a5ef
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_gradientbluered.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_kde.png b/kpresenter/templates/Screenpresentations/hi48-action-template_kde.png
new file mode 100644
index 000000000..08402592c
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_kde.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_kde2.png b/kpresenter/templates/Screenpresentations/hi48-action-template_kde2.png
new file mode 100644
index 000000000..df409db70
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_kde2.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_kde3.png b/kpresenter/templates/Screenpresentations/hi48-action-template_kde3.png
new file mode 100644
index 000000000..74103d042
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_kde3.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_savannah.png b/kpresenter/templates/Screenpresentations/hi48-action-template_savannah.png
new file mode 100644
index 000000000..a9ee2f7ed
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_savannah.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_screenplain.png b/kpresenter/templates/Screenpresentations/hi48-action-template_screenplain.png
new file mode 100644
index 000000000..7c86f17b6
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_screenplain.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_snowymountains.png b/kpresenter/templates/Screenpresentations/hi48-action-template_snowymountains.png
new file mode 100644
index 000000000..7fa677fc1
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_snowymountains.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/hi48-action-template_totallynewproduct.png b/kpresenter/templates/Screenpresentations/hi48-action-template_totallynewproduct.png
new file mode 100644
index 000000000..4a5db5901
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/hi48-action-template_totallynewproduct.png
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/kde.desktop b/kpresenter/templates/Screenpresentations/kde.desktop
new file mode 100644
index 000000000..6108324b9
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/kde.desktop
@@ -0,0 +1,45 @@
+[Desktop Entry]
+Type=Link
+URL=.source/kde.kpt
+Name=KDE
+Name[af]=Kde
+Name[hi]=केडीई
+Name[sk]=KDEComment=Prezentácia
+Comment=A presentation with original KDE theming
+Comment[bg]=Презентация с оригинални теми за KDE
+Comment[ca]=Una presentació amb el tema original de KDE
+Comment[cy]=Cyflwyniad efo thema KDE gwreiddiol
+Comment[da]=En præsentation med KDE-originaltema
+Comment[de]=Eine Präsentation im originalen KDE-Design
+Comment[el]=Μια παρουσίαση με το αρχικό θέμα του KDE
+Comment[es]=Una presentación con el tema original de KDE
+Comment[et]=KDE algupärase teemaga esitlus
+Comment[fa]=ارائه‌ای با چهرۀ اصلی KDE
+Comment[fi]=Esitys alkuperäisellä KDE-teemalla
+Comment[fr]=Une présentation avec un thème KDE original
+Comment[fy]=In presintaasje mei it orizjinele tema fan KDE
+Comment[gl]=Unha presentación cun estilo orixinal para KDE
+Comment[he]=מצגת עם ערכת נושא מקורית של KDE
+Comment[hu]=Bemutató eredeti, KDE-szerű stílusban
+Comment[is]=Kynning með upprunalegu KDE þema
+Comment[it]=Una presentazione con tema di KDE originale
+Comment[ja]=KDE オリジナルテーマによるプレゼンテーション
+Comment[km]=ការ​បង្ហាញ​ដែល​មាន​ស្បែក KDE ដើម
+Comment[nb]=En presentasjon med original KDE-drakt
+Comment[nds]=En Presentatschoon mit dat Orginaalmuster vun KDE
+Comment[ne]=मौलिक KDE विषयवस्तुसँग प्रस्तुतिकरण
+Comment[nl]=Een presentatie met het originele thema van KDE
+Comment[pl]=Prezentacja z oryginalnym motywem KDE
+Comment[pt]=Uma apresentação com o tema original do KDE
+Comment[pt_BR]=Uma apresentação com o tema original do KDE
+Comment[ru]=Презентация в стиле KDE 1
+Comment[se]=Presentašuvdna mas lea álgovuolggálaš KDE-fáddá
+Comment[sk]=Prezentácia s témou KDE
+Comment[sl]=Predstavitev s temo prvotnega KDE
+Comment[sr]=Презентација са првобитном темом KDE-а
+Comment[sr@Latn]=Prezentacija sa prvobitnom temom KDE-a
+Comment[sv]=En presentation med KDE-originaltema
+Comment[uk]=Презентація з оригінальною темою KDE
+Comment[zh_CN]=与 KDE 主题协调的演示文稿
+Comment[zh_TW]=原始 KDE 佈景主題展示
+Icon=template_kde
diff --git a/kpresenter/templates/Screenpresentations/kde.kpt b/kpresenter/templates/Screenpresentations/kde.kpt
new file mode 100644
index 000000000..1f56b3a5a
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/kde.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/kde2.desktop b/kpresenter/templates/Screenpresentations/kde2.desktop
new file mode 100644
index 000000000..4d9248c9d
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/kde2.desktop
@@ -0,0 +1,47 @@
+[Desktop Entry]
+Type=Link
+URL=.source/kde2.kpt
+Name=KDE 2
+Name[af]=Kde 2
+Name[hi]=केडीई 2
+Name[ne]=KDE २
+Comment=A presentation with KDE 2 theming
+Comment[bg]=Презентация с теми за KDE 2
+Comment[ca]=Una presentació amb el tema de KDE 2
+Comment[cy]=Cyflwyniad efo thema KDE 2
+Comment[da]=En præsentation med KDE 2 tema
+Comment[de]=Eine Präsentation im Design von KDE 2.
+Comment[el]=Μια παρουσίαση με χρωματικό θέμα το KDE 2
+Comment[es]=Una presentación con el tema de KDE 2
+Comment[et]=KDE 2 teemaga esitlus
+Comment[fa]=ارائه‌ای با چهرۀ KDE 2
+Comment[fi]=Esitys KDE 2 -teemalla
+Comment[fr]=Une présentation avec un thème KDE 2
+Comment[fy]=In presintaasje mei it tema fan KDE 2
+Comment[gl]=Unha presentación cun estilo KDE 2
+Comment[he]=מצגת עם ערכת נושא מקורית של KDE 2
+Comment[hu]=Bemutató KDE 2-szerű stílusban
+Comment[is]=Kynning með KDE 2 þema
+Comment[it]=Una presentazione con tema di KDE 2
+Comment[ja]=KDE 2 テーマによるプレゼンテーション
+Comment[km]=ការ​បង្ហាញ​ដែល​មាន​ស្បែក KDE 2
+Comment[nb]=En presentasjon med KDE2-drakt
+Comment[nds]=En Presentatschoon mit dat Orginaalmuster vun KDE 2
+Comment[ne]=KDE २ विषयवस्तु सँग प्रस्तुतिकरण
+Comment[nl]=Een presentatie met het thema van KDE 2
+Comment[pl]=Prezentacja z motywem z KDE 2
+Comment[pt]=Uma apresentação com o tema do KDE 2
+Comment[pt_BR]=Uma apresentação com o tema do KDE 2
+Comment[ru]=Презентация в стиле KDE 2
+Comment[se]=Presentašuvdna mas lea KDE2-fáddá
+Comment[sk]=Prezentácia s témou KDE 2
+Comment[sl]=Predstavitev s temo KDE 2
+Comment[sr]=Презентација са темом KDE-а 2
+Comment[sr@Latn]=Prezentacija sa temom KDE-a 2
+Comment[sv]=En presentation med KDE 2 tema
+Comment[uk]=Презентація з оригінальною темою KDE 2
+Comment[uz]=KDE 2 mavzulik namoyish
+Comment[uz@cyrillic]=KDE 2 мавзулик намойиш
+Comment[zh_CN]=带有 KDE 2 主题的演示文稿
+Comment[zh_TW]=KDE 2 佈景主題展示
+Icon=template_kde2
diff --git a/kpresenter/templates/Screenpresentations/kde2.kpt b/kpresenter/templates/Screenpresentations/kde2.kpt
new file mode 100644
index 000000000..7ba322f5a
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/kde2.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/kde3.desktop b/kpresenter/templates/Screenpresentations/kde3.desktop
new file mode 100644
index 000000000..ac29360fe
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/kde3.desktop
@@ -0,0 +1,45 @@
+[Desktop Entry]
+Type=Link
+URL=.source/kde3.kpt
+Name=KDE 3
+Name[ne]=KDE ३
+Comment=A presentation with KDE 3 theming
+Comment[bg]=Презентация с теми за KDE 3
+Comment[ca]=Una presentació amb el tema de KDE 3
+Comment[cy]=Cyflwyniad efo thema KDE 3
+Comment[da]=En præsentation med KDE 3 tema
+Comment[de]=Eine Präsentation im Design von KDE 3.
+Comment[el]=Μια παρουσίαση με χρωματικό θέμα το KDE 3
+Comment[es]=Una presentación con el tema de KDE 3
+Comment[et]=KDE 3 teemaga esitlus
+Comment[fa]=ارائه‌ای با چهرۀ KDE 3
+Comment[fi]=Esitys KDE 3 -teemalla
+Comment[fr]=Une présentation avec un thème KDE 3
+Comment[fy]=In presintaasje mei it tema fan KDE 3
+Comment[gl]=Unha presentación cun estilo KDE 3
+Comment[he]=מצגת עם ערכת נושא מקורית של KDE 3
+Comment[hu]=KDE 3-stílusú bemutató
+Comment[is]=Kynning með KDE 3 þema
+Comment[it]=Una presentazione con tema di KDE 3
+Comment[ja]=KDE 3 テーマによるプレゼンテーション
+Comment[km]=ការ​បង្ហាញ​ដែល​មាន​ស្បែក KDE 3
+Comment[nb]=En presentasjon med KDE3-drakt
+Comment[nds]=En Presentatschoon mit dat Orginaalmuster vun KDE 3
+Comment[ne]=KDE ३ विषयवस्तु सँग प्रस्तुतिकरण
+Comment[nl]=Een presentatie met het thema van KDE 3
+Comment[pl]=Prezentacja z motywem z KDE 3
+Comment[pt]=Uma apresentação com o tema do KDE 3
+Comment[pt_BR]=Uma apresentação com o tema do KDE 3
+Comment[ru]=Презентация в стиле KDE 3
+Comment[se]=Presentašuvdna mas lea KDE3-fáddá
+Comment[sk]=Prezentácia s témou KDE 3
+Comment[sl]=Predstavitev s temo KDE 3
+Comment[sr]=Презентација са темом KDE-а 3
+Comment[sr@Latn]=Prezentacija sa temom KDE-a 3
+Comment[sv]=En presentation med KDE 3 tema
+Comment[uk]=Презентація з оригінальною темою KDE 3
+Comment[uz]=KDE 3 mavzulik namoyish
+Comment[uz@cyrillic]=KDE 3 мавзулик намойиш
+Comment[zh_CN]=带有 KDE 3 主题的演示文稿
+Comment[zh_TW]=KDE 3 佈景主題展示
+Icon=template_kde3
diff --git a/kpresenter/templates/Screenpresentations/kde3.kpt b/kpresenter/templates/Screenpresentations/kde3.kpt
new file mode 100644
index 000000000..523144851
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/kde3.kpt
Binary files differ
diff --git a/kpresenter/templates/Screenpresentations/savannah.desktop b/kpresenter/templates/Screenpresentations/savannah.desktop
new file mode 100644
index 000000000..3888e9e47
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/savannah.desktop
@@ -0,0 +1,64 @@
+[Desktop Entry]
+Icon=template_savannah
+Name=Savannah
+Name[de]=Savanne
+Name[el]=Σαβάνα
+Name[fr]=Savane
+Name[fy]=Savanne
+Name[ga]=Sabhána
+Name[hu]=Szavanna
+Name[it]=Savana
+Name[ja]=サバンナ
+Name[lv]=Savanna
+Name[nds]=Savann
+Name[ne]=साभान्नाह
+Name[nl]=Savanne
+Name[pl]=Sawanna
+Name[pt]=Savana
+Name[pt_BR]=Savana
+Name[ru]=Саванна
+Name[sk]=Savana
+Name[sr]=Савана
+Name[sr@Latn]=Savana
+Name[sv]=Savann
+Name[uk]=Савана
+Name[uz]=Savanna
+Name[uz@cyrillic]=Саванна
+Name[zh_TW]=薩凡納
+Comment=Savannah by dannya
+Comment[bg]=Savannah на dannya
+Comment[br]=Savannah gant dannya
+Comment[ca]=Savannah per dannya
+Comment[da]=Savanna af dannya
+Comment[de]=Savanne von dannya
+Comment[el]=Σαβάνα από dannya
+Comment[eo]=Savannah far dannya
+Comment[es]=Savannah por dannya
+Comment[et]='dannya' loodud Savannah
+Comment[fr]=Savane par Dannya
+Comment[fy]=Savanne troch dannya
+Comment[ga]=Sabhána le dannya
+Comment[gl]=Savannah por dannya
+Comment[hu]=Szavanna (készítette: dannya)
+Comment[is]=Savannah eftir dannya
+Comment[it]=Savana di dannya
+Comment[km]=Savannah ដោយ dannya
+Comment[nb]=Savannah av dannya
+Comment[nds]=Savann vun dannya
+Comment[ne]=डान्याद्वारा साभान्नाह
+Comment[nl]=Savanne door dannya
+Comment[pl]=Prezentacja Sawanna (autor: dannya)
+Comment[pt]=Savana por dannya
+Comment[pt_BR]=Savana por dannya
+Comment[ru]=Презентация на фоне саванны
+Comment[se]=Savannah maid dannya lea ráhkadan
+Comment[sk]=Savana - autor dannya
+Comment[sl]=Savannah, avtorja dannya
+Comment[sr]=Савана од Данија
+Comment[sr@Latn]=Savana od Danija
+Comment[sv]=Savann av dannya
+Comment[uk]=Савана (автор: dannya)
+Comment[zh_TW]=dannya 的薩凡納
+Type=Link
+URL=.source/savannah.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/Screenpresentations/savannah.kpt b/kpresenter/templates/Screenpresentations/savannah.kpt
new file mode 100644
index 000000000..b9f3170fd
--- /dev/null
+++ b/kpresenter/templates/Screenpresentations/savannah.kpt
Binary files differ
diff --git a/kpresenter/templates/common_desktop/OneColumnLandscape.desktop b/kpresenter/templates/common_desktop/OneColumnLandscape.desktop
new file mode 100644
index 000000000..0d161b51c
--- /dev/null
+++ b/kpresenter/templates/common_desktop/OneColumnLandscape.desktop
@@ -0,0 +1,107 @@
+[Desktop Entry]
+Icon=template_onecolumnlandscape
+Name=One Column
+Name[af]=Een Kolom
+Name[ar]=عمود واحد
+Name[az]=Tək Sütun
+Name[bg]=Една колона
+Name[br]=Ur bann
+Name[bs]=Jedan stupac
+Name[ca]=Una columna
+Name[cs]=Jeden sloupec
+Name[cy]=Un Golofn
+Name[da]=Én søjle
+Name[de]=1-spaltig
+Name[el]=Μία στήλη
+Name[eo]=Unu kolumno
+Name[es]=Una columna
+Name[et]=Üks veerg
+Name[eu]=Zutabe bat
+Name[fa]=یک ستون
+Name[fi]=Yksi palsta
+Name[fo]=Ein teigur
+Name[fr]=Une colonne
+Name[fy]=Ien kolom
+Name[gl]=Unha Coluna
+Name[he]=טור אחד
+Name[hr]=Jedan stupac
+Name[hu]=Egyoszlopos
+Name[id]=Satu Kolom
+Name[is]=Einn dálkur
+Name[it]=Una colonna
+Name[ja]=1 列
+Name[km]=មួយជួរឈរ
+Name[lo]=ນື່ງແຖວ
+Name[lt]=Viename stulpelyje
+Name[lv]=Viena kolonna
+Name[mk]=Една колона
+Name[ms]=Satu Lajur
+Name[mt]=Kolonna Waħda
+Name[nb]=En spalte
+Name[nds]=Een Striep
+Name[ne]=एउटा स्तम्भ
+Name[nl]=Eén kolom, landschap
+Name[nn]=Ei spalte
+Name[pl]=Jedna kolumna
+Name[pt]=Uma Coluna
+Name[pt_BR]=Uma Coluna
+Name[ro]=O coloană
+Name[ru]=Одна колонка
+Name[se]=Okta bálstá
+Name[sk]=Jeden stĺpec
+Name[sl]=En stolpec
+Name[sr]=Једна колона
+Name[sr@Latn]=Jedna kolona
+Name[sv]=En kolumn
+Name[ta]=ஒரு நிரல்
+Name[tg]=Як Сутун
+Name[th]=หนึ่งคอลัมน์
+Name[tr]=Bir Sütun
+Name[uk]=Один стовпчик
+Name[uz]=Bitta ustun
+Name[uz@cyrillic]=Битта устун
+Name[ven]=Kholomo nthihi
+Name[wa]=Ene colone
+Name[xh]=Umhlathi Omnye
+Name[zh_CN]=单列
+Name[zh_TW]=單列
+Name[zu]=Ikholamu Eyodwa
+Comment=Presentation with a page title and single large text area
+Comment[bg]=Презентация със заглавие на страница и едно голямо текстово поле
+Comment[ca]=Presentació amb un títol de pàgina i una gran àrea de text
+Comment[cy]=Cyflwyniad efo teitl tudalen ac ardal testun mawr sengl
+Comment[da]=Præsentation med sideoverskrift og et enkelt stort tekstområde
+Comment[de]=Eine Präsentation mit Seitentitel und einem einzelnen, großen Textbereich
+Comment[el]=Παρουσίαση με τίτλο μίας σελίδας και μία μεγάλη περιοχή κειμένου
+Comment[es]=Presentación con un título de página y un área grande de texto
+Comment[et]=Esitlus lehekülje pealkirja ja ühe suure tekstialaga
+Comment[fa]=ارائه‌ای با یک عنوان صفحه و ناحیۀ متن بزرگ و تک
+Comment[fi]=Esitys, jossa otsikko ja yksi suuri tekstikenttä
+Comment[fr]=Présentation avec un titre de page et un seul grand texte
+Comment[fy]=Presintaasje mei in sidetitel en in grutte romte foar tekst
+Comment[gl]=Presentación con título de páxina e unha única área de texto grande
+Comment[he]=מצגת עם כותרת עמוד ואיזור גדול לטקסט
+Comment[hu]=Bemutató címoldallal és egy nagyobb szövegterülettel
+Comment[is]=Kynning með síðutitli og einu stóru textasvæði
+Comment[it]=Presentazione con titolo della pagina e una sola grande area di testo
+Comment[ja]=ページタイトルと一つの大きなテキスト欄で構成するプレゼンテーション
+Comment[km]=ការ​បង្ហាញ​មាន​ចំណង​ជើង​ទំព័រ និង​ផ្ទៃ​អត្ថបទ​ធំ​តែ​មួយ
+Comment[nb]=Presentasjon med en sidetittel og ett stort tekstfelt
+Comment[nds]=Presentatschoon mit Siedentitel un en groot Textrebeet
+Comment[ne]=पृष्ठ शीर्षक र एक्लो लामो पाठ क्षेत्र सँगको प्रस्तुतिकरण
+Comment[nl]=Presentatie met een paginatitel en een grote ruimte voor tekst
+Comment[pl]=Prezentacja z tytułem strony oraz dużym miejscem na tekst
+Comment[pt]=Uma apresentação com um título e uma área de texto grande
+Comment[pt_BR]=Uma apresentação com um título e uma área de texto grande
+Comment[ru]=Презентация с заголовком и большой областью для текста
+Comment[se]=Presentašuvdna mas lea siidonamahus ja stuorra teakstagieddi
+Comment[sk]=Prezentácia s titulkou a jednou veľkou textovou oblasťou
+Comment[sl]=Predstavitev z naslovom strani in enim samim velikim območjem besedila
+Comment[sr]=Презентација са насловом стране и једним великим подручјем за текст
+Comment[sr@Latn]=Prezentacija sa naslovom strane i jednim velikim područjem za tekst
+Comment[sv]=Presentation med sidrubrik och ett enda stort textområde
+Comment[uk]=Презентація з заголовком сторінки і великою ділянкою для тексту
+Comment[zh_TW]=有頁面標題及一個大型文字區域的展示
+Type=Link
+URL=.source/OneColumnLandscape.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/common_desktop/OneColumnPortrait.desktop b/kpresenter/templates/common_desktop/OneColumnPortrait.desktop
new file mode 100644
index 000000000..06c0a1aa6
--- /dev/null
+++ b/kpresenter/templates/common_desktop/OneColumnPortrait.desktop
@@ -0,0 +1,102 @@
+[Desktop Entry]
+Icon=template_onecolumnportrait
+Name=One Column Portrait
+Name[af]=Een Kolom Portret
+Name[ar]=عمود واحد، طولي
+Name[az]=Tək Sütun Portret
+Name[bg]=Една колона, портрет
+Name[bs]=Jedan stupac portret
+Name[ca]=Una columna vertical
+Name[cs]=Jeden sloupec na výšku
+Name[cy]=Portread Un Golofn
+Name[da]=Énsøjle-portræt
+Name[de]=1-spaltig Hochformat
+Name[el]=Πορτραίτο μίας στήλης
+Name[eo]=Unu kolumno vertikale
+Name[es]=Vertical de una columna
+Name[et]=Üks püstine veerg
+Name[eu]=Zutabe bakarreko bertikala
+Name[fa]=طول یک ستون
+Name[fi]=Yksi palsta, pystysuuntainen
+Name[fr]=Une colonne, portrait
+Name[fy]=Ien kolom, portet
+Name[gl]=Unha Coluna en Vertical
+Name[he]=טור אחד לאורך
+Name[hr]=Jedan stupac, portret
+Name[hu]=Egyoszlopos, álló
+Name[is]=Einn dálkur lóðrétt
+Name[it]=Una colonna verticale
+Name[ja]=1 列 (縦長)
+Name[km]=បញ្ឈរ​ជួរ​ឈរ​មួយ
+Name[lo]=ແນວຕັ້ງແບບໜື່ງແຖວ
+Name[lt]=Vieno stulpelio portretas
+Name[lv]=Viena Kolona Portretveidā
+Name[ms]=Potret Satu Lajur
+Name[mt]=Kolonna Waħda, għat-Tul
+Name[nb]=En spalte stående
+Name[nds]=Een Striep Hoochformaat
+Name[ne]=एउटा स्तम्भ पोर्ट्रेट
+Name[nl]=Eén kolom, portret
+Name[nn]=Ei spalte ståande
+Name[pl]=Jedna kolumna (format portretu)
+Name[pt]=Uma Coluna Vertical
+Name[pt_BR]=Uma Coluna (Retrato)
+Name[ro]=Portret o coloană
+Name[ru]=Одна колонка, портрет
+Name[se]=Okta bálstá ceaggu
+Name[sk]=Jeden stĺpec na výšku
+Name[sl]=En stolpec pokončno
+Name[sr]=Усправно у једној колони
+Name[sr@Latn]=Uspravno u jednoj koloni
+Name[sv]=En kolumn stående bild
+Name[ta]=ஒரு நிரல் நீளவாக்கு
+Name[tg]=Як Сутуни Тимсол
+Name[th]=แนวตั้งแบบหนึ่งคอลัมน์
+Name[tr]=Dikey Tek Sütun
+Name[uk]=Книжкова в один стовпчик
+Name[uz]=Boʻyiga bitta ustun
+Name[uz@cyrillic]=Бўйига битта устун
+Name[ven]=Tshifanyiso tsha kholomo nthihi
+Name[wa]=Ene colone d' astampé
+Name[xh]=Umhlathi Omnye Womzobi
+Name[zh_CN]=单列纵向
+Name[zh_TW]=單列肖象
+Name[zu]=Eyodwa Ikholamu Yodwebu
+Comment=Presentation with a page title and single large text area (portrait-oriented)
+Comment[bg]=Презентация със заглавие на страница и едно голямо текстово поле (вертикална ориентация)
+Comment[ca]=Presentació amb un títol de pàgina i una gran àrea de text (orientada a retrat)
+Comment[cy]=Cyflwyniad efo teitl tudalen ac ardal testun mawr sengl (cyfeiriadaeth ddarlun)
+Comment[da]=Præsentation med sideoverskrift og et enkelt stort tekstområde (portrætformat)
+Comment[de]=Eine Präsentation mit Seitentitel und einem einzelnen, großen Textbereich (Hochformat)
+Comment[el]=Παρουσίαση με τίτλο μίας σελίδας και μία μεγάλη περιοχή κειμένου (διάταξη πορτραίτου)
+Comment[es]=Presentación con un título de página y un área grande de texto (orientación vertical)
+Comment[et]=Esitlus lehekülje pealkirja ja ühe suure tekstialaga (püstpaigutus)
+Comment[fa]=ارائه‌ای با یک عنوان صفحه و ناحیۀ متن بزرگ و تک )جهت طولی(
+Comment[fi]=Esitys, jossa otsikko ja yksi suuri pystysuuntainen tekstikenttä
+Comment[fr]=Présentation avec un titre de page et un seul grand texte (portrait)
+Comment[fy]=Presintaasje mei in sidetitel en 1 grut tekst diel (portret-setting)
+Comment[gl]=Presentación con título de páxina é unha única área de texto (con orientación vertical)
+Comment[hu]=Bemutató címoldallal és egy nagyobb szövegterülettel (álló tájolású)
+Comment[is]=Kynning með síðutitli og einu stóru textasvæði (lóðrétt síða)
+Comment[it]=Presentazione con titolo della pagina e una sola grande area di testo (orientata in verticale)
+Comment[ja]=ページタイトルと一つの大きなテキスト欄で構成するプレゼンテーション (縦長)
+Comment[km]=ការ​បង្ហាញ​ចំណង​ជើង​ទំព័រ​​និង​អត្ថបទ​ធំ​តែ​មួយ​ (ទិស​ឈរ)
+Comment[nb]=Presentasjon med en sidetittel og ett stort tekstfelt (stående format)
+Comment[nds]=Presentatschoon mit Siedentitel un en groot Textrebeet (Hoochformaat)
+Comment[ne]=पृष्ठ शीर्षक र एक्लो लामो पाठ क्षेत्रसँग प्रस्तुतिकरण (पोर्ट्रेट-अभिविन्यस्त)
+Comment[nl]=Presentatie met een paginatitel en een grote ruimte voor tekst (portretoriëntatie)
+Comment[pl]=Prezentacja z tytułem strony oraz dużym miejscem na tekst (format portretu)
+Comment[pt]=Uma apresentação com um título e uma área de texto grande (no formato de retrato)
+Comment[pt_BR]=Uma apresentação com um título e uma área de texto grande (no formato de retrato)
+Comment[ru]=Презентация с заголовком и большой областью для текста (портретная ориентация)
+Comment[se]=Presentašuvdna mas lea siidonamahus ja stuorra teakstagieddi (ceaggu formáhtta)
+Comment[sk]=Prezentácia s titulkou a jednou veľkou textovou oblasťou (na výšku)
+Comment[sl]=Predstavitev z naslovom strani in enim samim velikim območjem besedila (navpična)
+Comment[sr]=Презентација са насловом стране и једним великим подручјем за текст (водоравно усмерена)
+Comment[sr@Latn]=Prezentacija sa naslovom strane i jednim velikim područjem za tekst (vodoravno usmerena)
+Comment[sv]=Presentation med sidrubrik och ett enda stort textområde (stående format)
+Comment[uk]=Презентація з заголовком сторінки і великою ділянкою для тексту (книжкова орієнтація)
+Comment[zh_TW]=一個頁面標題與單一文字區域的簡報(縱向)
+Type=Link
+URL=.source/OneColumnPortrait.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/common_desktop/TitleLandscape.desktop b/kpresenter/templates/common_desktop/TitleLandscape.desktop
new file mode 100644
index 000000000..f0ca81b55
--- /dev/null
+++ b/kpresenter/templates/common_desktop/TitleLandscape.desktop
@@ -0,0 +1,109 @@
+[Desktop Entry]
+Icon=template_titlelandscape
+Name=Title
+Name[af]=Titel
+Name[ar]=عنوان
+Name[az]=Başlıq
+Name[bg]=Заглавие
+Name[br]=Titl
+Name[bs]=Naslov
+Name[ca]=Títol
+Name[cs]=Titulek
+Name[cy]=Teitl
+Name[da]=Titel
+Name[de]=Titel
+Name[el]=Τίτλος
+Name[eo]=Titolo
+Name[es]=Título
+Name[et]=Tiitel
+Name[fa]=عنوان
+Name[fi]=Otsikko
+Name[fo]=Heiti
+Name[fr]=Titre
+Name[fy]=Titel
+Name[ga]=Teideal
+Name[gl]=Título
+Name[he]=כותרת
+Name[hi]=शीर्षक
+Name[hr]=Naslov
+Name[hu]=Címfelirat
+Name[id]=Judul
+Name[is]=Titill
+Name[it]=Titolo
+Name[ja]=タイトル
+Name[km]=ចំណងជើង
+Name[lo]=ຫົວເລື່ອງ
+Name[lv]=Virsraksts
+Name[mk]=Наслов
+Name[ms]=Tajuk
+Name[mt]=Titolu
+Name[nb]=Tittel
+Name[nds]=Titel
+Name[ne]=शीर्षक
+Name[nl]=Titel, landschap
+Name[nn]=Tittel
+Name[pl]=Tytuł
+Name[pt]=Título
+Name[pt_BR]=Título
+Name[ro]=Titlu
+Name[ru]=Заголовок
+Name[se]=Namahus
+Name[sk]=Titulok
+Name[sl]=Naslov
+Name[sr]=Наслов
+Name[sr@Latn]=Naslov
+Name[sv]=Titel
+Name[ta]=தலைப்பு
+Name[tg]=Сарлавҳа
+Name[th]=หัวเรื่อง
+Name[tr]=Başlık
+Name[uk]=Заголовок
+Name[uz]=Sarlavha
+Name[uz@cyrillic]=Сарлавҳа
+Name[ven]=Thoho
+Name[wa]=Tite
+Name[xh]=Isihloko
+Name[zh_CN]=标题
+Name[zh_TW]=標題
+Name[zu]=Ibizo
+Comment=Presentation with a page title
+Comment[bg]=Презентация със заглавие на страницата
+Comment[ca]=Presentació amb un títol de pàgina
+Comment[cy]=Cyflwyniad â theitl tudalen
+Comment[da]=Præsentation med en sideoverskrift
+Comment[de]=Eine Präsentation mit Seitentitel
+Comment[el]=Παρουσίαση με μία σελίδα τίτλου
+Comment[eo]=Prezentado kun paghtitolo
+Comment[es]=Presentación con un título de página
+Comment[et]=Esitlus lehekülje pealkirjaga
+Comment[fa]=ارائه با یک عنوان صفحه
+Comment[fr]=Présentation avec un titre de page
+Comment[fy]=Presintaasje mei in sidetitel
+Comment[gl]=Presentación cunha páxina de título
+Comment[he]=מצגת עם כותרת עמוד
+Comment[hu]=Bemutató címoldallal
+Comment[is]=Kynning með síðutitli
+Comment[it]=Presentazione con un titolo di pagina
+Comment[ja]=ページタイトルで構成するプレゼンテーション
+Comment[km]=ការ​បង្ហាញ​ដែល​មាន​ចំណងជើង​ទំព័រ
+Comment[lv]=Prezentācija ar lapas virsrakstu
+Comment[nb]=Presentasjon med en sidetittel
+Comment[nds]=Presentatschoon mit Siedentitel
+Comment[ne]=पृष्ठ शीर्षकसँग प्रस्तुतिकरण
+Comment[nl]=Presentatie met een paginatitel
+Comment[pl]=Prezentacja z tytułem strony
+Comment[pt]=Uma apresentação com uma página de título
+Comment[pt_BR]=Uma apresentação com uma página de título
+Comment[ru]=Презентация с заголовком
+Comment[se]=Presentašuvdna mas lea siidonamahus
+Comment[sk]=Prezentácia s titulkou
+Comment[sl]=Predstavitev z naslovom strani
+Comment[sr]=Презентација са насловом стране
+Comment[sr@Latn]=Prezentacija sa naslovom strane
+Comment[sv]=Presentation med en sidrubrik
+Comment[uk]=Презентація з заголовком сторінки
+Comment[zh_CN]=带页面标题的演示文稿
+Comment[zh_TW]=具有頁面標題的展示
+Type=Link
+URL=.source/TitleLandscape.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/common_desktop/TitlePortrait.desktop b/kpresenter/templates/common_desktop/TitlePortrait.desktop
new file mode 100644
index 000000000..16b752166
--- /dev/null
+++ b/kpresenter/templates/common_desktop/TitlePortrait.desktop
@@ -0,0 +1,102 @@
+[Desktop Entry]
+Icon=template_titleportrait
+Name=Title Portrait
+Name[af]=Titel Portret
+Name[ar]=عنوان، طولي
+Name[az]=Başlıq Portrteti
+Name[bg]=Заглавие, портрет
+Name[bs]=Naslov portret
+Name[ca]=Títol vertical
+Name[cs]=Titulek na výšku
+Name[cy]=Portread Teitl
+Name[da]=Titelportræt
+Name[de]=Titel im Hochformat
+Name[el]=Τίτλος πορτραίτο
+Name[eo]=Titolo vertikale
+Name[es]=Título en vertical
+Name[et]=Püstine tiitel
+Name[eu]=Izenburu bertikala
+Name[fa]=طول عنوان
+Name[fi]=Otsikko pystysuuntainen
+Name[fr]=Titre, portrait
+Name[fy]=Titel, portret
+Name[gl]=Título en Vertical
+Name[he]=כותרת לאורך
+Name[hr]=Naslov, portret
+Name[hu]=Címfelirat, álló
+Name[is]=Titill lóðrétt
+Name[it]=Titolo verticale
+Name[ja]=タイトル (縦長)
+Name[km]= ចំណង​ជើង​រូបភាព​
+Name[lo]=ແນວຕັ້ງແບບມີຫົວເລື່ອງ
+Name[lt]=Antraštės portretas
+Name[lv]=Titli Portretveidā
+Name[ms]=Potret Tajuk
+Name[mt]=Titolu, għat-Tul
+Name[nb]=Tittel stående
+Name[nds]=Titel Hoochformaat
+Name[ne]=शीर्षक पोर्ट्रेट
+Name[nl]=Titel, portret
+Name[nn]=Tittel ståande
+Name[pl]=Tytuł (format portretu)
+Name[pt]=Título Vertical
+Name[pt_BR]=Título (Retrato)
+Name[ro]=Potret titlu
+Name[ru]=Заголовок, портрет
+Name[se]=Ceaggu namahus
+Name[sk]=Titulok na výšku
+Name[sl]=Naslov pokončno
+Name[sr]=Наслов, усправно
+Name[sr@Latn]=Naslov, uspravno
+Name[sv]=Titel stående bild
+Name[ta]=தலைப்பு நீளவாக்கு
+Name[tg]=Сарлавҳаи Тимсол
+Name[th]=แนวตั้งแบบมีหัวเรื่อง
+Name[tr]=Dikey Başlık
+Name[uk]=Книжкова з заголовком
+Name[uz]=Boʻyiga sarlavha
+Name[uz@cyrillic]=Бўйига сарлавҳа
+Name[ven]=Thoho ya tshifanyiso
+Name[wa]=Tite d' astampé
+Name[xh]=Umzobi Wesihloko
+Name[zh_CN]=标题纵向
+Name[zh_TW]=標題肖象
+Name[zu]=Umdwebi Onebizo
+Comment=Presentation with a page title (portrait-oriented)
+Comment[bg]=Презентация със заглавие на страница (вертикална ориентация)
+Comment[ca]=Presentació amb un títol de pàgina (orientada a retrat)
+Comment[cy]=Cyflwyniad efo teitl tudalen (cyfeiriadaeth ddarlun)
+Comment[da]=Præsentation med en sideoverskrift (stående format)
+Comment[de]=Eine Präsentation mit Seitentitel (Hochformat)
+Comment[el]=Παρουσίαση με τίτλο μίας σελίδας (διάταξη πορτραίτου)
+Comment[es]=Presentación con un título de página (orientación vertical)
+Comment[et]=Esitlus lehekülje pealkirjaga (püstpaigutus)
+Comment[fa]=ارائه با یک عنوان صفحه )جهت طولی(
+Comment[fi]=Esitys, jossa otsikko (pystysuuntainen)
+Comment[fr]=Présentation avec un titre de page (portrait)
+Comment[fy]=Presintaasje mei in sidetitel (portet-setting)
+Comment[gl]=Presentación cunha páxina de título (orientada en vertical)
+Comment[hu]=Bemutató címoldallal (álló tájolással)
+Comment[is]=Kynning með síðutitli (lóðrétt síða)
+Comment[it]=Presentazione con un titolo di pagina (orientata in verticale)
+Comment[ja]=ページタイトルで構成するプレゼンテーション (縦長)
+Comment[km]=ការ​បង្ហាញ​ចំណង​ជើង​ទំព័រ​ (ទិស​ឈរ)
+Comment[nb]=Presentasjon med en sidetittel (stående format)
+Comment[nds]=Presentatschoon mit Siedentitel (Hoochformaat)
+Comment[ne]=पृष्ठ शीर्षक (पोर्ट्रेट-अभिविन्यस्त) सँगको प्रस्तुतिकरण
+Comment[nl]=Presentatie met een paginatitel (portretoriëntatie)
+Comment[pl]=Prezentacja z tytułem strony (format portretu)
+Comment[pt]=Uma apresentação com um título (com o formato de retrato)
+Comment[pt_BR]=Uma apresentação com um título (com o formato de retrato)
+Comment[ru]=Презентация с заголовком (портретная ориентация)
+Comment[se]=Presentašuvdna mas lea siidonamahus (ceaggu formáhtta)
+Comment[sk]=Prezentácia s titulkou (na výšku)
+Comment[sl]=Predstavitev z naslovom strani (pokončna)
+Comment[sr]=Презентација са насловом стране (усправно усмерена)
+Comment[sr@Latn]=Prezentacija sa naslovom strane (uspravno usmerena)
+Comment[sv]=Presentation med en sidrubrik (stående format)
+Comment[uk]=Презентація з заголовком сторінки (книжкова орієнтація)
+Comment[zh_TW]=具有標題的簡報(縱向)
+Type=Link
+URL=.source/TitlePortrait.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/common_desktop/TwoColumnLandscape.desktop b/kpresenter/templates/common_desktop/TwoColumnLandscape.desktop
new file mode 100644
index 000000000..1add6daca
--- /dev/null
+++ b/kpresenter/templates/common_desktop/TwoColumnLandscape.desktop
@@ -0,0 +1,106 @@
+[Desktop Entry]
+Icon=template_twocolumnlandscape
+Name=Two Column
+Name[af]=Twee Kolom
+Name[ar]=عمودَين
+Name[az]=İki Sütun
+Name[bg]=Две колони
+Name[br]=Daou vann
+Name[bs]=Dva stupca
+Name[ca]=Dues columnes
+Name[cs]=Dva sloupce
+Name[cy]=Dwy Golofn
+Name[da]=Tosøjle
+Name[de]=2-spaltig
+Name[el]=Δύο στήλες
+Name[eo]=Du kolumnoj
+Name[es]=Dos columnas
+Name[et]=Kaks veergu
+Name[eu]=Bi zutabe
+Name[fa]=دو ستون
+Name[fi]=Kaksi palstaa
+Name[fo]=Tveir teigar
+Name[fr]=Deux colonnes
+Name[fy]=Twa kolommen
+Name[gl]=Duas Colunas
+Name[he]=שתי עמודות
+Name[hi]=दो स्तम्भ
+Name[hr]=Dva stupca
+Name[hu]=Kétoszlopos
+Name[is]=Tveir dálkar
+Name[it]=Due colonne
+Name[ja]=2 列
+Name[km]=ពីរ​ជួរឈរ
+Name[lo]=ສອງແຖວ
+Name[lt]=Dviem stulpeliais
+Name[lv]=Divas kolonnas
+Name[ms]=Dua Lajur
+Name[mt]=Żewġ Kolonni
+Name[nb]=To spalter
+Name[nds]=Twee Striepen
+Name[ne]=दुई स्तम्भ
+Name[nl]=Twee kolommen, landschap
+Name[nn]=To spalter
+Name[pl]=Dwie kolumny
+Name[pt]=Duas Colunas
+Name[pt_BR]=Duas Colunas
+Name[ro]=Două coloane
+Name[ru]=Две колонки
+Name[se]=Guokte bálsttá
+Name[sk]=Dva stĺpce
+Name[sl]=Dva stolpca
+Name[sr]=Две колоне
+Name[sr@Latn]=Dve kolone
+Name[sv]=Två kolumner
+Name[ta]=இரு நிரல்
+Name[tg]=Ду Сутун
+Name[th]=สองคอลัมน์
+Name[tr]=İki Sütun
+Name[uk]=Два стовпчики
+Name[uz]=Ikkita ustun
+Name[uz@cyrillic]=Иккита устун
+Name[ven]=Kholomo mbili
+Name[wa]=Deus colones
+Name[xh]=Imihlathi Emibini
+Name[zh_CN]=双列
+Name[zh_TW]=兩列
+Name[zu]=Amakholamu Amabili
+Comment=Presentation with a page title and two text columns
+Comment[bg]=Презентация със заглавие на страница и две текстови колони
+Comment[ca]=Presentació amb un títol de pàgina i dues columnes de text
+Comment[cy]=Cyflwyniad efo teitl tudalen a dwy golofn destun
+Comment[da]=Præsentation med en sideoverskrift og to tekstsøjler
+Comment[de]=Eine Präsentation mit Seitentitel und zwei Textspalten
+Comment[el]=Παρουσίαση με τίτλο μίας σελίδας και δύο στήλες κειμένου
+Comment[es]=Presentación con un título de página y dos columnas de texto
+Comment[et]=Esitlus lehekülje pealkirja ja kahe tekstiveeruga
+Comment[fa]=ارائه با یک عنوان صفحه و دو ستون متن
+Comment[fi]=Esitys, jossa otsikko ja kaksi tekstipalstaa
+Comment[fr]=Présentation avec un titre de page et deux colonnes de texte
+Comment[fy]=Presintaasje mei in sidetitel en twa tekstkolommen
+Comment[gl]=Presentación cunha páxina de título e duas colunas de texto
+Comment[he]=מצגת עם כותרת עמוד ושתי עמודות
+Comment[hu]=Bemutató címmel és két szöveges oszloppal
+Comment[is]=Kynning með síðutitli og tveimur textadálkum
+Comment[it]=Presentazione con un titolo di pagina e due colonne di testo
+Comment[ja]=タイトルと二つのテキスト欄で構成するプレゼンテーション
+Comment[km]= ការបង្ហាញ​ចំណង​ជើង​ និង​អត្ថបទ​ជួរឈរ​ពីរ​
+Comment[nb]=Presentasjon med en sidetittel og to tekstspalter
+Comment[nds]=Presentatschoon mit Siedentitel un twee Textstriepen
+Comment[ne]=पृष्ठ शीर्षक र दुई पाठ स्तम्भहरूसँगको प्रस्तुतिकरण
+Comment[nl]=Presentatie met een paginatitel en twee tekstkolommen
+Comment[pl]=Prezentacja z tytułem strony oraz dwoma kolumnami na tekst
+Comment[pt]=Uma apresentação com um título e duas colunas de texto
+Comment[pt_BR]=Uma apresentação com um título e duas colunas de texto
+Comment[ru]=Презентация с заголовком и двумя колонками
+Comment[se]=Presentašuvdna mas lea siidonamahus ja guokte teakstabálstta
+Comment[sk]=Prezentácia s titulkou a dvoma stĺpcami textu
+Comment[sl]=Predstavitev z naslovom strani in dvema stolpcema besedila
+Comment[sr]=Презентација са насловом стране и две текстуалне колоне
+Comment[sr@Latn]=Prezentacija sa naslovom strane i dve tekstualne kolone
+Comment[sv]=Presentation med en sidrubrik och två textkolumner
+Comment[uk]=Презентація з заголовком сторінки і двома стовпчиками для тексту
+Comment[zh_TW]=具有標題及兩欄文字的展示
+Type=Link
+URL=.source/TwoColumnLandscape.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/common_desktop/TwoColumnPortrait.desktop b/kpresenter/templates/common_desktop/TwoColumnPortrait.desktop
new file mode 100644
index 000000000..1439354a4
--- /dev/null
+++ b/kpresenter/templates/common_desktop/TwoColumnPortrait.desktop
@@ -0,0 +1,102 @@
+[Desktop Entry]
+Icon=template_twocolumnportrait
+Name=Two Column Portrait
+Name[af]=Twee Kolom Portret
+Name[ar]=عمودين، طولي
+Name[az]=İki Sütun Portret
+Name[bg]=Две колони, портрет
+Name[bs]=Dva stupca portret
+Name[ca]=Dues columnes vertical
+Name[cs]=Dva sloupce na výšku
+Name[cy]=Portread Dwy Golofn
+Name[da]=Tosøjle-portræt
+Name[de]=2-spaltig Hochformat
+Name[el]=Δύο στήλες πορτραίτο
+Name[eo]=Du kolumnoj vertikale
+Name[es]=Dos columnas en vertical
+Name[et]=Kaks püstist veergu
+Name[eu]=Bi zutabe bertikala
+Name[fa]=طول دو ستون
+Name[fi]=Kaksi palstaa, pystysuuntainen
+Name[fr]=Deux colonnes, portrait
+Name[fy]=Twa kolommen, portet
+Name[gl]=Duas Colunas en Vertical
+Name[he]=שני טורים לאורך
+Name[hr]=Dva stupca, portret
+Name[hu]=Kétoszlopos, álló
+Name[is]=Tveir dálkar lóðrétt
+Name[it]=Due colonne verticale
+Name[ja]=2 列 (縦長)
+Name[km]= រូបភាព​ជួរឈរពីរ
+Name[lo]=ແນວຕັັ້ງແບບສອງແຖວ
+Name[lt]=Dviejų stulpelių portretas
+Name[lv]=Divas Kolonas Portretveidā
+Name[ms]=Potret Dua Lajur
+Name[mt]=Żewġ Kolonni, għat-Tul
+Name[nb]=To spalter stående
+Name[nds]=Twee Striepen Hoochformaat
+Name[ne]=दुई स्तम्भ पोर्ट्रेट
+Name[nl]=Twee kolommen, portret
+Name[nn]=To spalter ståande
+Name[pl]=Dwie kolumny (format portretu)
+Name[pt]=Duas Colunas na Vertical
+Name[pt_BR]=Duas Colunas (Retrato)
+Name[ro]=Portret două coloane
+Name[ru]=Две колонки, портрет
+Name[se]=Guokte bálsttá ceaggu
+Name[sk]=Dva stĺpce na výšku
+Name[sl]=Dva stolpca pokončno
+Name[sr]=Две колоне, усправно
+Name[sr@Latn]=Dve kolone, uspravno
+Name[sv]=Två kolumners stående bild
+Name[ta]=இரு நிரல் நீளவாக்கு
+Name[tg]=Ду Сутуни Тимсол
+Name[th]=แนวตั้งแบบสองคอลัมน์
+Name[tr]=Dikey İki Sütun
+Name[uk]=Книжкова в два стовпчики
+Name[uz]=Boʻyiga ikkita ustun
+Name[uz@cyrillic]=Бўйига иккита устун
+Name[ven]=Tshifanyiso tsha kholomo mbili
+Name[wa]=Deus colones d' astampé
+Name[xh]=Imihlathi Emibini Yomzobi
+Name[zh_CN]=双列纵向
+Name[zh_TW]=兩列肖象
+Name[zu]=Umdwebo Wamakholamu Amabili
+Comment=Presentation with a page title and two text columns (portrait-oriented)
+Comment[bg]=Презентация със заглавие на страница и две текстови колони(вертикална ориентация)
+Comment[ca]=Presentació amb un títol de pàgina i dues columnes de text (orientada a retrats)
+Comment[cy]=Cyflwyniad efo teitl tudalen a dwy golofn destun (cyfeiriadaeth ddarlun)
+Comment[da]=Præsentation med en sideoverskrift og to tekstsøjler (stående format)
+Comment[de]=Eine Präsentation mit Seitentitel und zwei Textspalten (Hochformat)
+Comment[el]=Παρουσίαση με τίτλο μίας σελίδας και δύο στήλες κειμένου (διάταξη πορτραίτου)
+Comment[es]=Presentación con un título de página y dos columnas de textos (orientación vertical)
+Comment[et]=Esitlus lehekülje pealkirjaga ja kahe tekstiveeruga (püstpaigutus)
+Comment[fa]=ارائه با یک عنوان صفحه و دو ستون متن )جهت طولی(
+Comment[fi]=Esitys, jossa otsikko ja kaksi tekstipalstaa (pystysuuntainen)
+Comment[fr]=Présentation avec un titre de page et deux colonnes de texte (portrait)
+Comment[fy]=Presintaasje mei in sidetitel en twa tekstkolommen (portret-setting)
+Comment[gl]=Presentación cunha páxina de título e duas colunas de texto (orientadas en vertical)
+Comment[hu]=Bemutató címmel és két szöveges oszloppal (álló)
+Comment[is]=Kynning með síðutitli og tveimur textadálkum (lóðrétt síða)
+Comment[it]=Presentazione con un titolo di pagina e due colonne di testo (orientata in verticale)
+Comment[ja]=タイトルと二つのテキスト欄で構成するプレゼンテーション (縦長)
+Comment[km]=ការ​បង្ហាញ​ចំណង​ជើង​ទំព័រ​និង​ជួរ​ឈរ​អត្ថបទ​ពីរ​ (ទិស​ឈរ)
+Comment[nb]=Presentasjon med en sidetittel og to tekstspalter (stående format)
+Comment[nds]=Presentatschoon mit Siedentitel un twee Textstriepen (Hoochformaat)
+Comment[ne]=पृष्ठ शीर्षक र दुई पाठ स्तम्भहरू (पोर्ट्रेट-अभिविन्यस्त) सँगको प्रस्तुतिकरण
+Comment[nl]=Presentatie met een paginatitel en twee tekstkolommen (portretoriëntatie)
+Comment[pl]=Prezentacja z tytułem strony oraz dwoma kolumnami na tekst (format portretu)
+Comment[pt]=Uma apresentação com um título e duas colunas de texto (com o formato de retrato)
+Comment[pt_BR]=Uma apresentação com um título e duas colunas de texto (com o formato de retrato)
+Comment[ru]=Презентация с заголовком и двумя колонками (портретная ориентация)
+Comment[se]=Presentašuvdna mas lea siidonamahus ja guokte teakstabálstta (ceaggu formáhtta)
+Comment[sk]=Prezentácia s titulkou a dvoma stĺpcami textu (na výšku)
+Comment[sl]=Predstavitev z naslovom strani in dvema stolpcema besedila (pokončna)
+Comment[sr]=Презентација са насловом стране и две текстуалне колоне (усправно усмерена)
+Comment[sr@Latn]=Prezentacija sa naslovom strane i dve tekstualne kolone (uspravno usmerena)
+Comment[sv]=Presentation med en sidrubrik och två textkolumner (stående format)
+Comment[uk]=Презентація з заголовком сторінки і двома стовпчиками для тексту (книжкова орієнтація)
+Comment[zh_TW]=具有頁面標題與兩欄文字的簡報(縱向)
+Type=Link
+URL=.source/TwoColumnPortrait.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/common_desktop/emptyLandscape.desktop b/kpresenter/templates/common_desktop/emptyLandscape.desktop
new file mode 100644
index 000000000..165214fa7
--- /dev/null
+++ b/kpresenter/templates/common_desktop/emptyLandscape.desktop
@@ -0,0 +1,100 @@
+[Desktop Entry]
+Icon=template_emptylandscape
+Name=Empty
+Name[bg]=Празен документ
+Name[br]=Goullonderiñ
+Name[ca]=Buit
+Name[cs]=Prázdné
+Name[cy]=Gwag
+Name[da]=Tom
+Name[de]=Leer
+Name[el]=Κενό
+Name[eo]=Malplena
+Name[es]=Vacío
+Name[et]=Tühi
+Name[eu]=Hutsa
+Name[fa]=خالی
+Name[fi]=Tyhjä
+Name[fr]=Neutre
+Name[fy]=Leech
+Name[ga]=Folamh
+Name[gl]=Valeira
+Name[he]=ריק
+Name[hi]=खाली
+Name[hr]=Prazno
+Name[hu]=Üres
+Name[is]=Tómt
+Name[it]=Vuoto
+Name[ja]=空
+Name[km]=ទទេ
+Name[lt]=Tuščias
+Name[lv]=Tukšs
+Name[ms]=Kosong
+Name[nb]=Tom
+Name[nds]=Leddig
+Name[ne]=खाली
+Name[nl]=Leeg
+Name[nn]=Tomt
+Name[pl]=Pusta
+Name[pt]=Vazio
+Name[pt_BR]=Vazio
+Name[ru]=Чистый лист
+Name[se]=Guorus
+Name[sk]=Prázdna
+Name[sl]=Prazno
+Name[sr]=Празно
+Name[sr@Latn]=Prazno
+Name[sv]=Tom
+Name[ta]= வெற்று
+Name[tg]=Ҳолӣ
+Name[tr]=Boş
+Name[uk]=Порожня
+Name[uz]=Boʻsh
+Name[uz@cyrillic]=Бўш
+Name[wa]=Vude
+Name[zh_CN]=空
+Name[zh_TW]=空白
+Comment=Empty presentation
+Comment[bg]=Празна презентация
+Comment[ca]=Presentació buida
+Comment[cy]=Cyflwyniad gwag
+Comment[da]=Tom præsentation
+Comment[de]=Leere Präsentation
+Comment[el]=Κενή παρουσίαση
+Comment[eo]=Malplena prezentaĵo
+Comment[es]=Presentación vacía
+Comment[et]=Tühi esitlus
+Comment[fa]=ارائۀ خالی
+Comment[fi]=Tyhjä esitys
+Comment[fr]=Présentation vide
+Comment[fy]=Lege presintaasje
+Comment[gl]=Presentación valeira
+Comment[he]=מצגת ריקה
+Comment[hu]=Üres bemutató
+Comment[is]=Tóm kynning
+Comment[it]=Presentazione vuota
+Comment[ja]=空のプレゼンテーション
+Comment[km]=​ការ​បង្ហាញ​ទទេ​
+Comment[lv]=Tukša prezentācija
+Comment[nb]=Tom presentasjon
+Comment[nds]=Leddig Presentatschoon
+Comment[ne]=खाली प्रस्तुतिकरण
+Comment[nl]=Lege presentatie
+Comment[pl]=Pusta prezentacja
+Comment[pt]=Uma apresentação em branco
+Comment[pt_BR]=Uma apresentação em branco
+Comment[ru]=Пустая презентация
+Comment[se]=Guorus presentašuvdna
+Comment[sk]=Prázdna prezentácia
+Comment[sl]=Prazna predstavitev
+Comment[sr]=Празна презентација
+Comment[sr@Latn]=Prazna prezentacija
+Comment[sv]=Tom presentation
+Comment[uk]=Порожня презентація
+Comment[uz]=Boʻsh namoyish
+Comment[uz@cyrillic]=Бўш намойиш
+Comment[zh_CN]=空演示文稿
+Comment[zh_TW]=空白展示
+Type=Link
+URL=.source/emptyLandscape.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/common_desktop/emptyPortrait.desktop b/kpresenter/templates/common_desktop/emptyPortrait.desktop
new file mode 100644
index 000000000..994512011
--- /dev/null
+++ b/kpresenter/templates/common_desktop/emptyPortrait.desktop
@@ -0,0 +1,91 @@
+[Desktop Entry]
+Icon=template_emptyportrait
+Name=Empty Portrait
+Name[bg]=Празен документ, портрет
+Name[br]=Poltred goullo
+Name[ca]=Buit vertical
+Name[cs]=Portrét, prázdný
+Name[cy]=Portread Gwag
+Name[da]=Tomt portræt
+Name[de]=Leer Hochformat
+Name[el]=Κενό πορτραίτο
+Name[eo]=Malplena vertikale
+Name[es]=Vertical vacío
+Name[et]=Tühi püstpaigutusega
+Name[eu]=Huts bertikala
+Name[fa]=پرترۀ خالی
+Name[fi]=Tyhjä pystysuuntainen
+Name[fr]=Portrait, neutre
+Name[fy]=Leech, portet
+Name[gl]=Valeira vertical
+Name[he]=לאורך, ריק
+Name[hr]=Prazno, portret
+Name[hu]=üres, álló
+Name[is]=Tómt lóðrétt
+Name[it]=Vuoto verticale
+Name[ja]=空 (縦長)
+Name[km]=ផ្ដេកទទេ
+Name[ms]=Potret Kosong
+Name[nb]=Tomt stående
+Name[nds]=Leddig Hoochformaat
+Name[ne]=खाली पोर्ट्रेट
+Name[nl]=Leeg, portret
+Name[nn]=Tomt ståande
+Name[pl]=Pusta (format portretu)
+Name[pt]=Vazio na Vertical
+Name[pt_BR]=Vazio (Retrato)
+Name[ru]=Чистый лист, портрет
+Name[se]=Guorus ceaggu
+Name[sk]=Prázdny na výšku
+Name[sl]=Prazno pokončno
+Name[sr]=Празно, усправно
+Name[sr@Latn]=Prazno, uspravno
+Name[sv]=Tom stående bild
+Name[ta]= வெற்று நீளவாக்கு
+Name[tg]=Тимсоли Ҳолӣ
+Name[tr]=Dikey Boş
+Name[uk]=Порожня книжкова
+Name[uz]=Boʻyiga boʻsh
+Name[uz@cyrillic]=Бўйига бўш
+Name[wa]=Vude d' astampé
+Name[zh_CN]=空纵向
+Name[zh_TW]=空白縱向
+Comment=Empty presentation (portrait-oriented)
+Comment[bg]=Празна презентация (вертикална ориентация)
+Comment[ca]=Presentació buida (orientada a retrats)
+Comment[cy]=Cyflwyniad gwag (cyfeiriadaeth ddarlun)
+Comment[da]=Tom præsentation (stående format)
+Comment[de]=Leere Präsentation (Hochformat)
+Comment[el]=Κενή παρουσίαση (διάταξη πορτραίτου)
+Comment[es]=Presentación vacía (orientación vertical)
+Comment[et]=Tühi esitlus (püstpaigutus)
+Comment[fa]=ارائۀ خالی )جهت طولی(
+Comment[fi]=Tyhjä esitys (pystysuuntainen)
+Comment[fr]=Présentation vide (portrait)
+Comment[fy]=Lege presintaasje (portet-setting)
+Comment[gl]=Presentación valeira (orientada en vertical)
+Comment[hu]=Üres bemutató (álló tájolású)
+Comment[is]=Tóm kynning (lóðrétt síða)
+Comment[it]=Presentazione vuota (orientata in verticale)
+Comment[ja]=空のプレゼンテーション (縦長)
+Comment[km]=ការ​បង្ហាញ​ទទេ (ទិស​ផ្ដេក)
+Comment[nb]=Tom presentasjon (stående format)
+Comment[nds]=Leddig Presentatschoon (Hoochformaat)
+Comment[ne]=खाली प्रस्तुतिकरण (पोर्ट्रेट-अभिविन्यस्त)
+Comment[nl]=Lege presentatie (portretoriëntatie)
+Comment[pl]=Pusta prezentacja (format portretu)
+Comment[pt]=Uma apresentação em branco (com o formato de retrato)
+Comment[pt_BR]=Uma apresentação em branco (com o formato de retrato)
+Comment[ru]=Пустая презентация (портретная ориентация)
+Comment[se]=Guorus presentašuvdna (ceaggu formáhtta)
+Comment[sk]=Prázdna prezentácia (na výšku)
+Comment[sl]=Prazna predstavitev (pokončna)
+Comment[sr]=Празна презентација (усправно усмерена)
+Comment[sr@Latn]=Prazna prezentacija (uspravno usmerena)
+Comment[sv]=Tom presentation (stående format)
+Comment[uk]=Порожня презентація (книжкова орієнтація)
+Comment[zh_CN]=空演示文稿(纵向)
+Comment[zh_TW]=空白簡報(縱向)
+Type=Link
+URL=.source/emptyPortrait.kpt
+X-KDE-Hidden=false
diff --git a/kpresenter/templates/common_icon/Makefile.am b/kpresenter/templates/common_icon/Makefile.am
new file mode 100644
index 000000000..24cd3daac
--- /dev/null
+++ b/kpresenter/templates/common_icon/Makefile.am
@@ -0,0 +1,3 @@
+kpricondir = $(kde_datadir)/kpresenter/icons
+kpricon_ICON = AUTO
+
diff --git a/kpresenter/templates/common_icon/cr48-action-template_emptylandscape.png b/kpresenter/templates/common_icon/cr48-action-template_emptylandscape.png
new file mode 100644
index 000000000..fadb8e35a
--- /dev/null
+++ b/kpresenter/templates/common_icon/cr48-action-template_emptylandscape.png
Binary files differ
diff --git a/kpresenter/templates/common_icon/cr48-action-template_emptyportrait.png b/kpresenter/templates/common_icon/cr48-action-template_emptyportrait.png
new file mode 100644
index 000000000..b076487f0
--- /dev/null
+++ b/kpresenter/templates/common_icon/cr48-action-template_emptyportrait.png
Binary files differ
diff --git a/kpresenter/templates/common_icon/cr48-action-template_onecolumnlandscape.png b/kpresenter/templates/common_icon/cr48-action-template_onecolumnlandscape.png
new file mode 100644
index 000000000..5b2be11aa
--- /dev/null
+++ b/kpresenter/templates/common_icon/cr48-action-template_onecolumnlandscape.png
Binary files differ
diff --git a/kpresenter/templates/common_icon/cr48-action-template_onecolumnportrait.png b/kpresenter/templates/common_icon/cr48-action-template_onecolumnportrait.png
new file mode 100644
index 000000000..2d6c81f27
--- /dev/null
+++ b/kpresenter/templates/common_icon/cr48-action-template_onecolumnportrait.png
Binary files differ
diff --git a/kpresenter/templates/common_icon/cr48-action-template_titlelandscape.png b/kpresenter/templates/common_icon/cr48-action-template_titlelandscape.png
new file mode 100644
index 000000000..2f9e6409c
--- /dev/null
+++ b/kpresenter/templates/common_icon/cr48-action-template_titlelandscape.png
Binary files differ
diff --git a/kpresenter/templates/common_icon/cr48-action-template_titleportrait.png b/kpresenter/templates/common_icon/cr48-action-template_titleportrait.png
new file mode 100644
index 000000000..a5d866ff1
--- /dev/null
+++ b/kpresenter/templates/common_icon/cr48-action-template_titleportrait.png
Binary files differ
diff --git a/kpresenter/templates/common_icon/cr48-action-template_twocolumnlandscape.png b/kpresenter/templates/common_icon/cr48-action-template_twocolumnlandscape.png
new file mode 100644
index 000000000..2c55c5761
--- /dev/null
+++ b/kpresenter/templates/common_icon/cr48-action-template_twocolumnlandscape.png
Binary files differ
diff --git a/kpresenter/templates/common_icon/cr48-action-template_twocolumnportrait.png b/kpresenter/templates/common_icon/cr48-action-template_twocolumnportrait.png
new file mode 100644
index 000000000..90df10502
--- /dev/null
+++ b/kpresenter/templates/common_icon/cr48-action-template_twocolumnportrait.png
Binary files differ
diff --git a/kpresenter/templates/common_icon/crsc-action-template_emptylandscape.svgz b/kpresenter/templates/common_icon/crsc-action-template_emptylandscape.svgz
new file mode 100644
index 000000000..14ed6ea05
--- /dev/null
+++ b/kpresenter/templates/common_icon/crsc-action-template_emptylandscape.svgz
Binary files differ
diff --git a/kpresenter/templates/common_icon/crsc-action-template_emptyportrait.svgz b/kpresenter/templates/common_icon/crsc-action-template_emptyportrait.svgz
new file mode 100644
index 000000000..9f86b5c0b
--- /dev/null
+++ b/kpresenter/templates/common_icon/crsc-action-template_emptyportrait.svgz
Binary files differ
diff --git a/kpresenter/templates/common_icon/crsc-action-template_onecolumnlandscape.svgz b/kpresenter/templates/common_icon/crsc-action-template_onecolumnlandscape.svgz
new file mode 100644
index 000000000..f08019cc3
--- /dev/null
+++ b/kpresenter/templates/common_icon/crsc-action-template_onecolumnlandscape.svgz
Binary files differ
diff --git a/kpresenter/templates/common_icon/crsc-action-template_onecolumnportrait.svgz b/kpresenter/templates/common_icon/crsc-action-template_onecolumnportrait.svgz
new file mode 100644
index 000000000..3945499d6
--- /dev/null
+++ b/kpresenter/templates/common_icon/crsc-action-template_onecolumnportrait.svgz
Binary files differ
diff --git a/kpresenter/templates/common_icon/crsc-action-template_titlelandscape.svgz b/kpresenter/templates/common_icon/crsc-action-template_titlelandscape.svgz
new file mode 100644
index 000000000..fb944c281
--- /dev/null
+++ b/kpresenter/templates/common_icon/crsc-action-template_titlelandscape.svgz
Binary files differ
diff --git a/kpresenter/templates/common_icon/crsc-action-template_titleportrait.svgz b/kpresenter/templates/common_icon/crsc-action-template_titleportrait.svgz
new file mode 100644
index 000000000..26fac8069
--- /dev/null
+++ b/kpresenter/templates/common_icon/crsc-action-template_titleportrait.svgz
Binary files differ
diff --git a/kpresenter/templates/common_icon/crsc-action-template_twocolumnlandscape.svgz b/kpresenter/templates/common_icon/crsc-action-template_twocolumnlandscape.svgz
new file mode 100644
index 000000000..a8515751a
--- /dev/null
+++ b/kpresenter/templates/common_icon/crsc-action-template_twocolumnlandscape.svgz
Binary files differ
diff --git a/kpresenter/templates/common_icon/crsc-action-template_twocolumnportrait.svgz b/kpresenter/templates/common_icon/crsc-action-template_twocolumnportrait.svgz
new file mode 100644
index 000000000..0e247d2be
--- /dev/null
+++ b/kpresenter/templates/common_icon/crsc-action-template_twocolumnportrait.svgz
Binary files differ
diff --git a/kpresenter/templates/legal/.directory b/kpresenter/templates/legal/.directory
new file mode 100644
index 000000000..fda415f73
--- /dev/null
+++ b/kpresenter/templates/legal/.directory
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Name=Legal
+Name[af]=Wettig
+Name[az]=Qanuni
+Name[bg]=Юридически формат (Legal)
+Name[br]=Lisans
+Name[cy]=Cyfreithiol
+Name[eu]=Legala
+Name[fa]=مجاز
+Name[fo]=US Legal (216×356 mm, amerikansk pappírsstødd)
+Name[ga]=Dlí
+Name[hi]=लीगल
+Name[hr]=Pravno
+Name[it]=US legal
+Name[nds]=US Legal
+Name[ne]=कानूनी
+Name[pl]=Wzorce
+Name[sr]=Легал
+Name[tr]=Yasal
+Name[ven]=Zwa milayo
+Name[wa]=Legal US
+Name[xh]=Esemthethweni
+Name[zu]=Okusemthethweni
+X-KDE-DefaultTab=true
diff --git a/kpresenter/templates/legal/Makefile.am b/kpresenter/templates/legal/Makefile.am
new file mode 100644
index 000000000..d6cfda8e1
--- /dev/null
+++ b/kpresenter/templates/legal/Makefile.am
@@ -0,0 +1,20 @@
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kpresenter/templates/legal
+ for file in OneColumnLandscape.desktop TitleLandscape.desktop \
+ TwoColumnLandscape.desktop emptyLandscape.desktop OneColumnPortrait.desktop \
+ TitlePortrait.desktop TwoColumnPortrait.desktop emptyPortrait.desktop; do \
+ $(INSTALL_DATA) $(srcdir)/../common_desktop/$$file $(DESTDIR)$(kde_datadir)/kpresenter/templates/legal/$$file ;\
+ done
+ $(INSTALL_DATA) $(srcdir)/.directory $(DESTDIR)$(kde_datadir)/kpresenter/templates/legal
+
+templatesrc_DATA = \
+ OneColumnLandscape.kpt \
+ OneColumnPortrait.kpt \
+ TitleLandscape.kpt \
+ TitlePortrait.kpt \
+ TwoColumnLandscape.kpt \
+ TwoColumnPortrait.kpt \
+ emptyLandscape.kpt \
+ emptyPortrait.kpt
+templatesrcdir = $(kde_datadir)/kpresenter/templates/legal/.source
diff --git a/kpresenter/templates/legal/OneColumnLandscape.kpt b/kpresenter/templates/legal/OneColumnLandscape.kpt
new file mode 100644
index 000000000..0699530b8
--- /dev/null
+++ b/kpresenter/templates/legal/OneColumnLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/legal/OneColumnPortrait.kpt b/kpresenter/templates/legal/OneColumnPortrait.kpt
new file mode 100644
index 000000000..208f7b593
--- /dev/null
+++ b/kpresenter/templates/legal/OneColumnPortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/legal/TitleLandscape.kpt b/kpresenter/templates/legal/TitleLandscape.kpt
new file mode 100644
index 000000000..6a1813f30
--- /dev/null
+++ b/kpresenter/templates/legal/TitleLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/legal/TitlePortrait.kpt b/kpresenter/templates/legal/TitlePortrait.kpt
new file mode 100644
index 000000000..b5e926779
--- /dev/null
+++ b/kpresenter/templates/legal/TitlePortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/legal/TwoColumnLandscape.kpt b/kpresenter/templates/legal/TwoColumnLandscape.kpt
new file mode 100644
index 000000000..c112035b3
--- /dev/null
+++ b/kpresenter/templates/legal/TwoColumnLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/legal/TwoColumnPortrait.kpt b/kpresenter/templates/legal/TwoColumnPortrait.kpt
new file mode 100644
index 000000000..b68b64922
--- /dev/null
+++ b/kpresenter/templates/legal/TwoColumnPortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/legal/emptyLandscape.kpt b/kpresenter/templates/legal/emptyLandscape.kpt
new file mode 100644
index 000000000..afaf2c0e6
--- /dev/null
+++ b/kpresenter/templates/legal/emptyLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/legal/emptyPortrait.kpt b/kpresenter/templates/legal/emptyPortrait.kpt
new file mode 100644
index 000000000..fbe0f2223
--- /dev/null
+++ b/kpresenter/templates/legal/emptyPortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/letter/.directory b/kpresenter/templates/letter/.directory
new file mode 100644
index 000000000..b9e17560d
--- /dev/null
+++ b/kpresenter/templates/letter/.directory
@@ -0,0 +1,43 @@
+[Desktop Entry]
+Name=Letter
+Name[af]=Brief
+Name[az]=Məktub
+Name[bg]=писмо
+Name[br]=Lizher
+Name[ca]=Carta
+Name[cy]=Llythyr
+Name[de]=US Letter
+Name[eo]=Letero
+Name[es]=Carta
+Name[fa]=نامه
+Name[fo]=US Letter (216×279 mm, amerikansk pappírsstødd)
+Name[fr]=Lettre
+Name[fy]=Brief
+Name[ga]=Litir
+Name[he]=מכתב
+Name[hi]=पत्र
+Name[hr]=Pismo
+Name[is]=US Letter
+Name[it]=US letter
+Name[km]=សំបុត្រ
+Name[lt]=Laiškas
+Name[lv]=Vēstule
+Name[nds]=US Letter
+Name[ne]=अक्षर
+Name[nl]=Brief
+Name[pl]=List
+Name[pt]=Carta
+Name[pt_BR]=Carta
+Name[sr]=Писмо
+Name[sr@Latn]=Pismo
+Name[sv]=US Letter
+Name[tg]=Мактуб
+Name[tr]=Zarf
+Name[uz]=Xat
+Name[uz@cyrillic]=Хат
+Name[ven]=Lunwalo
+Name[wa]=Lete
+Name[xh]=Ileta
+Name[zh_CN]=信函
+Name[zu]=Incwadi
+X-KDE-DefaultTab=true
diff --git a/kpresenter/templates/letter/Makefile.am b/kpresenter/templates/letter/Makefile.am
new file mode 100644
index 000000000..8528704a1
--- /dev/null
+++ b/kpresenter/templates/letter/Makefile.am
@@ -0,0 +1,20 @@
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(kde_datadir)/kpresenter/templates/letter
+ for file in OneColumnLandscape.desktop TitleLandscape.desktop \
+ TwoColumnLandscape.desktop emptyLandscape.desktop OneColumnPortrait.desktop \
+ TitlePortrait.desktop TwoColumnPortrait.desktop emptyPortrait.desktop; do \
+ $(INSTALL_DATA) $(srcdir)/../common_desktop/$$file $(DESTDIR)$(kde_datadir)/kpresenter/templates/letter/$$file ;\
+ done
+ $(INSTALL_DATA) $(srcdir)/.directory $(DESTDIR)$(kde_datadir)/kpresenter/templates/letter
+
+templatesrc_DATA = \
+ OneColumnLandscape.kpt \
+ OneColumnPortrait.kpt \
+ TitleLandscape.kpt \
+ TitlePortrait.kpt \
+ TwoColumnLandscape.kpt \
+ TwoColumnPortrait.kpt \
+ emptyLandscape.kpt \
+ emptyPortrait.kpt
+templatesrcdir = $(kde_datadir)/kpresenter/templates/letter/.source
diff --git a/kpresenter/templates/letter/OneColumnLandscape.kpt b/kpresenter/templates/letter/OneColumnLandscape.kpt
new file mode 100644
index 000000000..aaabb23d8
--- /dev/null
+++ b/kpresenter/templates/letter/OneColumnLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/letter/OneColumnPortrait.kpt b/kpresenter/templates/letter/OneColumnPortrait.kpt
new file mode 100644
index 000000000..c390da522
--- /dev/null
+++ b/kpresenter/templates/letter/OneColumnPortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/letter/TitleLandscape.kpt b/kpresenter/templates/letter/TitleLandscape.kpt
new file mode 100644
index 000000000..f95749d8b
--- /dev/null
+++ b/kpresenter/templates/letter/TitleLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/letter/TitlePortrait.kpt b/kpresenter/templates/letter/TitlePortrait.kpt
new file mode 100644
index 000000000..a35454eb2
--- /dev/null
+++ b/kpresenter/templates/letter/TitlePortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/letter/TwoColumnLandscape.kpt b/kpresenter/templates/letter/TwoColumnLandscape.kpt
new file mode 100644
index 000000000..8e02a733c
--- /dev/null
+++ b/kpresenter/templates/letter/TwoColumnLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/letter/TwoColumnPortrait.kpt b/kpresenter/templates/letter/TwoColumnPortrait.kpt
new file mode 100644
index 000000000..217656945
--- /dev/null
+++ b/kpresenter/templates/letter/TwoColumnPortrait.kpt
Binary files differ
diff --git a/kpresenter/templates/letter/emptyLandscape.kpt b/kpresenter/templates/letter/emptyLandscape.kpt
new file mode 100644
index 000000000..9ef59eece
--- /dev/null
+++ b/kpresenter/templates/letter/emptyLandscape.kpt
Binary files differ
diff --git a/kpresenter/templates/letter/emptyPortrait.kpt b/kpresenter/templates/letter/emptyPortrait.kpt
new file mode 100644
index 000000000..b35b032f3
--- /dev/null
+++ b/kpresenter/templates/letter/emptyPortrait.kpt
Binary files differ
diff --git a/kpresenter/tests/oasis-kpresenter.sh b/kpresenter/tests/oasis-kpresenter.sh
new file mode 100755
index 000000000..7da7ec6f3
--- /dev/null
+++ b/kpresenter/tests/oasis-kpresenter.sh
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+# This script helps finding out problems in the OASIS loading/saving code,
+# by converting .kpr -> .odp -> .kpr and comparing the initial and final .kpr files.
+# We use the kpr format as a "dump" of the KPresenter data, to check if everything is correct
+# in memory, but the point is of course to ensure that the .odp has all the information.
+
+# To use this script, you need to pass the full path to an existing kpr file as argument.
+# Don't use a relative path, dcopstart won't handle it
+input="$1"
+
+# Set this to 1 in order to validate the saved oasis document using oasislint
+checkoasis="1"
+
+appname=kpresenter
+oldextension=kpr
+oasisextension=odp
+oasismimetype=application/vnd.oasis.opendocument.presentation
+
+test -f "$input" || { echo "No such file $input"; exit 1; }
+
+# Load old native file
+appid=`dcopstart $appname $input`
+test -n "$appid" || { echo "Error starting $appname!"; exit 1; }
+while `dcop $appid Document-0 isLoading` == "true"; do
+ sleep 1;
+done
+
+# Save again (in case of changes in syntax etc.)
+origfile=$PWD/oasisregtest-initial.$oldextension
+dcop $appid Document-0 saveAs $origfile || exit 1
+test -f $origfile || exit 1
+
+# Save to OASIS
+tmpoasisfile=$PWD/oasisregtest.$oasisextension
+dcop $appid Document-0 setOutputMimeType $oasismimetype || exit 1
+dcop $appid Document-0 saveAs $tmpoasisfile || exit 1
+test -f $tmpoasisfile || exit 1
+
+dcopquit $appid
+
+# Load resulting OASIS file, convert to old native format
+tmpnativefile=$PWD/oasisregtest-final.$oldextension
+appid=`dcopstart $appname $tmpoasisfile`
+while `dcop $appid Document-0 isLoading` == "true"; do
+ sleep 1;
+done
+dcop $appid Document-0 setOutputMimeType "application/x-$appname" || exit 1
+dcop $appid Document-0 saveAs $tmpnativefile || exit 1
+test -f $tmpnativefile || exit 1
+
+# Unpack everything
+rm -rf oasisregtest-orig
+mkdir oasisregtest-orig
+rm -rf oasisregtest-final
+mkdir oasisregtest-final
+rm -rf oasisregtest-oasis
+mkdir oasisregtest-oasis
+cd oasisregtest-orig || exit 1
+unzip $origfile || exit 1
+cd ..
+cd oasisregtest-final || exit 1
+unzip $tmpnativefile || exit 1
+cd ..
+# Validate OASIS format
+cd oasisregtest-oasis || exit 1
+unzip $tmpoasisfile || exit 1
+if test "$checkoasis" = "1"; then
+ if type -p oasislint >/dev/null 2>&1; then
+ for f in content.xml styles.xml meta.xml settings.xml; do
+ echo "Checking $f..." ; oasislint $f
+ done
+ fi
+ if type -p oasislint-strict >/dev/null 2>&1; then
+ for f in content.xml styles.xml meta.xml settings.xml; do
+ echo "Checking $f strict..." && oasislint-strict $f
+ done
+ fi
+fi
+cd ..
+
+# Compare initial and final "native format" files
+diff -urp oasisregtest-orig oasisregtest-final 2>&1 | tee oasisdiff | less
+
+echo "See oasisregtest-oasis for the OASIS xml files."
+echo "For a better diffing mechanism, launch xemacs and paste into a terminal:"
+echo "gnudoit '(ediff-files \"$PWD/oasisregtest-orig/maindoc.xml\" \"$PWD/oasisregtest-final/maindoc.xml\")'"
diff --git a/kpresenter/textpropertyui.ui b/kpresenter/textpropertyui.ui
new file mode 100644
index 000000000..16ebb3410
--- /dev/null
+++ b/kpresenter/textpropertyui.ui
@@ -0,0 +1,61 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>TextPropertyUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>TextPropertyUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>187</width>
+ <height>246</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>protectContent</cstring>
+ </property>
+ <property name="text">
+ <string>Prot&amp;ect content</string>
+ </property>
+ </widget>
+ <widget class="KPMarginWidget" row="1" column="0">
+ <property name="name">
+ <cstring>marginWidget</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>KPMarginWidget</class>
+ <header location="global">KPrMarginWidget.h</header>>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="PNG" length="826">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b00000301494441541895b59531681b5718c77f0e377c070e3c810a3a70e0041eac51852e0a19e45134830a1d9a4c69a04bc8928e990a693a640e1d0c8642b08742321894c1507991b484c890902bb8701a047760c3bd21701fe4201dde49b6a41a32b8df72dcbbeffdbefffbbfefbd5b1b0c07cce266ebe667ae2006c3c1dada0cdc3be87d6e6c35b0d692a409d9c7ec8b20d65ae29398d19b1114e7e3de4ce98b3f5e10dc0053cf0951b4506496e1b964bf7ce6c585d9054c62d01d617ca48be0596553cf496d8f2c8b01c5f795fc93904e85ec4c01a152857a5d9175d0b2805c872080f18595ccc1499a10a225d4e2fbc2877786fe81253ab6c04c8d106e09db5d43ab0d146e5c64d1a23938fb98a185cea1c33eecfd9eba49eb427dcb201e245365f2b7b2fb5b4a3a31dcb927178afe07d86901df870fefa4842aed6f6b74ba42e52b4014d580e1eb9cbd9d94de7e4aad16d2f9be02d805f0b5e532f927a1ffcacea1777f122a8105b164a7c25faf323a5d9f1f1fd600e1e5bec59e2d4b5c7ef5209d0ad17b8b31864e57c0b3e0815ac3ee33253ab664a770ff5185d1a1cb8d2267d3e58aa1dc7d2508cbe597d0e74fdd269aaaf0f52d414c4ea3e9762c996869e42560d7a72e41c4799a2586e74f95e8d8151481fa86efbe7b3398ac58b1a2b8527589f15451ad303ac2293542ad6648a796278f13a27185e4c4754310facb98c53a79e19a3fdc1426ff28c3d7399d1f7cb25343eb96106cf83c790ce9c4f2eb831855c55485663327992eb6dc8a6259874ed700b0b793323cccb9ffa842b30d6133e3e75fea989ac15a8b16ca76b746b0b92278d919774c5b6d48a78697fb29bbcf52468742a32120909c24e899ce67beed5be2db01e22d1e9485bb620e47f9ee9e606a21bd3f5d3744c7e7c54d55e87443867d8b554515ac5db4620e8e4f62263170fd1cdee90aad7640141992891b0f367c9adfe4049bb07d3b7022bd8c687c0978f46684ee084150b65ac1fcca94591b7a90a496e4c095164fb016a2b192a497795cc0f84817aebe25f7bf70ccc54a575c555c03f78ffa5fc0570d1f0c076bff0232285a09283782c80000000049454e44ae426082</data>
+ </image>
+</images>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpmarginwidget.h</includehint>
+</includehints>
+</UI>
diff --git a/kpresenter/toolbar/Makefile.am b/kpresenter/toolbar/Makefile.am
new file mode 100644
index 000000000..10d50ebef
--- /dev/null
+++ b/kpresenter/toolbar/Makefile.am
@@ -0,0 +1,2 @@
+kpresentericondir = $(kde_datadir)/kpresenter/icons
+kpresentericon_ICON = AUTO
diff --git a/kpresenter/toolbar/action-alignobjs.svg b/kpresenter/toolbar/action-alignobjs.svg
new file mode 100644
index 000000000..771d58dcd
--- /dev/null
+++ b/kpresenter/toolbar/action-alignobjs.svg
@@ -0,0 +1,886 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="32px"
+ height="32px"
+ id="svg1333"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-alignobjs.svg"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr16-action-alignobjs.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45">
+ <defs
+ id="defs1335">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient2228">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop2230" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop2232" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3082">
+ <stop
+ style="stop-color:#fab100;stop-opacity:1;"
+ offset="0"
+ id="stop3084" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1;"
+ offset="1"
+ id="stop3086" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3082"
+ id="linearGradient3088"
+ x1="-0.56291676"
+ y1="15.499685"
+ x2="-7.1243687"
+ y2="10.812185"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.439113,0,0,1.421941,13.99909,-1.751571)" />
+ <linearGradient
+ id="linearGradient3111">
+ <stop
+ style="stop-color:#59a6ff;stop-opacity:1;"
+ offset="0"
+ id="stop3113" />
+ <stop
+ style="stop-color:#a9d7ff;stop-opacity:1;"
+ offset="1"
+ id="stop3115" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3111"
+ id="linearGradient3117"
+ x1="21.102264"
+ y1="16.332613"
+ x2="13.514696"
+ y2="6.4625802"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.461537,0,0,1.461537,-1.46152,-0.155237)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2228"
+ id="linearGradient2234"
+ x1="2.1610777"
+ y1="11.521504"
+ x2="13.153853"
+ y2="16.398424"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.984657,0,0,0.972908,-0.39266,-0.17807)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2228"
+ id="linearGradient2238"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.984657,0,0,0.972908,16.11774,-2.514927)"
+ x1="2.1610777"
+ y1="11.521504"
+ x2="13.153853"
+ y2="16.398424" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3111"
+ id="linearGradient2244"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.461537,0,0,1.461537,-1.46152,-0.155237)"
+ x1="21.102264"
+ y1="16.332613"
+ x2="13.514696"
+ y2="6.4625802" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2228"
+ id="linearGradient2246"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.984657,0,0,0.972908,16.11774,-2.514927)"
+ x1="2.1610777"
+ y1="11.521504"
+ x2="13.153853"
+ y2="16.398424" />
+ <linearGradient
+ y2="296.31726"
+ x2="58.429586"
+ y1="232.78678"
+ x1="18.809567"
+ gradientTransform="matrix(1.278924,0,0,0.781908,-5.933544,5.34019)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1227"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <radialGradient
+ r="181.02384"
+ fy="209.99586"
+ fx="408.92502"
+ cy="209.99586"
+ cx="408.92502"
+ gradientTransform="matrix(0.746344,0,0,1.339864,-5.933544,5.34019)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient1226"
+ xlink:href="#light100to25to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="105.15331"
+ x2="152.95656"
+ y1="-21.820315"
+ x1="250.67159"
+ gradientTransform="matrix(0.746283,0,0,1.339974,-5.933544,5.34019)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1225"
+ xlink:href="#greantodarkgrean"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="297.71126"
+ x2="280.66960"
+ y1="65.382599"
+ x1="78.528797"
+ spreadMethod="reflect"
+ gradientTransform="matrix(1.056051,0,0,0.946924,-5.933544,5.34019)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1224"
+ xlink:href="#greantodarkgrean"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="300.40905"
+ x2="285.12177"
+ y1="59.381731"
+ x1="75.412579"
+ spreadMethod="reflect"
+ gradientTransform="matrix(1.053976,0,0,0.948788,-5.933544,5.34019)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1222"
+ xlink:href="#greantodarkgrean"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="4.3021142e-16"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient581" />
+ <linearGradient
+ xlink:href="#blacktowhite"
+ collect="always"
+ id="linearGradient9077"
+ y2="0.46428570"
+ x2="0.99264705"
+ y1="0.46428570"
+ x1="0.016544119" />
+ <linearGradient
+ xlink:href="#garylighttowite"
+ collect="always"
+ id="linearGradient5108"
+ y2="0.46428570"
+ x2="0.99264705"
+ y1="0.46428570"
+ x1="0.016544119" />
+ <linearGradient
+ xlink:href="#graytolightgray"
+ collect="always"
+ id="linearGradient5103"
+ y2="0.46428570"
+ x2="0.99264705"
+ y1="0.46428570"
+ x1="0.016544119" />
+ <linearGradient
+ xlink:href="#graytoblack"
+ id="linearGradient782"
+ y2="0.46428570"
+ x2="0.99264705"
+ y1="0.46428570"
+ x1="0.016544119" />
+ <linearGradient
+ xlink:href="#reddarktoblack"
+ collect="always"
+ id="linearGradient4473"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-3.4965520e-17" />
+ <linearGradient
+ xlink:href="#redtodarkred"
+ collect="always"
+ id="linearGradient4471"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-2.0979312e-17" />
+ <linearGradient
+ xlink:href="#greandarktobgrean"
+ collect="always"
+ id="linearGradient3704"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-6.9931040e-18" />
+ <linearGradient
+ xlink:href="#greantodarkgrean"
+ collect="always"
+ id="linearGradient3080"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-5.4454054e-17" />
+ <linearGradient
+ xlink:href="#bluelightlesstoblue"
+ collect="always"
+ id="linearGradient3471"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-4.7460950e-17" />
+ <linearGradient
+ xlink:href="#blueligtmoretoblue"
+ collect="always"
+ id="linearGradient3464"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-3.3474742e-17" />
+ <linearGradient
+ xlink:href="#shadow25tolineto0"
+ collect="always"
+ id="linearGradient3445"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-5.0968344e-16" />
+ <linearGradient
+ xlink:href="#shadow0wto25to0"
+ collect="always"
+ id="linearGradient3440"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-3.1582809e-16" />
+ <linearGradient
+ xlink:href="#shadow25to25w"
+ collect="always"
+ id="linearGradient3435"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-3.5182360e-16" />
+ <linearGradient
+ xlink:href="#sadow75to0w"
+ collect="always"
+ id="linearGradient3431"
+ y2="0.55782312"
+ x2="0.99077493"
+ y1="0.55782312"
+ x1="-0.0092250919" />
+ <linearGradient
+ xlink:href="#shadow100to0"
+ collect="always"
+ id="linearGradient3427"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="6.8293895e-16" />
+ <linearGradient
+ xlink:href="#light50to25to7"
+ collect="always"
+ id="linearGradient2794"
+ y2="0.56802720"
+ x2="1.0000000"
+ y1="0.57142860"
+ x1="0.0036900369" />
+ <linearGradient
+ xlink:href="#light100to25to0"
+ collect="always"
+ id="linearGradient2788"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-6.5594231e-17" />
+ <linearGradient
+ xlink:href="#light100to75to0"
+ collect="always"
+ id="linearGradient2781"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="1.2826112e-16" />
+ <linearGradient
+ xlink:href="#light75to25"
+ collect="always"
+ id="linearGradient2776"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="9.2265605e-17" />
+ <linearGradient
+ xlink:href="#light75to0"
+ collect="always"
+ id="linearGradient2771"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="5.6270093e-17" />
+ <linearGradient
+ xlink:href="#light100to0"
+ collect="always"
+ id="linearGradient2766"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="2.0274581e-17" />
+ <linearGradient
+ xlink:href="#orangelesstoyelow"
+ collect="always"
+ id="linearGradient2757"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-6.9931040e-18" />
+ <linearGradient
+ xlink:href="#orangemoretoyelow"
+ collect="always"
+ id="linearGradient2756"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-1.3227267e-17" />
+ <linearGradient
+ xlink:href="#orangetoyelow"
+ collect="always"
+ id="linearGradient2755"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-3.3718688e-17" />
+ <linearGradient
+ xlink:href="#bluelignonlinblu"
+ collect="always"
+ id="linearGradient2754"
+ y2="0.50000000"
+ x2="1.0000000"
+ y1="0.50000000"
+ x1="-1.9488534e-17" />
+ <linearGradient
+ id="orangetoyelow">
+ <stop
+ id="stop2661"
+ offset="0.0000000"
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2662"
+ offset="1.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="orangemoretoyelow">
+ <stop
+ id="stop2671"
+ offset="0.0000000"
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2679"
+ offset="0.74641621"
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2672"
+ offset="1.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="orangelesstoyelow">
+ <stop
+ id="stop2689"
+ offset="0.0000000"
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2690"
+ offset="0.25358382"
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2691"
+ offset="1.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="orangetoblackorange">
+ <stop
+ id="stop4207"
+ offset="0.0000000"
+ style="stop-color:#ff8b00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop4209"
+ offset="1.0000000"
+ style="stop-color:#4d0200;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="reddarktoblack">
+ <stop
+ id="stop3230"
+ offset="0.0000000"
+ style="stop-color:#8e0000;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3231"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="redtodarkred">
+ <stop
+ id="stop3856"
+ offset="0.0000000"
+ style="stop-color:#ff0000;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3855"
+ offset="1.0000000"
+ style="stop-color:#920000;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="greandarktobgrean">
+ <stop
+ id="stop4492"
+ offset="0.0000000"
+ style="stop-color:#00ad01;stop-opacity:1.0000000;" />
+ <stop
+ id="stop4493"
+ offset="1.0000000"
+ style="stop-color:#15720f;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="greandraktoblack">
+ <stop
+ id="stop7328"
+ offset="0.0000000"
+ style="stop-color:#007c00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop7329"
+ offset="1.0000000"
+ style="stop-color:#025a00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="greantodarkgrean">
+ <stop
+ id="stop5123"
+ offset="0.0000000"
+ style="stop-color:#00ff01;stop-opacity:1.0000000;" />
+ <stop
+ id="stop5124"
+ offset="1.0000000"
+ style="stop-color:#15980f;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluedarktoblackblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop2959"
+ offset="0.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2960"
+ offset="1.0000000"
+ style="stop-color:#032442;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="blueligtmoretoblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop3457"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3465"
+ offset="0.74217570"
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3463"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluelignonlinblu"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop84"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop86"
+ offset="0.13480000"
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop88"
+ offset="0.32049999"
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop90"
+ offset="0.56800002"
+ style="stop-color:#3293fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop92"
+ offset="0.75340003"
+ style="stop-color:#107bfe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop94"
+ offset="0.85390002"
+ style="stop-color:#0372fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop96"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluelightlesstoblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop3468"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3469"
+ offset="0.24089479"
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3470"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluelighttowhite"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop6078"
+ offset="0.0055999998"
+ style="stop-color:#69d3ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop6080"
+ offset="1.0000000"
+ style="stop-color:#edffff;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ id="light100to0">
+ <stop
+ id="stop2764"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2765"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="light75to0">
+ <stop
+ id="stop2769"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.72916669;" />
+ <stop
+ id="stop2770"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="light75to25">
+ <stop
+ id="stop2774"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.72941178;" />
+ <stop
+ id="stop2775"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.26249999;" />
+ </linearGradient>
+ <linearGradient
+ id="light100to75to0">
+ <stop
+ id="stop2779"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2782"
+ offset="0.50000000"
+ style="stop-color:#ffffff;stop-opacity:0.77499998;" />
+ <stop
+ id="stop2780"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="light100to25to0">
+ <stop
+ id="stop2785"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2786"
+ offset="0.50000000"
+ style="stop-color:#ffffff;stop-opacity:0.28749999;" />
+ <stop
+ id="stop2787"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="light50to25to7">
+ <stop
+ id="stop2791"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.47450981;" />
+ <stop
+ id="stop2795"
+ offset="0.50000000"
+ style="stop-color:#ffffff;stop-opacity:0.25833333;" />
+ <stop
+ id="stop2793"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.10833333;" />
+ </linearGradient>
+ <linearGradient
+ id="shadow100to0">
+ <stop
+ id="stop3425"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3426"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="sadow75to0w">
+ <stop
+ id="stop3429"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:0.72941178;" />
+ <stop
+ id="stop3430"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="shadow25to25w">
+ <stop
+ id="stop3433"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:0.25416666;" />
+ <stop
+ id="stop3434"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.26274511;" />
+ </linearGradient>
+ <linearGradient
+ id="shadow0wto25to0">
+ <stop
+ id="stop3437"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ <stop
+ id="stop3438"
+ offset="0.50000000"
+ style="stop-color:#000000;stop-opacity:0.27916667;" />
+ <stop
+ id="stop3439"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="shadow25tolineto0">
+ <stop
+ id="stop3442"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:0.25490198;" />
+ <stop
+ id="stop3450"
+ offset="0.45393065"
+ style="stop-color:#000000;stop-opacity:0.029166667;" />
+ <stop
+ id="stop3449"
+ offset="0.50000000"
+ style="stop-color:#000000;stop-opacity:0.37083334;" />
+ <stop
+ id="stop3451"
+ offset="0.53497112"
+ style="stop-color:#000000;stop-opacity:0.062745102;" />
+ <stop
+ id="stop3444"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ id="stop5097"
+ offset="0.0000000"
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;" />
+ <stop
+ id="stop5098"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="graytolightgray">
+ <stop
+ id="stop5101"
+ offset="0.0000000"
+ style="stop-color:#d4d3d3;stop-opacity:1.0000000;" />
+ <stop
+ id="stop5102"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="garylighttowite">
+ <stop
+ id="stop5106"
+ offset="0.0000000"
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;" />
+ <stop
+ id="stop5107"
+ offset="1.0000000"
+ style="stop-color:#d3d4d4;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="blacktowhite">
+ <stop
+ id="stop2476"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2475"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="9.9091949"
+ inkscape:cx="-4.2974893"
+ inkscape:cy="-1.5059771"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ inkscape:window-width="1215"
+ inkscape:window-height="832"
+ inkscape:window-x="111"
+ inkscape:window-y="251" />
+ <metadata
+ id="metadata1338">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <g
+ id="g2240"
+ transform="matrix(0.988308,0,0,0.995611,0.6666,-0.578238)"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <rect
+ ry="0.45318019"
+ style="opacity:1;fill:url(#linearGradient2244);fill-opacity:1;fill-rule:nonzero;stroke:#166cd4;stroke-width:1.46153665;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect3103"
+ width="11.69226"
+ height="14.613266"
+ x="18.269232"
+ y="9.3468437"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ style="opacity:1;fill:url(#linearGradient2246);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ d="M 18.495775,11.158046 L 18.495775,23.24121 L 20.006347,23.24121 L 20.006347,11.158046 L 29.069782,11.158046 L 29.069782,9.6372558 L 20.147964,9.6372558 C 19.145789,9.6372558 18.495775,10.20501 18.495775,11.158046 z "
+ id="path2236"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cccccccc" />
+ </g>
+ <rect
+ style="opacity:1;fill:url(#linearGradient3088);fill-opacity:1;fill-rule:nonzero;stroke:#b86920;stroke-width:1.4305011;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect1334"
+ width="11.514411"
+ height="8.5335951"
+ x="1.7660322"
+ y="11.755434"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ ry="0.48048636" />
+ <path
+ style="opacity:1;fill:url(#linearGradient2234);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ d="M 1.9853704,13.494903 L 1.9853704,19.578067 L 3.495943,19.578067 L 3.495943,13.494903 L 12.559378,13.494903 L 12.559378,11.974113 L 3.6375592,11.974113 C 2.6353841,11.974113 1.9853704,12.541867 1.9853704,13.494903 z "
+ id="rect3121"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cccccccc" />
+ <rect
+ style="opacity:1;fill:#4c4465;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect3119"
+ width="32.153809"
+ height="2.0000002"
+ x="0"
+ y="15"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <rect
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ y="-17"
+ x="0"
+ height="2.0000002"
+ width="32.153809"
+ id="rect1331"
+ style="opacity:1;fill:#4c4465;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ transform="matrix(0,1,-1,0,0,0)" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-autoform.svg b/kpresenter/toolbar/action-autoform.svg
new file mode 100644
index 000000000..06bd98800
--- /dev/null
+++ b/kpresenter/toolbar/action-autoform.svg
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg5082"
+ sodipodi:version="0.32"
+ inkscape:version="0.43+devel"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-autoform.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr16-action-autoform.png"
+ inkscape:export-xdpi="11.25"
+ inkscape:export-ydpi="11.25">
+ <defs
+ id="defs3">
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2208"
+ x1="2.6070418"
+ y1="-25.389669"
+ x2="112.17229"
+ y2="94.497658"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.757545,0,3.448185e-7,0.719636,-12.63443,33.29376)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2216"
+ x1="2.6070418"
+ y1="-25.389669"
+ x2="112.17229"
+ y2="94.497658"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.757545,0,3.448185e-7,0.719636,-12.63443,33.29376)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.328125"
+ inkscape:cx="100.05634"
+ inkscape:cy="72.663714"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="780"
+ inkscape:window-height="590"
+ inkscape:window-x="453"
+ inkscape:window-y="148" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <rect
+ style="opacity:1;fill:url(#linearGradient2216);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient2208);stroke-width:2.61298919;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect1327"
+ width="93.55146"
+ height="88.412636"
+ x="-10.813479"
+ y="34.603531"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ transform="matrix(1,0,0.357909,0.933756,0,0)" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-circle.svg b/kpresenter/toolbar/action-circle.svg
new file mode 100644
index 000000000..b7b07ea29
--- /dev/null
+++ b/kpresenter/toolbar/action-circle.svg
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg5082"
+ sodipodi:version="0.32"
+ inkscape:version="0.43+devel"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-circle.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <defs
+ id="defs3">
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient4335"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.395481,0.716599)"
+ x1="70.478043"
+ y1="34.964851"
+ x2="151.68063"
+ y2="193.08136" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient4334"
+ gradientUnits="userSpaceOnUse"
+ x1="99.916199"
+ y1="25.734213"
+ x2="209.91537"
+ y2="136.16571" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.328125"
+ inkscape:cx="64"
+ inkscape:cy="70.625193"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="780"
+ inkscape:window-height="590"
+ inkscape:window-x="374"
+ inkscape:window-y="248" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ sodipodi:type="arc"
+ style="fill:url(#linearGradient4334);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4335);stroke-width:3.63902092;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ id="path1250"
+ sodipodi:cx="155.63631"
+ sodipodi:cy="81.918655"
+ sodipodi:rx="53.226269"
+ sodipodi:ry="53.226269"
+ d="M 208.86258 81.918655 A 53.226269 53.226269 0 1 1 102.41004,81.918655 A 53.226269 53.226269 0 1 1 208.86258 81.918655 z"
+ transform="matrix(1.138155,0,0,1.138155,-113.2509,-29.34881)"
+ inkscape:export-filename="/home/rob/icon play/helpwithopenoffice/working area/shapes_filled.png"
+ inkscape:export-xdpi="72.059998"
+ inkscape:export-ydpi="72.059998"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-closed_cubicbeziercurve.svg b/kpresenter/toolbar/action-closed_cubicbeziercurve.svg
new file mode 100644
index 000000000..4b1c04965
--- /dev/null
+++ b/kpresenter/toolbar/action-closed_cubicbeziercurve.svg
@@ -0,0 +1,444 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg1978"
+ sodipodi:version="0.32"
+ inkscape:version="0.42.2"
+ sodipodi:docbase="/home/tz/develop/kpresenter/newicons/tz"
+ sodipodi:docname="action-closed_cubicbeziercurve.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr16-action-closed_cubicbeziercurve.png"
+ inkscape:export-xdpi="11.25"
+ inkscape:export-ydpi="11.25">
+ <defs
+ id="defs3">
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45939"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45938"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45937"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45936"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45934"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45933"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45932"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45931"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ id="stop1979" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ id="stop1978" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45930"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45929"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45928"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18528"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18527"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18526"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90196079;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1399"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1401"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1403"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1405"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1407"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1409"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1411"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1413"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1383"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1385"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1387"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1389"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2270"
+ x1="0.42874196"
+ y1="1.6257921"
+ x2="53.713982"
+ y2="96.934631"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(0.469375,4.224373)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.1304936"
+ inkscape:cx="50.447024"
+ inkscape:cy="66.980738"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="1392"
+ inkscape:window-height="975"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.08452704pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0"
+ d="M 0.74499569,127.24869 L 127.53555,0.74499569 M 127.53555,127.24869 L 0.74499569,0.74499569"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ sodipodi:nodetypes="ccsc"
+ id="path43061"
+ d="M 117.76012,7.9858699 L 11.483549,121.10967 C 11.285172,54.470515 41.204649,60.364712 62.038559,60.364712 C 86.142516,60.364712 117.76012,70.309850 117.76012,7.9858699 z "
+ style="fill:url(#linearGradient2270);fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:3.4171272pt;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1.0000000" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-closed_freehand.svg b/kpresenter/toolbar/action-closed_freehand.svg
new file mode 100644
index 000000000..6db334bc9
--- /dev/null
+++ b/kpresenter/toolbar/action-closed_freehand.svg
@@ -0,0 +1,482 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg1978"
+ sodipodi:version="0.32"
+ inkscape:version="0.42.2"
+ sodipodi:docbase="/home/tz/develop/kpresenter/newicons/tz"
+ sodipodi:docname="action-closed_freehand.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr48-action-closed_polyline.png"
+ inkscape:export-xdpi="33.75"
+ inkscape:export-ydpi="33.75">
+ <defs
+ id="defs3">
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45939"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45938"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45937"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45936"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45934"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45933"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45932"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45931"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ id="stop1979" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ id="stop1978" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45930"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45929"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45928"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18528"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18527"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18526"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90196079;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1399"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1401"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1403"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1405"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1407"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1409"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1411"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1413"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1383"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1385"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1387"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1389"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2278"
+ x1="31.356537"
+ y1="24.749172"
+ x2="82.897346"
+ y2="114.25147"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2292"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2294"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient2296"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient2298"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.1304936"
+ inkscape:cx="2.3722361"
+ inkscape:cy="37.025380"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="780"
+ inkscape:window-height="590"
+ inkscape:window-x="306"
+ inkscape:window-y="125"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.08452704pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0"
+ d="M 0.74499569,127.24869 L 127.53555,0.74499569 M 127.53555,127.24869 L 0.74499569,0.74499569"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ sodipodi:nodetypes="cczzzc"
+ id="path43061"
+ d="M 23.885167,119.69707 L 3.7020514,76.983968 C 14.408803,64.514426 17.024974,27.872828 33.006056,31.126595 C 48.987138,34.380362 86.194872,101.39626 99.588543,96.506568 C 112.98221,91.616874 130.20968,5.8244888 118.06183,6.9515535 C 105.91397,8.0786181 43.386560,49.728373 23.885167,119.69707 z "
+ style="fill:url(#linearGradient2278);fill-opacity:1.0;fill-rule:evenodd;stroke:#000000;stroke-width:4.771;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-closed_polyline.svg b/kpresenter/toolbar/action-closed_polyline.svg
new file mode 100644
index 000000000..61b82c05c
--- /dev/null
+++ b/kpresenter/toolbar/action-closed_polyline.svg
@@ -0,0 +1,482 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg1978"
+ sodipodi:version="0.32"
+ inkscape:version="0.42.2"
+ sodipodi:docbase="/home/tz/develop/kpresenter/newicons/tz"
+ sodipodi:docname="action-closed_polyline.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr16-action-closed_cubicbeziercurve.png"
+ inkscape:export-xdpi="11.25"
+ inkscape:export-ydpi="11.25">
+ <defs
+ id="defs3">
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45939"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45938"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45937"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45936"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45934"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45933"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45932"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45931"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ id="stop1979" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ id="stop1978" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45930"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45929"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45928"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18528"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18527"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18526"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90196079;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1399"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1401"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1403"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0.000000,0.000000,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1405"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0.000000,0.000000,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1407"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1409"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1411"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0.000000,0.000000,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1413"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0.000000,0.000000,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1383"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1385"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1387"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0.000000,0.000000,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1389"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0.000000,0.000000,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2278"
+ x1="31.356537"
+ y1="24.749172"
+ x2="82.897346"
+ y2="114.25147"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2292"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2294"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient2296"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0.000000,0.000000,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient2298"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0.000000,0.000000,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.1304936"
+ inkscape:cx="2.3722361"
+ inkscape:cy="33.973265"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="780"
+ inkscape:window-height="590"
+ inkscape:window-x="306"
+ inkscape:window-y="125"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.08452704pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0"
+ d="M 0.74499569,127.24869 L 127.53555,0.74499569 M 127.53555,127.24869 L 0.74499569,0.74499569"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ sodipodi:nodetypes="ccccc"
+ id="path43061"
+ d="M 11.212048,116.41145 L 35.822305,39.575341 L 99.588543,96.506568 L 116.18433,10.237177 L 11.212048,116.41145 z "
+ style="fill:url(#linearGradient2278);fill-opacity:1.0;fill-rule:evenodd;stroke:#000000;stroke-width:4.771;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-closed_quadricbeziercurve.svg b/kpresenter/toolbar/action-closed_quadricbeziercurve.svg
new file mode 100644
index 000000000..8de64b3a0
--- /dev/null
+++ b/kpresenter/toolbar/action-closed_quadricbeziercurve.svg
@@ -0,0 +1,402 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg1978"
+ sodipodi:version="0.32"
+ inkscape:version="0.42.2"
+ sodipodi:docbase="/home/tz/develop/kpresenter/newicons/tz"
+ sodipodi:docname="action-closed_quadricbeziercurve.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr48-action-closed_quadricbeziercurve.png"
+ inkscape:export-xdpi="33.75"
+ inkscape:export-ydpi="33.75">
+ <defs
+ id="defs3">
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45939"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45938"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45937"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45936"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45934"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45933"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45932"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45931"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ id="stop1979" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ id="stop1978" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45930"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45929"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45928"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18528"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18527"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18526"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90196079;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1399"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1401"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1403"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1405"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1407"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1409"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1411"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1413"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2257"
+ x1="6.3837619"
+ y1="7.8605504"
+ x2="111.43236"
+ y2="90.439247"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.73666667"
+ inkscape:cx="41.402675"
+ inkscape:cy="-23.814480"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="1392"
+ inkscape:window-height="975"
+ inkscape:window-x="0"
+ inkscape:window-y="0" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.08452704pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0"
+ d="M 0.74499569,127.24869 L 127.53555,0.74499569 M 127.53555,127.24869 L 0.74499569,0.74499569"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ sodipodi:nodetypes="ccc"
+ id="path43061"
+ d="M 108.57710,116.67017 C 72.598454,116.48550 52.718174,116.06692 20.521481,115.99626 C 6.3292729,-25.730811 119.98392,-25.397955 108.57710,116.67017 z "
+ style="fill:url(#linearGradient2257);fill-opacity:1.0;fill-rule:evenodd;stroke:#000000;stroke-width:3.27860985pt;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-cubicbeziercurve.svg b/kpresenter/toolbar/action-cubicbeziercurve.svg
new file mode 100644
index 000000000..49b88cee7
--- /dev/null
+++ b/kpresenter/toolbar/action-cubicbeziercurve.svg
@@ -0,0 +1,432 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg1978"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-cubicbeziercurve.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr48-action-cubicbeziercurve.png"
+ inkscape:export-xdpi="33.75"
+ inkscape:export-ydpi="33.75">
+ <defs
+ id="defs3">
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45939"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45938"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45937"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45936"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45934"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45933"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45932"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45931"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ id="stop1979" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ id="stop1978" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45930"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45929"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45928"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18528"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18527"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18526"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90196079;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1399"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1401"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1403"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1405"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1407"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1409"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1411"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1413"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1383"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1385"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1387"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1389"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.1304936"
+ inkscape:cx="50.447024"
+ inkscape:cy="51.058503"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="780"
+ inkscape:window-height="590"
+ inkscape:window-x="306"
+ inkscape:window-y="125" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.08452704pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0"
+ d="M 0.74499569,127.24869 L 127.53555,0.74499569 M 127.53555,127.24869 L 0.74499569,0.74499569"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ sodipodi:nodetypes="csc"
+ id="path43061"
+ d="M 11.014174,116.8853 C 10.815797,50.246142 40.735274,56.140339 61.569184,56.140339 C 85.673141,56.140339 117.29075,66.085477 117.29075,3.7614967"
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.41712723pt;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-effect.png.svg b/kpresenter/toolbar/action-effect.png.svg
new file mode 100644
index 000000000..8b42185a1
--- /dev/null
+++ b/kpresenter/toolbar/action-effect.png.svg
@@ -0,0 +1,973 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64px"
+ height="64px"
+ id="svg3948"
+ sodipodi:version="0.32"
+ inkscape:version="0.43+devel"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr48-action-effect.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-effect.png.svg">
+ <defs
+ id="defs3950">
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3926"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2143"
+ id="linearGradient3924"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.830598,0.830598,-0.821235,0.821235,35.27076,-26.5421)"
+ x1="34.575813"
+ y1="4.7051349"
+ x2="34.315556"
+ y2="13.490262" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient3922"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.830598,0.830598,-0.821235,0.821235,36.93195,-24.8809)"
+ cx="32.423191"
+ cy="25.805140"
+ fx="32.423191"
+ fy="25.805140"
+ r="13.043961" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient3920"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.830598,0.830598,-0.821235,0.821235,36.93195,-24.8809)"
+ x1="30.899836"
+ y1="-3.8899043"
+ x2="34.512043"
+ y2="35.252430" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelightlesstoblue"
+ id="linearGradient3918"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.830598,0.830598,-0.821235,0.821235,36.93195,-24.8809)"
+ x1="31.632498"
+ y1="-8.6353083"
+ x2="30.865753"
+ y2="27.555025" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3916"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3914"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3912"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3910"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3908"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ y2="51.0311"
+ x2="88.7039"
+ y1="18.0479"
+ x1="55.6276"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2143">
+ <stop
+ id="stop2145"
+ stop-opacity="1"
+ offset="0"
+ stop-color="#ffffff" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.16494845;"
+ id="stop2147"
+ stop-opacity="1"
+ offset="1.0000000"
+ stop-color="#cccccc" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2143"
+ id="linearGradient3946"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,50.93451,68.42093)"
+ x1="34.575813"
+ y1="4.7051349"
+ x2="34.315556"
+ y2="13.490262" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient3944"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,49.27332,66.75974)"
+ cx="32.423191"
+ cy="25.805140"
+ fx="32.423191"
+ fy="25.805140"
+ r="13.043961" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient3942"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,49.27332,66.75976)"
+ x1="30.899836"
+ y1="-3.8899043"
+ x2="34.512043"
+ y2="35.252430" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluelightlesstoblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop3468"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3469"
+ offset="0.24089479"
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3470"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelightlesstoblue"
+ id="linearGradient3940"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,49.27332,66.75976)"
+ x1="31.632498"
+ y1="-8.6353083"
+ x2="30.865753"
+ y2="27.555025" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3938"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3936"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3934"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3932"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3930"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3928"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3860"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ x1="55.023899"
+ y1="38.641102"
+ x2="55.023899"
+ y2="69.925598" />
+ <linearGradient
+ id="wihitetolightgray">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop1885" />
+ <stop
+ style="stop-color:#d5d4d4;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop1886" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#wihitetolightgray"
+ id="linearGradient3858"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.000008,0.999992)"
+ x1="76.367203"
+ y1="201.91719"
+ x2="73.576660"
+ y2="176.39580" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="blueligtmoretoblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop3457" />
+ <stop
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;"
+ offset="0.74217570"
+ id="stop3465" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3463" />
+ </radialGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#blueligtmoretoblue"
+ id="radialGradient3856"
+ gradientUnits="userSpaceOnUse"
+ cx="75.443954"
+ cy="199.57872"
+ fx="75.443954"
+ fy="199.57872"
+ r="30.888128" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ fy="94.9063"
+ fx="56.1016"
+ r="56.5206"
+ cy="94.9063"
+ cx="56.1016"
+ id="XMLID_10_">
+ <stop
+ id="stop138"
+ style="stop-color:rgb(157,255,0)"
+ offset="0" />
+ <stop
+ id="stop140"
+ style="stop-color:rgb(0,151,0)"
+ offset="0.764" />
+ </radialGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_10_"
+ id="radialGradient3854"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ cx="56.1016"
+ cy="94.9063"
+ fx="56.1016"
+ fy="94.9063"
+ r="56.5206" />
+ <linearGradient
+ y2="35.9005"
+ x2="56.4961"
+ y1="146.565"
+ x1="56.4961"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_9_">
+ <stop
+ id="stop129"
+ style="stop-color:rgb(179,202,255)"
+ offset="0" />
+ <stop
+ id="stop131"
+ style="stop-color:rgb(0,83,189)"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_9_"
+ id="linearGradient3852"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ x1="56.4961"
+ y1="146.565"
+ x2="56.4961"
+ y2="35.9005" />
+ <linearGradient
+ id="light100to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2764" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2765" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3850"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ x1="56.496601"
+ y1="28.296900"
+ x2="56.496601"
+ y2="57.564800" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluedarktoblackblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop2959"
+ offset="0.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2960"
+ offset="1.0000000"
+ style="stop-color:#032442;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient3848"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.000007,0.999993)"
+ x1="70.420311"
+ y1="162.71689"
+ x2="77.398453"
+ y2="227.64589" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ fy="109.628"
+ fx="55.8057"
+ r="80.5726"
+ cy="109.628"
+ cx="55.8057"
+ id="XMLID_7_">
+ <stop
+ id="stop104"
+ style="stop-color:rgb(255,255,255)"
+ offset="0" />
+ <stop
+ id="stop106"
+ style="stop-color:rgb(230,249,255)"
+ offset="0.0626" />
+ <stop
+ id="stop108"
+ style="stop-color:rgb(206,242,255)"
+ offset="0.1386" />
+ <stop
+ id="stop2057"
+ style="stop-color:rgb(197,240,255)"
+ offset="0.1854" />
+ <stop
+ id="stop2059"
+ style="stop-color:rgb(29,116,217)"
+ offset="1" />
+ </radialGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_7_"
+ id="radialGradient3846"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ cx="55.8057"
+ cy="109.628"
+ fx="55.8057"
+ fy="109.628"
+ r="80.5726" />
+ <linearGradient
+ y2="138.443"
+ x2="182.81"
+ y1="52.8003"
+ x1="21.8281"
+ gradientUnits="userSpaceOnUse"
+ id="XMLID_4_">
+ <stop
+ id="stop59"
+ style="stop-color:rgb(255,255,255)"
+ offset="0" />
+ <stop
+ id="stop61"
+ style="stop-color:rgb(231,231,231)"
+ offset="0.5033" />
+ <stop
+ id="stop63"
+ style="stop-color:rgb(212,212,212)"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_4_"
+ id="linearGradient3844"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.235582,0,0,0.235582,61.90697,177.0787)"
+ x1="21.8281"
+ y1="52.8003"
+ x2="182.81"
+ y2="138.443" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="5.5"
+ inkscape:cx="32"
+ inkscape:cy="32"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:document-units="px"
+ inkscape:grid-bbox="true" />
+ <metadata
+ id="metadata3953">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <g
+ id="g3885"
+ transform="translate(0.235581,27.55904)"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <g
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="g3004"
+ transform="matrix(1.575911,0,0,1.161402,1.487093,8.018937)">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ id="path3006"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient3908);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ id="path3008"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+ <g
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="g2996"
+ transform="matrix(1.174643,0,0,1.161402,10.07566,3.373329)">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ id="path2998"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient3910);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ id="path3000"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+ <g
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="g3037"
+ transform="matrix(1.575911,0,0,-1.161402,1.021073,18.26267)">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ id="path3039"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient3912);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ id="path3041"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+ <g
+ transform="matrix(1.174643,0,0,1.161402,14.41513,22.87344)"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="g3025">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ id="path3027"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient3914);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ id="path3029"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+ <g
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="g3031"
+ transform="matrix(1.174643,0,0,-1.161402,9.728305,22.90827)">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ id="path3033"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient3916);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ id="path3035"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+ <path
+ id="rect2086"
+ d="M 62.584472,3.797575 L 62.691693,22.713142 L 43.776124,22.605922 L 43.668904,3.6903533 L 62.584472,3.797575 z "
+ style="fill:url(#linearGradient3918);fill-opacity:1;stroke:url(#linearGradient3920);stroke-width:2.61661315;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ id="path2960"
+ d="M 62.584472,3.797575 L 62.691693,22.713142 L 43.776124,22.605922 L 43.668904,3.6903533 L 62.584472,3.797575 z "
+ style="fill:url(#radialGradient3922);fill-opacity:1;stroke:none;stroke-width:1.94000006;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path2125"
+ d="M 60.233429,6.1486176 L 60.313846,20.335294 C 54.867608,18.643274 48.986008,12.996312 46.046752,6.0682007 L 60.233429,6.1486176 z "
+ style="fill:url(#linearGradient3924);fill-opacity:1;stroke:none;stroke-width:2.53999996;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <g
+ transform="matrix(1.174643,0,0,-1.161402,14.76249,3.408168)"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="g2992">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ id="path2181"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient3926);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ id="path2982"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+ </g>
+ <g
+ id="g3862"
+ transform="translate(16.39345,-37.19876)"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <g
+ transform="matrix(-1.174643,0,0,1.161402,49.95584,60.18309)"
+ id="g1716"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ style="opacity:0.50697674">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1718"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1720"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3928);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ <g
+ transform="matrix(-1.174643,0,0,-1.161402,54.64266,60.21792)"
+ id="g1722"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ style="opacity:0.50697674">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1724"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1726"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3930);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ <g
+ transform="matrix(-1.507287,0,0,-1.161402,62.66434,55.57232)"
+ id="g1728"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ style="opacity:0.50697674">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1730"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1732"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3932);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ <g
+ transform="matrix(-1.174643,0,0,-1.161402,49.60848,40.71781)"
+ id="g1742"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ style="opacity:0.50697674">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1744"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1746"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3934);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ <g
+ transform="matrix(-1.174643,0,0,1.161402,54.2953,40.68298)"
+ id="g1748"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ style="opacity:0.50697674">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1750"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1752"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3936);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ <g
+ transform="matrix(-1.468945,0,0,1.161402,61.93395,45.32858)"
+ id="g1754"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ style="opacity:0.50697674">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1756"
+ d="M 12.214286,0.9999972 L 30,0.9999972 L 28.071425,3 L 10.285711,3 L 12.214286,0.9999972 z "
+ style="fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path1758"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.03 L 9.9899967,3.03 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3938);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient3940);fill-opacity:1;stroke:url(#linearGradient3942);stroke-width:2.61661386;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 20.594832,41.107231 L 1.6792589,41.00001 L 1.7864789,59.915584 L 20.702054,60.022804 L 20.594832,41.107231 z "
+ id="path1734" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#radialGradient3944);fill-opacity:1;stroke:none;stroke-width:1.94000006;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 20.594834,41.107221 L 1.6792659,41 L 1.7864859,59.915569 L 20.702055,60.022789 L 20.594834,41.107221 z "
+ id="path1736" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient3946);fill-opacity:1;stroke:none;stroke-width:2.53999996;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 18.243791,43.458264 L 4.0571139,43.377847 C 5.7491339,48.824085 11.396096,54.705685 18.324208,57.644941 L 18.243791,43.458264 z "
+ id="path1738"
+ sodipodi:nodetypes="cccc" />
+ </g>
+ <g
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ transform="matrix(1.33432,0,0,1.299363,-82.72169,-201.1821)"
+ id="g6127">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path55"
+ style="fill:none"
+ d="M 77.413448,196.55191 L 77.413448,193.56426 C 75.394982,194.4067 73.191112,194.89247 70.880288,194.93417 L 70.880288,196.55191 L 77.413448,196.55191 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path66"
+ style="fill:url(#linearGradient3844)"
+ d="M 77.413448,191.65251 L 70.880288,191.65251 L 70.880288,194.93417 C 73.191112,194.89223 75.394982,194.4067 77.413448,193.56426 L 77.413448,191.65251 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path68"
+ style="fill:none"
+ d="M 81.076749,195.0178 C 81.076749,195.41522 81.178991,195.71112 81.383712,195.90618 C 81.587961,196.10124 81.898459,196.19854 82.314025,196.19854 C 82.907692,196.19854 83.331739,196.10195 83.585697,195.90806 C 83.839654,195.71418 83.966868,195.34431 83.966868,194.79871 L 83.966868,194.61919 L 83.966868,192.71616 C 82.943736,192.92112 82.206364,193.20382 81.754282,193.56473 C 81.302672,193.9254 81.076749,194.40929 81.076749,195.0178 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path87"
+ style="fill:none"
+ d="M 82.774502,184.07723 C 82.910571,184.21363 83.045991,184.34937 83.18206,184.48479 L 83.18206,183.56446 C 83.045991,183.7041 82.910571,183.84406 82.774502,183.98371 C 82.774502,184.01488 82.774502,184.04671 82.774502,184.07723 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path89"
+ style="fill:none"
+ d="M 82.797883,185.96012 C 82.758264,185.67727 82.316932,185.33076 82.115588,185.18365 C 82.084412,185.18365 82.053236,185.18365 82.02206,185.18365 C 81.998029,185.20703 81.974323,185.23041 81.950941,185.25379 C 81.948343,185.6646 81.951915,185.94908 81.950941,186.26636 C 82.248735,186.55668 82.547503,186.84603 82.844322,187.13636 C 82.876472,187.13636 82.907973,187.13636 82.939474,187.13636 C 82.962206,187.11298 82.986562,187.08927 83.009619,187.06589 C 83.009619,187.02659 83.009619,186.9873 83.009619,186.94898 C 82.923236,186.84603 82.837503,186.74471 82.750795,186.64209 C 82.884266,186.64209 83.017738,186.64209 83.15056,186.64209 C 83.160952,186.65281 83.171019,186.66288 83.181736,186.67392 L 83.181736,185.97344 C 82.992083,186.00429 83.0671,186.00007 82.797883,185.96012 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path115"
+ style="fill:url(#radialGradient3846);fill-rule:evenodd;stroke:url(#linearGradient3848);stroke-width:0.57354796;stroke-miterlimit:4"
+ d="M 87.406382,191.30255 C 87.406382,198.20182 81.812598,203.79561 74.913327,203.79561 C 68.012432,203.79561 62.418647,198.20182 62.418647,191.30255 C 62.418647,184.40198 68.012432,178.8082 74.913327,178.8082 C 81.812598,178.8082 87.406382,184.40198 87.406382,191.30255 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path124"
+ style="fill:url(#linearGradient3850);fill-opacity:1;stroke:none"
+ d="M 85.365991,187.02172 C 85.365991,191.18759 80.685073,194.56367 74.913002,194.56367 C 69.138658,194.56367 64.457415,191.18759 64.457415,187.02172 C 64.457415,182.85651 69.138658,179.47913 74.913002,179.47913 C 80.685073,179.47913 85.365991,182.85651 85.365991,187.02172 z "
+ a:adobe-blending-mode="screen" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path134"
+ style="fill:url(#linearGradient3852)"
+ d="M 74.911378,180.76675 C 69.101961,180.76675 64.375904,185.49281 64.375904,191.30125 C 64.375904,197.11099 69.101961,201.83738 74.911378,201.83738 C 80.72112,201.83738 85.447178,197.11067 85.447178,191.30125 C 85.447178,185.49281 80.72112,180.76675 74.911378,180.76675 z M 74.911378,201.3587 C 69.356888,201.3587 64.855232,196.85704 64.855232,191.30125 C 64.855232,185.74806 69.356888,181.24543 74.911378,181.24543 C 80.465868,181.24543 84.968174,185.74839 84.968174,191.30125 C 84.968174,196.85704 80.465868,201.3587 74.911378,201.3587 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path143"
+ style="fill:url(#radialGradient3854)"
+ d="M 74.911378,181.72443 C 69.630002,181.72443 65.334235,186.02117 65.334235,191.30158 C 65.334235,196.5836 69.630326,200.87937 74.911378,200.87937 C 80.19243,200.87937 84.489496,196.58328 84.489496,191.30158 C 84.489496,186.02117 80.192755,181.72443 74.911378,181.72443 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path169"
+ style="fill:url(#radialGradient3856);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3858);stroke-width:0.57354796;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 74.911378,200.87937 C 69.630002,200.87937 65.334235,196.58328 65.334235,191.30158 C 65.334235,186.02117 69.630326,181.72443 74.911378,181.72443 C 80.19243,181.72443 84.489496,186.02117 84.489496,191.30158 C 84.489496,196.58328 80.192755,200.87937 74.911378,200.87937 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path207"
+ style="fill:url(#linearGradient3860);fill-opacity:1"
+ d="M 74.782778,191.58703 C 78.585902,188.72568 82.162027,187.75598 83.72991,187.44909 C 82.220157,183.98565 78.8142,181.56758 74.85065,181.56758 C 69.486138,181.56758 65.137762,185.99519 65.137762,191.45421 C 65.137762,192.31284 65.245579,193.14452 65.447897,193.93821 C 67.020976,194.23373 70.86924,194.5299 74.782778,191.58703 z "
+ a:adobe-blending-mode="screen" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path177"
+ style="opacity:0.8;fill:#00009d"
+ d="M 75.959665,199.07864 C 75.959665,199.65734 75.491053,200.1266 74.912028,200.1266 C 74.334301,200.1266 73.865365,199.65767 73.865365,199.07864 C 73.865365,198.50059 74.334301,198.03133 74.912028,198.03133 C 75.490729,198.03133 75.959665,198.50027 75.959665,199.07864 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path175"
+ style="opacity:0.8;fill:#00009d"
+ d="M 75.959665,183.52484 C 75.959665,184.10321 75.491053,184.5728 74.912028,184.5728 C 74.334301,184.5728 73.865365,184.10321 73.865365,183.52484 C 73.865365,182.94614 74.334301,182.47752 74.912028,182.47752 C 75.490729,182.47785 75.959665,182.94614 75.959665,183.52484 z " />
+ <g
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ transform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ id="g180">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path182"
+ style="opacity:0.8;fill:#00009d"
+ d="M 80.447,70.581 C 78.664,70.581 77.219,69.135 77.219,67.353 C 77.219,65.574 78.663,64.129 80.447,64.129 C 82.228,64.129 83.671,65.573 83.671,67.353 C 83.671,69.135 82.229,70.581 80.447,70.581 z " />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path184"
+ style="opacity:0.8;fill:#00009d"
+ d="M 32.55,70.581 C 30.768,70.581 29.325,69.135 29.325,67.353 C 29.325,65.574 30.768,64.129 32.55,64.129 C 34.333,64.129 35.777,65.573 35.777,67.353 C 35.777,69.135 34.333,70.581 32.55,70.581 z " />
+ </g>
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path197"
+ d="M 76.084043,191.55975 C 76.084043,192.29141 75.490729,192.88277 74.76037,192.88277 C 74.030012,192.88277 73.436373,192.29141 73.436373,191.55975 C 73.436373,190.82874 74.030012,190.2364 74.76037,190.2364 C 75.490729,190.2364 76.084043,190.82874 76.084043,191.55975 z " />
+ <g
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ transform="matrix(0.187725,0.142332,-0.142332,0.187725,73.14272,172.3284)"
+ id="g2746">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path2742"
+ d="M 85.972408,63.227913 L 85.920832,58.100066 L 52.784489,58.45323 L 52.837031,63.580092 L 85.972408,63.227913 z "
+ style="fill:#000000;fill-opacity:1" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path2745"
+ d="M 54.878271,63.227913 L 54.826695,58.100066 L 21.690352,58.45323 L 21.742894,63.580092 L 54.878271,63.227913 z "
+ style="fill:#000000;fill-opacity:0" />
+ </g>
+ <g
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ transform="matrix(0.235582,0,0,0.235582,61.90697,177.0787)"
+ id="g2750">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path2743"
+ d="M 52.850072,87.665598 L 57.717309,87.588284 L 57.275941,58.957734 L 52.406696,59.03118 L 52.850072,87.665598 z "
+ style="fill:#000000;fill-opacity:1" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path2749"
+ d="M 52.850072,61.847362 L 57.717309,61.770048 L 57.275941,33.139498 L 52.406696,33.212944 L 52.850072,61.847362 z "
+ style="fill:#000000;fill-opacity:0" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-effect.svg b/kpresenter/toolbar/action-effect.svg
new file mode 100644
index 000000000..931de9297
--- /dev/null
+++ b/kpresenter/toolbar/action-effect.svg
@@ -0,0 +1,879 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ inkscape:export-ydpi="45.000000"
+ inkscape:export-xdpi="45.000000"
+ inkscape:export-filename="/home/pinheiro/kdeplayground-artwork/oooicons/crystalsvg/animationmode.png"
+ sodipodi:docname="animationmode.svg"
+ sodipodi:docbase="/home/pinheiro/kdeplayground-artwork/oooicons/crystalsvg"
+ inkscape:version="0.41"
+ sodipodi:version="0.32"
+ id="svg3166"
+ height="64px"
+ width="64px">
+ <defs
+ id="defs3">
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient2269"
+ gradientUnits="userSpaceOnUse"
+ x1="55.023899"
+ y1="38.641102"
+ x2="55.023899"
+ y2="69.925598"
+ gradientTransform="matrix(0.324748,0.000000,0.000000,0.324748,56.56474,169.4285)" />
+ <linearGradient
+ id="wihitetolightgray">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop1885" />
+ <stop
+ style="stop-color:#d5d4d4;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop1886" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#wihitetolightgray"
+ id="linearGradient4587"
+ gradientTransform="scale(1.000008,0.999992)"
+ x1="76.367203"
+ y1="201.91719"
+ x2="73.576660"
+ y2="176.39580"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="blueligtmoretoblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop3457" />
+ <stop
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;"
+ offset="0.74217570"
+ id="stop3465" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3463" />
+ </radialGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#blueligtmoretoblue"
+ id="radialGradient2272"
+ gradientUnits="userSpaceOnUse"
+ cx="75.443954"
+ cy="199.57872"
+ fx="75.443954"
+ fy="199.57872"
+ r="30.888128" />
+ <radialGradient
+ id="XMLID_10_"
+ cx="56.1016"
+ cy="94.9063"
+ r="56.5206"
+ fx="56.1016"
+ fy="94.9063"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0"
+ style="stop-color:rgb(157,255,0)"
+ id="stop138" />
+ <stop
+ offset="0.764"
+ style="stop-color:rgb(0,151,0)"
+ id="stop140" />
+ </radialGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_10_"
+ id="radialGradient2278"
+ gradientUnits="userSpaceOnUse"
+ cx="56.1016"
+ cy="94.9063"
+ fx="56.1016"
+ fy="94.9063"
+ r="56.5206"
+ gradientTransform="matrix(0.324748,0.000000,0.000000,0.324748,56.56474,169.4285)" />
+ <linearGradient
+ id="XMLID_9_"
+ gradientUnits="userSpaceOnUse"
+ x1="56.4961"
+ y1="146.565"
+ x2="56.4961"
+ y2="35.9005">
+ <stop
+ offset="0"
+ style="stop-color:rgb(179,202,255)"
+ id="stop129" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(0,83,189)"
+ id="stop131" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_9_"
+ id="linearGradient2281"
+ gradientUnits="userSpaceOnUse"
+ x1="56.4961"
+ y1="146.565"
+ x2="56.4961"
+ y2="35.9005"
+ gradientTransform="matrix(0.324748,0.000000,0.000000,0.324748,56.56474,169.4285)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient2284"
+ gradientUnits="userSpaceOnUse"
+ x1="56.496601"
+ y1="28.296900"
+ x2="56.496601"
+ y2="57.564800"
+ gradientTransform="matrix(0.324748,0.000000,0.000000,0.324748,56.56474,169.4285)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient5353"
+ gradientTransform="scale(1.000007,0.999993)"
+ x1="70.420311"
+ y1="162.71689"
+ x2="77.398453"
+ y2="227.64589"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ id="XMLID_7_"
+ cx="55.8057"
+ cy="109.628"
+ r="80.5726"
+ fx="55.8057"
+ fy="109.628"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0"
+ style="stop-color:rgb(255,255,255)"
+ id="stop104" />
+ <stop
+ offset="0.0626"
+ style="stop-color:rgb(230,249,255)"
+ id="stop106" />
+ <stop
+ offset="0.1386"
+ style="stop-color:rgb(206,242,255)"
+ id="stop108" />
+ <stop
+ offset="0.1854"
+ style="stop-color:rgb(197,240,255)"
+ id="stop2057" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(29,116,217)"
+ id="stop2059" />
+ </radialGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_7_"
+ id="radialGradient2287"
+ gradientUnits="userSpaceOnUse"
+ cx="55.8057"
+ cy="109.628"
+ fx="55.8057"
+ fy="109.628"
+ r="80.5726"
+ gradientTransform="matrix(0.324748,0.000000,0.000000,0.324748,56.56474,169.4285)" />
+ <linearGradient
+ id="XMLID_4_"
+ gradientUnits="userSpaceOnUse"
+ x1="21.8281"
+ y1="52.8003"
+ x2="182.81"
+ y2="138.443">
+ <stop
+ offset="0"
+ style="stop-color:rgb(255,255,255)"
+ id="stop59" />
+ <stop
+ offset="0.5033"
+ style="stop-color:rgb(231,231,231)"
+ id="stop61" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(212,212,212)"
+ id="stop63" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_4_"
+ id="linearGradient2296"
+ gradientUnits="userSpaceOnUse"
+ x1="21.8281"
+ y1="52.8003"
+ x2="182.81"
+ y2="138.443"
+ gradientTransform="matrix(0.235582,0.000000,0.000000,0.235582,61.90697,177.0787)" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0.000000,0.000000,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3047"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0.000000,0.000000,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3045"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0.000000,0.000000,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3043"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluedarktoblackblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop2959"
+ offset="0.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2960"
+ offset="1.0000000"
+ style="stop-color:#032442;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ gradientTransform="matrix(1.356437,0.000000,0.000000,1.341146,0.306884,-1.140040)"
+ gradientUnits="userSpaceOnUse"
+ y2="35.252430"
+ x2="34.512043"
+ y1="-3.8899043"
+ x1="30.899836"
+ id="linearGradient2956"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluelightlesstoblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop3468"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3469"
+ offset="0.24089479"
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3470"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ gradientTransform="matrix(1.356437,0.000000,0.000000,1.341146,0.306884,-1.140040)"
+ gradientUnits="userSpaceOnUse"
+ y2="27.555025"
+ x2="30.865753"
+ y1="-8.6353083"
+ x1="31.632498"
+ id="linearGradient2958"
+ xlink:href="#bluelightlesstoblue"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientTransform="matrix(1.356437,0.000000,0.000000,1.341146,0.306883,-1.140043)"
+ gradientUnits="userSpaceOnUse"
+ r="13.043961"
+ fy="25.805140"
+ fx="32.423191"
+ cy="25.805140"
+ cx="32.423191"
+ id="radialGradient2970"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="51.0311"
+ x2="88.7039"
+ y1="18.0479"
+ x1="55.6276"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2143">
+ <stop
+ id="stop2145"
+ stop-opacity="1"
+ offset="0"
+ stop-color="#ffffff" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.16494845;"
+ id="stop2147"
+ stop-opacity="1"
+ offset="1.0000000"
+ stop-color="#cccccc" />
+ </linearGradient>
+ <linearGradient
+ gradientTransform="matrix(1.356437,0.000000,0.000000,1.341146,-2.405991,-1.140043)"
+ y2="13.490262"
+ x2="34.315556"
+ y1="4.7051349"
+ x1="34.575813"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2945"
+ xlink:href="#linearGradient2143"
+ inkscape:collect="always" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient8145"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.859142,1.163952)"
+ spreadMethod="pad"
+ x1="72.409058"
+ y1="146.02444"
+ x2="87.291985"
+ y2="179.08333" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient7383"
+ gradientTransform="scale(0.859142,1.163952)"
+ x1="89.259972"
+ y1="186.23854"
+ x2="79.174026"
+ y2="158.88571"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="pad" />
+ <linearGradient
+ id="shadow0wto25to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="0.0000000"
+ id="stop3437" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.27916667;"
+ offset="0.50000000"
+ id="stop3438" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop3439" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#shadow0wto25to0"
+ id="radialGradient6623"
+ gradientTransform="scale(0.831851,1.202139)"
+ cx="85.725777"
+ cy="199.52441"
+ fx="85.725777"
+ fy="199.52441"
+ r="46.232933"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90833336;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="radialGradient5843"
+ gradientTransform="scale(1.208127,0.827728)"
+ cx="69.910759"
+ cy="279.37149"
+ fx="69.910759"
+ fy="279.37149"
+ r="18.067240"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="pad" />
+ <linearGradient
+ id="blacktowhite">
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2476" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2475" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#blacktowhite"
+ id="linearGradient2752"
+ gradientTransform="scale(0.778499,1.284524)"
+ x1="96.976326"
+ y1="157.14804"
+ x2="24.387333"
+ y2="99.690155"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect" />
+ <linearGradient
+ id="greylighttograyw">
+ <stop
+ style="stop-color:#b5b5b8;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop575" />
+ <stop
+ style="stop-color:#ebebee;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop576" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greylighttograyw"
+ id="linearGradient5073"
+ gradientTransform="scale(0.778499,1.284524)"
+ x1="78.248695"
+ y1="136.51736"
+ x2="83.356216"
+ y2="165.42656"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0.000000,0.000000,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3010"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0.000000,0.000000,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3002"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ id="light100to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2764" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2765" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0.000000,0.000000,0.328066,-0.604286,-5.999996e-2)"
+ id="linearGradient2990"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient589">
+ <stop
+ id="stop590"
+ offset="0"
+ style="stop-color:#ffffff;stop-opacity:0.9059;" />
+ <stop
+ id="stop591"
+ offset="1.000000"
+ style="stop-color:#f5ffff;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ y2="51.100159"
+ x2="32.431320"
+ y1="0.54920614"
+ x1="32.431320"
+ gradientTransform="scale(1.246487,0.802255)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3164"
+ xlink:href="#linearGradient589"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient633">
+ <stop
+ id="stop634"
+ offset="0"
+ style="stop-color:#ffdf00;stop-opacity:1.0000;" />
+ <stop
+ id="stop635"
+ offset="1.000000"
+ style="stop-color:#ffaa0a;stop-opacity:1.0000;" />
+ </linearGradient>
+ <radialGradient
+ r="157.04091"
+ fy="554.13105"
+ fx="360.42844"
+ cy="554.13105"
+ cx="360.42844"
+ gradientTransform="matrix(0.235702,0.000000,0.000000,0.234369,-45.09652,-54.57756)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3162"
+ xlink:href="#linearGradient633"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient570">
+ <stop
+ id="stop571"
+ offset="0"
+ style="stop-color:#ffffff;stop-opacity:1.0000;" />
+ <stop
+ id="stop572"
+ offset="1.000000"
+ style="stop-color:#8f8f97;stop-opacity:1.0000;" />
+ </linearGradient>
+ <linearGradient
+ y2="565.14730"
+ x2="322.47819"
+ y1="661.19545"
+ x1="327.05249"
+ gradientTransform="scale(1.011905,0.988235)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3160"
+ xlink:href="#linearGradient570"
+ inkscape:collect="always" />
+ </defs>
+ <sodipodi:namedview
+ inkscape:window-y="391"
+ inkscape:window-x="0"
+ inkscape:window-height="536"
+ inkscape:window-width="640"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ showgrid="true"
+ inkscape:current-layer="layer1"
+ inkscape:cy="32.000000"
+ inkscape:cx="32.000000"
+ inkscape:zoom="5.5000000"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF
+ id="RDF5">
+ <cc:Work
+ id="Work6"
+ rdf:about="">
+ <dc:format
+ id="format7">image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage"
+ id="type9" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:groupmode="layer"
+ inkscape:label="Layer 1"
+ id="layer1">
+ <g
+ id="g1397">
+ <g
+ transform="matrix(1.356437,0.000000,0.000000,-1.341146,-9.423490e-2,34.37647)"
+ id="g3023">
+ <g
+ id="g3025">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3027"
+ d="M 12.214286,0.99999720 L 30.000000,0.99999720 L 28.071425,3.0000000 L 10.285711,3.0000000 L 12.214286,0.99999720 z "
+ style="fill:#0000ff;fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3029"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.0300000 L 9.9899967,3.0300000 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3043);fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ </g>
+ <g
+ transform="translate(-3.989997,3.970000)"
+ id="g3031">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3033"
+ d="M 12.214286,0.99999720 L 30.000000,0.99999720 L 28.071425,3.0000000 L 10.285711,3.0000000 L 12.214286,0.99999720 z "
+ style="fill:#0000ff;fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3035"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.0300000 L 9.9899967,3.0300000 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3045);fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ </g>
+ <g
+ transform="translate(-7.989997,7.970000)"
+ id="g3037">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3039"
+ d="M 12.214286,0.99999720 L 30.000000,0.99999720 L 28.071425,3.0000000 L 10.285711,3.0000000 L 12.214286,0.99999720 z "
+ style="fill:#0000ff;fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3041"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.0300000 L 9.9899967,3.0300000 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3047);fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ </g>
+ </g>
+ <path
+ id="rect2086"
+ d="M 44.670431,1.3307795 L 60.203342,16.688588 L 44.670431,32.046398 L 29.137521,16.688588 L 44.670431,1.3307795 z "
+ style="fill:url(#linearGradient2958);fill-opacity:1.0000000;stroke:url(#linearGradient2956);stroke-width:2.6166136;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ <path
+ id="path2960"
+ d="M 44.670431,1.3307795 L 60.203342,16.688588 L 44.670431,32.046398 L 29.137521,16.688588 L 44.670431,1.3307795 z "
+ style="fill:url(#radialGradient2970);fill-opacity:1.0000000;stroke:none;stroke-width:1.9400001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path2125"
+ d="M 44.670431,5.1702305 L 56.320116,16.688588 C 50.491427,19.754065 41.077869,19.945657 33.020747,16.688588 L 44.670431,5.1702305 z "
+ style="fill:url(#linearGradient2945);fill-opacity:1.0000000;stroke:none;stroke-width:2.5400000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ <g
+ transform="matrix(1.356437,0.000000,0.000000,1.341146,0.306883,-1.140043)"
+ id="g3012">
+ <g
+ id="g2992">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path2181"
+ d="M 12.214286,0.99999720 L 30.000000,0.99999720 L 28.071425,3.0000000 L 10.285711,3.0000000 L 12.214286,0.99999720 z "
+ style="fill:#0000ff;fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path2982"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.0300000 L 9.9899967,3.0300000 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient2990);fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ </g>
+ <g
+ transform="translate(-3.989997,3.970000)"
+ id="g2996">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path2998"
+ d="M 12.214286,0.99999720 L 30.000000,0.99999720 L 28.071425,3.0000000 L 10.285711,3.0000000 L 12.214286,0.99999720 z "
+ style="fill:#0000ff;fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3000"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.0300000 L 9.9899967,3.0300000 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3002);fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ </g>
+ <g
+ transform="translate(-7.989997,7.970000)"
+ id="g3004">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3006"
+ d="M 12.214286,0.99999720 L 30.000000,0.99999720 L 28.071425,3.0000000 L 10.285711,3.0000000 L 12.214286,0.99999720 z "
+ style="fill:#0000ff;fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3008"
+ d="M 11.976429,0.96999716 L 30.295714,0.96999716 L 28.309282,3.0300000 L 9.9899967,3.0300000 L 11.976429,0.96999716 z "
+ style="fill:url(#linearGradient3010);fill-opacity:1.0000000;stroke:none;stroke-width:1.7399995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" />
+ </g>
+ </g>
+ </g>
+ <g
+ id="g11205"
+ transform="matrix(0.656259,-2.127977e-2,2.257639e-2,0.623395,0.388944,-81.13310)">
+ <g
+ id="g11199"
+ transform="matrix(0.985666,0.000000,0.000000,0.999981,65.87568,0.626231)">
+ <path
+ style="fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:2.5875001;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:0.054298643"
+ d="M 20.054410,199.40720 C 21.137200,204.75954 21.580620,203.96632 21.956250,208.88967 C 20.797570,219.75109 18.739620,217.45558 16.954290,232.18772 C 7.9866300,232.51937 -5.0567500,232.67347 -7.4521600,230.15713 C -9.6332700,226.23295 -12.343810,220.16716 -14.528180,214.95856 C -16.068050,212.11878 -16.366770,194.08724 -10.839070,194.50182 C -9.3542800,192.02453 -10.107120,203.95124 -9.8359400,208.57735 C -8.6630900,205.12101 -10.330100,190.84809 -10.404040,184.40535 C -10.756820,179.92102 -10.631350,173.57880 -10.148390,171.20626 C -9.2339400,167.51685 -6.0055300,170.83126 -5.3195500,172.85775 C -5.0815400,174.49038 -4.7690800,175.60528 -4.2722500,180.24062 C -3.6378700,188.62690 -1.9914600,200.41687 -1.9914600,200.41687 C -1.9914600,200.41687 -1.8881100,189.47042 -1.8881100,189.47042 C -1.7672500,188.74526 4.8306300,188.47262 4.9514900,189.56036 C 5.0723500,191.25241 6.3929200,201.85615 6.3929200,201.85615 C 6.3929200,201.85615 5.4408100,194.49280 6.0160600,191.14378 C 9.0361000,191.54571 12.597130,193.26291 13.316140,194.60254 C 13.747570,197.14777 13.168120,203.05359 14.606220,202.91968 L 14.620750,196.00183 L 20.054410,199.40720 z "
+ id="path11193"
+ sodipodi:nodetypes="cccccccccccccccccccc" />
+ <path
+ style="fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:3.8375001;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:0.054298643"
+ d="M 20.054410,199.40720 C 21.137200,204.75954 21.580620,203.96632 21.956250,208.88967 C 20.797570,219.75109 18.739620,217.45558 16.954290,232.18772 C 7.9866300,232.51937 -5.0567500,232.67347 -7.4521600,230.15713 C -9.6332700,226.23295 -12.343810,220.16716 -14.528180,214.95856 C -16.068050,212.11878 -16.366770,194.08724 -10.839070,194.50182 C -9.3542800,192.02453 -10.107120,203.95124 -9.8359400,208.57735 C -8.6630900,205.12101 -10.330100,190.84809 -10.404040,184.40535 C -10.756820,179.92102 -10.631350,173.57880 -10.148390,171.20626 C -9.2339400,167.51685 -6.0055300,170.83126 -5.3195500,172.85775 C -5.0815400,174.49038 -4.7690800,175.60528 -4.2722500,180.24062 C -3.6378700,188.62690 -1.9914600,200.41687 -1.9914600,200.41687 C -1.9914600,200.41687 -1.8881100,189.47042 -1.8881100,189.47042 C -1.7672500,188.74526 4.8306300,188.47262 4.9514900,189.56036 C 5.0723500,191.25241 6.3929200,201.85615 6.3929200,201.85615 C 6.3929200,201.85615 5.4408100,194.49280 6.0160600,191.14378 C 9.0361000,191.54571 12.597130,193.26291 13.316140,194.60254 C 13.747570,197.14777 13.168120,203.05359 14.606220,202.91968 L 14.620750,196.00183 L 20.054410,199.40720 z "
+ id="path11191"
+ sodipodi:nodetypes="cccccccccccccccccccc" />
+ <path
+ style="fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:4.5875001;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:0.054298643"
+ d="M 20.181108,199.40720 C 21.263898,204.75954 21.707318,203.96632 22.082948,208.88967 C 20.924268,219.75109 18.866318,217.45558 17.080988,232.18772 C 8.1133280,232.51937 -4.9300520,232.67347 -7.3254620,230.15713 C -9.5065720,226.23295 -12.217112,220.16716 -14.401482,214.95856 C -15.941352,212.11878 -16.240072,194.08724 -10.712372,194.50182 C -9.2275820,192.02453 -9.9804220,203.95124 -9.7092420,208.57735 C -8.5363920,205.12101 -10.203402,190.84809 -10.277342,184.40535 C -10.630122,179.92102 -10.504652,173.57880 -10.021692,171.20626 C -9.1072420,167.51685 -5.8788320,170.83126 -5.1928520,172.85775 C -4.9548420,174.49038 -4.6423820,175.60528 -4.1455520,180.24062 C -3.5111720,188.62690 -1.8647620,200.41687 -1.8647620,200.41687 C -1.8647620,200.41687 -1.7614120,189.47042 -1.7614120,189.47042 C -1.6405520,188.74526 4.9573280,188.47262 5.0781880,189.56036 C 5.1990480,191.25241 6.5196180,201.85615 6.5196180,201.85615 C 6.5196180,201.85615 5.5675080,194.49280 6.1427580,191.14378 C 9.1627980,191.54571 12.723828,193.26291 13.442838,194.60254 C 13.874268,197.14777 13.294818,203.05359 14.732918,202.91968 L 14.747448,196.00183 L 20.181108,199.40720 z "
+ id="path10423"
+ sodipodi:nodetypes="cccccccccccccccccccc" />
+ <path
+ style="fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.7125000;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:0.054298643"
+ d="M 20.054410,199.40720 C 21.137200,204.75954 21.580620,203.96632 21.956250,208.88967 C 20.797570,219.75109 18.739620,217.45558 16.954290,232.18772 C 7.9866300,232.51937 -5.0567500,232.67347 -7.4521600,230.15713 C -9.6332700,226.23295 -12.343810,220.16716 -14.528180,214.95856 C -16.068050,212.11878 -16.366770,194.08724 -10.839070,194.50182 C -9.3542800,192.02453 -10.107120,203.95124 -9.8359400,208.57735 C -8.6630900,205.12101 -10.330100,190.84809 -10.404040,184.40535 C -10.756820,179.92102 -10.631350,173.57880 -10.148390,171.20626 C -9.2339400,167.51685 -6.0055300,170.83126 -5.3195500,172.85775 C -5.0815400,174.49038 -4.7690800,175.60528 -4.2722500,180.24062 C -3.6378700,188.62690 -1.9914600,200.41687 -1.9914600,200.41687 C -1.9914600,200.41687 -1.8881100,189.47042 -1.8881100,189.47042 C -1.7672500,188.74526 4.8306300,188.47262 4.9514900,189.56036 C 5.0723500,191.25241 6.3929200,201.85615 6.3929200,201.85615 C 6.3929200,201.85615 5.4408100,194.49280 6.0160600,191.14378 C 9.0361000,191.54571 12.597130,193.26291 13.316140,194.60254 C 13.747570,197.14777 13.168120,203.05359 14.606220,202.91968 L 14.620750,196.00183 L 20.054410,199.40720 z "
+ id="path11195"
+ sodipodi:nodetypes="cccccccccccccccccccc" />
+ </g>
+ <path
+ style="fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.96249998;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:0.054298643"
+ d="M 86.054410,199.40720 C 87.137200,204.75954 87.580620,203.96632 87.956250,208.88967 C 86.797570,219.75109 84.739620,217.45558 82.954290,232.18772 C 73.986630,232.51937 60.943250,232.67347 58.547840,230.15713 C 56.366730,226.23295 53.656190,220.16716 51.471820,214.95856 C 49.931950,212.11878 49.633230,194.08724 55.160930,194.50182 C 56.645720,192.02453 55.892880,203.95124 56.164060,208.57735 C 57.336910,205.12101 55.669900,190.84809 55.595960,184.40535 C 55.243180,179.92102 55.368650,173.57880 55.851610,171.20626 C 56.766060,167.51685 59.994470,170.83126 60.680450,172.85775 C 60.918460,174.49038 61.230920,175.60528 61.727750,180.24062 C 62.362130,188.62690 64.008540,200.41687 64.008540,200.41687 C 64.008540,200.41687 64.111890,189.47042 64.111890,189.47042 C 64.232750,188.74526 70.830630,188.47262 70.951490,189.56036 C 71.072350,191.25241 72.392920,201.85615 72.392920,201.85615 C 72.392920,201.85615 71.440810,194.49280 72.016060,191.14378 C 75.036100,191.54571 78.597130,193.26291 79.316140,194.60254 C 79.747570,197.14777 79.168120,203.05359 80.606220,202.91968 L 80.620750,196.00183 L 86.054410,199.40720 z "
+ id="path11197"
+ sodipodi:nodetypes="cccccccccccccccccccc" />
+ <path
+ style="fill:url(#linearGradient5073);fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient2752);stroke-width:1.5875000;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"
+ d="M 86.054410,199.40720 C 87.137200,204.75954 87.580620,203.96632 87.956250,208.88967 C 86.797570,219.75109 84.739620,217.45558 82.954290,232.18772 C 73.986630,232.51937 60.943250,232.67347 58.547840,230.15713 C 56.366730,226.23295 53.656190,220.16716 51.471820,214.95856 C 49.931950,212.11878 49.633230,194.08724 55.160930,194.50182 C 56.645720,192.02453 55.892880,203.95124 56.164060,208.57735 C 57.336910,205.12101 55.669900,190.84809 55.595960,184.40535 C 55.243180,179.92102 55.368650,173.57880 55.851610,171.20626 C 56.766060,167.51685 59.994470,170.83126 60.680450,172.85775 C 60.918460,174.49038 61.230920,175.60528 61.727750,180.24062 C 62.362130,188.62690 64.008540,200.41687 64.008540,200.41687 C 64.008540,200.41687 64.111890,189.47042 64.111890,189.47042 C 64.232750,188.74526 70.830630,188.47262 70.951490,189.56036 C 71.072350,191.25241 72.392920,201.85615 72.392920,201.85615 C 72.392920,201.85615 71.440810,194.49280 72.016060,191.14378 C 75.036100,191.54571 78.597130,193.26291 79.316140,194.60254 C 79.747570,197.14777 79.168120,203.05359 80.606220,202.91968 L 80.620750,196.00183 L 86.054410,199.40720 z "
+ id="path11247"
+ sodipodi:nodetypes="cccccccccccccccccccc" />
+ <path
+ style="fill:url(#radialGradient5843);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.5875000;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"
+ d="M 87.956250,208.88967 C 86.797570,219.75109 84.739620,217.45558 82.954290,232.18772 C 73.986630,232.51937 60.943250,232.67347 58.547840,230.15713 C 56.366730,226.23295 53.656190,220.16716 51.471820,214.95856 C 49.931950,212.11878 87.580620,203.96632 87.956250,208.88967 z "
+ id="path5075"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="opacity:0.52173913;fill:url(#radialGradient6623);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.5875000;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"
+ d="M 86.054410,199.40720 C 87.137200,204.75954 87.580620,203.96632 87.956250,208.88967 C 86.797570,219.75109 84.739620,217.45558 82.954290,232.18772 C 73.986630,232.51937 60.943250,232.67347 58.547840,230.15713 C 56.366730,226.23295 53.656190,220.16716 51.471820,214.95856 C 49.931950,212.11878 49.633230,194.08724 55.160930,194.50182 C 56.645720,192.02453 55.892880,203.95124 56.164060,208.57735 C 57.336910,205.12101 55.669900,190.84809 55.595960,184.40535 C 55.243180,179.92102 61.230920,175.60528 61.727750,180.24062 C 62.362130,188.62690 64.008540,200.41687 64.008540,200.41687 C 64.008540,200.41687 64.111890,189.47042 64.111890,189.47042 C 64.232750,188.74526 70.830630,188.47262 70.951490,189.56036 C 71.072350,191.25241 72.392920,201.85615 72.392920,201.85615 C 72.392920,201.85615 71.440810,194.49280 72.016060,191.14378 C 75.036100,191.54571 78.597130,193.26291 79.316140,194.60254 C 79.747570,197.14777 79.168120,203.05359 80.606220,202.91968 L 80.620750,196.00183 L 86.054410,199.40720 z "
+ id="path6615"
+ sodipodi:nodetypes="cccccccccccccccccc" />
+ <path
+ style="fill:url(#linearGradient7383);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.5875000;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"
+ d="M 85.073217,200.22486 C 86.646604,205.57720 88.822158,212.96842 74.056022,210.85206 C 62.226935,209.15665 55.782107,219.67656 53.597737,214.46796 C 52.057867,211.62818 50.514343,199.04941 54.428399,194.63559 C 56.089680,192.76219 55.892880,203.95124 56.164060,208.57735 C 57.336910,205.12101 55.669900,190.84809 55.595960,184.40535 C 55.243180,179.92102 55.368650,173.57880 55.851610,171.20626 C 56.766060,167.51685 59.994470,170.83126 60.680450,172.85775 C 60.918460,174.49038 61.230920,175.60528 61.727750,180.24062 C 62.362130,188.62690 64.008540,200.41687 64.008540,200.41687 C 64.008540,200.41687 64.111890,189.47042 64.111890,189.47042 C 64.232750,188.74526 70.830630,188.47262 70.951490,189.56036 C 71.072350,191.25241 72.392920,201.85615 72.392920,201.85615 C 72.392920,201.85615 71.440810,194.49280 72.016060,191.14378 C 75.036100,191.54571 78.597130,193.26291 79.316140,194.60254 C 79.747570,197.14777 79.168120,203.05359 80.606220,202.91968 L 80.620750,196.00183 L 85.073217,200.22486 z "
+ id="path4307"
+ sodipodi:nodetypes="cscscccccccccccccc" />
+ <path
+ style="fill:url(#linearGradient8145);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.5875000;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"
+ d="M 85.073217,200.22486 C 86.646604,205.57720 88.822158,212.96842 74.056022,210.85206 C 62.226935,209.15665 55.782107,219.67656 53.597737,214.46796 C 52.057867,211.62818 50.514343,199.04941 54.428399,194.63559 C 56.089680,192.76219 55.892880,203.95124 56.164060,208.57735 C 57.336910,205.12101 55.669900,190.84809 55.595960,184.40535 C 55.243180,179.92102 55.368650,173.57880 55.851610,171.20626 C 56.766060,167.51685 59.994470,170.83126 60.680450,172.85775 C 60.918460,174.49038 61.230920,175.60528 61.727750,180.24062 C 62.362130,188.62690 64.008540,200.41687 64.008540,200.41687 C 64.008540,200.41687 64.111890,189.47042 64.111890,189.47042 C 64.232750,188.74526 70.830630,188.47262 70.951490,189.56036 C 71.072350,191.25241 72.392920,201.85615 72.392920,201.85615 C 72.392920,201.85615 71.440810,194.49280 72.016060,191.14378 C 75.036100,191.54571 78.597130,193.26291 79.316140,194.60254 C 79.747570,197.14777 79.168120,203.05359 80.606220,202.91968 L 80.620750,196.00183 L 85.073217,200.22486 z "
+ id="path7385"
+ sodipodi:nodetypes="cscscccccccccccccc" />
+ </g>
+ <g
+ id="g6127"
+ transform="matrix(1.530593,0.000000,0.000000,1.490494,-95.16061,-240.1344)">
+ <path
+ d="M 77.413448,196.55191 L 77.413448,193.56426 C 75.394982,194.40670 73.191112,194.89247 70.880288,194.93417 L 70.880288,196.55191 L 77.413448,196.55191 z "
+ style="fill:none"
+ id="path55" />
+ <path
+ d="M 77.413448,191.65251 L 70.880288,191.65251 L 70.880288,194.93417 C 73.191112,194.89223 75.394982,194.40670 77.413448,193.56426 L 77.413448,191.65251 z "
+ style="fill:url(#linearGradient2296)"
+ id="path66" />
+ <path
+ d="M 81.076749,195.01780 C 81.076749,195.41522 81.178991,195.71112 81.383712,195.90618 C 81.587961,196.10124 81.898459,196.19854 82.314025,196.19854 C 82.907692,196.19854 83.331739,196.10195 83.585697,195.90806 C 83.839654,195.71418 83.966868,195.34431 83.966868,194.79871 L 83.966868,194.61919 L 83.966868,192.71616 C 82.943736,192.92112 82.206364,193.20382 81.754282,193.56473 C 81.302672,193.92540 81.076749,194.40929 81.076749,195.01780 z "
+ style="fill:none"
+ id="path68" />
+ <path
+ d="M 82.774502,184.07723 C 82.910571,184.21363 83.045991,184.34937 83.182060,184.48479 L 83.182060,183.56446 C 83.045991,183.70410 82.910571,183.84406 82.774502,183.98371 C 82.774502,184.01488 82.774502,184.04671 82.774502,184.07723 z "
+ style="fill:none"
+ id="path87" />
+ <path
+ d="M 82.797883,185.96012 C 82.758264,185.67727 82.316932,185.33076 82.115588,185.18365 C 82.084412,185.18365 82.053236,185.18365 82.022060,185.18365 C 81.998029,185.20703 81.974323,185.23041 81.950941,185.25379 C 81.948343,185.66460 81.951915,185.94908 81.950941,186.26636 C 82.248735,186.55668 82.547503,186.84603 82.844322,187.13636 C 82.876472,187.13636 82.907973,187.13636 82.939474,187.13636 C 82.962206,187.11298 82.986562,187.08927 83.009619,187.06589 C 83.009619,187.02659 83.009619,186.98730 83.009619,186.94898 C 82.923236,186.84603 82.837503,186.74471 82.750795,186.64209 C 82.884266,186.64209 83.017738,186.64209 83.150560,186.64209 C 83.160952,186.65281 83.171019,186.66288 83.181736,186.67392 L 83.181736,185.97344 C 82.992083,186.00429 83.067100,186.00007 82.797883,185.96012 z "
+ style="fill:none"
+ id="path89" />
+ <path
+ d="M 87.406382,191.30255 C 87.406382,198.20182 81.812598,203.79561 74.913327,203.79561 C 68.012432,203.79561 62.418647,198.20182 62.418647,191.30255 C 62.418647,184.40198 68.012432,178.80820 74.913327,178.80820 C 81.812598,178.80820 87.406382,184.40198 87.406382,191.30255 z "
+ style="fill:url(#radialGradient2287);fill-rule:evenodd;stroke:url(#linearGradient5353);stroke-width:0.50000000;stroke-miterlimit:4.0000000"
+ id="path115" />
+ <path
+ a:adobe-blending-mode="screen"
+ d="M 85.365991,187.02172 C 85.365991,191.18759 80.685073,194.56367 74.913002,194.56367 C 69.138658,194.56367 64.457415,191.18759 64.457415,187.02172 C 64.457415,182.85651 69.138658,179.47913 74.913002,179.47913 C 80.685073,179.47913 85.365991,182.85651 85.365991,187.02172 z "
+ style="fill:url(#linearGradient2284);fill-opacity:1.0000000;stroke:none"
+ id="path124" />
+ <path
+ d="M 74.911378,180.76675 C 69.101961,180.76675 64.375904,185.49281 64.375904,191.30125 C 64.375904,197.11099 69.101961,201.83738 74.911378,201.83738 C 80.721120,201.83738 85.447178,197.11067 85.447178,191.30125 C 85.447178,185.49281 80.721120,180.76675 74.911378,180.76675 z M 74.911378,201.35870 C 69.356888,201.35870 64.855232,196.85704 64.855232,191.30125 C 64.855232,185.74806 69.356888,181.24543 74.911378,181.24543 C 80.465868,181.24543 84.968174,185.74839 84.968174,191.30125 C 84.968174,196.85704 80.465868,201.35870 74.911378,201.35870 z "
+ style="fill:url(#linearGradient2281)"
+ id="path134" />
+ <path
+ d="M 74.911378,181.72443 C 69.630002,181.72443 65.334235,186.02117 65.334235,191.30158 C 65.334235,196.58360 69.630326,200.87937 74.911378,200.87937 C 80.192430,200.87937 84.489496,196.58328 84.489496,191.30158 C 84.489496,186.02117 80.192755,181.72443 74.911378,181.72443 z "
+ style="fill:url(#radialGradient2278)"
+ id="path143" />
+ <path
+ d="M 74.911378,200.87937 C 69.630002,200.87937 65.334235,196.58328 65.334235,191.30158 C 65.334235,186.02117 69.630326,181.72443 74.911378,181.72443 C 80.192430,181.72443 84.489496,186.02117 84.489496,191.30158 C 84.489496,196.58328 80.192755,200.87937 74.911378,200.87937 z "
+ style="fill:url(#radialGradient2272);fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient4587);stroke-width:0.50000000;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"
+ id="path169" />
+ <path
+ a:adobe-blending-mode="screen"
+ d="M 74.782778,191.58703 C 78.585902,188.72568 82.162027,187.75598 83.729910,187.44909 C 82.220157,183.98565 78.814200,181.56758 74.850650,181.56758 C 69.486138,181.56758 65.137762,185.99519 65.137762,191.45421 C 65.137762,192.31284 65.245579,193.14452 65.447897,193.93821 C 67.020976,194.23373 70.869240,194.52990 74.782778,191.58703 z "
+ style="fill:url(#linearGradient2269);fill-opacity:1.0000000"
+ id="path207" />
+ <path
+ d="M 75.959665,199.07864 C 75.959665,199.65734 75.491053,200.12660 74.912028,200.12660 C 74.334301,200.12660 73.865365,199.65767 73.865365,199.07864 C 73.865365,198.50059 74.334301,198.03133 74.912028,198.03133 C 75.490729,198.03133 75.959665,198.50027 75.959665,199.07864 z "
+ style="opacity:0.80000001;fill:#00009d"
+ id="path177" />
+ <path
+ d="M 75.959665,183.52484 C 75.959665,184.10321 75.491053,184.57280 74.912028,184.57280 C 74.334301,184.57280 73.865365,184.10321 73.865365,183.52484 C 73.865365,182.94614 74.334301,182.47752 74.912028,182.47752 C 75.490729,182.47785 75.959665,182.94614 75.959665,183.52484 z "
+ style="opacity:0.80000001;fill:#00009d"
+ id="path175" />
+ <g
+ id="g180"
+ transform="matrix(0.324748,0.000000,0.000000,0.324748,56.56474,169.4285)">
+ <path
+ d="M 80.447000,70.581000 C 78.664000,70.581000 77.219000,69.135000 77.219000,67.353000 C 77.219000,65.574000 78.663000,64.129000 80.447000,64.129000 C 82.228000,64.129000 83.671000,65.573000 83.671000,67.353000 C 83.671000,69.135000 82.229000,70.581000 80.447000,70.581000 z "
+ style="opacity:0.80000001;fill:#00009d"
+ id="path182" />
+ <path
+ d="M 32.550000,70.581000 C 30.768000,70.581000 29.325000,69.135000 29.325000,67.353000 C 29.325000,65.574000 30.768000,64.129000 32.550000,64.129000 C 34.333000,64.129000 35.777000,65.573000 35.777000,67.353000 C 35.777000,69.135000 34.333000,70.581000 32.550000,70.581000 z "
+ style="opacity:0.80000001;fill:#00009d"
+ id="path184" />
+ </g>
+ <path
+ d="M 76.084043,191.55975 C 76.084043,192.29141 75.490729,192.88277 74.760370,192.88277 C 74.030012,192.88277 73.436373,192.29141 73.436373,191.55975 C 73.436373,190.82874 74.030012,190.23640 74.760370,190.23640 C 75.490729,190.23640 76.084043,190.82874 76.084043,191.55975 z "
+ id="path197" />
+ <g
+ id="g2746"
+ transform="matrix(0.187725,0.142332,-0.142332,0.187725,73.14272,172.3284)">
+ <path
+ style="fill:#000000;fill-opacity:1.0000000"
+ d="M 85.972408,63.227913 L 85.920832,58.100066 L 52.784489,58.453230 L 52.837031,63.580092 L 85.972408,63.227913 z "
+ id="path2742" />
+ <path
+ style="fill:#000000;fill-opacity:0.0000000"
+ d="M 54.878271,63.227913 L 54.826695,58.100066 L 21.690352,58.453230 L 21.742894,63.580092 L 54.878271,63.227913 z "
+ id="path2745" />
+ </g>
+ <g
+ id="g2750"
+ transform="matrix(0.235582,0.000000,0.000000,0.235582,61.90697,177.0787)">
+ <path
+ style="fill:#000000;fill-opacity:1.0000000"
+ d="M 52.850072,87.665598 L 57.717309,87.588284 L 57.275941,58.957734 L 52.406696,59.031180 L 52.850072,87.665598 z "
+ id="path2743" />
+ <path
+ style="fill:#000000;fill-opacity:0.0000000"
+ d="M 52.850072,61.847362 L 57.717309,61.770048 L 57.275941,33.139498 L 52.406696,33.212944 L 52.850072,61.847362 z "
+ id="path2749" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-freehand.svg b/kpresenter/toolbar/action-freehand.svg
new file mode 100644
index 000000000..14899a269
--- /dev/null
+++ b/kpresenter/toolbar/action-freehand.svg
@@ -0,0 +1,481 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg1978"
+ sodipodi:version="0.32"
+ inkscape:version="0.42.2"
+ sodipodi:docbase="/home/tz/develop/kpresenter/newicons/all"
+ sodipodi:docname="action-freehand.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr48-action-closed_polyline.png"
+ inkscape:export-xdpi="33.75"
+ inkscape:export-ydpi="33.75">
+ <defs
+ id="defs3">
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45939"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45938"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45937"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45936"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45934"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45933"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45932"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45931"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ id="stop1979" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ id="stop1978" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45930"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45929"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45928"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18528"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18527"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18526"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90196079;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1399"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1401"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1403"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1405"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1407"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1409"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1411"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1413"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1383"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1385"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1387"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1389"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2292"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2294"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient2296"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient2298"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1361"
+ gradientUnits="userSpaceOnUse"
+ x1="31.356537"
+ y1="24.749172"
+ x2="82.897346"
+ y2="114.25147"
+ gradientTransform="translate(9.245808e-2,-0.111238)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="4.5181405"
+ inkscape:cx="34.845311"
+ inkscape:cy="38.785507"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="1392"
+ inkscape:window-height="975"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ style="display:inline">
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.084527040pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.0000000"
+ d="M 0.74499569,127.24869 L 127.53555,0.74499569 M 127.53555,127.24869 L 0.74499569,0.74499569"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ style="fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:4.7709999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
+ d="M 3.7020514,76.983968 C 14.408803,64.514426 17.024974,27.872828 33.006056,31.126595 C 48.987138,34.380362 86.194872,101.39626 99.588543,96.506568 C 112.98221,91.616874 130.20968,5.8244888 118.06183,6.9515535 C 105.91397,8.0786181 43.386560,49.728373 23.885167,119.69707"
+ id="path43061" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-line.svg b/kpresenter/toolbar/action-line.svg
new file mode 100644
index 000000000..44413942e
--- /dev/null
+++ b/kpresenter/toolbar/action-line.svg
@@ -0,0 +1,539 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg1978"
+ sodipodi:version="0.32"
+ inkscape:version="0.43+devel"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-line.svg"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr48-action-line.png"
+ inkscape:export-xdpi="11.52"
+ inkscape:export-ydpi="11.52"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <defs
+ id="defs3">
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light75to0"
+ id="radialGradient33502"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.289787,0.291335,-0.409009,0.406835,545.1053,518.8194)"
+ cx="-877.84998"
+ cy="236.02315"
+ fx="-873.63324"
+ fy="236.02316"
+ r="371.08578" />
+ <linearGradient
+ id="light75to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.72916669;"
+ offset="0.0000000"
+ id="stop2769" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2770" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light75to0"
+ id="radialGradient33501"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.203035,0.20412,-0.583768,0.580664,544.1801,519.2883)"
+ cx="-1963.6747"
+ cy="230.98705"
+ fx="-1963.6747"
+ fy="230.98705"
+ r="410.84229" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient33500"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.59373,1.684268)"
+ x1="-2058.2698"
+ y1="-115.9186"
+ x2="-1316.7168"
+ y2="7.2321897" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient33499"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.289805,0.291354,-0.408983,0.406809,545.7464,518.642)"
+ x1="-1676.9677"
+ y1="-226.97523"
+ x2="-1250.356"
+ y2="98.317917" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient33498"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.84403,1.184792)"
+ x1="-1382.8806"
+ y1="-213.63434"
+ x2="-1241.6945"
+ y2="-42.625187" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient33497"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.84403,1.184792)"
+ x1="-1539.9783"
+ y1="-373.56558"
+ x2="-755.297"
+ y2="393.0744" />
+ <linearGradient
+ id="linearGradient12493">
+ <stop
+ style="stop-color:#8e0000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop12494" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop12495" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient12493"
+ id="radialGradient33496"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.84403,1.184792)"
+ cx="-1134.9819"
+ cy="130.48505"
+ fx="-1139.2013"
+ fy="127.46671"
+ r="869.9408" />
+ <linearGradient
+ id="linearGradient15059">
+ <stop
+ style="stop-color:#8e0000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop15060" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop15061" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15059"
+ id="linearGradient33495"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.001725,0.998278)"
+ x1="374.32877"
+ y1="368.14835"
+ x2="-3.5185382"
+ y2="9.3744097" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18358"
+ gradientUnits="userSpaceOnUse"
+ x1="183.38441"
+ y1="18.164442"
+ x2="183.38441"
+ y2="346.10425" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangetoblackorange"
+ id="linearGradient18357"
+ gradientUnits="userSpaceOnUse"
+ x1="21.640696"
+ y1="21.700418"
+ x2="344.80951"
+ y2="347.24612" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#yelowtoorange"
+ id="radialGradient18356"
+ gradientUnits="userSpaceOnUse"
+ cx="229.19582"
+ cy="298.50546"
+ fx="230.51244"
+ fy="295.85083"
+ r="163.26007" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18355"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18354"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18353"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18511"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="195.90846"
+ y1="129.9646"
+ x2="317.40915"
+ y2="129.9646" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18510"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="187.36211"
+ y1="65.068039"
+ x2="320.50891"
+ y2="194.37303" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18509"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="291.43869"
+ cy="173.08044"
+ fx="292.46613"
+ fy="172.54587"
+ r="65.751137" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient18445"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ id="stop1979" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ id="stop1978" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient18444"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,83.03569,-296.1794)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient18443"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.996641,1.003371)"
+ x1="-271.96796"
+ y1="-0.91287619"
+ x2="-365.85571"
+ y2="-94.742722" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient18442"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.996641,1.003371)"
+ x1="-271.64923"
+ y1="-1.3734332"
+ x2="-365.21259"
+ y2="-94.403656" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18441"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="195.90846"
+ y1="129.9646"
+ x2="317.40915"
+ y2="129.9646" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18440"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="187.36211"
+ y1="65.068039"
+ x2="320.50891"
+ y2="194.37303" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18439"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="291.43869"
+ cy="173.08044"
+ fx="292.46613"
+ fy="172.54587"
+ r="65.751137" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18474"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="195.90846"
+ y1="129.9646"
+ x2="317.40915"
+ y2="129.9646" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18473"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="187.36211"
+ y1="65.068039"
+ x2="320.50891"
+ y2="194.37303" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18472"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="291.43869"
+ cy="173.08044"
+ fx="292.46613"
+ fy="172.54587"
+ r="65.751137" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18471"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18470"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18469"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ id="orangetoblackorange">
+ <stop
+ style="stop-color:#ff8b00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop4207" />
+ <stop
+ style="stop-color:#4d0200;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop4209" />
+ </linearGradient>
+ <linearGradient
+ id="yelowtoorange">
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3105" />
+ <stop
+ style="stop-color:#ff8c00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3107" />
+ </linearGradient>
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90196079;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient10675"
+ gradientTransform="matrix(0.997144,0,0,0.997267,-1.369617,-2.339856)"
+ x1="2.7363148"
+ y1="3.6788297"
+ x2="370.75006"
+ y2="374.32068"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.78358169"
+ inkscape:cx="176.09775"
+ inkscape:cy="-40.819258"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="780"
+ inkscape:window-height="592"
+ inkscape:window-x="490"
+ inkscape:window-y="122" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.25pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0"
+ d="M 0.84841629,375 L 375.84842,0.84841629 M 375.84842,375 L 0.84841629,0.84841629"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:6.39491749;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 3.1974587,126.77384 L 124.19868,6.3433627"
+ id="path18512"
+ sodipodi:nodetypes="cc"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-penbrush.svg b/kpresenter/toolbar/action-penbrush.svg
new file mode 100644
index 000000000..732e193a8
--- /dev/null
+++ b/kpresenter/toolbar/action-penbrush.svg
@@ -0,0 +1,3337 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64px"
+ height="64px"
+ id="svg1316"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-penbrush.svg"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr48-action-penbrush.png"
+ inkscape:export-xdpi="67.5"
+ inkscape:export-ydpi="67.5">
+ <defs
+ id="defs1318">
+ <linearGradient
+ id="linearGradient3796"
+ gradientUnits="userSpaceOnUse"
+ x1="33.332001"
+ y1="10.305200"
+ x2="33.332001"
+ y2="91.407700">
+ <stop
+ id="stop3798"
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(84,84,119)"
+ id="stop3800" />
+ </linearGradient>
+ <linearGradient
+ y2="91.407700"
+ x2="33.332001"
+ y1="10.305200"
+ x1="33.332001"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3747">
+ <linearGradient
+ xlink:href="#linearGradient2642"
+ spreadMethod="pad"
+ y2="91.407700"
+ x2="33.332001"
+ y1="10.305200"
+ x1="33.332001"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3749" />
+ <stop
+ id="stop3751"
+ style="stop-color:rgb(255,255,255)"
+ offset="0" />
+ <stop
+ id="stop3753"
+ style="stop-color:rgb(84,84,119)"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3763"
+ gradientUnits="userSpaceOnUse"
+ x1="33.332001"
+ y1="10.305200"
+ x2="33.332001"
+ y2="91.407700">
+ <linearGradient
+ id="linearGradient3765"
+ gradientUnits="userSpaceOnUse"
+ x1="33.332001"
+ y1="10.305200"
+ x2="33.332001"
+ y2="91.407700"
+ spreadMethod="pad"
+ xlink:href="#linearGradient2642" />
+ <stop
+ offset="0"
+ style="stop-color:rgb(255,255,255)"
+ id="stop3767" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(84,84,119)"
+ id="stop3769" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3620">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop3622" />
+ <stop
+ id="stop3628"
+ offset="0.36649215"
+ style="stop-color:#000000;stop-opacity:0.49803922;" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop3624" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3565">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop3567" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop3569" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3552">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop3554" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop3556" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3482">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop3484" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop3486" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3462">
+ <stop
+ style="stop-color:#222222;stop-opacity:1;"
+ offset="0"
+ id="stop3464" />
+ <stop
+ style="stop-color:#222222;stop-opacity:0;"
+ offset="1"
+ id="stop3466" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient3076"
+ gradientUnits="userSpaceOnUse"
+ x1="182.14200"
+ y1="163.12953"
+ x2="182.14198"
+ y2="115.63019"
+ gradientTransform="matrix(0.990985,0.000000,0.000000,1.009097,0.000000,-20.00000)" />
+ <linearGradient
+ id="graytoblack">
+ <stop
+ id="stop5097"
+ offset="0.0000000"
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;" />
+ <stop
+ id="stop5098"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3857"
+ id="linearGradient3073"
+ gradientUnits="userSpaceOnUse"
+ x1="180.26233"
+ y1="143.76784"
+ x2="180.26268"
+ y2="134.31752"
+ gradientTransform="matrix(0.990985,0.000000,0.000000,1.009097,0.000000,-20.00000)"
+ spreadMethod="reflect" />
+ <linearGradient
+ id="linearGradient3857">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ id="stop3861" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#a9a9bb;stop-opacity:1.0000000;"
+ id="stop3859" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3857"
+ id="linearGradient3070"
+ gradientUnits="userSpaceOnUse"
+ x1="23.701700"
+ y1="32.068401"
+ x2="23.701700"
+ y2="1.5501000"
+ gradientTransform="matrix(1.058011,0.000000,0.000000,1.077347,153.5621,83.33260)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3857"
+ id="linearGradient3067"
+ gradientUnits="userSpaceOnUse"
+ x1="180.91510"
+ y1="145.33969"
+ x2="180.02591"
+ y2="118.40839"
+ gradientTransform="matrix(0.990985,0.000000,0.000000,1.009097,0.000000,-20.00000)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient3063"
+ gradientUnits="userSpaceOnUse"
+ x1="161.59552"
+ y1="111.36876"
+ x2="188.92943"
+ y2="155.94814"
+ gradientTransform="matrix(0.990985,0.000000,0.000000,1.009097,0.000000,-20.00000)" />
+ <linearGradient
+ y2="91.407700"
+ x2="33.332001"
+ y1="10.305200"
+ x1="33.332001"
+ gradientUnits="userSpaceOnUse"
+ id="bludraktowhite">
+ <stop
+ offset="0"
+ style="stop-color:#a9a9bb;stop-opacity:1;"
+ id="stop3435" />
+ <stop
+ id="stop7273"
+ style="stop-color:rgb(84,84,119)"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#garylighttowite"
+ id="linearGradient3060"
+ gradientUnits="userSpaceOnUse"
+ x1="180.63930"
+ y1="141.89970"
+ x2="180.63922"
+ y2="136.60526"
+ gradientTransform="matrix(0.990985,0.000000,0.000000,1.009097,0.000000,-20.00000)" />
+ <linearGradient
+ id="garylighttowite">
+ <stop
+ id="stop5106"
+ offset="0.0000000"
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;" />
+ <stop
+ id="stop5107"
+ offset="1.0000000"
+ style="stop-color:#d3d4d4;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient3057"
+ gradientUnits="userSpaceOnUse"
+ x1="23.697800"
+ y1="37.043900"
+ x2="23.697800"
+ y2="32.738300"
+ gradientTransform="matrix(1.058011,0.000000,0.000000,1.077347,153.5621,83.33260)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient11457"
+ gradientTransform="matrix(1.872379,0.000000,0.000000,0.534080,0.000000,-20.00000)"
+ x1="87.965759"
+ y1="228.39000"
+ x2="122.14636"
+ y2="270.91983"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="light100to0">
+ <stop
+ id="stop2764"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2765"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greandarktobgrean"
+ id="linearGradient3096"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.748120,-0.761792,0.748120,0.761792,229.2332,131.3576)"
+ x1="-6.4966002"
+ y1="-38.180698"
+ x2="-6.3817000"
+ y2="-37.491199" />
+ <linearGradient
+ id="greandarktobgrean">
+ <stop
+ id="stop4492"
+ offset="0.0000000"
+ style="stop-color:#00ad01;stop-opacity:1.0000000;" />
+ <stop
+ id="stop4493"
+ offset="1.0000000"
+ style="stop-color:#15720f;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3093"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.748120,-0.761792,0.748120,0.761792,229.2332,131.3576)"
+ x1="-6.3134999"
+ y1="-38.719200"
+ x2="-6.3134999"
+ y2="-38.160900" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#garylighttowite"
+ id="linearGradient3034"
+ gradientUnits="userSpaceOnUse"
+ x1="180.41942"
+ y1="119.82854"
+ x2="180.05978"
+ y2="145.28880"
+ gradientTransform="matrix(0.990985,0.000000,0.000000,1.009097,0.000000,-20.00000)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient3031"
+ gradientUnits="userSpaceOnUse"
+ x1="163.95276"
+ y1="56.162014"
+ x2="188.99994"
+ y2="146.23071"
+ gradientTransform="matrix(0.990985,0.000000,0.000000,1.009097,0.000000,-20.00000)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3857"
+ id="linearGradient3027"
+ gradientUnits="userSpaceOnUse"
+ x1="171.52795"
+ y1="88.272369"
+ x2="200.48302"
+ y2="112.93732"
+ gradientTransform="scale(0.990985,1.009097)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3857"
+ id="linearGradient3023"
+ gradientUnits="userSpaceOnUse"
+ x1="14.500500"
+ y1="32.291000"
+ x2="35.789902"
+ y2="53.580601"
+ gradientTransform="matrix(1.058011,0.000000,0.000000,1.077347,153.5621,83.33260)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient3019"
+ gradientUnits="userSpaceOnUse"
+ x1="23.679199"
+ y1="19.698700"
+ x2="23.679199"
+ y2="28.978600"
+ gradientTransform="matrix(1.058011,0.000000,0.000000,1.077347,153.5621,83.33260)" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluelignonlinblu"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop84"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop86"
+ offset="0.13480000"
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop88"
+ offset="0.32049999"
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop90"
+ offset="0.56800002"
+ style="stop-color:#3293fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop92"
+ offset="0.75340003"
+ style="stop-color:#107bfe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop94"
+ offset="0.85390002"
+ style="stop-color:#0372fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop96"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient6901"
+ gradientTransform="matrix(1.485251,0.000000,0.000000,0.673287,0.000000,-20.00000)"
+ x1="113.67773"
+ y1="186.93973"
+ x2="128.96295"
+ y2="205.73032"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ r="50.578453"
+ fy="27.383936"
+ fx="12.810296"
+ cy="27.383936"
+ cx="12.810296"
+ gradientTransform="matrix(1.068601,0.000000,0.000000,0.955303,-21.48656,6.128758)"
+ id="radialGradient2207"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <radialGradient
+ r="28.933352"
+ fy="89.387924"
+ fx="54.280910"
+ cy="89.387924"
+ cx="54.280910"
+ gradientTransform="matrix(1.151988,0.000000,0.000000,0.886154,-12.45295,-2.216075)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3236"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="11.102478"
+ x2="-16.667776"
+ y1="79.266365"
+ x1="42.188053"
+ gradientTransform="matrix(1.080815,0.000000,0.000000,0.944508,-12.65436,-1.621945)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3196"
+ xlink:href="#blacktowhite"
+ inkscape:collect="always" />
+ <linearGradient
+ id="blacktowhite">
+ <stop
+ id="stop2476"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2475"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ y2="-5.2496204"
+ x2="-12.340737"
+ y1="93.603699"
+ x1="55.349602"
+ gradientTransform="matrix(1.080815,0.000000,0.000000,0.944508,-5.360585,-1.621945)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3197"
+ xlink:href="#blacktowhite"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="31.206570"
+ x2="10.556294"
+ y1="83.336693"
+ x1="57.458168"
+ gradientTransform="matrix(1.196889,0.000000,0.000000,0.929477,-22.59966,2.420480)"
+ id="linearGradient4310"
+ xlink:href="#graytolightgray"
+ inkscape:collect="always" />
+ <linearGradient
+ id="graytolightgray">
+ <stop
+ id="stop5101"
+ offset="0.0000000"
+ style="stop-color:#d4d3d3;stop-opacity:1.0000000;" />
+ <stop
+ id="stop5102"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="436.36536"
+ x2="-164.89326"
+ y1="436.36536"
+ x1="-190.43472"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ id="linearGradient2999"
+ xlink:href="#multicolors"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="52.754902"
+ x2="80.019501"
+ y1="52.754902"
+ x1="26.843800"
+ gradientUnits="userSpaceOnUse"
+ id="multicolors">
+ <stop
+ id="stop110"
+ style="stop-color:rgb(255,0,0)"
+ offset="0" />
+ <stop
+ id="stop112"
+ style="stop-color:rgb(255,177,0)"
+ offset="0.236" />
+ <stop
+ id="stop114"
+ style="stop-color:rgb(0,192,0)"
+ offset="0.4775" />
+ <stop
+ id="stop116"
+ style="stop-color:rgb(0,0,255)"
+ offset="0.8" />
+ <stop
+ id="stop118"
+ style="stop-color:rgb(255,2,255)"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="375.81558"
+ x2="-91.394302"
+ y1="375.81558"
+ x1="-117.06016"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,261.7187,-180.0349)"
+ id="linearGradient5648"
+ xlink:href="#zerotowhitetozero"
+ inkscape:collect="always" />
+ <linearGradient
+ id="zerotowhitetozero">
+ <stop
+ id="stop3155"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ <stop
+ id="stop3156"
+ offset="0.33462518"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ <stop
+ id="stop3157"
+ offset="0.55554277"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3158"
+ offset="0.74528182"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ <stop
+ id="stop3159"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,244.6084,-145.8000)"
+ y2="437.18375"
+ x2="-126.80632"
+ y1="437.18375"
+ x1="-152.34778"
+ id="linearGradient1893"
+ xlink:href="#linearGradient3857"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="91.407700"
+ x2="33.332001"
+ y1="10.305200"
+ x1="33.332001"
+ gradientUnits="userSpaceOnUse"
+ id="bluedrklighttowite"
+ spreadMethod="pad"
+ xlink:href="#linearGradient3857" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,227.4982,-112.4776)"
+ y2="285.89084"
+ x2="-117.95375"
+ y1="285.97815"
+ x1="-143.52490"
+ id="linearGradient2515"
+ xlink:href="#light90to0"
+ inkscape:collect="always" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ id="stop1890"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.90833336;" />
+ <stop
+ id="stop1892"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="437.18375"
+ x2="-12.545480"
+ y1="437.18375"
+ x1="-38.086945"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ id="linearGradient2512"
+ xlink:href="#wihitetolightgray"
+ inkscape:collect="always" />
+ <linearGradient
+ id="wihitetolightgray">
+ <stop
+ id="stop1885"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop1886"
+ offset="1.0000000"
+ style="stop-color:#d5d4d4;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ y2="437.18376"
+ x2="-126.80632"
+ y1="437.18376"
+ x1="-152.34778"
+ id="linearGradient578"
+ xlink:href="#bludraktowhite"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ y2="140.50669"
+ x2="-165.04343"
+ y1="140.50669"
+ x1="-190.58490"
+ id="linearGradient582"
+ xlink:href="#yelowtoorange"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="yelowtoorange">
+ <stop
+ id="stop3105"
+ offset="0.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3107"
+ offset="1.0000000"
+ style="stop-color:#ff8c00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ y2="484.89935"
+ x2="-50.820229"
+ y1="484.89935"
+ x1="-75.751329"
+ id="linearGradient4468"
+ xlink:href="#greylighttograyw"
+ inkscape:collect="always"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="greylighttograyw">
+ <stop
+ id="stop575"
+ offset="0.0000000"
+ style="stop-color:#b5b5b8;stop-opacity:1.0000000;" />
+ <stop
+ id="stop576"
+ offset="1.0000000"
+ style="stop-color:#ebebee;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ y2="387.73757"
+ x2="-164.89326"
+ y1="387.73757"
+ x1="-190.43472"
+ id="linearGradient7330"
+ xlink:href="#greandraktoblack"
+ inkscape:collect="always"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="greandraktoblack">
+ <stop
+ id="stop7328"
+ offset="0.0000000"
+ style="stop-color:#007c00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop7329"
+ offset="1.0000000"
+ style="stop-color:#025a00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ y2="239.39903"
+ x2="-164.89326"
+ y1="239.39903"
+ x1="-190.43472"
+ id="linearGradient6704"
+ xlink:href="#bluelighttowhite"
+ inkscape:collect="always"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluelighttowhite"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop6078"
+ offset="0.0055999998"
+ style="stop-color:#69d3ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop6080"
+ offset="1.0000000"
+ style="stop-color:#edffff;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ y2="41.614335"
+ x2="-165.04343"
+ y1="41.614335"
+ x1="-190.58490"
+ id="linearGradient5454"
+ xlink:href="#orangetoblackorange"
+ inkscape:collect="always"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="orangetoblackorange">
+ <stop
+ id="stop4207"
+ offset="0.0000000"
+ style="stop-color:#ff8b00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop4209"
+ offset="1.0000000"
+ style="stop-color:#4d0200;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ y2="189.95285"
+ x2="-165.04343"
+ y1="189.95285"
+ x1="-190.58490"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient581"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluedarktoblackblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop2959"
+ offset="0.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2960"
+ offset="1.0000000"
+ style="stop-color:#032442;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ xlink:href="#blacktowhite"
+ collect="always"
+ id="linearGradient9077"
+ y2="484.89935"
+ x2="-127.14428"
+ y1="484.89935"
+ x1="-152.07539"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ xlink:href="#garylighttowite"
+ collect="always"
+ id="linearGradient5108"
+ y2="484.89935"
+ x2="-89.057346"
+ y1="484.89935"
+ x1="-113.98845"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ xlink:href="#graytolightgray"
+ collect="always"
+ id="linearGradient5103"
+ y2="484.89921"
+ x2="-12.883455"
+ y1="484.89921"
+ x1="-37.814561"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ xlink:href="#graytoblack"
+ id="linearGradient782"
+ y2="486.99113"
+ x2="-165.94998"
+ y1="486.99113"
+ x1="-190.88108"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ xlink:href="#reddarktoblack"
+ collect="always"
+ id="linearGradient4473"
+ y2="487.08498"
+ x2="-203.84911"
+ y1="487.08498"
+ x1="-229.39058"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="reddarktoblack">
+ <stop
+ id="stop3230"
+ offset="0.0000000"
+ style="stop-color:#8e0000;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3231"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ xlink:href="#redtodarkred"
+ collect="always"
+ id="linearGradient4471"
+ y2="437.63879"
+ x2="-203.84911"
+ y1="437.63879"
+ x1="-229.39058"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="redtodarkred">
+ <stop
+ id="stop3856"
+ offset="0.0000000"
+ style="stop-color:#ff0000;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3855"
+ offset="1.0000000"
+ style="stop-color:#920000;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ xlink:href="#greandarktobgrean"
+ collect="always"
+ id="linearGradient3704"
+ y2="389.01100"
+ x2="-203.84911"
+ y1="389.01100"
+ x1="-229.39058"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ xlink:href="#greantodarkgrean"
+ collect="always"
+ id="linearGradient3080"
+ y2="339.56484"
+ x2="-203.84911"
+ y1="339.56484"
+ x1="-229.39058"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="greantodarkgrean">
+ <stop
+ id="stop5123"
+ offset="0.0000000"
+ style="stop-color:#00ff01;stop-opacity:1.0000000;" />
+ <stop
+ id="stop5124"
+ offset="1.0000000"
+ style="stop-color:#15980f;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ xlink:href="#bluelightlesstoblue"
+ collect="always"
+ id="linearGradient3471"
+ y2="289.30027"
+ x2="-203.84911"
+ y1="289.30027"
+ x1="-229.39058"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluelightlesstoblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop3468"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3469"
+ offset="0.24089479"
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3470"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ xlink:href="#blueligtmoretoblue"
+ collect="always"
+ id="linearGradient3464"
+ y2="240.67248"
+ x2="-203.84911"
+ y1="240.67248"
+ x1="-229.39058"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="blueligtmoretoblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop3457"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3465"
+ offset="0.74217570"
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3463"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#shadow25tolineto0"
+ collect="always"
+ id="linearGradient3445"
+ y2="236.93242"
+ x2="-66.175239"
+ y1="236.93242"
+ x1="-91.841094" />
+ <linearGradient
+ id="shadow25tolineto0">
+ <stop
+ id="stop3442"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:0.25490198;" />
+ <stop
+ id="stop3450"
+ offset="0.45393065"
+ style="stop-color:#000000;stop-opacity:0.029166667;" />
+ <stop
+ id="stop3449"
+ offset="0.50000000"
+ style="stop-color:#000000;stop-opacity:0.37083334;" />
+ <stop
+ id="stop3451"
+ offset="0.53497112"
+ style="stop-color:#000000;stop-opacity:0.062745102;" />
+ <stop
+ id="stop3444"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#shadow0wto25to0"
+ collect="always"
+ id="linearGradient3440"
+ y2="187.22644"
+ x2="-66.175239"
+ y1="187.22644"
+ x1="-91.841094" />
+ <linearGradient
+ id="shadow0wto25to0">
+ <stop
+ id="stop3437"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ <stop
+ id="stop3438"
+ offset="0.50000000"
+ style="stop-color:#000000;stop-opacity:0.27916667;" />
+ <stop
+ id="stop3439"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#shadow25to25w"
+ collect="always"
+ id="linearGradient3435"
+ y2="139.14619"
+ x2="-66.175239"
+ y1="139.14619"
+ x1="-91.841094" />
+ <linearGradient
+ id="shadow25to25w">
+ <stop
+ id="stop3433"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:0.25416666;" />
+ <stop
+ id="stop3434"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.26274511;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#sadow75to0w"
+ collect="always"
+ id="linearGradient3431"
+ y2="94.175793"
+ x2="-66.412008"
+ y1="94.175793"
+ x1="-92.077864" />
+ <linearGradient
+ id="sadow75to0w">
+ <stop
+ id="stop3429"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:0.72941178;" />
+ <stop
+ id="stop3430"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356840,0.000000,0.000000,0.737006,228.1044,-149.7510)"
+ xlink:href="#shadow100to0"
+ collect="always"
+ id="linearGradient3427"
+ y2="44.608502"
+ x2="-66.177619"
+ y1="44.608502"
+ x1="-91.849261" />
+ <linearGradient
+ id="shadow100to0">
+ <stop
+ id="stop3425"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ <stop
+ id="stop3426"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#light50to25to7"
+ collect="always"
+ id="linearGradient2794"
+ y2="285.89085"
+ x2="-117.95375"
+ y1="285.97815"
+ x1="-143.52490" />
+ <linearGradient
+ id="light50to25to7">
+ <stop
+ id="stop2791"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.47450981;" />
+ <stop
+ id="stop2795"
+ offset="0.50000000"
+ style="stop-color:#ffffff;stop-opacity:0.25833333;" />
+ <stop
+ id="stop2793"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.10833333;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#light100to25to0"
+ collect="always"
+ id="linearGradient2788"
+ y2="236.06466"
+ x2="-117.95375"
+ y1="236.06466"
+ x1="-143.61961" />
+ <linearGradient
+ id="light100to25to0">
+ <stop
+ id="stop2785"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2786"
+ offset="0.50000000"
+ style="stop-color:#ffffff;stop-opacity:0.28749999;" />
+ <stop
+ id="stop2787"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#light100to75to0"
+ collect="always"
+ id="linearGradient2781"
+ y2="186.35868"
+ x2="-117.95375"
+ y1="186.35868"
+ x1="-143.61961" />
+ <linearGradient
+ id="light100to75to0">
+ <stop
+ id="stop2779"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2782"
+ offset="0.50000000"
+ style="stop-color:#ffffff;stop-opacity:0.77499998;" />
+ <stop
+ id="stop2780"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#light75to25"
+ collect="always"
+ id="linearGradient2776"
+ y2="138.27845"
+ x2="-117.95375"
+ y1="138.27845"
+ x1="-143.61961" />
+ <linearGradient
+ id="light75to25">
+ <stop
+ id="stop2774"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.72941178;" />
+ <stop
+ id="stop2775"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.26249999;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#light75to0"
+ collect="always"
+ id="linearGradient2771"
+ y2="91.823961"
+ x2="-117.95375"
+ y1="91.823961"
+ x1="-143.61961" />
+ <linearGradient
+ id="light75to0">
+ <stop
+ id="stop2769"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.72916669;" />
+ <stop
+ id="stop2770"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,228.1044,-149.7510)"
+ xlink:href="#light100to0"
+ collect="always"
+ id="linearGradient2766"
+ y2="43.743732"
+ x2="-117.95375"
+ y1="43.743732"
+ x1="-143.61961" />
+ <linearGradient
+ xlink:href="#bluelignonlinblu"
+ collect="always"
+ id="linearGradient2754"
+ y2="191.22630"
+ x2="-203.99928"
+ y1="191.22630"
+ x1="-229.54075"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ xlink:href="#orangelesstoyelow"
+ collect="always"
+ id="linearGradient2757"
+ y2="141.78014"
+ x2="-203.84911"
+ y1="141.78014"
+ x1="-229.39058"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="orangelesstoyelow">
+ <stop
+ id="stop2689"
+ offset="0.0000000"
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2690"
+ offset="0.25358382"
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2691"
+ offset="1.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ xlink:href="#orangemoretoyelow"
+ collect="always"
+ id="linearGradient2756"
+ y2="91.338440"
+ x2="-203.92421"
+ y1="91.338440"
+ x1="-229.46567"
+ gradientTransform="matrix(1.395481,0.000000,0.000000,0.716599,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="orangemoretoyelow">
+ <stop
+ id="stop2671"
+ offset="0.0000000"
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2679"
+ offset="0.74641621"
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2672"
+ offset="1.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ xlink:href="#orangetoyelow"
+ collect="always"
+ id="linearGradient2755"
+ y2="40.879728"
+ x2="-209.95222"
+ y1="40.879728"
+ x1="-235.61807"
+ gradientTransform="matrix(1.356931,0.000000,0.000000,0.736957,191.4588,-145.8000)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="orangetoyelow">
+ <stop
+ id="stop2661"
+ offset="0.0000000"
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2662"
+ offset="1.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3620"
+ id="linearGradient3626"
+ x1="2.1452298"
+ y1="62.195076"
+ x2="44.487244"
+ y2="50.943298"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,-0.408758,1,25.4975,-1.691523)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3620"
+ id="linearGradient3632"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,-0.408758,1,26.93425,-3.691523)"
+ x1="2.1452298"
+ y1="62.195076"
+ x2="44.487244"
+ y2="50.943298" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3565"
+ id="linearGradient1977"
+ gradientUnits="userSpaceOnUse"
+ x1="24.086939"
+ y1="16.355263"
+ x2="28.072435"
+ y2="22.584122"
+ gradientTransform="matrix(1.296382,-0.226186,0.226186,1.296382,10.38285,-11.34732)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3552"
+ id="radialGradient1980"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.131706,0.113867,-1.150548,1.330799,83.28796,-14.61432)"
+ cx="-41.394871"
+ cy="49.229198"
+ fx="-41.394871"
+ fy="49.229198"
+ r="16.6025" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangetoblackorange"
+ id="linearGradient1983"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.98001,-0.173929,0.196984,1.148431,10.09255,-3.902568)"
+ x1="-15.911189"
+ y1="50.067177"
+ x2="-4.9594078"
+ y2="50.067177" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3482"
+ id="radialGradient1986"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.191215,0.368524,-2.286972,-1.227815,111.1148,102.4431)"
+ cx="-3.5051379"
+ cy="43.013172"
+ fx="-3.5051379"
+ fy="43.013172"
+ r="1.609475" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3482"
+ id="radialGradient1989"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.191215,0.368524,-2.286972,-1.227815,112.3537,100.7831)"
+ cx="-3.5051379"
+ cy="43.013172"
+ fx="-3.5051379"
+ fy="43.013172"
+ r="1.609475" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3482"
+ id="radialGradient1992"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.191215,0.368524,-2.286972,-1.227815,113.6545,99.06335)"
+ cx="-3.5051379"
+ cy="43.013172"
+ fx="-3.5051379"
+ fy="43.013172"
+ r="1.609475" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3462"
+ id="radialGradient1995"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.292549,-0.229397,0.192575,1.122731,12.26208,-3.787876)"
+ cx="-3.984275"
+ cy="46.392977"
+ fx="-3.984275"
+ fy="46.392977"
+ r="2.765725" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient1998"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ x1="-5.1018434"
+ y1="44.656788"
+ x2="-5.6110334"
+ y2="45.17627"
+ gradientTransform="matrix(1.292549,-0.229397,0.225518,1.314785,10.7338,-12.69787)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient2001"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ x1="-5.1018434"
+ y1="44.656788"
+ x2="-5.6110334"
+ y2="45.17627"
+ gradientTransform="matrix(1.292549,-0.229397,0.225518,1.314785,10.7338,-12.69787)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient2004"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ x1="-5.1018434"
+ y1="44.656788"
+ x2="-5.6110334"
+ y2="45.17627"
+ gradientTransform="matrix(1.292551,-0.229397,0.225518,1.314787,10.73381,-12.69789)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient2006"
+ gradientUnits="userSpaceOnUse"
+ x1="-16.270781"
+ y1="31.86446"
+ x2="-6.0006475"
+ y2="45.890564"
+ gradientTransform="matrix(1.292551,-0.229397,0.225518,1.314787,10.73381,-12.69789)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangetoblackorange"
+ id="linearGradient2009"
+ gradientUnits="userSpaceOnUse"
+ x1="-15.911189"
+ y1="50.067177"
+ x2="-4.9594078"
+ y2="50.067177"
+ gradientTransform="matrix(1.505436,-0.267179,0.262661,1.531334,10.24184,-22.93644)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#yelowtoorange"
+ id="radialGradient2012"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.173176,0.130477,-1.052859,1.397405,65.5544,-18.02783)"
+ cx="-7.4786124"
+ cy="30.165716"
+ fx="-10.358942"
+ fy="32.910751"
+ r="17.102501" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangetoblackorange"
+ id="linearGradient2014"
+ gradientUnits="userSpaceOnUse"
+ x1="15.113712"
+ y1="-18.462482"
+ x2="9.5512104"
+ y2="44.423061"
+ gradientTransform="matrix(1.296382,-0.226186,0.226186,1.296382,10.38285,-11.34732)" />
+ <linearGradient
+ gradientTransform="matrix(0.182431,0.000000,0.000000,0.213888,4.641008,0.357569)"
+ y2="323.76923"
+ x2="272.46765"
+ y1="59.053604"
+ x1="122.43015"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3623"
+ xlink:href="#graytolightgray"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientTransform="matrix(0.696376,0.000000,0.000000,0.816451,10.14487,4.039048)"
+ r="23.6936"
+ fy="81.1689"
+ fx="74.4951"
+ cy="81.1689"
+ cx="74.4951"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3622"
+ xlink:href="#XMLID_9_"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient10235">
+ <stop
+ id="stop10237"
+ offset="0.0000000"
+ style="stop-color:#d4d3d3;stop-opacity:1.0000000;" />
+ <stop
+ id="stop10239"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientTransform="matrix(0.182431,0.000000,0.000000,0.213888,4.641008,0.357569)"
+ y2="273.80606"
+ x2="330.93881"
+ y1="340.20792"
+ x1="284.17496"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3621"
+ xlink:href="#graytolightgray"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient10242">
+ <stop
+ id="stop10244"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.72916669;" />
+ <stop
+ id="stop10246"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ r="508.29517"
+ fy="52.577991"
+ fx="53.182602"
+ cy="52.577991"
+ cx="53.182602"
+ gradientTransform="matrix(0.222656,0.000000,0.000000,0.175247,4.641008,1.797000e-2)"
+ id="radialGradient6111"
+ xlink:href="#light75to0"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientTransform="matrix(0.182431,0.000000,0.000000,0.213888,4.641008,0.357569)"
+ y2="513.91156"
+ x2="561.86395"
+ y1="248.01839"
+ x1="245.91402"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3619"
+ xlink:href="#garylighttowite"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient2411">
+ <stop
+ id="stop2413"
+ offset="0.0000000"
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2415"
+ offset="1.0000000"
+ style="stop-color:#d3d4d4;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientTransform="matrix(0.182431,0.000000,0.000000,0.213888,4.641008,0.357569)"
+ y2="648.29797"
+ x2="578.44397"
+ y1="-50.289883"
+ x1="-37.332329"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3618"
+ xlink:href="#garylighttowite"
+ inkscape:collect="always" />
+ <radialGradient
+ r="23.6936"
+ fy="81.1689"
+ fx="74.4951"
+ cy="81.1689"
+ cx="74.4951"
+ gradientTransform="matrix(0.696376,0.000000,0.000000,0.816451,10.14487,4.039048)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient7426"
+ xlink:href="#XMLID_9_"
+ inkscape:collect="always" />
+ <radialGradient
+ r="508.29517"
+ fy="52.577991"
+ fx="53.182602"
+ cy="52.577991"
+ cx="53.182602"
+ gradientTransform="matrix(0.261654,0.000000,0.000000,0.186725,-10.45838,-5.143526)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient1100"
+ xlink:href="#light75to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="323.76923"
+ x2="272.46765"
+ y1="59.053604"
+ x1="122.43015"
+ gradientTransform="matrix(0.214385,0.000000,0.000000,0.222911,-10.46009,-4.866561)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1101"
+ xlink:href="#graytolightgray"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="648.29797"
+ x2="578.44397"
+ y1="-50.289883"
+ x1="-37.332329"
+ gradientTransform="matrix(0.214385,0.000000,0.000000,0.227898,-10.37251,-4.757327)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1102"
+ xlink:href="#garylighttowite"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="513.91156"
+ x2="561.86395"
+ y1="248.01839"
+ x1="245.91402"
+ gradientTransform="matrix(0.214385,0.000000,0.000000,0.227898,-10.74547,-4.758651)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1103"
+ xlink:href="#garylighttowite"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="273.80606"
+ x2="330.93881"
+ y1="340.20792"
+ x1="284.17496"
+ gradientTransform="matrix(0.214385,0.000000,0.000000,0.227898,-11.00079,-4.737960)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1104"
+ xlink:href="#graytolightgray"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.007895,0.992167)"
+ r="16.905936"
+ fy="288.10696"
+ fx="99.576797"
+ cy="288.10696"
+ cx="99.576797"
+ id="radialGradient1162"
+ xlink:href="#yelowtoorange"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.007939,0.992123)"
+ r="32.600057"
+ fy="305.53129"
+ fx="117.98709"
+ cy="304.92585"
+ cx="117.06402"
+ id="radialGradient1161"
+ xlink:href="#yelowtoorange"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="92.233040"
+ x2="66.504250"
+ y1="124.63684"
+ x1="65.665718"
+ spreadMethod="pad"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1160"
+ xlink:href="#orangetoyelow"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="122.44665"
+ x2="66.497231"
+ y1="20.307247"
+ x1="59.273998"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1159"
+ xlink:href="#orangemoretoyelow"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="48.286541"
+ x2="59.353645"
+ y1="113.70891"
+ x1="62.404484"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1158"
+ xlink:href="#orangetoblackorange"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="175.27454"
+ x2="62.530823"
+ y1="18.808815"
+ x1="52.093212"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1157"
+ xlink:href="#orangetoblackorange"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="74.325470"
+ x2="57.450085"
+ y1="133.07648"
+ x1="60.536690"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1156"
+ xlink:href="#orangelesstoyelow"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="71.243797"
+ x2="43.653599"
+ y1="98.746101"
+ x1="51.968300"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1155"
+ xlink:href="#bludraktowhite"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientTransform="matrix(0.860113,2.48814e-17,-8.733996e-17,1.281905,243.3409,359.343)"
+ y2="267.88974"
+ x2="137.60123"
+ y1="19.868944"
+ x1="116.16369"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1154"
+ xlink:href="#linearGradient3796"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientTransform="scale(0.994701,1.005327)"
+ y2="123.23939"
+ x2="28.078188"
+ y1="-49.143494"
+ x1="13.411418"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1153"
+ xlink:href="#linearGradient3747"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.994505,1.005525)"
+ y2="109.8044"
+ x2="66.285202"
+ y1="64.368118"
+ x1="21.797516"
+ id="linearGradient1152"
+ xlink:href="#linearGradient10275"
+ inkscape:collect="always" />
+ <radialGradient
+ fy="0.76828623"
+ fx="0.82170546"
+ r="0.82132119"
+ cy="0.75303298"
+ cx="0.79844964"
+ id="radialGradient620"
+ xlink:href="#yelowtoorange" />
+ <radialGradient
+ fy="0.23816428"
+ fx="0.26356590"
+ r="0.67450374"
+ cy="0.23816428"
+ cx="0.26356590"
+ id="radialGradient577"
+ xlink:href="#yelowtoorange" />
+ <linearGradient
+ y2="1.0276290"
+ x2="0.99904650"
+ y1="0.33295012"
+ x1="0.31887081"
+ id="linearGradient1590"
+ xlink:href="#bludraktowhite"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientUnits="objectBoundingBox"
+ y2="1.2117912"
+ x2="0.41760600"
+ y1="-1.3477520"
+ x1="0.19983362"
+ id="linearGradient617"
+ xlink:href="#bludraktowhite" />
+ <linearGradient
+ y2="91.407700"
+ x2="33.332001"
+ y1="10.305200"
+ x1="33.332001"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient10275">
+ <stop
+ id="stop10277"
+ style="stop-color:rgb(255,255,255)"
+ offset="0" />
+ <stop
+ id="stop10279"
+ style="stop-color:rgb(84,84,119)"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="objectBoundingBox"
+ y2="1.4512330"
+ x2="0.53851098"
+ y1="-0.029274037"
+ x1="0.41054419"
+ id="linearGradient601"
+ xlink:href="#bludraktowhite" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="71.243797"
+ x2="43.653599"
+ y1="98.746101"
+ x1="51.968300"
+ id="linearGradient658"
+ xlink:href="#bludraktowhite" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="74.325470"
+ x2="57.450085"
+ y1="133.07648"
+ x1="60.536690"
+ id="linearGradient608"
+ xlink:href="#orangelesstoyelow" />
+ <linearGradient
+ id="linearGradient2375">
+ <stop
+ id="stop2377"
+ offset="0.0000000"
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2379"
+ offset="0.25358382"
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2381"
+ offset="1.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="175.27454"
+ x2="62.530823"
+ y1="18.808815"
+ x1="52.093212"
+ id="linearGradient583"
+ xlink:href="#orangetoblackorange" />
+ <linearGradient
+ id="linearGradient2368">
+ <stop
+ id="stop2370"
+ offset="0.0000000"
+ style="stop-color:#ff8b00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2372"
+ offset="1.0000000"
+ style="stop-color:#4d0200;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="48.286541"
+ x2="59.353645"
+ y1="113.70891"
+ x1="62.404484"
+ id="linearGradient613"
+ xlink:href="#orangetoblackorange" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="122.44665"
+ x2="66.497231"
+ y1="20.307247"
+ x1="59.273998"
+ id="linearGradient618"
+ xlink:href="#orangemoretoyelow" />
+ <linearGradient
+ id="linearGradient2358">
+ <stop
+ id="stop2360"
+ offset="0.0000000"
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2362"
+ offset="0.74641621"
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2364"
+ offset="1.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ spreadMethod="pad"
+ gradientUnits="userSpaceOnUse"
+ y2="92.233040"
+ x2="66.504250"
+ y1="124.63684"
+ x1="65.665718"
+ id="linearGradient573"
+ xlink:href="#orangetoyelow" />
+ <linearGradient
+ id="linearGradient2351">
+ <stop
+ id="stop2353"
+ offset="0.0000000"
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2355"
+ offset="1.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2345">
+ <stop
+ id="stop2347"
+ offset="0.0000000"
+ style="stop-color:#ffff00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2349"
+ offset="1.0000000"
+ style="stop-color:#ff8c00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient1441">
+ <stop
+ id="stop1443"
+ offset="0.0000000"
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;" />
+ <stop
+ id="stop1445"
+ offset="1.0000000"
+ style="stop-color:#d3d4d4;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="52.538799"
+ x2="58.535599"
+ y1="113.45800"
+ x1="58.535599"
+ id="linearGradient606"
+ xlink:href="#garylighttowite" />
+ <linearGradient
+ id="linearGradient1434">
+ <stop
+ id="stop1436"
+ offset="0.0000000"
+ style="stop-color:#d4d3d3;stop-opacity:1.0000000;" />
+ <stop
+ id="stop1438"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2332">
+ <stop
+ id="stop2334"
+ offset="0.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2336"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2326">
+ <stop
+ id="stop2328"
+ offset="0.0000000"
+ style="stop-color:#b5b5b8;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2330"
+ offset="1.0000000"
+ style="stop-color:#ebebee;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="13.105219"
+ x2="57.864365"
+ y1="36.379978"
+ x1="77.157959"
+ id="linearGradient2324"
+ xlink:href="#graytolightgray" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="100.58953"
+ x2="82.368210"
+ y1="-61.206173"
+ x1="44.404633"
+ id="linearGradient2322"
+ xlink:href="#blacktowhite" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="447.19601"
+ x2="123.39273"
+ y1="452.76382"
+ x1="123.39273"
+ id="linearGradient585"
+ xlink:href="#greylighttograyw" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="405.91858"
+ x2="84.319923"
+ y1="503.80502"
+ x1="147.44272"
+ id="linearGradient645"
+ xlink:href="#greylighttograyw" />
+ <linearGradient
+ id="linearGradient1418">
+ <stop
+ id="stop1420"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.72916669;" />
+ <stop
+ id="stop1422"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2311">
+ <stop
+ id="stop2313"
+ offset="0.0000000"
+ style="stop-color:#00ff01;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2315"
+ offset="1.0000000"
+ style="stop-color:#15980f;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2305">
+ <stop
+ id="stop2307"
+ offset="0.0000000"
+ style="stop-color:#007c00;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2309"
+ offset="1.0000000"
+ style="stop-color:#025a00;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5201">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5203" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5205" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2294">
+ <stop
+ id="stop2296"
+ offset="0.0000000"
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2298"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2287">
+ <stop
+ id="stop2289"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.72916669;" />
+ <stop
+ id="stop2291"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2279">
+ <stop
+ id="stop2281"
+ offset="0.0000000"
+ style="stop-color:#d4d3d3;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2283"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2271">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2273" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2275" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2642"
+ id="linearGradient6543"
+ gradientTransform="matrix(0.763898,0.000000,0.000000,2.503768,2.178960,-154.2521)"
+ x1="84.101753"
+ y1="74.286453"
+ x2="25.033056"
+ y2="74.450653"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="linearGradient2642">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ id="stop2646" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#a9a9bb;stop-opacity:1.0000000;"
+ id="stop2644" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient5777"
+ gradientTransform="matrix(0.741194,0.000000,0.000000,2.580463,2.178960,-154.2521)"
+ x1="104.96716"
+ y1="98.692421"
+ x2="56.848820"
+ y2="64.335876"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="linearGradient2246"
+ gradientUnits="userSpaceOnUse"
+ x1="33.332001"
+ y1="10.305200"
+ x2="33.332001"
+ y2="91.407700">
+ <linearGradient
+ id="linearGradient2248"
+ gradientUnits="userSpaceOnUse"
+ x1="33.332001"
+ y1="10.305200"
+ x2="33.332001"
+ y2="91.407700"
+ spreadMethod="pad"
+ xlink:href="#linearGradient2642" />
+ <stop
+ offset="0"
+ style="stop-color:rgb(255,255,255)"
+ id="stop7271" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(84,84,119)"
+ id="stop2251" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="linearGradient7510"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.334523,0.000000,0.000000,0.749331,23.21000,-2.999828e-2)"
+ x1="21.753733"
+ y1="16.770046"
+ x2="21.871677"
+ y2="30.831261" />
+ <linearGradient
+ id="linearGradient2239">
+ <stop
+ style="stop-color:#000000;stop-opacity:0.72941178;"
+ offset="0.0000000"
+ id="stop2241" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2243" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2642"
+ id="radialGradient2656"
+ cx="42.468056"
+ cy="123.48658"
+ fx="42.468056"
+ fy="123.48658"
+ r="7.7109990"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="matrix(1.382976,0.000000,0.000000,1.382976,2.178960,-154.2521)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient2640"
+ x1="45.622375"
+ y1="138.03079"
+ x2="35.765125"
+ y2="117.44884"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.382976,0.000000,0.000000,1.382976,2.178960,-154.2521)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient3433"
+ gradientTransform="matrix(1.618321,0.000000,0.000000,1.181855,2.178960,-154.2521)"
+ x1="27.782410"
+ y1="129.00298"
+ x2="35.948341"
+ y2="143.27217"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient4235"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ cx="40.972221"
+ cy="124.03846"
+ fx="40.972221"
+ fy="124.03846"
+ r="13.249377"
+ gradientTransform="matrix(1.382976,0.000000,0.000000,1.382976,2.178960,-154.2521)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2642"
+ id="radialGradient5003"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ cx="42.468056"
+ cy="123.48658"
+ fx="42.468056"
+ fy="123.48658"
+ r="7.7109990"
+ gradientTransform="matrix(1.382976,0.000000,0.000000,1.382976,2.178960,-109.9968)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient5005"
+ gradientUnits="userSpaceOnUse"
+ x1="45.622375"
+ y1="138.03079"
+ x2="35.765125"
+ y2="117.44884"
+ gradientTransform="matrix(1.382976,0.000000,0.000000,1.382976,2.178960,-109.9968)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient5007"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.618321,0.000000,0.000000,1.181855,2.178960,-109.9968)"
+ x1="27.782410"
+ y1="129.00298"
+ x2="35.948341"
+ y2="143.27217" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient5009"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ cx="40.972221"
+ cy="124.03846"
+ fx="40.972221"
+ fy="124.03846"
+ r="13.249377"
+ gradientTransform="matrix(1.382976,0.000000,0.000000,1.382976,2.178960,-109.9968)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="linearGradient7506"
+ gradientTransform="matrix(1.334523,0.000000,0.000000,0.749331,23.21000,19.97000)"
+ x1="21.753733"
+ y1="16.770046"
+ x2="21.871677"
+ y2="30.831261"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2642"
+ id="radialGradient6553"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ cx="42.468056"
+ cy="123.48658"
+ fx="42.468056"
+ fy="123.48658"
+ r="7.7109990"
+ gradientTransform="matrix(1.382976,0.000000,0.000000,0.726210,2.178960,-52.70438)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient6555"
+ gradientUnits="userSpaceOnUse"
+ x1="45.622375"
+ y1="138.03079"
+ x2="35.765125"
+ y2="117.44884"
+ gradientTransform="matrix(1.382976,0.000000,0.000000,0.726210,2.178960,-52.70438)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="radialGradient7374"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.507557,0.663325)"
+ cx="12.917841"
+ cy="200.89760"
+ fx="12.917841"
+ fy="200.89760"
+ r="0.85092342" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="radialGradient7376"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.507557,0.663325)"
+ cx="12.917841"
+ cy="200.89760"
+ fx="12.917841"
+ fy="200.89760"
+ r="0.85092342" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="radialGradient7378"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.507557,0.663325)"
+ cx="12.917841"
+ cy="200.89760"
+ fx="12.917841"
+ fy="200.89760"
+ r="0.85092342" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="radialGradient7380"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.507557,0.663325)"
+ cx="12.917841"
+ cy="200.89760"
+ fx="12.917841"
+ fy="200.89760"
+ r="0.85092342" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="radialGradient7382"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.507557,0.663325)"
+ cx="12.917841"
+ cy="200.89760"
+ fx="12.917841"
+ fy="200.89760"
+ r="0.85092342" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="radialGradient7384"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.507557,0.663325)"
+ cx="12.917841"
+ cy="200.89760"
+ fx="12.917841"
+ fy="200.89760"
+ r="0.85092342" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="radialGradient7386"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.507557,0.663325)"
+ cx="12.917841"
+ cy="200.89760"
+ fx="12.917841"
+ fy="200.89760"
+ r="0.85092342" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="radialGradient7388"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.507557,0.663325)"
+ cx="12.917841"
+ cy="200.89760"
+ fx="12.917841"
+ fy="200.89760"
+ r="0.85092342" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#sadow75to0w"
+ id="radialGradient7390"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.507557,0.663325)"
+ cx="12.917841"
+ cy="200.89760"
+ fx="12.917841"
+ fy="200.89760"
+ r="0.85092342" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient6557"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.618321,0.000000,0.000000,0.620601,2.178960,-52.70438)"
+ x1="27.782410"
+ y1="129.00298"
+ x2="35.948341"
+ y2="143.27217" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient6559"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ cx="40.972221"
+ cy="124.03846"
+ fx="40.972221"
+ fy="124.03846"
+ r="13.249377"
+ gradientTransform="matrix(1.382976,0.000000,0.000000,0.726210,2.178960,-52.70438)" />
+ <linearGradient
+ y2="138.443"
+ x2="182.81"
+ y1="52.8003"
+ x1="21.8281"
+ gradientTransform="matrix(0.235582,0,0,0.235582,61.90697,177.0787)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3844"
+ xlink:href="#XMLID_4_"
+ inkscape:collect="always" />
+ <linearGradient
+ id="XMLID_4_"
+ gradientUnits="userSpaceOnUse"
+ x1="21.8281"
+ y1="52.8003"
+ x2="182.81"
+ y2="138.443">
+ <stop
+ offset="0"
+ style="stop-color:rgb(255,255,255)"
+ id="stop59" />
+ <stop
+ offset="0.5033"
+ style="stop-color:rgb(231,231,231)"
+ id="stop61" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(212,212,212)"
+ id="stop63" />
+ </linearGradient>
+ <radialGradient
+ r="80.5726"
+ fy="109.628"
+ fx="55.8057"
+ cy="109.628"
+ cx="55.8057"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3846"
+ xlink:href="#XMLID_7_"
+ inkscape:collect="always" />
+ <radialGradient
+ id="XMLID_7_"
+ cx="55.8057"
+ cy="109.628"
+ r="80.5726"
+ fx="55.8057"
+ fy="109.628"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0"
+ style="stop-color:rgb(255,255,255)"
+ id="stop104" />
+ <stop
+ offset="0.0626"
+ style="stop-color:rgb(230,249,255)"
+ id="stop106" />
+ <stop
+ offset="0.1386"
+ style="stop-color:rgb(206,242,255)"
+ id="stop108" />
+ <stop
+ offset="0.1854"
+ style="stop-color:rgb(197,240,255)"
+ id="stop2057" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(29,116,217)"
+ id="stop2059" />
+ </radialGradient>
+ <linearGradient
+ y2="227.64589"
+ x2="77.398453"
+ y1="162.71689"
+ x1="70.420311"
+ gradientTransform="scale(1.000007,0.999993)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3848"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="radialGradient1911"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop1913" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop1915" />
+ </radialGradient>
+ <linearGradient
+ y2="57.564800"
+ x2="56.496601"
+ y1="28.296900"
+ x1="56.496601"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3850"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient1904">
+ <stop
+ id="stop1906"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop1908"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <linearGradient
+ y2="35.9005"
+ x2="56.4961"
+ y1="146.565"
+ x1="56.4961"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3852"
+ xlink:href="#XMLID_9_"
+ inkscape:collect="always" />
+ <linearGradient
+ id="XMLID_9_"
+ gradientUnits="userSpaceOnUse"
+ x1="56.4961"
+ y1="146.565"
+ x2="56.4961"
+ y2="35.9005">
+ <stop
+ offset="0"
+ style="stop-color:rgb(179,202,255)"
+ id="stop129" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(0,83,189)"
+ id="stop131" />
+ </linearGradient>
+ <radialGradient
+ r="56.5206"
+ fy="94.9063"
+ fx="56.1016"
+ cy="94.9063"
+ cx="56.1016"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3854"
+ xlink:href="#XMLID_10_"
+ inkscape:collect="always" />
+ <radialGradient
+ id="XMLID_10_"
+ cx="56.1016"
+ cy="94.9063"
+ r="56.5206"
+ fx="56.1016"
+ fy="94.9063"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0"
+ style="stop-color:rgb(157,255,0)"
+ id="stop138" />
+ <stop
+ offset="0.764"
+ style="stop-color:rgb(0,151,0)"
+ id="stop140" />
+ </radialGradient>
+ <radialGradient
+ r="30.888128"
+ fy="199.57872"
+ fx="75.443954"
+ cy="199.57872"
+ cx="75.443954"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3856"
+ xlink:href="#blueligtmoretoblue"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient1886"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop1888"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop1891"
+ offset="0.74217570"
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop1893"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ y2="176.39580"
+ x2="73.576660"
+ y1="201.91719"
+ x1="76.367203"
+ gradientTransform="scale(1.000008,0.999992)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3858"
+ xlink:href="#wihitetolightgray"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient1879">
+ <stop
+ id="stop1881"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop1883"
+ offset="1.0000000"
+ style="stop-color:#d5d4d4;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ y2="69.925598"
+ x2="55.023899"
+ y1="38.641102"
+ x1="55.023899"
+ gradientTransform="matrix(0.324748,0,0,0.324748,56.56474,169.4285)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3860"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3928"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3930"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3932"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3934"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3936"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3938"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="27.555025"
+ x2="30.865753"
+ y1="-8.6353083"
+ x1="31.632498"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,49.27332,66.75976)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3940"
+ xlink:href="#bluelightlesstoblue"
+ inkscape:collect="always" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="radialGradient1863"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop1865" />
+ <stop
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;"
+ offset="0.24089479"
+ id="stop1867" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop1869" />
+ </radialGradient>
+ <linearGradient
+ y2="35.252430"
+ x2="34.512043"
+ y1="-3.8899043"
+ x1="30.899836"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,49.27332,66.75976)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3942"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <radialGradient
+ r="13.043961"
+ fy="25.805140"
+ fx="32.423191"
+ cy="25.805140"
+ cx="32.423191"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,49.27332,66.75974)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3944"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="13.490262"
+ x2="34.315556"
+ y1="4.7051349"
+ x1="34.575813"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,50.93451,68.42093)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3946"
+ xlink:href="#linearGradient2143"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient2143"
+ gradientUnits="userSpaceOnUse"
+ x1="55.6276"
+ y1="18.0479"
+ x2="88.7039"
+ y2="51.0311">
+ <stop
+ stop-color="#ffffff"
+ offset="0"
+ stop-opacity="1"
+ id="stop2145" />
+ <stop
+ stop-color="#cccccc"
+ offset="1.0000000"
+ stop-opacity="1"
+ id="stop2147"
+ style="stop-color:#ffffff;stop-opacity:0.16494845;" />
+ </linearGradient>
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3908"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3910"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3912"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3914"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3916"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="27.555025"
+ x2="30.865753"
+ y1="-8.6353083"
+ x1="31.632498"
+ gradientTransform="matrix(0.830598,0.830598,-0.821235,0.821235,36.93195,-24.8809)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3918"
+ xlink:href="#bluelightlesstoblue"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="35.252430"
+ x2="34.512043"
+ y1="-3.8899043"
+ x1="30.899836"
+ gradientTransform="matrix(0.830598,0.830598,-0.821235,0.821235,36.93195,-24.8809)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3920"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <radialGradient
+ r="13.043961"
+ fy="25.805140"
+ fx="32.423191"
+ cy="25.805140"
+ cx="32.423191"
+ gradientTransform="matrix(0.830598,0.830598,-0.821235,0.821235,36.93195,-24.8809)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3922"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="13.490262"
+ x2="34.315556"
+ y1="4.7051349"
+ x1="34.575813"
+ gradientTransform="matrix(0.830598,0.830598,-0.821235,0.821235,35.27076,-26.5421)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3924"
+ xlink:href="#linearGradient2143"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="7.0179429"
+ x2="9.7297535"
+ y1="6.0945296"
+ x1="3.6637187"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3926"
+ xlink:href="#light100to0"
+ inkscape:collect="always" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient2090"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient2092"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient2094"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient2096"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient2098"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient2100"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(3.233796,0,0,0.328066,-0.604286,-5.999996e-2)"
+ x1="3.6637187"
+ y1="6.0945296"
+ x2="9.7297535"
+ y2="7.0179429" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelightlesstoblue"
+ id="linearGradient2102"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,49.27332,66.75976)"
+ x1="31.632498"
+ y1="-8.6353083"
+ x2="30.865753"
+ y2="27.555025" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2104"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,49.27332,66.75976)"
+ x1="30.899836"
+ y1="-3.8899043"
+ x2="34.512043"
+ y2="35.252430" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient2106"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,49.27332,66.75974)"
+ cx="32.423191"
+ cy="25.805140"
+ fx="32.423191"
+ fy="25.805140"
+ r="13.043961" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2143"
+ id="linearGradient2108"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.830598,-0.830598,-0.821235,0.821235,50.93451,68.42093)"
+ x1="34.575813"
+ y1="4.7051349"
+ x2="34.315556"
+ y2="13.490262" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2143"
+ id="linearGradient2111"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.547369,-2.115685,-2.518654,2.091835,202.7688,60.78931)"
+ x1="34.575813"
+ y1="4.7051349"
+ x2="34.315556"
+ y2="13.490262" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient2114"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.547369,-2.115685,-2.518654,2.091835,191.6256,62.21348)"
+ cx="32.423191"
+ cy="25.805140"
+ fx="32.423191"
+ fy="25.805140"
+ r="13.043961" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelightlesstoblue"
+ id="linearGradient2117"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.54737,-2.115685,-2.518655,2.091835,191.6257,62.21353)"
+ x1="31.632498"
+ y1="-8.6353083"
+ x2="30.865753"
+ y2="27.555025" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2119"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.54737,-2.115685,-2.518655,2.091835,191.6257,62.21353)"
+ x1="30.899836"
+ y1="-3.8899043"
+ x2="34.512043"
+ y2="35.252430" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelightlesstoblue"
+ id="linearGradient2144"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.54737,-2.115685,-2.518655,2.091835,191.6257,62.21353)"
+ x1="31.632498"
+ y1="-8.6353083"
+ x2="30.865753"
+ y2="27.555025" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2146"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.54737,-2.115685,-2.518655,2.091835,191.6257,62.21353)"
+ x1="30.899836"
+ y1="-3.8899043"
+ x2="34.512043"
+ y2="35.252430" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient2148"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.547369,-2.115685,-2.518654,2.091835,191.6256,62.21348)"
+ cx="32.423191"
+ cy="25.805140"
+ fx="32.423191"
+ fy="25.805140"
+ r="13.043961" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2143"
+ id="linearGradient2150"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.547369,-2.115685,-2.518654,2.091835,202.7688,60.78931)"
+ x1="34.575813"
+ y1="4.7051349"
+ x2="34.315556"
+ y2="13.490262" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelightlesstoblue"
+ id="linearGradient2186"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.54737,-2.115685,-2.518655,2.091835,191.6257,62.21353)"
+ x1="31.632498"
+ y1="-8.6353083"
+ x2="30.865753"
+ y2="27.555025" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2188"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.54737,-2.115685,-2.518655,2.091835,191.6257,62.21353)"
+ x1="30.899836"
+ y1="-3.8899043"
+ x2="34.512043"
+ y2="35.252430" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient2190"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.547369,-2.115685,-2.518654,2.091835,191.6256,62.21348)"
+ cx="32.423191"
+ cy="25.805140"
+ fx="32.423191"
+ fy="25.805140"
+ r="13.043961" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2143"
+ id="linearGradient2192"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-2.547369,-2.115685,-2.518654,2.091835,202.7688,60.78931)"
+ x1="34.575813"
+ y1="4.7051349"
+ x2="34.315556"
+ y2="13.490262" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="6.0032727"
+ inkscape:cx="39.820195"
+ inkscape:cy="25.631173"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:document-units="px"
+ inkscape:grid-bbox="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="780"
+ inkscape:window-height="538"
+ inkscape:window-x="221"
+ inkscape:window-y="183" />
+ <metadata
+ id="metadata1321">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <g
+ id="g2139"
+ transform="matrix(0.750593,0,0,0.913244,-32.59972,21.56958)">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient2186);fill-opacity:1;stroke:url(#linearGradient2188);stroke-width:3.16041493;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 103.67124,-3.1281439 L 45.658856,-3.4012554 L 45.98769,44.780165 L 104.00008,45.053274 L 103.67124,-3.1281439 z "
+ id="path1734" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#radialGradient2190);fill-opacity:1;stroke:none;stroke-width:1.94000006;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 103.67116,-3.128162 L 45.658821,-3.4012734 L 45.987654,44.780135 L 104,45.053244 L 103.67116,-3.128162 z "
+ id="path1736" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient2192);fill-opacity:1;stroke:none;stroke-width:2.53999996;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 102.50926,-2.7951631 L 46,-3 C 44.52624,28.529599 90.83624,12.861159 102.75589,33.340893 L 102.50926,-2.7951631 z "
+ id="path1738"
+ sodipodi:nodetypes="cccc" />
+ </g>
+ <path
+ style="fill:url(#linearGradient3626);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;opacity:0.13953488"
+ d="M 7.5632541,59.308477 C 9.3183009,59.710927 10.756198,60.812691 12.917625,60.420463 C 15.219206,59.85032 17.063222,57.378659 19.399667,56.974344 C 22.744633,56.008859 26.095504,54.969057 29.445902,53.63697 C 33.979105,52.137091 62.093826,41.367353 63.34208,39.560183 C 64.584364,36.709157 60.408907,38.499829 58.758015,39.21237 C 56.616444,40.009626 51.053089,41.83708 48.953415,42.804432 C 44.961934,44.331044 32.678491,48.612882 28.766673,50.489041 C 26.542988,51.420733 24.259253,52.31109 22.200392,53.849841 C 19.54956,55.509162 16.579254,56.53578 14.059545,56.330819 C 12.018237,56.16948 9.8028345,57.608704 7.8968079,59.07128 L 7.5632541,59.308477 z "
+ id="path3617"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cccccccccccc" />
+ <path
+ sodipodi:nodetypes="cccccccccccc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path3630"
+ d="M 9,57.308477 C 10.755047,57.710927 12.192944,58.812691 14.354371,58.420463 C 16.655952,57.85032 18.499968,55.378659 20.836413,54.974344 C 24.181379,54.008859 27.53225,52.969057 30.882648,51.63697 C 35.415851,50.137091 63.530572,39.367353 64.778826,37.560183 C 66.02111,34.709157 61.845653,36.499829 60.194761,37.21237 C 58.05319,38.009626 52.489835,39.83708 50.390161,40.804432 C 46.39868,42.331044 34.115237,46.612882 30.203419,48.489041 C 27.979734,49.420733 25.695999,50.31109 23.637138,51.849841 C 20.986306,53.509162 18.016,54.53578 15.496291,54.330819 C 13.454983,54.16948 11.23958,55.608704 9.3335538,57.07128 L 9,57.308477 z "
+ style="fill:url(#linearGradient3632);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;opacity:0.13953488" />
+ <g
+ transform="matrix(0.135753,-0.138151,0.150189,0.148017,-19.55476,31.57842)"
+ inkscape:export-ydpi="72.000000"
+ inkscape:export-xdpi="72.000000"
+ id="use1134"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <g
+ transform="matrix(1.100273,1.806595e-2,0,1.045972,-206.8777,-387.3046)"
+ id="g1136"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ transform="matrix(2.434977,2.390956,-2.439754,2.468211,459.337,221.8959)"
+ id="path1137"
+ style="fill:url(#linearGradient1152);fill-opacity:1"
+ d="M 65.983,93.86 L 47.763,75.64 C 51.275,66.881 49.603,56.637 42.67,49.703 C 35.599,42.634 25.091,41.032 16.222,44.819 L 31.115,59.71 L 16.74,74.085 L 2.326,59.669 C -0.654,68.188 1.151,77.901 7.812,84.561 C 14.472,91.221 24.185,93.028 32.703,90.048 L 51.249,108.594 L 65.983,93.86 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ transform="matrix(2.434977,2.390956,-2.439754,2.468211,459.337,221.8959)"
+ id="path1138"
+ style="fill:none"
+ d="M 19.761,74.757 L 31.95,62.569 L 30.103,60.722 L 17.915,72.91 L 19.761,74.757 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ transform="matrix(2.434977,2.390956,-2.439754,2.468211,459.337,221.8959)"
+ id="path1139"
+ style="fill:url(#linearGradient1153);fill-opacity:1"
+ d="M 43.35,49.022 C 36.183,41.857 25.387,39.86 15.846,43.934 C 15.552,44.059 15.339,44.323 15.279,44.636 C 15.218,44.949 15.318,45.273 15.544,45.499 C 15.544,45.499 28.515,58.471 29.755,59.71 C 28.582,60.883 17.915,71.551 16.74,72.724 C 15.506,71.489 3.005,58.99 3.005,58.99 C 2.771,58.755 2.434,58.658 2.111,58.732 C 1.931,58.773 1.771,58.864 1.645,58.99 C 1.544,59.091 1.466,59.213 1.417,59.353 C -1.808,68.571 0.382,78.492 7.132,85.242 C 13.738,91.848 23.383,94.073 32.434,91.139 C 33.226,91.932 50.57,109.274 50.57,109.274 C 50.945,109.65 51.553,109.65 51.929,109.274 L 66.664,94.541 C 67.039,94.166 67.039,93.556 66.664,93.18 C 66.664,93.18 49.705,76.221 48.874,75.391 C 52.317,66.149 50.191,55.866 43.35,49.022 z M 41.989,50.385 C 48.434,56.83 50.351,66.604 46.869,75.281 C 46.726,75.639 46.809,76.049 47.082,76.32 C 47.082,76.32 63.341,92.58 64.623,93.86 C 63.444,95.038 52.427,106.055 51.249,107.231 C 49.967,105.951 33.384,89.368 33.384,89.368 C 33.123,89.106 32.734,89.018 32.385,89.14 C 23.87,92.118 14.714,90.102 8.491,83.88 C 2.63,78.02 0.505,69.556 2.769,61.475 C 4.681,63.387 16.061,74.766 16.061,74.766 C 16.437,75.141 17.046,75.141 17.422,74.766 L 31.796,60.392 C 32.172,60.016 32.172,59.407 31.796,59.031 C 31.796,59.031 19.76,46.995 17.951,45.186 C 26.419,42.148 35.717,44.111 41.989,50.385 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ id="path1140"
+ style="fill:url(#linearGradient1154);fill-opacity:1"
+ d="M 385.04851,510.60211 C 410.41749,499.38859 428.15639,474.56419 428.18936,445.99221 C 428.20909,423.44328 417.19727,403.58863 400.09464,391.0997 L 400.04439,442.20356 C 400.03584,448.41604 394.98068,453.53017 388.75076,453.6289 L 320.29492,454.71866 C 314.06745,454.81492 309.01731,449.85608 309.02341,443.65092 L 309.07603,395.10291 C 293.80309,408.14137 284.12281,427.18693 284.09962,448.28304 C 284.07508,475.72029 300.39428,499.19589 324.14251,510.22868 L 324.04605,605.84983 L 384.97564,582.23355 L 385.04851,510.60211 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ transform="matrix(2.434977,2.390956,-2.439754,2.468211,459.337,221.8959)"
+ id="path1141"
+ style="fill:url(#linearGradient1155)"
+ d="M 56.769,105.303 C 56.129,105.943 55.095,105.943 54.455,105.303 L 36.414,87.261 C 35.776,86.621 35.776,85.586 36.414,84.948 L 42.989,78.371 C 43.629,77.732 44.664,77.732 45.304,78.371 L 63.345,96.414 C 63.984,97.053 63.984,98.089 63.345,98.727 L 56.769,105.303 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ <g
+ transform="matrix(1.100273,0,0,1.045972,-23.07103,-4.422415)"
+ id="g1142"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <g
+ transform="matrix(1,0,0,0.95591,0,8.895155)"
+ id="g1143"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ transform="matrix(2.434977,2.429522,-2.439754,2.429569,291.1713,-121.6664)"
+ id="path1144"
+ style="fill:url(#linearGradient1156)"
+ d="M 78.431,102.573 L 55.277,79.418 L 37.127,97.566 L 60.282,120.72 C 65.294,125.732 73.419,125.732 78.43,120.72 C 83.441,115.708 83.441,107.584 78.431,102.573 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ transform="matrix(2.434977,2.429522,-2.439754,2.429569,291.1713,-121.6664)"
+ id="path1145"
+ style="fill:url(#linearGradient1157)"
+ d="M 56.065,78.63 C 55.63,78.193 54.925,78.193 54.487,78.63 L 36.34,96.779 C 35.904,97.215 35.904,97.921 36.34,98.356 L 59.493,121.51 C 64.931,126.948 73.779,126.948 79.219,121.509 C 84.657,116.07 84.657,107.222 79.219,101.782 L 56.065,78.63 z M 77.642,103.361 C 82.21,107.929 82.21,115.364 77.642,119.932 C 73.074,124.501 65.64,124.5 61.072,119.932 C 61.072,119.932 40.226,99.085 38.706,97.566 C 40.085,96.189 53.899,82.374 55.277,80.996 C 56.796,82.516 77.642,103.361 77.642,103.361 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ <g
+ id="g1146"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ transform="matrix(2.434977,2.429522,-2.439754,2.429569,291.1713,-121.6664)"
+ id="path1147"
+ style="fill:url(#linearGradient1158)"
+ d="M 74.268,106.506 C 75.273,107.512 75.987,108.698 76.411,109.961 C 76.453,107.629 75.585,105.284 73.806,103.506 L 54.719,84.419 L 42.129,97.009 L 46.37,101.25 L 57.69,89.929 L 74.268,106.506 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ transform="matrix(2.434977,2.429522,-2.439754,2.429569,291.1713,-121.6664)"
+ id="path1148"
+ style="fill:url(#linearGradient1159)"
+ d="M 73.805,116.096 C 75.504,114.399 76.369,112.186 76.41,109.961 C 75.986,108.698 75.272,107.512 74.267,106.506 L 55.18,87.419 L 43.86,98.739 L 61.215,116.096 C 64.692,119.573 70.329,119.573 73.805,116.096 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ transform="matrix(2.434977,2.429522,-2.439754,2.429569,291.1713,-121.6664)"
+ id="path1149"
+ style="fill:url(#linearGradient1160)"
+ d="M 74.6,117.055 C 70.743,120.911 64.488,120.911 60.63,117.054 C 56.772,113.197 56.772,106.941 60.63,103.083 C 64.488,99.225 70.743,99.225 74.6,103.083 C 78.458,106.941 78.458,113.196 74.6,117.055 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ transform="matrix(1.043367,1.652517e-2,0,1.056755,76.0249,0.3264)"
+ id="path1150"
+ style="fill:url(#radialGradient1161);fill-rule:evenodd"
+ d="M 106.03364,312.24686 C 94.991098,312.42194 86.038764,303.74282 86.049589,292.87268 C 86.053408,282.00036 95.023303,273.0454 106.07285,272.8725 C 117.1154,272.69742 126.07007,281.3742 126.05691,292.24668 C 126.04374,303.11915 117.07618,312.07637 106.03364,312.24686 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ transform="matrix(1.043367,1.652517e-2,0,1.056755,76.0249,0.3264)"
+ id="path1151"
+ style="fill:url(#radialGradient1162)"
+ d="M 106.32109,304.79373 C 99.347952,304.90514 93.697898,299.42752 93.704738,292.55782 C 93.711578,285.69271 99.372722,280.0381 106.34819,279.92895 C 113.32365,279.8244 118.9737,285.30202 118.96687,292.16253 C 118.96237,299.0299 113.30123,304.68451 106.32109,304.79373 z "
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ </g>
+ </g>
+ <path
+ style="fill:url(#radialGradient2012);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient2014);stroke-width:0.625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 16.246401,44.974665 C 19.441782,39.666103 20.245893,36.409497 25.832543,29.048983 C 31.419192,21.688469 41.819409,10.24895 49.766295,0.81158752 C 50.272451,0.21049814 51.446727,0.1045293 52.308179,0.75837215 C 53.202484,1.4371525 53.337222,2.6390369 52.940608,3.2208989 C 45.991645,13.415557 37.767817,26.507094 32.181168,33.867607 C 26.594518,41.22812 23.674198,42.87852 19.420713,47.383976 C 18.362609,46.580872 17.304505,45.777768 16.246401,44.974665 z "
+ id="path1324"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="czszszcc" />
+ <path
+ style="fill:url(#linearGradient2009);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 15.380336,51.874285 C 14.365111,54.32321 14.460079,56.906269 12.334663,59.221063 C 9.333126,62.490039 4.1368231,63.134835 1.0820498e-07,61.253557 C 3.5665666,60.101979 4.4381491,56.674637 7.65029,53.775763 C 8.7857463,52.751043 11.863808,51.393399 12.910638,50.13615 C 13.733871,50.71553 14.557103,51.294907 15.380336,51.874285 z "
+ id="path1330"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cscscc" />
+ <path
+ style="fill:url(#linearGradient2004);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient2006);stroke-width:0.37500042;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 16.191495,44.773031 C 15.710014,44.840131 14.954808,44.695903 14.747052,44.974336 C 14.539295,45.252768 14.878984,45.953865 14.944952,46.443628 C 14.463471,46.510728 13.708265,46.3665 13.500508,46.644933 C 13.292752,46.923365 13.632441,47.624462 13.698408,48.114224 C 13.216927,48.181326 12.461722,48.037097 12.253964,48.315531 C 12.046208,48.593963 12.385897,49.295058 12.451866,49.784822 C 13.546762,50.630147 14.641658,51.475473 15.736553,52.320797 C 16.218032,52.253696 16.973239,52.397924 17.180995,52.119492 C 17.388753,51.84106 17.049062,51.139963 16.983096,50.650199 C 17.464576,50.583098 18.219783,50.727327 18.427539,50.448895 C 18.635297,50.170464 18.295606,49.469365 18.229639,48.979604 C 18.71112,48.912502 19.466327,49.05673 19.674083,48.778298 C 19.881839,48.499865 19.54215,47.798769 19.476182,47.309006 C 18.381287,46.463681 17.286391,45.618357 16.191495,44.773031 z "
+ id="path1328"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cscscsccscscscc" />
+ <path
+ sodipodi:nodetypes="cscscsccscscscc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path3448"
+ d="M 16.19148,44.772987 C 15.709999,44.840087 14.954793,44.695858 14.747037,44.974291 C 14.53928,45.252723 14.87897,45.953819 14.944939,46.443582 C 14.463458,46.510682 13.708251,46.366454 13.500495,46.644886 C 13.292739,46.923317 13.632428,47.624415 13.698396,48.114176 C 13.216915,48.181278 12.46171,48.037048 12.253954,48.315482 C 12.046197,48.593913 12.385886,49.295008 12.451854,49.784772 C 13.546748,50.630095 14.641643,51.475421 15.736537,52.320744 C 16.218017,52.253643 16.973222,52.39787 17.180978,52.11944 C 17.388736,51.841007 17.049046,51.139912 16.983079,50.650148 C 17.464559,50.583047 18.219765,50.727275 18.427521,50.448845 C 18.635278,50.170413 18.295588,49.469316 18.229621,48.979554 C 18.711101,48.912452 19.466308,49.056681 19.674063,48.77825 C 19.88182,48.499816 19.54213,47.798721 19.476162,47.308958 C 18.381269,46.463635 17.286374,45.61831 16.19148,44.772987 z "
+ style="opacity:0.50232562;fill:url(#linearGradient2001);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="opacity:0.50232562;fill:url(#linearGradient1998);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 12.411079,49.49504 C 12.437281,49.597551 12.448042,49.690819 12.46041,49.78265 C 13.555305,50.627972 14.633694,51.490298 15.728587,52.335623 C 16.142359,52.277957 16.785768,52.370214 17.082671,52.222317 C 17.09304,52.21661 17.106542,52.180461 17.116016,52.174062 C 17.120521,52.170684 17.152143,52.170457 17.156408,52.166894 C 17.160428,52.16314 17.145593,52.129754 17.149361,52.125806 C 15.863523,51.472379 13.407221,49.895098 12.411079,49.49504 z "
+ id="path3450" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="opacity:0.50232562;fill:url(#radialGradient1995);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 14.927922,46.211727 C 14.937748,46.250168 14.942682,46.298735 14.949065,46.334989 C 14.956577,46.382599 14.971071,46.453423 14.977254,46.499337 C 16.072148,47.344658 17.150538,48.206987 18.245431,49.052309 C 18.58162,49.005455 19.067202,49.032984 19.397554,48.974848 C 19.458668,48.961979 19.553125,48.962114 19.599516,48.939005 C 19.602387,48.934713 19.589541,48.903193 19.592469,48.897918 C 19.595228,48.89354 19.630493,48.892348 19.632861,48.890749 C 19.636496,48.890175 19.672187,48.884473 19.673253,48.883581 C 19.673191,48.879658 19.66701,48.847311 19.666205,48.842494 C 18.059175,48.430488 15.924066,46.611787 14.927922,46.211727 z M 13.578145,47.80609 C 13.58797,47.844532 13.592905,47.893097 13.599288,47.929351 C 13.606798,47.976961 13.621293,48.047785 13.627477,48.0937 C 14.722371,48.93902 15.800761,49.801349 16.895655,50.646673 C 17.283565,50.59261 17.892503,50.652475 18.209346,50.540537 C 18.219284,50.536373 18.240461,50.537991 18.249739,50.533368 C 18.25261,50.529076 18.280155,50.490389 18.283083,50.485113 C 18.286748,50.484562 18.318974,50.478405 18.323475,50.477944 C 18.323412,50.474022 18.317232,50.441673 18.316428,50.436857 C 16.709398,50.02485 14.574288,48.20615 13.578145,47.80609 z M 12.418125,49.536127 C 12.437908,49.623909 12.449586,49.702297 12.46041,49.78265 C 13.555305,50.627972 14.633694,51.490298 15.728587,52.335623 C 16.103568,52.283364 16.678529,52.332986 17.001888,52.236655 C 17.02301,52.229193 17.064115,52.231562 17.082671,52.222317 C 17.088416,52.213734 17.110497,52.182819 17.116016,52.174062 C 17.119681,52.17351 17.151908,52.167357 17.156408,52.166894 C 17.156347,52.162971 17.150166,52.130624 17.149361,52.125806 C 15.554886,51.71702 13.424042,49.954884 12.418125,49.536127 z "
+ id="path3455" />
+ <path
+ style="fill:url(#radialGradient1992);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 19.305597,47.419746 C 19.318957,47.187295 19.153628,47.071734 18.981378,46.95493 C 17.98337,46.180139 16.99518,45.392336 15.995134,44.620248 C 15.621747,44.668181 15.234122,44.631905 14.873744,44.76548 C 14.758653,44.808138 14.661226,44.861699 14.838997,44.907191 C 15.753818,45.141288 16.556649,45.706299 17.351422,46.219142 C 17.973085,46.617532 18.568935,47.064242 19.233281,47.388196 C 19.257225,47.39909 19.281323,47.409636 19.305597,47.419746 z "
+ id="path3476"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cscssssc" />
+ <path
+ sodipodi:nodetypes="cscssssc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path3493"
+ d="M 18.004869,49.139509 C 18.018229,48.907058 17.8529,48.791496 17.680651,48.674693 C 16.68264,47.899901 15.694452,47.112098 14.694406,46.340011 C 14.321018,46.387944 13.933393,46.351668 13.573015,46.485242 C 13.457925,46.5279 13.360497,46.581462 13.538269,46.626954 C 14.453089,46.861051 15.255921,47.426062 16.050693,47.938905 C 16.672355,48.337295 17.268206,48.784004 17.932553,49.107957 C 17.956497,49.118852 17.980595,49.129398 18.004869,49.139509 z "
+ style="opacity:0.79534882;fill:url(#radialGradient1989);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="opacity:0.51162792;fill:url(#radialGradient1986);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 16.765875,50.799497 C 16.779235,50.567046 16.613905,50.451485 16.441656,50.334682 C 15.443646,49.559891 14.455457,48.772088 13.455412,48 C 13.082024,48.047933 12.694398,48.011658 12.334021,48.145231 C 12.218931,48.18789 12.121503,48.241452 12.299275,48.286942 C 13.214095,48.521041 14.016926,49.086052 14.811699,49.598893 C 15.43336,49.997285 16.029211,50.443994 16.69356,50.767947 C 16.717503,50.778842 16.741601,50.789388 16.765875,50.799497 z "
+ id="path3497"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cscssssc" />
+ <path
+ sodipodi:nodetypes="cscscc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path3530"
+ d="M 14.685122,52.070894 C 14.061607,53.883009 12.918451,57.203864 11.566767,58.896854 C 9.6579018,61.287711 5.0395585,62.380308 2.3034763,60.904418 C 4.6167006,60.104952 5.7826686,57.031387 7.8353447,54.920597 C 8.5609434,54.174456 12.377726,51.651712 13.041541,50.730355 C 13.5894,51.177204 14.137263,51.624047 14.685122,52.070894 z "
+ style="fill:url(#linearGradient1983);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="czszszcc"
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ id="path3534"
+ d="M 16.246401,44.974665 C 19.441782,39.666103 20.245893,36.409497 25.832543,29.048983 C 31.419192,21.688469 41.819409,10.24895 49.766295,0.81158752 C 50.272451,0.21049814 51.446727,0.1045293 52.308179,0.75837215 C 53.202484,1.4371525 53.337222,2.6390369 52.940608,3.2208989 C 45.991645,13.415557 37.767817,26.507094 32.181168,33.867607 C 26.594518,41.22812 23.674198,42.87852 19.420713,47.383976 C 18.362609,46.580872 17.304505,45.777768 16.246401,44.974665 z "
+ style="fill:url(#radialGradient1980);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient1977);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 50.496341,0.355727 C 50.204299,0.43458951 49.957152,0.60749588 49.783161,0.81412044 C 44.949785,6.5540188 34.579025,18.349278 29.743961,24.533161 C 30.975401,24.252295 32.667503,23.79892 34.190012,22.500524 C 37.077253,20.038283 48.476669,4.4751566 50.259611,2.5026813 C 51.379598,1.2636369 52.234525,2.3643057 53.141528,2.3571741 C 53.120282,1.8033445 52.876944,1.1717985 52.318004,0.74756081 C 51.752677,0.31847691 51.053875,0.20517249 50.496341,0.355727 z "
+ id="path3560"
+ sodipodi:nodetypes="cscsscsc" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-pie.svg b/kpresenter/toolbar/action-pie.svg
new file mode 100644
index 000000000..784e9315c
--- /dev/null
+++ b/kpresenter/toolbar/action-pie.svg
@@ -0,0 +1,603 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg5082"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-pie.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr16-action-pie.png"
+ inkscape:export-xdpi="11.25"
+ inkscape:export-ydpi="11.25">
+ <defs
+ id="defs3">
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="96.934631"
+ x2="53.713982"
+ y1="1.6257921"
+ x1="0.42874196"
+ id="linearGradient2270"
+ xlink:href="#bluelignonlinblu"
+ inkscape:collect="always" />
+ <radialGradient
+ r="23.534935"
+ fy="537.74377"
+ fx="171.9519"
+ cy="537.74377"
+ cx="171.9519"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient1389"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="663.16486"
+ x2="60.867611"
+ y1="615.31268"
+ x1="41.779896"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1387"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.07904"
+ x2="223.36394"
+ y1="701.17023"
+ x1="216.42781"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1385"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.08466"
+ x2="223.34302"
+ y1="701.12646"
+ x1="216.38365"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1383"
+ xlink:href="#bluelignonlinblu"
+ inkscape:collect="always" />
+ <radialGradient
+ r="23.534935"
+ fy="537.74377"
+ fx="171.9519"
+ cy="537.74377"
+ cx="171.9519"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient1413"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="663.16486"
+ x2="60.867611"
+ y1="615.31268"
+ x1="41.779896"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1411"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.07904"
+ x2="223.36394"
+ y1="701.17023"
+ x1="216.42781"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1409"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.08466"
+ x2="223.34302"
+ y1="701.12646"
+ x1="216.38365"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1407"
+ xlink:href="#bluelignonlinblu"
+ inkscape:collect="always" />
+ <radialGradient
+ r="23.534935"
+ fy="537.74377"
+ fx="171.9519"
+ cy="537.74377"
+ cx="171.9519"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient1405"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="663.16486"
+ x2="60.867611"
+ y1="615.31268"
+ x1="41.779896"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1403"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.07904"
+ x2="223.36394"
+ y1="701.17023"
+ x1="216.42781"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1401"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.08466"
+ x2="223.34302"
+ y1="701.12646"
+ x1="216.38365"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1399"
+ xlink:href="#bluelignonlinblu"
+ inkscape:collect="always" />
+ <linearGradient
+ id="graytoblack">
+ <stop
+ id="stop5097"
+ offset="0.0000000"
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;" />
+ <stop
+ id="stop5098"
+ offset="1.0000000"
+ style="stop-color:#000000;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="light90to0">
+ <stop
+ id="stop1890"
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.90196079;" />
+ <stop
+ id="stop1892"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+ </linearGradient>
+ <radialGradient
+ r="65.751129"
+ fy="97.798195"
+ fx="256.26614"
+ cy="98.022842"
+ cx="256.57788"
+ gradientTransform="scale(1.01733,0.982965)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient18526"
+ xlink:href="#graytoblack"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="64.906898"
+ x2="256.32883"
+ y1="259.13287"
+ x1="258.11154"
+ gradientTransform="scale(1.01872,0.981624)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient18527"
+ xlink:href="#graytoblack"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="346.2533"
+ x2="328.93796"
+ y1="300.00095"
+ x1="278.15439"
+ gradientTransform="scale(1.01877,0.981576)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient18528"
+ xlink:href="#light90to0"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.08466"
+ x2="223.34302"
+ y1="701.12646"
+ x1="216.38365"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient45928"
+ xlink:href="#bluelignonlinblu"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient2278"
+ fy="112.9609"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.9609"
+ cx="38.797401">
+ <stop
+ id="stop2280"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2282"
+ offset="0.13480000"
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2284"
+ offset="0.32049999"
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2286"
+ offset="0.56800002"
+ style="stop-color:#3293fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2288"
+ offset="0.75340003"
+ style="stop-color:#107bfe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2290"
+ offset="0.85390002"
+ style="stop-color:#0372fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2292"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ y2="708.07904"
+ x2="223.36394"
+ y1="701.17023"
+ x1="216.42781"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient45929"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient2271"
+ fy="112.9609"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.9609"
+ cx="38.797401">
+ <stop
+ id="stop2273"
+ offset="0.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2275"
+ offset="1.0000000"
+ style="stop-color:#032442;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ y2="663.16486"
+ x2="60.867611"
+ y1="615.31268"
+ x1="41.779896"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient45930"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ id="stop1979"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ offset="0.0000000" />
+ <stop
+ id="stop1978"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000" />
+ </linearGradient>
+ <radialGradient
+ r="23.534935"
+ fy="537.74377"
+ fx="171.9519"
+ cy="537.74377"
+ cx="171.9519"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient45931"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.08466"
+ x2="223.34302"
+ y1="701.12646"
+ x1="216.38365"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient45932"
+ xlink:href="#bluelignonlinblu"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.07904"
+ x2="223.36394"
+ y1="701.17023"
+ x1="216.42781"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient45933"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="663.16486"
+ x2="60.867611"
+ y1="615.31268"
+ x1="41.779896"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient45934"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <radialGradient
+ r="23.534935"
+ fy="537.74377"
+ fx="171.9519"
+ cy="537.74377"
+ cx="171.9519"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient45935"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.08466"
+ x2="223.34302"
+ y1="701.12646"
+ x1="216.38365"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient45936"
+ xlink:href="#bluelignonlinblu"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="708.07904"
+ x2="223.36394"
+ y1="701.17023"
+ x1="216.42781"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient45937"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="663.16486"
+ x2="60.867611"
+ y1="615.31268"
+ x1="41.779896"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient45938"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <radialGradient
+ r="23.534935"
+ fy="537.74377"
+ fx="171.9519"
+ cy="537.74377"
+ cx="171.9519"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient45939"
+ xlink:href="#linearGradient1977"
+ inkscape:collect="always" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2322"
+ gradientUnits="userSpaceOnUse"
+ x1="0.42874196"
+ y1="1.6257921"
+ x2="53.713982"
+ y2="96.934631"
+ gradientTransform="translate(-83.37032,-63.99684)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#radialGradient2278"
+ id="linearGradient2331"
+ x1="62.062805"
+ y1="132.72458"
+ x2="71.844063"
+ y2="83.425827"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ y2="136.16571"
+ x2="209.91537"
+ y1="25.734213"
+ x1="99.916199"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4334"
+ xlink:href="#bluelignonlinblu"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient2359"
+ fy="112.9609"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.9609"
+ cx="38.797401">
+ <stop
+ id="stop2361"
+ offset="0.0055999998"
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2363"
+ offset="0.13480000"
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2365"
+ offset="0.32049999"
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2367"
+ offset="0.56800002"
+ style="stop-color:#3293fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2369"
+ offset="0.75340003"
+ style="stop-color:#107bfe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2371"
+ offset="0.85390002"
+ style="stop-color:#0372fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2373"
+ offset="1.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ y2="193.08136"
+ x2="151.68063"
+ y1="34.964851"
+ x1="70.478043"
+ gradientTransform="scale(1.395481,0.716599)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4335"
+ xlink:href="#bluedarktoblackblue"
+ inkscape:collect="always" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient2352"
+ fy="112.9609"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.9609"
+ cx="38.797401">
+ <stop
+ id="stop2354"
+ offset="0.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2356"
+ offset="1.0000000"
+ style="stop-color:#032442;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#radialGradient2271"
+ id="linearGradient2385"
+ x1="18.059883"
+ y1="140.54156"
+ x2="59.939224"
+ y2="68.321068"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.328125"
+ inkscape:cx="71.755481"
+ inkscape:cy="56.780239"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="780"
+ inkscape:window-height="590"
+ inkscape:window-x="453"
+ inkscape:window-y="148"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:url(#linearGradient2331);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient2385);stroke-width:1.85112286;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="path1326"
+ sodipodi:cx="82.629105"
+ sodipodi:cy="75.417839"
+ sodipodi:rx="46.572769"
+ sodipodi:ry="46.572769"
+ d="M 82.629106,121.99061 A 46.572769,46.572769 0 0 1 37.080508,85.131138 L 82.629105,75.417839 z"
+ sodipodi:start="1.5707963"
+ sodipodi:end="2.9314885"
+ transform="matrix(-1.518299,1.288443,-1.225252,-1.596603,283.4432,127.1668)" />
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.08452704pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0"
+ d="M -82.625324,63.25185 L 44.16523,-63.251844 M 44.16523,63.25185 L -82.625324,-63.251844"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-polygon.svg b/kpresenter/toolbar/action-polygon.svg
new file mode 100644
index 000000000..62b203348
--- /dev/null
+++ b/kpresenter/toolbar/action-polygon.svg
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg5082"
+ sodipodi:version="0.32"
+ inkscape:version="0.43+devel"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-polygon.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr48-action-polygon.png"
+ inkscape:export-xdpi="33.75"
+ inkscape:export-ydpi="33.75">
+ <defs
+ id="defs3">
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2208"
+ x1="2.6070418"
+ y1="-25.389669"
+ x2="112.17229"
+ y2="94.497658"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.665622,1.249167e-7,1.249167e-7,0.665622,46.64703,-37.36074)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2216"
+ x1="2.6070418"
+ y1="-25.389669"
+ x2="112.17229"
+ y2="94.497658"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.665622,1.249167e-7,1.249167e-7,0.665622,46.64703,-37.36074)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.328125"
+ inkscape:cx="106.10827"
+ inkscape:cy="59.413328"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="780"
+ inkscape:window-height="590"
+ inkscape:window-x="453"
+ inkscape:window-y="148" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ transform="matrix(0.694507,0.719486,-0.694507,0.719486,0,0)"
+ style="fill:url(#linearGradient2216);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient2208);stroke-width:2.35562181;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:4;stroke-opacity:1"
+ d="M 46.202549,-28.67576 L 107.67168,-58.059142 L 145.95415,-7.0096529 L 114.69459,47.180811 L 51.843326,34.514174 L 46.202549,-28.67576 z "
+ id="rect1327"
+ sodipodi:nodetypes="cccccc" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-polyline.svg b/kpresenter/toolbar/action-polyline.svg
new file mode 100644
index 000000000..e861c359a
--- /dev/null
+++ b/kpresenter/toolbar/action-polyline.svg
@@ -0,0 +1,327 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg1978"
+ sodipodi:version="0.32"
+ inkscape:version="0.42.2"
+ sodipodi:docbase="/home/tz/develop/kpresenter/newicons/tz"
+ sodipodi:docname="action-polyline.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr16-action-closed_cubicbeziercurve.png"
+ inkscape:export-xdpi="11.25"
+ inkscape:export-ydpi="11.25">
+ <defs
+ id="defs3">
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2278"
+ x1="31.356537"
+ y1="24.749172"
+ x2="82.897346"
+ y2="114.25147"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-148.1857,21.02384)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45939"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45938"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45937"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45936"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45934"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45933"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45932"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45931"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ id="stop1979" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ id="stop1978" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45930"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45929"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45928"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18528"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18527"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18526"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90196079;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.1304936"
+ inkscape:cx="61.219017"
+ inkscape:cy="-54.055749"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="1392"
+ inkscape:window-height="975"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.08452704pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0"
+ d="M 0.74499569,127.24869 L 127.53555,0.74499569 M 127.53555,127.24869 L 0.74499569,0.74499569"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ sodipodi:nodetypes="cccc"
+ id="path43061"
+ d="M 11.681422,115.94207 L 35.822305,39.575341 L 99.588543,96.506568 L 116.18433,10.237177"
+ style="fill:none;fill-opacity:1.0;fill-rule:evenodd;stroke:#000000;stroke-width:4.771;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-quadricbeziercurve.svg b/kpresenter/toolbar/action-quadricbeziercurve.svg
new file mode 100644
index 000000000..fb033728a
--- /dev/null
+++ b/kpresenter/toolbar/action-quadricbeziercurve.svg
@@ -0,0 +1,393 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg1978"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-quadricbeziercurve.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr16-action-quadricbeziercurve.png"
+ inkscape:export-xdpi="11.25"
+ inkscape:export-ydpi="11.25">
+ <defs
+ id="defs3">
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45939"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45938"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45937"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45936"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45934"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45933"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45932"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient45931"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ id="linearGradient1977">
+ <stop
+ offset="0.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.83529413;"
+ id="stop1979" />
+ <stop
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ id="stop1978" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient45930"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient45929"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient45928"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light90to0"
+ id="linearGradient18528"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01877,0.981576)"
+ x1="278.15439"
+ y1="300.00095"
+ x2="328.93796"
+ y2="346.2533" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="linearGradient18527"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01872,0.981624)"
+ x1="258.11154"
+ y1="259.13287"
+ x2="256.32883"
+ y2="64.906898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#graytoblack"
+ id="radialGradient18526"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.01733,0.982965)"
+ cx="256.57788"
+ cy="98.022842"
+ fx="256.26614"
+ fy="97.798195"
+ r="65.751129" />
+ <linearGradient
+ id="light90to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.90196079;"
+ offset="0.0000000"
+ id="stop1890" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop1892" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1399"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1401"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1403"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1405"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient1407"
+ gradientUnits="userSpaceOnUse"
+ x1="216.38365"
+ y1="701.12646"
+ x2="223.34302"
+ y2="708.08466" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient1409"
+ gradientUnits="userSpaceOnUse"
+ x1="216.42781"
+ y1="701.17023"
+ x2="223.36394"
+ y2="708.07904" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="linearGradient1411"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.420134,0,0,0.704159,84.43947,-293.3599)"
+ x1="41.779896"
+ y1="615.31268"
+ x2="60.867611"
+ y2="663.16486" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1977"
+ id="radialGradient1413"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.148604,0,0,0.870622,21.42854,-245.2865)"
+ cx="171.9519"
+ cy="537.74377"
+ fx="171.9519"
+ fy="537.74377"
+ r="23.534935" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.73666667"
+ inkscape:cx="149.99996"
+ inkscape:cy="92.407613"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="710"
+ inkscape:window-height="590"
+ inkscape:window-x="306"
+ inkscape:window-y="125" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <path
+ id="path2028"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.08452704pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0"
+ d="M 0.74499569,127.24869 L 127.53555,0.74499569 M 127.53555,127.24869 L 0.74499569,0.74499569"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ sodipodi:nodetypes="cc"
+ id="path43061"
+ d="M 20.521481,115.99626 C 6.3292729,-25.730811 119.98392,-25.397955 108.5771,116.67017"
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.27860985pt;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-rectangle.svg b/kpresenter/toolbar/action-rectangle.svg
new file mode 100644
index 000000000..93b979cc0
--- /dev/null
+++ b/kpresenter/toolbar/action-rectangle.svg
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg5082"
+ sodipodi:version="0.32"
+ inkscape:version="0.43+devel"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="action-rectangle.svg"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr16-action-circle.png"
+ inkscape:export-xdpi="11.25"
+ inkscape:export-ydpi="11.25">
+ <defs
+ id="defs3">
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.9609"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.9609"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient2208"
+ x1="2.6070418"
+ y1="-25.389669"
+ x2="112.17229"
+ y2="94.497658"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.863389,0,0,0.863389,9.082907,9.780087)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient2216"
+ x1="2.6070418"
+ y1="-25.389669"
+ x2="112.17229"
+ y2="94.497658"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.863389,0,0,0.863389,9.082907,9.780087)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.328125"
+ inkscape:cx="27.943662"
+ inkscape:cy="70.625193"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="false"
+ gridspacingy="1.0000000pt"
+ gridspacingx="1.0000000pt"
+ gridoriginy="0.0000000pt"
+ gridoriginx="0.0000000pt"
+ inkscape:window-width="780"
+ inkscape:window-height="590"
+ inkscape:window-x="453"
+ inkscape:window-y="148" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <rect
+ style="opacity:1;fill:url(#linearGradient2216);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient2208);stroke-width:3.05551195;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect1327"
+ width="106.62254"
+ height="106.07395"
+ x="11.158282"
+ y="11.351494"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/action-slide_effect.svg b/kpresenter/toolbar/action-slide_effect.svg
new file mode 100644
index 000000000..55b5ac138
--- /dev/null
+++ b/kpresenter/toolbar/action-slide_effect.svg
@@ -0,0 +1,680 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64px"
+ height="64px"
+ id="svg3948"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/Transition48.png"
+ inkscape:export-xdpi="67.5"
+ inkscape:export-ydpi="67.5"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="Transition.svg">
+ <defs
+ id="defs3950">
+ <linearGradient
+ id="linearGradient6289">
+ <stop
+ style="stop-color:#001d82;stop-opacity:1;"
+ offset="0"
+ id="stop6291" />
+ <stop
+ style="stop-color:#002cc5;stop-opacity:0;"
+ offset="1"
+ id="stop6293" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient6281">
+ <stop
+ style="stop-color:#0e7afe;stop-opacity:1;"
+ offset="0"
+ id="stop6283" />
+ <stop
+ style="stop-color:#0e7afe;stop-opacity:0;"
+ offset="1"
+ id="stop6285" />
+ </linearGradient>
+ <radialGradient
+ id="radialGradient3132"
+ cx="56.1016"
+ cy="94.9063"
+ r="56.5206"
+ fx="56.1016"
+ fy="94.9063"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0"
+ style="stop-color:#528600;stop-opacity:1;"
+ id="stop3134" />
+ <stop
+ offset="0.764"
+ style="stop-color:#004d00;stop-opacity:1;"
+ id="stop3136" />
+ </radialGradient>
+ <linearGradient
+ y2="51.0311"
+ x2="88.7039"
+ y1="18.0479"
+ x1="55.6276"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2143">
+ <stop
+ id="stop2145"
+ stop-opacity="1"
+ offset="0"
+ stop-color="#ffffff" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.16494845;"
+ id="stop2147"
+ stop-opacity="1"
+ offset="1.0000000"
+ stop-color="#cccccc" />
+ </linearGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ fy="94.9063"
+ fx="56.1016"
+ r="56.5206"
+ cy="94.9063"
+ cx="56.1016"
+ id="XMLID_10_">
+ <stop
+ id="stop138"
+ style="stop-color:rgb(157,255,0)"
+ offset="0" />
+ <stop
+ id="stop140"
+ style="stop-color:rgb(0,151,0)"
+ offset="0.764" />
+ </radialGradient>
+ <linearGradient
+ id="light100to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2764" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2765" />
+ </linearGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ id="bluedarktoblackblue"
+ fy="112.96090"
+ fx="38.797401"
+ r="67.358803"
+ cy="112.96090"
+ cx="38.797401">
+ <stop
+ id="stop2959"
+ offset="0.0000000"
+ style="stop-color:#0356fe;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2960"
+ offset="1.0000000"
+ style="stop-color:#032442;stop-opacity:1.0000000;" />
+ </radialGradient>
+ <linearGradient
+ id="linearGradient2642">
+ <stop
+ id="stop2646"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000" />
+ <stop
+ id="stop2644"
+ style="stop-color:#a9a9bb;stop-opacity:1.0000000;"
+ offset="1.0000000" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2351">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2353" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2355" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient10275"
+ gradientUnits="userSpaceOnUse"
+ x1="33.332001"
+ y1="10.305200"
+ x2="33.332001"
+ y2="91.407700">
+ <stop
+ offset="0"
+ style="stop-color:rgb(255,255,255)"
+ id="stop10277" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(84,84,119)"
+ id="stop10279" />
+ </linearGradient>
+ <linearGradient
+ id="orangetoyelow">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2661" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2662" />
+ </linearGradient>
+ <linearGradient
+ id="orangemoretoyelow">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2671" />
+ <stop
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;"
+ offset="0.74641621"
+ id="stop2679" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2672" />
+ </linearGradient>
+ <linearGradient
+ id="orangelesstoyelow">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2689" />
+ <stop
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;"
+ offset="0.25358382"
+ id="stop2690" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2691" />
+ </linearGradient>
+ <linearGradient
+ id="orangetoblackorange">
+ <stop
+ style="stop-color:#ff8b00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop4207" />
+ <stop
+ style="stop-color:#4d0200;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop4209" />
+ </linearGradient>
+ <linearGradient
+ id="yelowtoorange">
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3105" />
+ <stop
+ style="stop-color:#ff8c00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3107" />
+ </linearGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <linearGradient
+ id="bludraktowhite"
+ gradientUnits="userSpaceOnUse"
+ x1="33.332001"
+ y1="10.305200"
+ x2="33.332001"
+ y2="91.407700">
+ <stop
+ id="stop3435"
+ style="stop-color:#a9a9bb;stop-opacity:1;"
+ offset="0" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(84,84,119)"
+ id="stop7273" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3747"
+ gradientUnits="userSpaceOnUse"
+ x1="33.332001"
+ y1="10.305200"
+ x2="33.332001"
+ y2="91.407700">
+ <linearGradient
+ id="linearGradient3749"
+ gradientUnits="userSpaceOnUse"
+ x1="33.332001"
+ y1="10.305200"
+ x2="33.332001"
+ y2="91.407700"
+ spreadMethod="pad"
+ xlink:href="#linearGradient2642" />
+ <stop
+ offset="0"
+ style="stop-color:rgb(255,255,255)"
+ id="stop3751" />
+ <stop
+ offset="1"
+ style="stop-color:rgb(84,84,119)"
+ id="stop3753" />
+ </linearGradient>
+ <linearGradient
+ y2="91.407700"
+ x2="33.332001"
+ y1="10.305200"
+ x1="33.332001"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient3796">
+ <stop
+ offset="0"
+ style="stop-color:#ffffff;stop-opacity:1;"
+ id="stop3798" />
+ <stop
+ id="stop3800"
+ style="stop-color:rgb(84,84,119)"
+ offset="1" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient10275"
+ id="linearGradient4258"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.994505,1.005525)"
+ x1="21.797516"
+ y1="64.368118"
+ x2="66.285202"
+ y2="109.8044" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3747"
+ id="linearGradient4260"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.994701,1.005327)"
+ x1="13.411418"
+ y1="-49.143494"
+ x2="28.078188"
+ y2="123.23939" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3796"
+ id="linearGradient4262"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.860113,1.292863e-16,-6.61973e-17,1.281905,243.3409,359.343)"
+ x1="116.16369"
+ y1="19.868944"
+ x2="137.60123"
+ y2="267.88974" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bludraktowhite"
+ id="linearGradient4264"
+ gradientUnits="userSpaceOnUse"
+ x1="51.968300"
+ y1="98.746101"
+ x2="43.653599"
+ y2="71.243797" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangelesstoyelow"
+ id="linearGradient4266"
+ gradientUnits="userSpaceOnUse"
+ x1="60.536690"
+ y1="133.07648"
+ x2="57.450085"
+ y2="74.325470" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangetoblackorange"
+ id="linearGradient4268"
+ gradientUnits="userSpaceOnUse"
+ x1="52.093212"
+ y1="18.808815"
+ x2="62.530823"
+ y2="175.27454" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangetoblackorange"
+ id="linearGradient4270"
+ gradientUnits="userSpaceOnUse"
+ x1="62.404484"
+ y1="113.70891"
+ x2="59.353645"
+ y2="48.286541" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangemoretoyelow"
+ id="linearGradient4272"
+ gradientUnits="userSpaceOnUse"
+ x1="59.273998"
+ y1="20.307247"
+ x2="66.497231"
+ y2="122.44665" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangetoyelow"
+ id="linearGradient4274"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="pad"
+ x1="65.665718"
+ y1="124.63684"
+ x2="66.504250"
+ y2="92.233040" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#yelowtoorange"
+ id="radialGradient4276"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.007939,0.992123)"
+ cx="117.06402"
+ cy="304.92585"
+ fx="117.98709"
+ fy="305.53129"
+ r="32.600057" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#yelowtoorange"
+ id="radialGradient4278"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.007895,0.992167)"
+ cx="99.576797"
+ cy="288.10696"
+ fx="99.576797"
+ fy="288.10696"
+ r="16.905936" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#XMLID_10_"
+ id="linearGradient4285"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.662304,-1.269711,-1.643567,1.255397,97.2282,46.33819)"
+ x1="31.632498"
+ y1="-8.6353083"
+ x2="30.865753"
+ y2="27.555025" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#radialGradient3132"
+ id="linearGradient4287"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.662304,-1.269711,-1.643567,1.255397,97.2282,46.33819)"
+ x1="30.899836"
+ y1="-3.8899043"
+ x2="34.512043"
+ y2="35.25243" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient4289"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.662304,-1.259719,-1.643563,1.245519,97.228,46.26502)"
+ cx="32.423191"
+ cy="25.805140"
+ fx="32.423191"
+ fy="25.805140"
+ r="13.043961" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2143"
+ id="linearGradient4291"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.662304,-1.259719,-1.643563,1.245519,104.4397,45.6067)"
+ x1="34.575813"
+ y1="4.7051349"
+ x2="34.315556"
+ y2="13.490262" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2351"
+ id="linearGradient4301"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.662304,-1.25972,-1.643567,1.245519,97.2282,46.26507)"
+ x1="31.618959"
+ y1="3.7376304"
+ x2="31.030998"
+ y2="23.946081" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#orangetoblackorange"
+ id="linearGradient4303"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.662304,-1.25972,-1.643567,1.245519,97.2282,46.26507)"
+ x1="30.594465"
+ y1="1.581671"
+ x2="35.605167"
+ y2="23.352057" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="radialGradient4305"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.662304,-1.259719,-1.643563,1.245519,97.228,46.26502)"
+ cx="32.423191"
+ cy="25.805140"
+ fx="32.423191"
+ fy="25.805140"
+ r="13.043961" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2143"
+ id="linearGradient4307"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.662304,-1.259719,-1.643563,1.245519,104.4397,45.6067)"
+ x1="34.575813"
+ y1="4.7051349"
+ x2="34.315556"
+ y2="13.490262" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient5393"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(-1.309138,-0.763861)"
+ x1="-53.441853"
+ y1="-197.36633"
+ x2="-72.369476"
+ y2="-236.33725" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluelignonlinblu"
+ id="linearGradient5395"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(-1.309138,-0.763861)"
+ x1="-53.441853"
+ y1="-197.36633"
+ x2="-72.369476"
+ y2="-236.33725" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#bluedarktoblackblue"
+ id="linearGradient5397"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.309139,0.763861)"
+ x1="56.570652"
+ y1="209.39684"
+ x2="71.634178"
+ y2="237.81303" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient5399"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1.178224,0,0,-0.576209,8.659658,40.50238)"
+ x1="-65.990189"
+ y1="-214.22188"
+ x2="-65.639671"
+ y2="-226.53479" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient6281"
+ id="linearGradient6287"
+ x1="53.205536"
+ y1="25.54961"
+ x2="53.205536"
+ y2="22.009035"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.094322,0,0,1.333702,-6.036612,-7.879096)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient6289"
+ id="linearGradient6295"
+ x1="53.205536"
+ y1="25.54961"
+ x2="53.205536"
+ y2="22.009035"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.094322,0,0,1.333702,-6.036612,-7.879096)" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="9.420528"
+ inkscape:cx="92.193079"
+ inkscape:cy="64.613205"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:document-units="px"
+ inkscape:grid-bbox="true"
+ inkscape:window-width="780"
+ inkscape:window-height="538"
+ inkscape:window-x="1132"
+ inkscape:window-y="25"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata3953">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <g
+ id="g12708"
+ transform="matrix(1.250112,0,0,1.448375,-65.44789,-229.3269)">
+ <path
+ d="M 94.691662,181.07679 L 86.565549,172.95068 L 90.831759,172.96974 C 90.935186,167.42473 84.389636,163.02891 73.083089,173.03922 C 81.803785,155.35386 98.897266,167.26055 98.957872,172.96974 L 102.81778,172.95068 L 94.691662,181.07679 z "
+ style="fill:url(#linearGradient5393);fill-opacity:1;stroke:none;stroke-width:1.73999953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ id="path12826" />
+ <path
+ d="M 94.691662,181.07679 L 86.565549,172.95068 L 90.831759,172.96974 C 90.935186,167.42473 84.389636,163.02891 73.083089,173.03922 C 81.126857,156.43694 98.942395,164.19181 98.957872,172.96974 L 102.81778,172.95068 L 94.691662,181.07679 z "
+ style="fill:url(#linearGradient5395);fill-opacity:1;stroke:url(#linearGradient5397);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ id="path12694"
+ sodipodi:nodetypes="ccccccc" />
+ <path
+ d="M 90.679013,172.64973 C 90.817225,166.43614 83.527247,164.33869 74.660082,171.3483 C 81.786652,157.15014 98.524639,164.37178 98.534056,172.69486 L 90.679013,172.64973 z "
+ style="fill:url(#linearGradient5399);fill-opacity:1;stroke:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ id="path12704"
+ sodipodi:nodetypes="cccc" />
+ </g>
+ <g
+ transform="matrix(1,0,0,1.007943,1,-4.293879)"
+ id="g4293">
+ <path
+ id="path4295"
+ d="M 39.832933,7.3593789 L 1.9765461,7.1967627 L 1.9850072,36.089403 L 40.047521,36.047521 L 39.832933,7.3593789 z "
+ style="fill:url(#linearGradient4301);fill-opacity:1;stroke:url(#linearGradient4303);stroke-width:1.90495884;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ id="path4297"
+ d="M 39.832889,7.3593537 L 1.976553,7.1967383 L 2.191137,35.884865 L 40.047473,36.047479 L 39.832889,7.3593537 z "
+ style="fill:url(#radialGradient4305);fill-opacity:1;stroke:none;stroke-width:1.94000006;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path4299"
+ d="M 39.01473,7.7472903 L 2.5132646,7.6253259 C 3.3528636,27.19811 29.46535,16.670546 39.175671,29.263386 L 39.01473,7.7472903 z "
+ style="fill:url(#linearGradient4307);fill-opacity:1;stroke:none;stroke-width:2.53999996;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ </g>
+ <g
+ id="g4280"
+ transform="matrix(1.050036,0,0,1.096003,18.94384,19.40421)">
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient4285);fill-opacity:1;stroke:url(#linearGradient4287);stroke-width:1.91249835;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 39.832933,7.12394 L 1.9765493,6.960034 L 1.9850104,36.083472 L 40.047521,36.039621 L 39.832933,7.12394 z "
+ id="path1734"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#radialGradient4289);fill-opacity:1;stroke:none;stroke-width:1.94000006;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 39.832889,7.3593537 L 1.9765527,7.1967383 L 2.1911366,35.884865 L 40.047473,36.047479 L 39.832889,7.3593537 z "
+ id="path1736" />
+ <path
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ style="fill:url(#linearGradient4291);fill-opacity:1;stroke:none;stroke-width:2.53999996;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 39.01473,7.7472903 L 2.5132646,7.6253259 C 3.3528636,27.19811 29.46535,16.670546 39.175671,29.263386 L 39.01473,7.7472903 z "
+ id="path1738"
+ sodipodi:nodetypes="cccc" />
+ </g>
+ <path
+ sodipodi:nodetypes="ccccccc"
+ id="path5401"
+ style="fill:url(#linearGradient6287);fill-opacity:1;stroke:url(#linearGradient6295);stroke-width:2.01839542;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 52.927289,32.888505 L 42.768738,21.118849 L 48.101978,21.146454 C 48.231273,13.115199 40.048604,6.7484027 25.914154,21.247087 C 35.969765,-2.7992437 58.241182,8.4327178 58.260529,21.146454 L 63.085846,21.118849 L 52.927289,32.888505 z " />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/cr16-action-alignobjs.png b/kpresenter/toolbar/cr16-action-alignobjs.png
new file mode 100644
index 000000000..e714f0d51
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-alignobjs.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-alignobjs.svg b/kpresenter/toolbar/cr16-action-alignobjs.svg
new file mode 100644
index 000000000..d25302fb1
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-alignobjs.svg
@@ -0,0 +1,1066 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16px"
+ height="16px"
+ id="svg3128"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr16-action-alignobjs.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="cr16-action-alignobjs.svg">
+ <defs
+ id="defs3130">
+ <linearGradient
+ id="linearGradient3082">
+ <stop
+ style="stop-color:#fab100;stop-opacity:1;"
+ offset="0"
+ id="stop3084" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1;"
+ offset="1"
+ id="stop3086" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3082"
+ id="linearGradient3088"
+ x1="-0.56291676"
+ y1="15.499685"
+ x2="-7.1243687"
+ y2="10.812185"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.62514,0,0,0.666764,6.81396,-0.829734)" />
+ <linearGradient
+ id="linearGradient3111">
+ <stop
+ style="stop-color:#59a6ff;stop-opacity:1;"
+ offset="0"
+ id="stop3113" />
+ <stop
+ style="stop-color:#a9d7ff;stop-opacity:1;"
+ offset="1"
+ id="stop3115" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3111"
+ id="linearGradient3117"
+ x1="21.102264"
+ y1="16.332613"
+ x2="13.514696"
+ y2="6.4625802"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.753048,0,0,0.803835,-1.655392,-1.726085)" />
+ <linearGradient
+ id="blacktowhite">
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2476" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2475" />
+ </linearGradient>
+ <linearGradient
+ id="garylighttowite">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5106" />
+ <stop
+ style="stop-color:#d3d4d4;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5107" />
+ </linearGradient>
+ <linearGradient
+ id="graytolightgray">
+ <stop
+ style="stop-color:#d4d3d3;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5101" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5102" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ id="shadow25tolineto0">
+ <stop
+ style="stop-color:#000000;stop-opacity:0.25490198;"
+ offset="0.0000000"
+ id="stop3442" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.029166667;"
+ offset="0.45393065"
+ id="stop3450" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.37083334;"
+ offset="0.50000000"
+ id="stop3449" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.062745102;"
+ offset="0.53497112"
+ id="stop3451" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop3444" />
+ </linearGradient>
+ <linearGradient
+ id="shadow0wto25to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="0.0000000"
+ id="stop3437" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.27916667;"
+ offset="0.50000000"
+ id="stop3438" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop3439" />
+ </linearGradient>
+ <linearGradient
+ id="shadow25to25w">
+ <stop
+ style="stop-color:#000000;stop-opacity:0.25416666;"
+ offset="0.0000000"
+ id="stop3433" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.26274511;"
+ offset="1.0000000"
+ id="stop3434" />
+ </linearGradient>
+ <linearGradient
+ id="sadow75to0w">
+ <stop
+ style="stop-color:#000000;stop-opacity:0.72941178;"
+ offset="0.0000000"
+ id="stop3429" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop3430" />
+ </linearGradient>
+ <linearGradient
+ id="shadow100to0">
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3425" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop3426" />
+ </linearGradient>
+ <linearGradient
+ id="light50to25to7">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.47450981;"
+ offset="0.0000000"
+ id="stop2791" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.25833333;"
+ offset="0.50000000"
+ id="stop2795" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.10833333;"
+ offset="1.0000000"
+ id="stop2793" />
+ </linearGradient>
+ <linearGradient
+ id="light100to25to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2785" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.28749999;"
+ offset="0.50000000"
+ id="stop2786" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2787" />
+ </linearGradient>
+ <linearGradient
+ id="light100to75to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2779" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.77499998;"
+ offset="0.50000000"
+ id="stop2782" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2780" />
+ </linearGradient>
+ <linearGradient
+ id="light75to25">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.72941178;"
+ offset="0.0000000"
+ id="stop2774" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.26249999;"
+ offset="1.0000000"
+ id="stop2775" />
+ </linearGradient>
+ <linearGradient
+ id="light75to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.72916669;"
+ offset="0.0000000"
+ id="stop2769" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2770" />
+ </linearGradient>
+ <linearGradient
+ id="light100to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2764" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2765" />
+ </linearGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="bluelighttowhite"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#69d3ff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop6078" />
+ <stop
+ style="stop-color:#edffff;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop6080" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="bluelightlesstoblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop3468" />
+ <stop
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;"
+ offset="0.24089479"
+ id="stop3469" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3470" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="blueligtmoretoblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop3457" />
+ <stop
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;"
+ offset="0.74217570"
+ id="stop3465" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3463" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ id="greantodarkgrean">
+ <stop
+ style="stop-color:#00ff01;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5123" />
+ <stop
+ style="stop-color:#15980f;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5124" />
+ </linearGradient>
+ <linearGradient
+ id="greandraktoblack">
+ <stop
+ style="stop-color:#007c00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop7328" />
+ <stop
+ style="stop-color:#025a00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop7329" />
+ </linearGradient>
+ <linearGradient
+ id="greandarktobgrean">
+ <stop
+ style="stop-color:#00ad01;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop4492" />
+ <stop
+ style="stop-color:#15720f;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop4493" />
+ </linearGradient>
+ <linearGradient
+ id="redtodarkred">
+ <stop
+ style="stop-color:#ff0000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3856" />
+ <stop
+ style="stop-color:#920000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3855" />
+ </linearGradient>
+ <linearGradient
+ id="reddarktoblack">
+ <stop
+ style="stop-color:#8e0000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3230" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3231" />
+ </linearGradient>
+ <linearGradient
+ id="orangetoblackorange">
+ <stop
+ style="stop-color:#ff8b00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop4207" />
+ <stop
+ style="stop-color:#4d0200;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop4209" />
+ </linearGradient>
+ <linearGradient
+ id="orangelesstoyelow">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2689" />
+ <stop
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;"
+ offset="0.25358382"
+ id="stop2690" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2691" />
+ </linearGradient>
+ <linearGradient
+ id="orangemoretoyelow">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2671" />
+ <stop
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;"
+ offset="0.74641621"
+ id="stop2679" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2672" />
+ </linearGradient>
+ <linearGradient
+ id="orangetoyelow">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2661" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2662" />
+ </linearGradient>
+ <linearGradient
+ x1="-1.9488534e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2754"
+ collect="always"
+ xlink:href="#bluelignonlinblu" />
+ <linearGradient
+ x1="-3.3718688e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2755"
+ collect="always"
+ xlink:href="#orangetoyelow" />
+ <linearGradient
+ x1="-1.3227267e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2756"
+ collect="always"
+ xlink:href="#orangemoretoyelow" />
+ <linearGradient
+ x1="-6.9931040e-18"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2757"
+ collect="always"
+ xlink:href="#orangelesstoyelow" />
+ <linearGradient
+ x1="2.0274581e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2766"
+ collect="always"
+ xlink:href="#light100to0" />
+ <linearGradient
+ x1="5.6270093e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2771"
+ collect="always"
+ xlink:href="#light75to0" />
+ <linearGradient
+ x1="9.2265605e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2776"
+ collect="always"
+ xlink:href="#light75to25" />
+ <linearGradient
+ x1="1.2826112e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2781"
+ collect="always"
+ xlink:href="#light100to75to0" />
+ <linearGradient
+ x1="-6.5594231e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2788"
+ collect="always"
+ xlink:href="#light100to25to0" />
+ <linearGradient
+ x1="0.0036900369"
+ y1="0.57142860"
+ x2="1.0000000"
+ y2="0.56802720"
+ id="linearGradient2794"
+ collect="always"
+ xlink:href="#light50to25to7" />
+ <linearGradient
+ x1="6.8293895e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3427"
+ collect="always"
+ xlink:href="#shadow100to0" />
+ <linearGradient
+ x1="-0.0092250919"
+ y1="0.55782312"
+ x2="0.99077493"
+ y2="0.55782312"
+ id="linearGradient3431"
+ collect="always"
+ xlink:href="#sadow75to0w" />
+ <linearGradient
+ x1="-3.5182360e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3435"
+ collect="always"
+ xlink:href="#shadow25to25w" />
+ <linearGradient
+ x1="-3.1582809e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3440"
+ collect="always"
+ xlink:href="#shadow0wto25to0" />
+ <linearGradient
+ x1="-5.0968344e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3445"
+ collect="always"
+ xlink:href="#shadow25tolineto0" />
+ <linearGradient
+ x1="-3.3474742e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3464"
+ collect="always"
+ xlink:href="#blueligtmoretoblue" />
+ <linearGradient
+ x1="-4.7460950e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3471"
+ collect="always"
+ xlink:href="#bluelightlesstoblue" />
+ <linearGradient
+ x1="-5.4454054e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3080"
+ collect="always"
+ xlink:href="#greantodarkgrean" />
+ <linearGradient
+ x1="-6.9931040e-18"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3704"
+ collect="always"
+ xlink:href="#greandarktobgrean" />
+ <linearGradient
+ x1="-2.0979312e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient4471"
+ collect="always"
+ xlink:href="#redtodarkred" />
+ <linearGradient
+ x1="-3.4965520e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient4473"
+ collect="always"
+ xlink:href="#reddarktoblack" />
+ <linearGradient
+ x1="0.016544119"
+ y1="0.46428570"
+ x2="0.99264705"
+ y2="0.46428570"
+ id="linearGradient782"
+ xlink:href="#graytoblack" />
+ <linearGradient
+ x1="0.016544119"
+ y1="0.46428570"
+ x2="0.99264705"
+ y2="0.46428570"
+ id="linearGradient5103"
+ collect="always"
+ xlink:href="#graytolightgray" />
+ <linearGradient
+ x1="0.016544119"
+ y1="0.46428570"
+ x2="0.99264705"
+ y2="0.46428570"
+ id="linearGradient5108"
+ collect="always"
+ xlink:href="#garylighttowite" />
+ <linearGradient
+ x1="0.016544119"
+ y1="0.46428570"
+ x2="0.99264705"
+ y2="0.46428570"
+ id="linearGradient9077"
+ collect="always"
+ xlink:href="#blacktowhite" />
+ <linearGradient
+ id="linearGradient581"
+ xlink:href="#bluedarktoblackblue"
+ x1="4.3021142e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1222"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.053976,0,0,0.948788,-5.933544,5.34019)"
+ spreadMethod="reflect"
+ x1="75.412579"
+ y1="59.381731"
+ x2="285.12177"
+ y2="300.40905" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1224"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.056051,0,0,0.946924,-5.933544,5.34019)"
+ spreadMethod="reflect"
+ x1="78.528797"
+ y1="65.382599"
+ x2="280.66960"
+ y2="297.71126" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1225"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.746283,0,0,1.339974,-5.933544,5.34019)"
+ x1="250.67159"
+ y1="-21.820315"
+ x2="152.95656"
+ y2="105.15331" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to25to0"
+ id="radialGradient1226"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.746344,0,0,1.339864,-5.933544,5.34019)"
+ cx="408.92502"
+ cy="209.99586"
+ fx="408.92502"
+ fy="209.99586"
+ r="181.02384" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient1227"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.278924,0,0,0.781908,-5.933544,5.34019)"
+ x1="18.809567"
+ y1="232.78678"
+ x2="58.429586"
+ y2="296.31726" />
+ <linearGradient
+ y2="16.398424"
+ x2="13.153853"
+ y1="11.521504"
+ x1="2.1610777"
+ gradientTransform="matrix(0.984657,0,0,0.972908,16.11774,-2.514927)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2246"
+ xlink:href="#linearGradient2228"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="6.4625802"
+ x2="13.514696"
+ y1="16.332613"
+ x1="21.102264"
+ gradientTransform="matrix(1.461537,0,0,1.461537,-1.46152,-0.155237)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2244"
+ xlink:href="#linearGradient3111"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="16.398424"
+ x2="13.153853"
+ y1="11.521504"
+ x1="2.1610777"
+ gradientTransform="matrix(0.984657,0,0,0.972908,16.11774,-2.514927)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2238"
+ xlink:href="#linearGradient2228"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientTransform="matrix(0.984657,0,0,0.972908,-0.39266,-0.17807)"
+ gradientUnits="userSpaceOnUse"
+ y2="16.398424"
+ x2="13.153853"
+ y1="11.521504"
+ x1="2.1610777"
+ id="linearGradient2234"
+ xlink:href="#linearGradient2228"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientTransform="matrix(1.461537,0,0,1.461537,-1.46152,-0.155237)"
+ gradientUnits="userSpaceOnUse"
+ y2="6.4625802"
+ x2="13.514696"
+ y1="16.332613"
+ x1="21.102264"
+ id="linearGradient1511"
+ xlink:href="#linearGradient3111"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient1505">
+ <stop
+ id="stop1507"
+ offset="0"
+ style="stop-color:#59a6ff;stop-opacity:1;" />
+ <stop
+ id="stop1509"
+ offset="1"
+ style="stop-color:#a9d7ff;stop-opacity:1;" />
+ </linearGradient>
+ <linearGradient
+ gradientTransform="matrix(1.439113,0,0,1.421941,13.99909,-1.751571)"
+ gradientUnits="userSpaceOnUse"
+ y2="10.812185"
+ x2="-7.1243687"
+ y1="15.499685"
+ x1="-0.56291676"
+ id="linearGradient1503"
+ xlink:href="#linearGradient3082"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient1497">
+ <stop
+ id="stop1499"
+ offset="0"
+ style="stop-color:#fab100;stop-opacity:1;" />
+ <stop
+ id="stop1501"
+ offset="1"
+ style="stop-color:#ffff00;stop-opacity:1;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2228"
+ inkscape:collect="always">
+ <stop
+ id="stop2230"
+ offset="0"
+ style="stop-color:#ffffff;stop-opacity:1;" />
+ <stop
+ id="stop2232"
+ offset="1"
+ style="stop-color:#ffffff;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3082"
+ id="linearGradient1670"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.62514,0,0,0.666764,6.81396,-0.829734)"
+ x1="-0.56291676"
+ y1="15.499685"
+ x2="-7.1243687"
+ y2="10.812185" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2228"
+ id="linearGradient1681"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.984657,0,0,0.972908,-12.39266,-81.17807)"
+ x1="2.1610777"
+ y1="11.521504"
+ x2="13.153853"
+ y2="16.398424" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3082"
+ id="linearGradient1684"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.62514,0,0,0.666764,-5.18604,-81.82973)"
+ x1="-0.56291676"
+ y1="15.499685"
+ x2="-7.1243687"
+ y2="10.812185" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1689"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.053976,0,0,0.948788,-5.933544,5.34019)"
+ spreadMethod="reflect"
+ x1="75.412579"
+ y1="59.381731"
+ x2="285.12177"
+ y2="300.40905" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1691"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.056051,0,0,0.946924,-5.933544,5.34019)"
+ spreadMethod="reflect"
+ x1="78.528797"
+ y1="65.382599"
+ x2="280.66960"
+ y2="297.71126" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1693"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.746283,0,0,1.339974,-5.933544,5.34019)"
+ x1="250.67159"
+ y1="-21.820315"
+ x2="152.95656"
+ y2="105.15331" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to25to0"
+ id="radialGradient1695"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.746344,0,0,1.339864,-5.933544,5.34019)"
+ cx="408.92502"
+ cy="209.99586"
+ fx="408.92502"
+ fy="209.99586"
+ r="181.02384" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient1697"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.278924,0,0,0.781908,-5.933544,5.34019)"
+ x1="18.809567"
+ y1="232.78678"
+ x2="58.429586"
+ y2="296.31726" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.197802"
+ inkscape:cx="6.3410464"
+ inkscape:cy="4.4146322"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="780"
+ inkscape:window-height="538"
+ inkscape:window-x="121"
+ inkscape:window-y="27" />
+ <metadata
+ id="metadata3133">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <rect
+ style="opacity:1;fill:url(#linearGradient3088);fill-opacity:1;fill-rule:nonzero;stroke:#b86920;stroke-width:1.00000024;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect1334"
+ width="5.001781"
+ height="4.0014939"
+ x="1.5000001"
+ y="5.5038466"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <rect
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ y="3.5000002"
+ x="8.5107498"
+ height="8.0372019"
+ width="6.0243649"
+ id="rect3103"
+ style="opacity:1;fill:url(#linearGradient3117);fill-opacity:1;fill-rule:nonzero;stroke:#166cd4;stroke-width:1.0000006;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:0.70642204;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ d="M 2.0107498,6.0075886 L 2.0107498,7.0075886 L 2.0107498,9.0075894 L 3.0107498,9.0075894 L 3.0107498,7.0075886 L 6.0107498,7.0075886 L 6.0107498,6.0075886 L 2.0107498,6.0075886 z "
+ id="rect3121"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ id="path3126"
+ d="M 9.0190835,4.0053394 L 9.0190835,5.0053394 L 9.0190835,11.00534 L 10.019084,11.00534 L 10.019084,5.0053394 L 14.019084,5.0053394 L 14.019084,4.0053394 L 9.0190835,4.0053394 z "
+ style="opacity:1;fill:#ffffff;fill-opacity:0.70642204;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cccccccc" />
+ <rect
+ style="opacity:1;fill:#4c4465;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect3119"
+ width="16"
+ height="1"
+ x="0.010749817"
+ y="7.0053406"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <rect
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ y="-8"
+ x="0"
+ height="1"
+ width="16"
+ id="rect1326"
+ style="opacity:1;fill:#4c4465;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ transform="matrix(0,1,-1,0,0,0)" />
+ <g
+ id="g2240"
+ transform="matrix(0.988308,0,0,0.995611,-11.3334,-81.57824)"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <rect
+ rx="0.45318019"
+ ry="0.45318019"
+ style="opacity:1;fill:url(#linearGradient2244);fill-opacity:1;fill-rule:nonzero;stroke:#166cd4;stroke-width:1.46153665;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect1654"
+ width="11.69226"
+ height="14.613266"
+ x="18.269232"
+ y="9.3468437"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <path
+ style="opacity:1;fill:url(#linearGradient2246);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ d="M 18.495775,11.158046 L 18.495775,23.24121 L 20.006347,23.24121 L 20.006347,11.158046 L 29.069782,11.158046 L 29.069782,9.6372558 L 20.147964,9.6372558 C 19.145789,9.6372558 18.495775,10.20501 18.495775,11.158046 z "
+ id="path2236"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cccccccc" />
+ </g>
+ <rect
+ rx="0.48048636"
+ style="fill:url(#linearGradient1684);fill-opacity:1;fill-rule:nonzero;stroke:#b86920;stroke-width:1.4305011;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect1657"
+ width="11.514411"
+ height="8.5335951"
+ x="-10.233968"
+ y="-69.244568"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ ry="0.48048636" />
+ <path
+ style="fill:url(#linearGradient1681);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ d="M -10.01463,-67.505097 L -10.01463,-61.421933 L -8.504057,-61.421933 L -8.504057,-67.505097 L 0.559378,-67.505097 L 0.559378,-69.025887 L -8.3624408,-69.025887 C -9.3646159,-69.025887 -10.01463,-68.458133 -10.01463,-67.505097 z "
+ id="path1659"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cccccccc" />
+ <rect
+ style="fill:#4c4465;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect1661"
+ width="32.153809"
+ height="2.0000002"
+ x="-12"
+ y="-66"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <rect
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ y="-5"
+ x="-81"
+ height="2.0000002"
+ width="32.153809"
+ id="rect1331"
+ style="fill:#4c4465;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ transform="matrix(0,1,-1,0,0,0)" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/cr16-action-autoform.png b/kpresenter/toolbar/cr16-action-autoform.png
new file mode 100644
index 000000000..48c012e50
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-autoform.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-circle.png b/kpresenter/toolbar/cr16-action-circle.png
new file mode 100644
index 000000000..fcee4d544
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-circle.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-closed_cubicbeziercurve.png b/kpresenter/toolbar/cr16-action-closed_cubicbeziercurve.png
new file mode 100644
index 000000000..8bb330b98
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-closed_cubicbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-closed_freehand.png b/kpresenter/toolbar/cr16-action-closed_freehand.png
new file mode 100644
index 000000000..6cd633297
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-closed_freehand.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-closed_polyline.png b/kpresenter/toolbar/cr16-action-closed_polyline.png
new file mode 100644
index 000000000..c0783dfa5
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-closed_polyline.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-closed_quadricbeziercurve.png b/kpresenter/toolbar/cr16-action-closed_quadricbeziercurve.png
new file mode 100644
index 000000000..5a3b247ae
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-closed_quadricbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-cubicbeziercurve.png b/kpresenter/toolbar/cr16-action-cubicbeziercurve.png
new file mode 100644
index 000000000..404477a18
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-cubicbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-effect.png b/kpresenter/toolbar/cr16-action-effect.png
new file mode 100644
index 000000000..45d7b0e97
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-effect.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-freehand.png b/kpresenter/toolbar/cr16-action-freehand.png
new file mode 100644
index 000000000..cefa554b5
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-freehand.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-line.png b/kpresenter/toolbar/cr16-action-line.png
new file mode 100644
index 000000000..14180ed5d
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-line.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-penbrush.png b/kpresenter/toolbar/cr16-action-penbrush.png
new file mode 100644
index 000000000..472fef080
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-penbrush.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-pie.png b/kpresenter/toolbar/cr16-action-pie.png
new file mode 100644
index 000000000..ce516c309
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-pie.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-polygon.png b/kpresenter/toolbar/cr16-action-polygon.png
new file mode 100644
index 000000000..22c6c036b
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-polygon.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-polyline.png b/kpresenter/toolbar/cr16-action-polyline.png
new file mode 100644
index 000000000..8484bd600
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-polyline.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-quadricbeziercurve.png b/kpresenter/toolbar/cr16-action-quadricbeziercurve.png
new file mode 100644
index 000000000..5b011e3c7
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-quadricbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-rectangle.png b/kpresenter/toolbar/cr16-action-rectangle.png
new file mode 100644
index 000000000..aec2a7251
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-rectangle.png
Binary files differ
diff --git a/kpresenter/toolbar/cr16-action-slide_effect.png b/kpresenter/toolbar/cr16-action-slide_effect.png
new file mode 100644
index 000000000..a4d0bfa8f
--- /dev/null
+++ b/kpresenter/toolbar/cr16-action-slide_effect.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-alignobjs.png b/kpresenter/toolbar/cr22-action-alignobjs.png
new file mode 100644
index 000000000..4977f0cac
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-alignobjs.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-alignobjs.svg b/kpresenter/toolbar/cr22-action-alignobjs.svg
new file mode 100644
index 000000000..b78489e29
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-alignobjs.svg
@@ -0,0 +1,1061 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="22"
+ height="22"
+ id="svg1316"
+ sodipodi:version="0.32"
+ inkscape:version="0.43"
+ version="1.0"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:docbase="/home/pinheiro/Documents/pics/outros trabalhos/koffice"
+ sodipodi:docname="cr22-action-alignobjs.svg"
+ inkscape:export-filename="/home/pinheiro/Documents/pics/outros trabalhos/koffice/cr22-action-alignobjs.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs1318">
+ <linearGradient
+ id="linearGradient3111">
+ <stop
+ style="stop-color:#59a6ff;stop-opacity:1;"
+ offset="0"
+ id="stop3113" />
+ <stop
+ style="stop-color:#a9d7ff;stop-opacity:1;"
+ offset="1"
+ id="stop3115" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3095">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop3097" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop3099" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3082">
+ <stop
+ style="stop-color:#fab100;stop-opacity:1;"
+ offset="0"
+ id="stop3084" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1;"
+ offset="1"
+ id="stop3086" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3082"
+ id="linearGradient3088"
+ x1="-0.56291676"
+ y1="15.499685"
+ x2="-7.1243687"
+ y2="10.812185"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(10.00042,-1.000371)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3095"
+ id="radialGradient3101"
+ cx="-6.6021123"
+ cy="11.118393"
+ fx="-7.1362381"
+ fy="10.342037"
+ r="3.9187208"
+ gradientTransform="matrix(2.245161,-9.517543e-2,7.401264e-2,1.745936,17.39821,-9.594862)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3095"
+ id="radialGradient3109"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(2.244858,-0.158567,7.400268e-2,2.908807,28.39608,-23.64313)"
+ cx="-6.6021123"
+ cy="11.118393"
+ fx="-7.1362381"
+ fy="10.342037"
+ r="3.9187208" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3111"
+ id="linearGradient3117"
+ x1="21.102264"
+ y1="16.332613"
+ x2="13.514696"
+ y2="6.4625802"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-1,0)" />
+ <linearGradient
+ id="blacktowhite">
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2476" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2475" />
+ </linearGradient>
+ <linearGradient
+ id="garylighttowite">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5106" />
+ <stop
+ style="stop-color:#d3d4d4;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5107" />
+ </linearGradient>
+ <linearGradient
+ id="graytolightgray">
+ <stop
+ style="stop-color:#d4d3d3;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5101" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5102" />
+ </linearGradient>
+ <linearGradient
+ id="graytoblack">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5097" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5098" />
+ </linearGradient>
+ <linearGradient
+ id="shadow25tolineto0">
+ <stop
+ style="stop-color:#000000;stop-opacity:0.25490198;"
+ offset="0.0000000"
+ id="stop3442" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.029166667;"
+ offset="0.45393065"
+ id="stop3450" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.37083334;"
+ offset="0.50000000"
+ id="stop3449" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.062745102;"
+ offset="0.53497112"
+ id="stop3451" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop3444" />
+ </linearGradient>
+ <linearGradient
+ id="shadow0wto25to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="0.0000000"
+ id="stop3437" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.27916667;"
+ offset="0.50000000"
+ id="stop3438" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop3439" />
+ </linearGradient>
+ <linearGradient
+ id="shadow25to25w">
+ <stop
+ style="stop-color:#000000;stop-opacity:0.25416666;"
+ offset="0.0000000"
+ id="stop3433" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.26274511;"
+ offset="1.0000000"
+ id="stop3434" />
+ </linearGradient>
+ <linearGradient
+ id="sadow75to0w">
+ <stop
+ style="stop-color:#000000;stop-opacity:0.72941178;"
+ offset="0.0000000"
+ id="stop3429" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop3430" />
+ </linearGradient>
+ <linearGradient
+ id="shadow100to0">
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3425" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop3426" />
+ </linearGradient>
+ <linearGradient
+ id="light50to25to7">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.47450981;"
+ offset="0.0000000"
+ id="stop2791" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.25833333;"
+ offset="0.50000000"
+ id="stop2795" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.10833333;"
+ offset="1.0000000"
+ id="stop2793" />
+ </linearGradient>
+ <linearGradient
+ id="light100to25to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2785" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.28749999;"
+ offset="0.50000000"
+ id="stop2786" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2787" />
+ </linearGradient>
+ <linearGradient
+ id="light100to75to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2779" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.77499998;"
+ offset="0.50000000"
+ id="stop2782" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2780" />
+ </linearGradient>
+ <linearGradient
+ id="light75to25">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.72941178;"
+ offset="0.0000000"
+ id="stop2774" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.26249999;"
+ offset="1.0000000"
+ id="stop2775" />
+ </linearGradient>
+ <linearGradient
+ id="light75to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.72916669;"
+ offset="0.0000000"
+ id="stop2769" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2770" />
+ </linearGradient>
+ <linearGradient
+ id="light100to0">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2764" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.0000000;"
+ offset="1.0000000"
+ id="stop2765" />
+ </linearGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="bluelighttowhite"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#69d3ff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop6078" />
+ <stop
+ style="stop-color:#edffff;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop6080" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="bluelightlesstoblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop3468" />
+ <stop
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;"
+ offset="0.24089479"
+ id="stop3469" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3470" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="bluelignonlinblu"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop84" />
+ <stop
+ style="stop-color:#95d9ff;stop-opacity:1.0000000;"
+ offset="0.13480000"
+ id="stop86" />
+ <stop
+ style="stop-color:#68b9ff;stop-opacity:1.0000000;"
+ offset="0.32049999"
+ id="stop88" />
+ <stop
+ style="stop-color:#3293fe;stop-opacity:1.0000000;"
+ offset="0.56800002"
+ id="stop90" />
+ <stop
+ style="stop-color:#107bfe;stop-opacity:1.0000000;"
+ offset="0.75340003"
+ id="stop92" />
+ <stop
+ style="stop-color:#0372fe;stop-opacity:1.0000000;"
+ offset="0.85390002"
+ id="stop94" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop96" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="blueligtmoretoblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#d9ffff;stop-opacity:1.0000000;"
+ offset="0.0055999998"
+ id="stop3457" />
+ <stop
+ style="stop-color:#6eaafe;stop-opacity:1.0000000;"
+ offset="0.74217570"
+ id="stop3465" />
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3463" />
+ </radialGradient>
+ <radialGradient
+ cx="38.797401"
+ cy="112.96090"
+ r="67.358803"
+ fx="38.797401"
+ fy="112.96090"
+ id="bluedarktoblackblue"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ style="stop-color:#0356fe;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2959" />
+ <stop
+ style="stop-color:#032442;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2960" />
+ </radialGradient>
+ <linearGradient
+ id="greantodarkgrean">
+ <stop
+ style="stop-color:#00ff01;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop5123" />
+ <stop
+ style="stop-color:#15980f;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop5124" />
+ </linearGradient>
+ <linearGradient
+ id="greandraktoblack">
+ <stop
+ style="stop-color:#007c00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop7328" />
+ <stop
+ style="stop-color:#025a00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop7329" />
+ </linearGradient>
+ <linearGradient
+ id="greandarktobgrean">
+ <stop
+ style="stop-color:#00ad01;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop4492" />
+ <stop
+ style="stop-color:#15720f;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop4493" />
+ </linearGradient>
+ <linearGradient
+ id="redtodarkred">
+ <stop
+ style="stop-color:#ff0000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3856" />
+ <stop
+ style="stop-color:#920000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3855" />
+ </linearGradient>
+ <linearGradient
+ id="reddarktoblack">
+ <stop
+ style="stop-color:#8e0000;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop3230" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop3231" />
+ </linearGradient>
+ <linearGradient
+ id="orangetoblackorange">
+ <stop
+ style="stop-color:#ff8b00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop4207" />
+ <stop
+ style="stop-color:#4d0200;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop4209" />
+ </linearGradient>
+ <linearGradient
+ id="orangelesstoyelow">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2689" />
+ <stop
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;"
+ offset="0.25358382"
+ id="stop2690" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2691" />
+ </linearGradient>
+ <linearGradient
+ id="orangemoretoyelow">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2671" />
+ <stop
+ style="stop-color:#ffbe00;stop-opacity:1.0000000;"
+ offset="0.74641621"
+ id="stop2679" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2672" />
+ </linearGradient>
+ <linearGradient
+ id="orangetoyelow">
+ <stop
+ style="stop-color:#ff7d00;stop-opacity:1.0000000;"
+ offset="0.0000000"
+ id="stop2661" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop2662" />
+ </linearGradient>
+ <linearGradient
+ x1="-1.9488534e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2754"
+ collect="always"
+ xlink:href="#bluelignonlinblu" />
+ <linearGradient
+ x1="-3.3718688e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2755"
+ collect="always"
+ xlink:href="#orangetoyelow" />
+ <linearGradient
+ x1="-1.3227267e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2756"
+ collect="always"
+ xlink:href="#orangemoretoyelow" />
+ <linearGradient
+ x1="-6.9931040e-18"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2757"
+ collect="always"
+ xlink:href="#orangelesstoyelow" />
+ <linearGradient
+ x1="2.0274581e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2766"
+ collect="always"
+ xlink:href="#light100to0" />
+ <linearGradient
+ x1="5.6270093e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2771"
+ collect="always"
+ xlink:href="#light75to0" />
+ <linearGradient
+ x1="9.2265605e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2776"
+ collect="always"
+ xlink:href="#light75to25" />
+ <linearGradient
+ x1="1.2826112e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2781"
+ collect="always"
+ xlink:href="#light100to75to0" />
+ <linearGradient
+ x1="-6.5594231e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient2788"
+ collect="always"
+ xlink:href="#light100to25to0" />
+ <linearGradient
+ x1="0.0036900369"
+ y1="0.57142860"
+ x2="1.0000000"
+ y2="0.56802720"
+ id="linearGradient2794"
+ collect="always"
+ xlink:href="#light50to25to7" />
+ <linearGradient
+ x1="6.8293895e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3427"
+ collect="always"
+ xlink:href="#shadow100to0" />
+ <linearGradient
+ x1="-0.0092250919"
+ y1="0.55782312"
+ x2="0.99077493"
+ y2="0.55782312"
+ id="linearGradient3431"
+ collect="always"
+ xlink:href="#sadow75to0w" />
+ <linearGradient
+ x1="-3.5182360e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3435"
+ collect="always"
+ xlink:href="#shadow25to25w" />
+ <linearGradient
+ x1="-3.1582809e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3440"
+ collect="always"
+ xlink:href="#shadow0wto25to0" />
+ <linearGradient
+ x1="-5.0968344e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3445"
+ collect="always"
+ xlink:href="#shadow25tolineto0" />
+ <linearGradient
+ x1="-3.3474742e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3464"
+ collect="always"
+ xlink:href="#blueligtmoretoblue" />
+ <linearGradient
+ x1="-4.7460950e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3471"
+ collect="always"
+ xlink:href="#bluelightlesstoblue" />
+ <linearGradient
+ x1="-5.4454054e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3080"
+ collect="always"
+ xlink:href="#greantodarkgrean" />
+ <linearGradient
+ x1="-6.9931040e-18"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient3704"
+ collect="always"
+ xlink:href="#greandarktobgrean" />
+ <linearGradient
+ x1="-2.0979312e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient4471"
+ collect="always"
+ xlink:href="#redtodarkred" />
+ <linearGradient
+ x1="-3.4965520e-17"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000"
+ id="linearGradient4473"
+ collect="always"
+ xlink:href="#reddarktoblack" />
+ <linearGradient
+ x1="0.016544119"
+ y1="0.46428570"
+ x2="0.99264705"
+ y2="0.46428570"
+ id="linearGradient782"
+ xlink:href="#graytoblack" />
+ <linearGradient
+ x1="0.016544119"
+ y1="0.46428570"
+ x2="0.99264705"
+ y2="0.46428570"
+ id="linearGradient5103"
+ collect="always"
+ xlink:href="#graytolightgray" />
+ <linearGradient
+ x1="0.016544119"
+ y1="0.46428570"
+ x2="0.99264705"
+ y2="0.46428570"
+ id="linearGradient5108"
+ collect="always"
+ xlink:href="#garylighttowite" />
+ <linearGradient
+ x1="0.016544119"
+ y1="0.46428570"
+ x2="0.99264705"
+ y2="0.46428570"
+ id="linearGradient9077"
+ collect="always"
+ xlink:href="#blacktowhite" />
+ <linearGradient
+ id="linearGradient581"
+ xlink:href="#bluedarktoblackblue"
+ x1="4.3021142e-16"
+ y1="0.50000000"
+ x2="1.0000000"
+ y2="0.50000000" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1222"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.053976,0,0,0.948788,-5.933544,5.34019)"
+ spreadMethod="reflect"
+ x1="75.412579"
+ y1="59.381731"
+ x2="285.12177"
+ y2="300.40905" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1224"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.056051,0,0,0.946924,-5.933544,5.34019)"
+ spreadMethod="reflect"
+ x1="78.528797"
+ y1="65.382599"
+ x2="280.66960"
+ y2="297.71126" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1225"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.746283,0,0,1.339974,-5.933544,5.34019)"
+ x1="250.67159"
+ y1="-21.820315"
+ x2="152.95656"
+ y2="105.15331" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to25to0"
+ id="radialGradient1226"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.746344,0,0,1.339864,-5.933544,5.34019)"
+ cx="408.92502"
+ cy="209.99586"
+ fx="408.92502"
+ fy="209.99586"
+ r="181.02384" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient1227"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.278924,0,0,0.781908,-5.933544,5.34019)"
+ x1="18.809567"
+ y1="232.78678"
+ x2="58.429586"
+ y2="296.31726" />
+ <linearGradient
+ y2="16.398424"
+ x2="13.153853"
+ y1="11.521504"
+ x1="2.1610777"
+ gradientTransform="matrix(0.984657,0,0,0.972908,16.11774,-2.514927)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2246"
+ xlink:href="#linearGradient2228"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="6.4625802"
+ x2="13.514696"
+ y1="16.332613"
+ x1="21.102264"
+ gradientTransform="matrix(1.461537,0,0,1.461537,-1.46152,-0.155237)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2244"
+ xlink:href="#linearGradient3111"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="16.398424"
+ x2="13.153853"
+ y1="11.521504"
+ x1="2.1610777"
+ gradientTransform="matrix(0.984657,0,0,0.972908,16.11774,-2.514927)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient2238"
+ xlink:href="#linearGradient2228"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientTransform="matrix(0.984657,0,0,0.972908,-0.39266,-0.17807)"
+ gradientUnits="userSpaceOnUse"
+ y2="16.398424"
+ x2="13.153853"
+ y1="11.521504"
+ x1="2.1610777"
+ id="linearGradient2234"
+ xlink:href="#linearGradient2228"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientTransform="matrix(1.461537,0,0,1.461537,-1.46152,-0.155237)"
+ gradientUnits="userSpaceOnUse"
+ y2="6.4625802"
+ x2="13.514696"
+ y1="16.332613"
+ x1="21.102264"
+ id="linearGradient1516"
+ xlink:href="#linearGradient3111"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient1510">
+ <stop
+ id="stop1512"
+ offset="0"
+ style="stop-color:#59a6ff;stop-opacity:1;" />
+ <stop
+ id="stop1514"
+ offset="1"
+ style="stop-color:#a9d7ff;stop-opacity:1;" />
+ </linearGradient>
+ <linearGradient
+ gradientTransform="matrix(1.439113,0,0,1.421941,13.99909,-1.751571)"
+ gradientUnits="userSpaceOnUse"
+ y2="10.812185"
+ x2="-7.1243687"
+ y1="15.499685"
+ x1="-0.56291676"
+ id="linearGradient1508"
+ xlink:href="#linearGradient3082"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient1502">
+ <stop
+ id="stop1504"
+ offset="0"
+ style="stop-color:#fab100;stop-opacity:1;" />
+ <stop
+ id="stop1506"
+ offset="1"
+ style="stop-color:#ffff00;stop-opacity:1;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2228"
+ inkscape:collect="always">
+ <stop
+ id="stop2230"
+ offset="0"
+ style="stop-color:#ffffff;stop-opacity:1;" />
+ <stop
+ id="stop2232"
+ offset="1"
+ style="stop-color:#ffffff;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3082"
+ id="linearGradient1676"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(10.00042,-1.000371)"
+ x1="-0.56291676"
+ y1="15.499685"
+ x2="-7.1243687"
+ y2="10.812185" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2228"
+ id="linearGradient1687"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.984657,0,0,0.972908,3.047962,-55.33188)"
+ x1="2.1610777"
+ y1="11.521504"
+ x2="13.153853"
+ y2="16.398424" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3082"
+ id="linearGradient1690"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(13.44104,-56.15418)"
+ x1="-0.56291676"
+ y1="15.499685"
+ x2="-7.1243687"
+ y2="10.812185" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1695"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.053976,0,0,0.948788,-5.933544,5.34019)"
+ spreadMethod="reflect"
+ x1="75.412579"
+ y1="59.381731"
+ x2="285.12177"
+ y2="300.40905" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1697"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.056051,0,0,0.946924,-5.933544,5.34019)"
+ spreadMethod="reflect"
+ x1="78.528797"
+ y1="65.382599"
+ x2="280.66960"
+ y2="297.71126" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#greantodarkgrean"
+ id="linearGradient1699"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.746283,0,0,1.339974,-5.933544,5.34019)"
+ x1="250.67159"
+ y1="-21.820315"
+ x2="152.95656"
+ y2="105.15331" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#light100to25to0"
+ id="radialGradient1701"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.746344,0,0,1.339864,-5.933544,5.34019)"
+ cx="408.92502"
+ cy="209.99586"
+ fx="408.92502"
+ fy="209.99586"
+ r="181.02384" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#light100to0"
+ id="linearGradient1703"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.278924,0,0,0.781908,-5.933544,5.34019)"
+ x1="18.809567"
+ y1="232.78678"
+ x2="58.429586"
+ y2="296.31726" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3111"
+ id="linearGradient1705"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.461537,0,0,1.461537,-1.46152,-0.155237)"
+ x1="21.102264"
+ y1="16.332613"
+ x2="13.514696"
+ y2="6.4625802" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2228"
+ id="linearGradient1707"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.984657,0,0,0.972908,16.11774,-2.514927)"
+ x1="2.1610777"
+ y1="11.521504"
+ x2="13.153853"
+ y2="16.398424" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="21.53956"
+ inkscape:cx="11.725308"
+ inkscape:cy="-4.5482538"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1084"
+ inkscape:window-height="864"
+ inkscape:window-x="79"
+ inkscape:window-y="222" />
+ <metadata
+ id="metadata1321">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true">
+ <rect
+ style="opacity:1;fill:url(#linearGradient3088);fill-opacity:1;fill-rule:nonzero;stroke:#b86920;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect1334"
+ width="8.0010481"
+ height="6.0013709"
+ x="1.5"
+ y="8.4986248"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true" />
+ <rect
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ y="6.5014348"
+ x="12.5"
+ height="9.9985628"
+ width="7.9999771"
+ id="rect3103"
+ style="opacity:1;fill:url(#linearGradient3117);fill-opacity:1;fill-rule:nonzero;stroke:#166cd4;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:0.70642203;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ d="M 2 9 L 2 10 L 2 14 L 3 14 L 3 10 L 9 10 L 9 9 L 2 9 z "
+ id="rect3121" />
+ <path
+ id="path3126"
+ d="M 13,7 L 13,8 L 13,16 L 14,16 L 14,8 L 20,8 L 20,7 L 13,7 z "
+ style="opacity:1;fill:#ffffff;fill-opacity:0.70642204;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ sodipodi:nodetypes="cccccccc" />
+ <rect
+ style="opacity:1;fill:#4c4465;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ id="rect3119"
+ width="22"
+ height="1"
+ x="-1.3322676e-15"
+ y="11"
+ inkscape:r_cx="true"
+ inkscape:r_cy="true"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <rect
+ inkscape:r_cy="true"
+ inkscape:r_cx="true"
+ y="-11.000004"
+ x="0"
+ height="1"
+ width="22"
+ id="rect1331"
+ style="opacity:1;fill:#4c4465;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:4;stroke-opacity:1"
+ transform="matrix(0,1,-1,0,0,0)" />
+ </g>
+</svg>
diff --git a/kpresenter/toolbar/cr22-action-arrange.png b/kpresenter/toolbar/cr22-action-arrange.png
new file mode 100644
index 000000000..670ba7612
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-arrange.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-autoform.png b/kpresenter/toolbar/cr22-action-autoform.png
new file mode 100644
index 000000000..be08fb609
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-autoform.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-cakes.png b/kpresenter/toolbar/cr22-action-cakes.png
new file mode 100644
index 000000000..4c4c61241
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-cakes.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-cakes3d.png b/kpresenter/toolbar/cr22-action-cakes3d.png
new file mode 100644
index 000000000..66364472f
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-cakes3d.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-circle.png b/kpresenter/toolbar/cr22-action-circle.png
new file mode 100644
index 000000000..4d317fd7b
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-circle.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-closed_cubicbeziercurve.png b/kpresenter/toolbar/cr22-action-closed_cubicbeziercurve.png
new file mode 100644
index 000000000..2b30a8eb2
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-closed_cubicbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-closed_freehand.png b/kpresenter/toolbar/cr22-action-closed_freehand.png
new file mode 100644
index 000000000..a696ec29f
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-closed_freehand.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-closed_polyline.png b/kpresenter/toolbar/cr22-action-closed_polyline.png
new file mode 100644
index 000000000..a1bc085f4
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-closed_polyline.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-closed_quadricbeziercurve.png b/kpresenter/toolbar/cr22-action-closed_quadricbeziercurve.png
new file mode 100644
index 000000000..6060284b4
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-closed_quadricbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-cubicbeziercurve.png b/kpresenter/toolbar/cr22-action-cubicbeziercurve.png
new file mode 100644
index 000000000..7de208209
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-cubicbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-edit_picture.png b/kpresenter/toolbar/cr22-action-edit_picture.png
new file mode 100644
index 000000000..6949de585
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-edit_picture.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-edit_pie.png b/kpresenter/toolbar/cr22-action-edit_pie.png
new file mode 100644
index 000000000..70fec8cd7
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-edit_pie.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-edit_polygon.png b/kpresenter/toolbar/cr22-action-edit_polygon.png
new file mode 100644
index 000000000..a9eef7ce7
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-edit_polygon.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-effect.png b/kpresenter/toolbar/cr22-action-effect.png
new file mode 100644
index 000000000..cffe4dbe4
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-effect.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-freehand.png b/kpresenter/toolbar/cr22-action-freehand.png
new file mode 100644
index 000000000..bcd4a8481
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-freehand.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line.png b/kpresenter/toolbar/cr22-action-line.png
new file mode 100644
index 000000000..2e71d2e87
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_arrow_begin.png b/kpresenter/toolbar/cr22-action-line_arrow_begin.png
new file mode 100644
index 000000000..8f1c548d6
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_arrow_begin.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_arrow_end.png b/kpresenter/toolbar/cr22-action-line_arrow_end.png
new file mode 100644
index 000000000..ffa98c507
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_arrow_end.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_begin.png b/kpresenter/toolbar/cr22-action-line_begin.png
new file mode 100644
index 000000000..e4dffe8c2
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_begin.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_circle_begin.png b/kpresenter/toolbar/cr22-action-line_circle_begin.png
new file mode 100644
index 000000000..547b1cd88
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_circle_begin.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_circle_end.png b/kpresenter/toolbar/cr22-action-line_circle_end.png
new file mode 100644
index 000000000..c11665b66
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_circle_end.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_dimension_line_begin.png b/kpresenter/toolbar/cr22-action-line_dimension_line_begin.png
new file mode 100644
index 000000000..ae55517c4
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_dimension_line_begin.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_dimension_line_end.png b/kpresenter/toolbar/cr22-action-line_dimension_line_end.png
new file mode 100644
index 000000000..3027f5d69
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_dimension_line_end.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_double_arrow_begin.png b/kpresenter/toolbar/cr22-action-line_double_arrow_begin.png
new file mode 100644
index 000000000..a7b7307b0
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_double_arrow_begin.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_double_arrow_end.png b/kpresenter/toolbar/cr22-action-line_double_arrow_end.png
new file mode 100644
index 000000000..3c51c18f7
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_double_arrow_end.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_double_line_arrow_begin.png b/kpresenter/toolbar/cr22-action-line_double_line_arrow_begin.png
new file mode 100644
index 000000000..04c20c45b
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_double_line_arrow_begin.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_double_line_arrow_end.png b/kpresenter/toolbar/cr22-action-line_double_line_arrow_end.png
new file mode 100644
index 000000000..bef76a469
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_double_line_arrow_end.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_end.png b/kpresenter/toolbar/cr22-action-line_end.png
new file mode 100644
index 000000000..f6823bab5
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_end.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_line_arrow_begin.png b/kpresenter/toolbar/cr22-action-line_line_arrow_begin.png
new file mode 100644
index 000000000..f7c343063
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_line_arrow_begin.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_line_arrow_end.png b/kpresenter/toolbar/cr22-action-line_line_arrow_end.png
new file mode 100644
index 000000000..10f2a912d
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_line_arrow_end.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_normal_begin.png b/kpresenter/toolbar/cr22-action-line_normal_begin.png
new file mode 100644
index 000000000..cdb9cb1f4
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_normal_begin.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_normal_end.png b/kpresenter/toolbar/cr22-action-line_normal_end.png
new file mode 100644
index 000000000..cdb9cb1f4
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_normal_end.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_rect_begin.png b/kpresenter/toolbar/cr22-action-line_rect_begin.png
new file mode 100644
index 000000000..df2c0371e
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_rect_begin.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-line_rect_end.png b/kpresenter/toolbar/cr22-action-line_rect_end.png
new file mode 100644
index 000000000..b349b9b78
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-line_rect_end.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-mini_autoform.png b/kpresenter/toolbar/cr22-action-mini_autoform.png
new file mode 100644
index 000000000..27df26b79
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-mini_autoform.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-mini_circle.png b/kpresenter/toolbar/cr22-action-mini_circle.png
new file mode 100644
index 000000000..7cbfbacde
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-mini_circle.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-mini_clipart.png b/kpresenter/toolbar/cr22-action-mini_clipart.png
new file mode 100644
index 000000000..13f5f4a5c
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-mini_clipart.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-mini_line.png b/kpresenter/toolbar/cr22-action-mini_line.png
new file mode 100644
index 000000000..7999039eb
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-mini_line.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-mini_pie.png b/kpresenter/toolbar/cr22-action-mini_pie.png
new file mode 100644
index 000000000..8a6dbb7d0
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-mini_pie.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-mini_polygon.png b/kpresenter/toolbar/cr22-action-mini_polygon.png
new file mode 100644
index 000000000..007e6a7e1
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-mini_polygon.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-mini_rect.png b/kpresenter/toolbar/cr22-action-mini_rect.png
new file mode 100644
index 000000000..7dc48fde5
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-mini_rect.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_style.png b/kpresenter/toolbar/cr22-action-pen_style.png
new file mode 100644
index 000000000..ef1829492
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_style.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_style_dash.png b/kpresenter/toolbar/cr22-action-pen_style_dash.png
new file mode 100644
index 000000000..1a6aedf4e
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_style_dash.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_style_dashdot.png b/kpresenter/toolbar/cr22-action-pen_style_dashdot.png
new file mode 100644
index 000000000..c1d549896
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_style_dashdot.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_style_dashdotdot.png b/kpresenter/toolbar/cr22-action-pen_style_dashdotdot.png
new file mode 100644
index 000000000..3d7274f1a
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_style_dashdotdot.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_style_dot.png b/kpresenter/toolbar/cr22-action-pen_style_dot.png
new file mode 100644
index 000000000..4697b669c
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_style_dot.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_style_nopen.png b/kpresenter/toolbar/cr22-action-pen_style_nopen.png
new file mode 100644
index 000000000..36b54b354
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_style_nopen.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_style_solid.png b/kpresenter/toolbar/cr22-action-pen_style_solid.png
new file mode 100644
index 000000000..80edf8a82
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_style_solid.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width.png b/kpresenter/toolbar/cr22-action-pen_width.png
new file mode 100644
index 000000000..1895feca6
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width1.png b/kpresenter/toolbar/cr22-action-pen_width1.png
new file mode 100644
index 000000000..80edf8a82
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width1.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width10.png b/kpresenter/toolbar/cr22-action-pen_width10.png
new file mode 100644
index 000000000..9e919e040
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width10.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width2.png b/kpresenter/toolbar/cr22-action-pen_width2.png
new file mode 100644
index 000000000..2c2f51f84
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width2.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width3.png b/kpresenter/toolbar/cr22-action-pen_width3.png
new file mode 100644
index 000000000..0446ee72a
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width3.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width4.png b/kpresenter/toolbar/cr22-action-pen_width4.png
new file mode 100644
index 000000000..5295e7a2a
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width4.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width5.png b/kpresenter/toolbar/cr22-action-pen_width5.png
new file mode 100644
index 000000000..1954d518b
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width5.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width6.png b/kpresenter/toolbar/cr22-action-pen_width6.png
new file mode 100644
index 000000000..dfdf829ab
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width6.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width7.png b/kpresenter/toolbar/cr22-action-pen_width7.png
new file mode 100644
index 000000000..0c0491b41
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width7.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width8.png b/kpresenter/toolbar/cr22-action-pen_width8.png
new file mode 100644
index 000000000..64de3cb27
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width8.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pen_width9.png b/kpresenter/toolbar/cr22-action-pen_width9.png
new file mode 100644
index 000000000..a0332447d
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pen_width9.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-penbrush.png b/kpresenter/toolbar/cr22-action-penbrush.png
new file mode 100644
index 000000000..66989e8c9
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-penbrush.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pgnum.png b/kpresenter/toolbar/cr22-action-pgnum.png
new file mode 100644
index 000000000..c176d3835
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pgnum.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-pie.png b/kpresenter/toolbar/cr22-action-pie.png
new file mode 100644
index 000000000..d3a04d5dc
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-pie.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-polygon.png b/kpresenter/toolbar/cr22-action-polygon.png
new file mode 100644
index 000000000..e090fc870
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-polygon.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-polyline.png b/kpresenter/toolbar/cr22-action-polyline.png
new file mode 100644
index 000000000..cee7ce1e6
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-polyline.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-quadricbeziercurve.png b/kpresenter/toolbar/cr22-action-quadricbeziercurve.png
new file mode 100644
index 000000000..69ba6e234
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-quadricbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-rectangle.png b/kpresenter/toolbar/cr22-action-rectangle.png
new file mode 100644
index 000000000..8fb009beb
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-rectangle.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-slide_effect.png b/kpresenter/toolbar/cr22-action-slide_effect.png
new file mode 100644
index 000000000..a2859ce9b
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-slide_effect.png
Binary files differ
diff --git a/kpresenter/toolbar/cr22-action-webpres.png b/kpresenter/toolbar/cr22-action-webpres.png
new file mode 100644
index 000000000..81b3371fb
--- /dev/null
+++ b/kpresenter/toolbar/cr22-action-webpres.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-alignobjs.png b/kpresenter/toolbar/cr32-action-alignobjs.png
new file mode 100644
index 000000000..e60949017
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-alignobjs.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-autoform.png b/kpresenter/toolbar/cr32-action-autoform.png
new file mode 100644
index 000000000..e944e522b
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-autoform.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-circle.png b/kpresenter/toolbar/cr32-action-circle.png
new file mode 100644
index 000000000..926c94feb
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-circle.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-closed_cubicbeziercurve.png b/kpresenter/toolbar/cr32-action-closed_cubicbeziercurve.png
new file mode 100644
index 000000000..1a31809af
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-closed_cubicbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-closed_freehand.png b/kpresenter/toolbar/cr32-action-closed_freehand.png
new file mode 100644
index 000000000..e4596887c
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-closed_freehand.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-closed_polyline.png b/kpresenter/toolbar/cr32-action-closed_polyline.png
new file mode 100644
index 000000000..e92fc50a3
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-closed_polyline.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-closed_quadricbeziercurve.png b/kpresenter/toolbar/cr32-action-closed_quadricbeziercurve.png
new file mode 100644
index 000000000..99879f335
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-closed_quadricbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-cubicbeziercurve.png b/kpresenter/toolbar/cr32-action-cubicbeziercurve.png
new file mode 100644
index 000000000..b27ff70c3
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-cubicbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-effect.png b/kpresenter/toolbar/cr32-action-effect.png
new file mode 100644
index 000000000..07b72743a
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-effect.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-freehand.png b/kpresenter/toolbar/cr32-action-freehand.png
new file mode 100644
index 000000000..9d5f58054
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-freehand.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-line.png b/kpresenter/toolbar/cr32-action-line.png
new file mode 100644
index 000000000..366b1d33d
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-line.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-penbrush.png b/kpresenter/toolbar/cr32-action-penbrush.png
new file mode 100644
index 000000000..efc776886
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-penbrush.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-pie.png b/kpresenter/toolbar/cr32-action-pie.png
new file mode 100644
index 000000000..c86e6630a
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-pie.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-polygon.png b/kpresenter/toolbar/cr32-action-polygon.png
new file mode 100644
index 000000000..c14aaf732
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-polygon.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-polyline.png b/kpresenter/toolbar/cr32-action-polyline.png
new file mode 100644
index 000000000..3f43775b7
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-polyline.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-quadricbeziercurve.png b/kpresenter/toolbar/cr32-action-quadricbeziercurve.png
new file mode 100644
index 000000000..027f28060
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-quadricbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-rectangle.png b/kpresenter/toolbar/cr32-action-rectangle.png
new file mode 100644
index 000000000..d7eb882a9
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-rectangle.png
Binary files differ
diff --git a/kpresenter/toolbar/cr32-action-slide_effect.png b/kpresenter/toolbar/cr32-action-slide_effect.png
new file mode 100644
index 000000000..3b1e658d0
--- /dev/null
+++ b/kpresenter/toolbar/cr32-action-slide_effect.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-alignobjs.png b/kpresenter/toolbar/cr48-action-alignobjs.png
new file mode 100644
index 000000000..ca2d63130
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-alignobjs.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-autoform.png b/kpresenter/toolbar/cr48-action-autoform.png
new file mode 100644
index 000000000..479e1a504
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-autoform.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-circle.png b/kpresenter/toolbar/cr48-action-circle.png
new file mode 100644
index 000000000..af196afcf
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-circle.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-closed_cubicbeziercurve.png b/kpresenter/toolbar/cr48-action-closed_cubicbeziercurve.png
new file mode 100644
index 000000000..a097479e2
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-closed_cubicbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-closed_freehand.png b/kpresenter/toolbar/cr48-action-closed_freehand.png
new file mode 100644
index 000000000..04a92e17f
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-closed_freehand.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-closed_polyline.png b/kpresenter/toolbar/cr48-action-closed_polyline.png
new file mode 100644
index 000000000..b722039a4
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-closed_polyline.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-closed_quadricbeziercurve.png b/kpresenter/toolbar/cr48-action-closed_quadricbeziercurve.png
new file mode 100644
index 000000000..f7b8426c5
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-closed_quadricbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-cubicbeziercurve.png b/kpresenter/toolbar/cr48-action-cubicbeziercurve.png
new file mode 100644
index 000000000..8c58e2568
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-cubicbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-effect.png b/kpresenter/toolbar/cr48-action-effect.png
new file mode 100644
index 000000000..907cb1ce3
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-effect.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-freehand.png b/kpresenter/toolbar/cr48-action-freehand.png
new file mode 100644
index 000000000..1d888d432
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-freehand.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-line.png b/kpresenter/toolbar/cr48-action-line.png
new file mode 100644
index 000000000..984d76986
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-line.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-penbrush.png b/kpresenter/toolbar/cr48-action-penbrush.png
new file mode 100644
index 000000000..1a9f4c38c
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-penbrush.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-pie.png b/kpresenter/toolbar/cr48-action-pie.png
new file mode 100644
index 000000000..46966ac7c
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-pie.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-polygon.png b/kpresenter/toolbar/cr48-action-polygon.png
new file mode 100644
index 000000000..0c3fa0edb
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-polygon.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-polyline.png b/kpresenter/toolbar/cr48-action-polyline.png
new file mode 100644
index 000000000..778b5fd4a
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-polyline.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-quadricbeziercurve.png b/kpresenter/toolbar/cr48-action-quadricbeziercurve.png
new file mode 100644
index 000000000..eac391d3a
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-quadricbeziercurve.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-rectangle.png b/kpresenter/toolbar/cr48-action-rectangle.png
new file mode 100644
index 000000000..5c9607ebc
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-rectangle.png
Binary files differ
diff --git a/kpresenter/toolbar/cr48-action-slide_effect.png b/kpresenter/toolbar/cr48-action-slide_effect.png
new file mode 100644
index 000000000..8f4a1894f
--- /dev/null
+++ b/kpresenter/toolbar/cr48-action-slide_effect.png
Binary files differ