Commit 17c91328 authored by C. Boemann's avatar C. Boemann
Browse files

Correctly merge the text-annotation branch.

    REVIEW: 111914
    FEATURE: Add support for annotations to Words and Author

Squashed commit of the following:

commit c26f5aa2
Merge: 955818d3 bbecfa55
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Nov 30 16:43:30 2013 +0100

    Merge branch 'text-annotation' of git://anongit.kde.org/calligra into text-annotation

commit 955818d3
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Nov 30 16:43:10 2013 +0100

    less qDebug

commit e442fabb
Merge: 0b4be461 d5f3f5dd
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Nov 30 14:07:55 2013 +0100

    Merge branch 'master' into text-annotation

commit bbecfa55
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Sat Nov 30 00:23:25 2013 +0100

    Don't show annotation shapes before they are laid out.

commit 0b4be461
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Nov 29 23:29:12 2013 +0100

    some small additions

commit 61ebd005
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Nov 29 21:06:08 2013 +0100

    Tested undo/redo.  Couldn't make it break or malfunction.

commit 4460fc3e
Merge: 311c6651 a7cf9f9d
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Nov 29 19:16:30 2013 +0100

    Merge branch 'master' into text-annotation

commit 311c6651
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Nov 17 13:36:23 2013 +0100

    Better interactivity

commit e539fb03
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Nov 17 13:36:08 2013 +0100

    more issues we need to fix

commit 72b4545f
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Nov 16 22:18:51 2013 +0100

    Preent inserting tables and annotatios into annotations

commit 7764db70
Merge: 06c65b23 c0243917
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Thu Nov 14 17:58:04 2013 +0100

    Merge branch 'master' into text-annotation

commit 06c65b23
Author: C. Boemann <cbo@boemann.dk>
Date:   Wed Nov 13 22:31:20 2013 +0100

    update todo list

commit 8f04d441
Author: C. Boemann <cbo@boemann.dk>
Date:   Wed Nov 13 00:36:55 2013 +0100

    Make the annotation commands work

commit 36b4d39e
Author: C. Boemann <cbo@boemann.dk>
Date:   Tue Nov 12 22:59:59 2013 +0100

    Fix option widget layout
    and
    Fix a warning

commit 3528cca0
Author: C. Boemann <cbo@boemann.dk>
Date:   Tue Nov 12 22:49:34 2013 +0100

    bum words.rc version since we have added a new item

commit ad1f9ff4
Author: C. Boemann <cbo@boemann.dk>
Date:   Tue Nov 12 22:33:49 2013 +0100

    Adding annotation is now undoable
     well except that the sidepanel doesn't disappear when the last annotation disappears

commit 327899b9
Merge: df156909 35fea766
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Tue Nov 12 22:08:46 2013 +0100

    Merge branch 'master' into text-annotation

commit df156909
Author: C. Boemann <cbo@boemann.dk>
Date:   Tue Nov 12 21:28:21 2013 +0100

    First steps on making deleting annotations undoable

commit 6771a211
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Nov 10 22:09:43 2013 +0100

    Also call the buttons "Comment" rather than "Note" and change the implementation to use actions

commit 584accff
Merge: 1e7c4fcf b60307ae
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Nov 10 18:01:51 2013 +0100

    Merge branch 'master' into text-annotation

commit 1e7c4fcf
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Wed Nov 6 19:43:15 2013 +0100

    Fix a couple of issues from the RR.

commit aa69ffc4
Merge: e52aa4f1 499f472d
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Wed Nov 6 18:23:41 2013 +0100

    Merge branch 'master' into text-annotation

    Reason: new review request

commit e52aa4f1
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Wed Nov 6 00:38:41 2013 +0330

    Put insert Annotation action in TextTool and set a shortcut for it.

commit 65f0e5b8
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Nov 5 22:27:13 2013 +0330

    Update Annotation_TODO

commit 533d8569
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Nov 5 22:22:55 2013 +0330

    Update Annotatio_TODO

commit 160c5efb
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Nov 5 22:01:58 2013 +0330

    Fix the saving of annotations date format.

commit 51c8c680
Merge: 91ed060a 1ae029d7
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Nov 5 21:42:45 2013 +0330

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

commit 1ae029d7
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Tue Nov 5 18:31:38 2013 +0100

    Guard against layout of annotations before the canvas is created.

commit 91ed060a
Merge: 5fb42a6c 6817ebef
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Nov 5 18:21:19 2013 +0330

    Merge remote-tracking branch 'origin/master' into text-annotation

commit 5fb42a6c
Merge: 3f47155b 9fcbee18
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Tue Nov 5 13:46:13 2013 +0100

    Merge branch 'master' into text-annotation

    Conflicts:
    	words/part/KWDocument.cpp
    	words/part/KWDocument.h

commit 3f47155b
Merge: 726d9d30 3dcbac5f
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Sun Sep 8 10:16:14 2013 +0200

    Merge branch 'master' into text-annotation

commit 726d9d30
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Fri Aug 30 15:13:47 2013 +0430

    Use ++it instead it++.

commit 9664cf48
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Fri Aug 30 00:09:01 2013 +0430

    Fix problem calligra freezed at saving.

commit e10f038f
Merge: b9a4b450 0c794069
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu Aug 29 23:34:49 2013 +0430

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

commit b9a4b450
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu Aug 29 23:33:52 2013 +0430

    Fixed issues in review.

commit 0c794069
Merge: ed8a4b0e e5a6ce1d
Author: C. Boemann <cbo@boemann.dk>
Date:   Thu Aug 29 21:01:12 2013 +0200

    Merge branch 'master' into text-annotation

commit ed8a4b0e
Author: C. Boemann <cbo@boemann.dk>
Date:   Thu Aug 29 20:45:47 2013 +0200

    Fix APIDox

commit e126b136
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Aug 17 11:16:27 2013 +0200

    Make the text tool report it being able to work with annotation shapes too

commit 5cc41fb4
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 27 21:49:32 2013 +0430

    Update annotations layout and connection lines when an anntation deleted.

commit 31fb81f2
Merge: 9b6eb154 52daa7f8
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 27 21:33:06 2013 +0430

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

commit 9b6eb154
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 27 21:24:21 2013 +0430

    Fix updating line connections, update whole of canvas.

commit 52daa7f8
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Aug 23 10:32:11 2013 +0200

    Add to TODO

commit 3b3f261e
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Fri Aug 23 12:57:45 2013 +0430

    Update the line conncetions between annotation shape and ref text between the outlinerect of page and textarea when y ref position changed.

commit 16e6ec34
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Thu Aug 22 07:24:28 2013 +0200

    Make the UI show "Notes" everywhere, not "Annotations"

commit b1889365
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Wed Aug 21 20:47:45 2013 +0200

    Get rid of annoying debug messages.

commit 869432ab
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Wed Aug 21 20:42:11 2013 +0200

    Make the annotation area continuous even at page breaks.

commit 114c0f1e
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Mon Aug 19 01:11:53 2013 +0200

    Better handling of constants todo with annotations.

     - annotation area width moved from KWView to KWCanvasBase
     - constants in the annotation shape are now constants, not magic numbers.

     - Also updated TODO-ANNOTATIONS

commit fd3ad2cd
Merge: 34dedb71 9c36e72c
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Aug 17 10:52:52 2013 +0200

    Merge branch 'master' into text-annotation

commit 34dedb71
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Aug 17 10:29:01 2013 +0200

    Revert "Make sure the cursor is painted at the right position when textshape has padding"

    This reverts commit 4703e59e.

commit c856608e
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Aug 17 10:17:07 2013 +0200

    Make the line to the annotation point to the correct textposition
     it used to just point to topLeft of the paragraph

commit 8b9fc663
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Aug 16 20:22:10 2013 +0200

     * Two small changes for annotations
        - Support meta:date-string
        - some simplification of loading.

commit f88fb2cd
Merge: ff594951 bc03d30d
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Aug 16 17:47:43 2013 +0200

    Merge branch 'master' into text-annotation

commit ff594951
Merge: 2498fd6c d4e4b5c3
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Thu Aug 15 19:24:35 2013 +0200

    Merge branch 'master' into text-annotation

commit 2498fd6c
Merge: cc891a94 474104e1
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Thu Aug 15 19:24:26 2013 +0200

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

    Conflicts:
    	libs/flake/KoShapeManager.cpp
    	libs/kotext/KoTextEditor.h
    	libs/kotext/opendocument/KoTextLoader.cpp
    	plugins/textshape/dialogs/SimpleAnnotationWidget.cpp

commit cc891a94
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Thu Aug 15 19:19:07 2013 +0200

    Fix some minor things pointed out in initial review.

commit 474104e1
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu Aug 15 13:39:54 2013 +0430

    Some cleanup.

commit 0f42698e
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu Aug 15 01:55:36 2013 +0430

    Fix save annotation method.

commit 24449c13
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Wed Aug 14 18:56:07 2013 +0430

    writes <office:annotation-end> before <office:annotation> problem Fixed.

commit 6c953a86
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Wed Aug 14 16:24:36 2013 +0430

    Disconnect in right place.

commit f38f4c2c
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Wed Aug 14 15:55:32 2013 +0430

    expanded shape doesn't move down other shapes Fixed.

commit ef4ec092
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Tue Aug 13 17:57:53 2013 +0200

    Update the buglist

commit e9396a82
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Tue Aug 13 14:13:39 2013 +0200

    Save office:annotation, not text:annotation.

commit 347fbc6d
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 6 16:26:43 2013 +0430

    Fix saving date problem.

commit b9c2c8fb
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 6 14:43:21 2013 +0430

    Save the date value.

commit 6ff15b11
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 6 14:32:31 2013 +0430

    Update TODO list.

commit 991474a2
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 6 14:18:40 2013 +0430

    Use local date for annotation date format.

commit 14021b9f
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 6 14:07:32 2013 +0430

    Clear KoAnnotation class.

commit 8119b38b
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 6 03:48:32 2013 +0430

    Set new size and new position for annotation shapes.

commit efa172e4
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Aug 6 03:01:19 2013 +0430

    paint connection lines with new path and new style.

commit 83f53b29
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Mon Aug 5 17:44:31 2013 +0430

    Set Creator and Date for annotation shape  that user insert.

commit e57f9f67
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sun Aug 4 14:23:01 2013 +0430

    Paint connections between text and annotation shape.

commit de296ec5
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat Aug 3 15:34:03 2013 +0430

    Fix annotation background according to new chnages in master.

commit f24fd7c3
Merge: b00d243b 221b8b6d
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat Aug 3 14:37:00 2013 +0430

    Merge remote-tracking branch 'origin/master' into text-annotation

    Conflicts:
    	libs/flake/KoShape.h

commit b00d243b
Author: Timothée Giet <animtim@gmail.com>
Date:   Tue Jul 30 16:41:35 2013 +0200

    Revert "Properly fix the maskWidth/maskHeight problem"

    This reverts commit 2c30521e.
    which introduced bad precision regression.

commit 5648f5f7
Author: C. Boemann <cbo@boemann.dk>
Date:   Mon Jul 29 11:45:49 2013 +0200

    Fix crash

    BUG: 319155

commit 01c88711
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Tue Jul 30 15:25:45 2013 +0400

    Added an option for disabling Anisotropic Spacing

commit 9300bc7a
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Tue Jul 30 14:41:34 2013 +0400

    Removed now unused methods x/ySpacing() of KisBrush

commit 8ba9ca54
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Tue Jul 30 13:52:12 2013 +0400

    PaintOps overriding paintLine() need not return spacing

commit 949f0ea2
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Tue Jul 30 13:50:48 2013 +0400

    Implemented anisotropic spacing for the Krita brushes

    Now if you change the 'ratio' option the brush, the horizontal
    and vertical spacing will be relative to the width and height of the
    brush correspondingly.

    This effect is achieved by used equation of a ellipse. When the
    cumulative 'distance' value grows out of the ellipse defined by the
    spacing values, a new dab is painted.

    BUG:276465

commit 72d1ab18
Author: Boudewijn Rempt <boud@valdyas.org>
Date:   Mon Jul 29 13:54:19 2013 +0200

    Wrap KoShapeBackground in QSharedPointer

    This patch wraps KoShapeBackground in a QPointer instead of doing manual
    refcounting. Bug 321714 shows, imo, that the manual refcounting is
    fragile and sometimes breaks. I don't remember why we weren't supposed
    to use QPointer (other than that it gets a little ugly with subclassing),
    but it seems a good fit here.

    There are other classes that do manual refcounting, and I think those
    should be converted, too -- but in another patch.

commit 41febefa
Author: Matus Uzak <matus.uzak@gmail.com>
Date:   Mon Jul 29 16:32:38 2013 +0200

    docx: Added support for bidi el. (Right to Left Section Layout).

    Changed interpretation of values of the jc element: In order to
    support different writing modes, left and right should be
    interpreted as start and end respectively.

    Reverted 36531721

    CCBUG:286971

commit f0706f09
Author: Boudewijn Rempt <boud@valdyas.org>
Date:   Mon Jul 29 12:59:29 2013 +0200

    BUG: 322940

    Don't create and try to update empty tiles.

commit 950ca205
Author: Jos van den Oever <jos@vandenoever.info>
Date:   Mon Jul 29 12:06:52 2013 +0200

    Speed up conversion from ppt to odp by not compressing png and jpg files.

commit 8f954101
Author: Boudewijn Rempt <boud@valdyas.org>
Date:   Sun Jul 28 12:04:39 2013 +0200

    Activate the right texture units

commit 232b0aa5
Author: Boudewijn Rempt <boud@valdyas.org>
Date:   Sat Jul 27 12:15:12 2013 +0200

    Revert "Wrap KoShapeBackground in QPointer"

    This reverts commit dcecbd47.

commit b6b528b7
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Fri Aug 2 22:22:19 2013 +0430

    Add an action that let user show or hide annotation area, annotation area will automatically shown after inserting an annotation shape.

commit b7d1f9a3
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Fri Aug 2 14:51:13 2013 +0430

    Fix problem, freezing after insert select annotation.

commit 5bbf9f52
Author: C. Boemann <cbo@boemann.dk>
Date:   Mon Jul 29 11:13:33 2013 +0200

    Place annotations releative to their placement in the text

    there is a bug however, adding more than one annotation will freeze words

commit 6f2c0200
Merge: 292c1f25 4703e59e
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Jul 28 12:09:33 2013 +0200

    Merge remote-tracking branch 'origin' into text-annotation

commit 292c1f25
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Jul 28 11:57:22 2013 +0200

    qDebugg--
    and make sure we actually clip so we don't draw too much

commit 993f7b5a
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Jul 28 10:36:34 2013 +0200

    Fix annotation shape not updating when typing in it

    also removed the annotationshape:paintcomponent mpl as the Textshape ditto is good enough

commit 2ffc0222
Merge: e71ff654 37dbe678
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Jul 27 20:32:04 2013 +0200

    Merge branch 'text-annotation' of git://anongit.kde.org/calligra into text-annotation

    Conflicts:
    	words/part/KWView.cpp

commit e71ff654
Merge: 64ef3326 19953b1f
Author: C. Boemann <cbo@boemann.dk>
Date:   Sat Jul 27 20:21:53 2013 +0200

    Merge remote-tracking branch 'origin' into text-annotation

    Conflicts:
    	words/part/KWView.cpp

commit 37dbe678
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Mon Jul 1 11:15:45 2013 +0700

    Add another issue

commit 69a6f5ce
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Jun 28 11:39:32 2013 +0700

    Found some more bugs

commit 08dec667
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Jun 28 10:23:30 2013 +0700

    Add a TODO and an informational file to the branch.

    These are only usable during the development and should be removed
    before merging to master.

commit ee481f99
Merge: d4a75b50 a8961144
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Mon Jun 24 10:52:47 2013 +0700

    Merge branch 'master' into text-annotation

commit d4a75b50
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat Jun 22 15:44:25 2013 +0430

    Anchor the text that annotation shape is referenced to it when user select on an annotation shape.

commit bf66b6a3
Merge: 62738e6b 5a4fdc60
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu Jun 20 15:48:56 2013 +0430

    Merge remote-tracking branch 'origin/master' into text-annotation

commit 62738e6b
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Fri May 31 21:15:07 2013 +0430

    Disable delete and option button at annotatio shape.

commit e3ef1abb
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu May 30 23:55:59 2013 +0430

    Text shape can shrink just for annotation shapes.

commit 771044c1
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat May 25 00:28:22 2013 +0430

    Fix conflicts.

commit d8418d61
Merge: 56b90b38 683ebc2c
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat May 25 00:07:06 2013 +0430

    Merge remote-tracking branch 'origin/master' into text-annotation

    Conflicts:
    	words/part/KWView.cpp

commit 56b90b38
Merge: f67dffc4 5e06af99
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu May 2 22:02:17 2013 +0430

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

commit f67dffc4
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu May 2 21:49:35 2013 +0430

    Sort the list of annotations in map to thrier reference position.

commit 5e06af99
Merge: 72d5de72 c6844960
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Mon Apr 29 18:44:49 2013 +0200

    Merge branch 'master' into text-annotation

commit 72d5de72
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat Apr 27 20:57:49 2013 +0430

    Fix problem about showing loaded annotation.

commit 64ef3326
Author: C. Boemann <cbo@boemann.dk>
Date:   Mon Apr 22 22:52:00 2013 +0200

    make the layout of annotations actually be called

commit 9268c12c
Merge: f4d2c6a9 11f9fba7
Author: C. Boemann <cbo@boemann.dk>
Date:   Mon Apr 22 16:45:18 2013 +0200

    Merge branch 'text-annotation' of git://anongit.kde.org/calligra into text-annotation

commit f4d2c6a9
Author: C. Boemann <cbo@boemann.dk>
Date:   Thu Apr 18 00:41:38 2013 +0200

    some changes to the way layout of annotation shapes takes place

commit 11f9fba7
Merge: c1ec6366 e3a1b70e
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Apr 19 19:42:45 2013 +0200

    Merge branch 'master' into text-annotation

commit c1ec6366
Merge: e1c30d47 9ef0d14c
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Apr 16 22:58:15 2013 +0430

    Merge remote-tracking branch 'origin/master' into text-annotation

    Conflicts:
    	plugins/textshape/CMakeLists.txt

commit e1c30d47
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Wed Apr 10 13:00:36 2013 +0430

    Add Remove annotation button to remove selected annotation shape.

commit 133ed324
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Tue Apr 9 13:19:09 2013 +0430

    Insert annotation in Review Tool plugin.

commit ba271ef1
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sun Apr 7 20:22:11 2013 +0430

    Change shape and color of annotation shape.

commit 47bd08cd
Merge: 287f3b16 d0643a2d
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Sat Apr 6 18:00:03 2013 +0200

    Merge branch 'master' into text-annotation

commit 287f3b16
Merge: 99a646f1 ff050263
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Mon Mar 18 20:16:56 2013 +0100

    Merge branch 'master' into text-annotation

commit 99a646f1
Merge: d8a509cf 31e350cf
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Wed Mar 13 22:11:23 2013 +0100

    Merge branch 'master' into text-annotation

commit d8a509cf
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Fri Mar 8 13:37:32 2013 +0330

    Remove annotation shape.
    Handle mouse press event for annotation shapes in TextTool::mousePressEvent.
    Handle mouse move event.
    Add an signal in KoShapeManager, when an annotation shape removed from shape manager.

commit 40b4463f
Merge: 4fc90b8c 6910b444
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu Mar 7 17:20:42 2013 +0330

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

commit 4fc90b8c
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu Mar 7 17:15:11 2013 +0330

    Paint a rect in corner at right top of annotation shape as delete annotation button.

commit 6910b444
Merge: 19ec2063 442a34d7
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Wed Mar 6 21:01:19 2013 +0100

    Merge branch 'master' into text-annotation

commit 19ec2063
Merge: 52f138dd 286af63f
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Wed Mar 6 19:48:26 2013 +0330

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

commit 52f138dd
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Wed Mar 6 19:44:21 2013 +0330

    Set annotation information (Author and Date) at top of the shape.

commit 286af63f
Merge: 80db4df1 3ae9d43f
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Mon Mar 4 19:26:27 2013 +0100

    Merge branch 'master' into text-annotation

commit 80db4df1
Merge: 54654e0f db3cae7a
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Mar 3 21:12:57 2013 +0100

    Merge branch 'master' into text-annotation

commit 54654e0f
Merge: b2156caa 737465a2
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Mar 3 18:46:29 2013 +0100

    Merge branch 'master' into text-annotation

commit b2156caa
Merge: b87e05e4 bb669078
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Mar 3 18:07:31 2013 +0100

    Merge branch 'master' into text-annotation

commit bb669078
Author: C. Boemann <cbo@boemann.dk>
Date:   Sun Mar 3 18:03:13 2013 +0100

    Make switching too in modebox faster (no need to recalc the icon size everytime)

commit b87e05e4
Merge: 7054a916 851fe7c7
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat Mar 2 22:44:11 2013 +0330

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

commit 7054a916
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat Mar 2 22:39:25 2013 +0330

    Set annotation shapes in different pages and in right page.

commit 851fe7c7
Merge: 6a4a51c7 2218723d
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Mar 1 22:15:06 2013 +0100

    Merge branch 'master' into text-annotation

commit 6a4a51c7
Merge: 14a2dc3b 2f3be17a
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Fri Mar 1 20:37:03 2013 +0330

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

commit 14a2dc3b
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Fri Mar 1 14:34:53 2013 +0330

    Handle changing annotations shapes size automatically when you add an annotation shape.

commit 2f3be17a
Merge: 94cc9bda 09967cce
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Tue Feb 26 20:44:22 2013 +0100

    Merge branch 'master' into text-annotation

commit 94cc9bda
Merge: bab06344 f30f5364
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Mon Feb 25 20:09:45 2013 +0330

    Merge remote-tracking branch 'origin/text-annotation' into text-annotation

commit bab06344
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Mon Feb 25 20:02:25 2013 +0330

    Move layout annotation shapes, stuff from KwCanvas to KWView with this when we insert an annotation
    shape i register an annotation and add it to annotation manager and also add the shape to
    annotation layout manager, and no problem in saving them because now we have them in annotation manager.
    Also define new signal specific for annotation shapes in KWDocument.

commit f30f5364
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Sat Feb 23 16:13:57 2013 +0100

    Make the background of the annotation shape solid white.

commit 08cae5ac
Merge: 8c9326c2 ca63ca73
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Sat Feb 23 15:17:37 2013 +0100

    Merge branch 'master' into text-annotation

commit 8c9326c2
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Sat Feb 23 13:38:44 2013 +0100

    Paint all backgrounds before we paint anything else.

    Before the annotations were overpainted by the color of the annotation
    area because it was painted after the contents was painted.

commit c505ae4a
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Sat Feb 23 12:50:44 2013 +0100

    Fix problems with painting the annotation area.

    There is still a problem because all shapes are painted before the
    area so the annotation shapes will be painted over.  The painting of
    the area has to be moved to before the painting of the shapes.

commit 9e09e783
Merge: dd2ddd68 67741149
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Thu Feb 21 09:56:08 2013 +0100

    Merge branch 'master' into text-annotation

commit dd2ddd68
Merge: e3f05b4c 99cb7ab8
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Wed Feb 20 20:37:30 2013 +0100

    Merge branch 'master' into text-annotation

commit e3f05b4c
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sun Feb 17 21:18:30 2013 +0330

    Layout annotation shapes, with  class KoAnnotationLayoutManager, for now its position is hardcoded in x == 400.

commit e9ef3e04
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Sat Feb 16 17:42:50 2013 +0100

    Reenable the signal now that there is a new API for shapes in flake.

commit 60814211
Merge: 2eeedc84 b25faa38
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Sat Feb 16 10:24:45 2013 +0100

    Merge branch 'master' into text-annotation

    Conflicts:
    	libs/widgets/KoBalloon.h
    	libs/widgets/KoOpacityConfigWidget.h
    	plugins/textshape/AnnotationTextShapeFactory.h
    	plugins/textshape/TextDocumentInspectionPlugin.cpp
    	plugins/textshape/TextDocumentInspectionPlugin.h
    	words/part/KWCanvas.cpp

commit 2eeedc84
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Feb 15 19:24:23 2013 +0100

    Fix broken build in a hacky way.

    This breakage was introduced by my previous patch.  Boemann says that
    she has a better way of doing this anyway so we will just comment the
    offending line away for now.

commit c965e855
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Feb 15 18:48:02 2013 +0100

    Remove a line on advice (more like an order :)) from boemann.

commit 13eeae1f
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Fri Feb 15 18:29:55 2013 +0100

    Some small cleanups, FIXME's and notes for later work.

commit c8becb5d
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Mon Jan 28 21:35:46 2013 +0100

    Make the annotation area work with zoom settings Fit to Page Width

commit 9114e642
Author: Inge Wallin <inge@lysator.liu.se>
Date:   Mon Jan 28 19:58:50 2013 +0100

    Make clear that there is a temporary hack in the code that has to be fixed.

commit fa867b2b
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Thu Jan 24 20:58:57 2013 +0330

    Reintroduce the red "annotation area" per boemann's plan.

commit c8b39525
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sun Jan 27 22:57:22 2013 +0330

    Implement Annotation::saveOdf, call it from KoAnnotation  and tweak words to doesen't KoShape::saveOdf.

commit 80e04c49
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sun Jan 27 12:57:24 2013 +0330

    Load annotation at a shape and show it in document.

commit e346a027
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat Jan 26 19:22:45 2013 +0330

    Add an annotation shape with AnnotationTextShape. you can edit text set bold, italic and also have a list.

commit d8753f79
Author: Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.com>
Date:   Sat Jan 26 15:43:42 2013 +0330

    Remove all old ui for annotation.
parent d5f3f5dd
The <office:annotation> element specifies an OpenDocument
annotation. The annotation's text is contained in <text:p> and
<text:list> elements.
The <office:annotation> element is usable within the following elements:
<table:covered-table-cell> 9.1.5 DONE (through loadSpan)
<table:table-cell> 9.1.4 DONE (through loadSpan)
<text:a> 6.1.8 DONE (through loadSpan)
<text:h> 5.1.2 DONE (through loadSpan)
<text:p> 5.1.3 DONE (through loadSpan)
<text:span> 6.1.7 DONE <-- actual implementation here
<text:meta> 6.1.9 DONE (through loadSpan)
<text:meta-field> 7.5.19
<text:ruby-base> 6.4.2
The <office:annotation> element has the following attributes:
draw:name 19.197.28
draw:caption-point-x 19.116
draw:caption-point-y 19.117
draw:class-names 19.120
draw:corner-radius 19.127
draw:id 19.187.3 DONE
draw:layer 19.189
draw:style-name 19.219.24
draw:text-style-name 19.227
draw:transform 19.228
draw:z-index 19.231
office:display 19.374
office:name 19.376.6 DONE
presentation:class-names 19.390
presentation:style-name 19.422
svg:height 19.539.9
svg:width 19.571.11
svg:x 19.573.7
svg:y 19.577.7
table:end-cell-address 19.627
table:end-x 19.632
table:end-y 19.633
table:table-background 19.728
text:anchor-page-number 19.753
text:anchor-type 19.754
xml:id 19.914. DONE
The <office:annotation> element has the following child elements:
<dc:creator> 4.3.2.7 DONE
<dc:date> 4.3.2.10 DONE
<meta:date-string> 14.3 DONE
<text:list> 5.3.1 DONE
<text:p> 5.1.3. DONE
Things left to do for the annotations branch
Features
--------
Bugs
----
* Annotation shapes should be handled gracefully in stage, (and any other app for that matter)
* Annotations should only be printed if the user want's it (different option to view->"Show comments")
To Check / Test
---------------
---------------- Milestone 1: merge with master ----------------
Annoyances
----------
* after inserting a comment the annotationshape should be active
* when clicking esc inside an annotation the cursor should return to the original textshape
* The background of the annotation area should be more neutral in color
* Save and load status of "Show Comments".
* Zoom to Page Width should include the annotation area if active.
* The review tool's annotation widget should have icons rather than text buttons .
* Setting of "Show comments" also available in the review tool?
More work
---------
* Load more attributes, especially the styles.
* roundtrip tests
* different layout when printing with comments
* Annotations to the left for people who use RTL languages.
Ideas
-----
* Use color coding for different authors
(This is probably already possible through the styles)
......@@ -126,6 +126,7 @@ set(flake_SRCS
KoTosContainerModel.cpp
KoClipPath.cpp
KoCurveFit.cpp
KoAnnotationLayoutManager.cpp
commands/KoShapeGroupCommand.cpp
commands/KoShapeAlignCommand.cpp
commands/KoShapeBackgroundCommand.cpp
......
/* This file is part of the KDE project
* Copyright (C) 2013 Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.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 "KoAnnotationLayoutManager.h"
#include <KoShape.h>
#include <QList>
#include <QHash>
#include <QMap>
#include <QtAlgorithms>
#include <QPainter>
#include <QPen>
#include <QLine>
#include <QLineF>
#include <kdebug.h>
int compare(const QPair < QPointF, KoShape * > &a, const QPair < QPointF, KoShape * > &b)
{
if (a.first.y() == b.first.y()) {
return a.first.x() < b.first.x();
}
return a.first.y() < b.first.y();
}
class KoAnnotationLayoutManager::Private
{
public:
Private()
: shapeManager(0),
canvas(0)
{}
qreal x; // The x point of annotation shapes position.
QList< QPair < QPointF, KoShape * > > annotationShapePositions;
KoShapeManager *shapeManager;
KoCanvasBase *canvas;
};
KoAnnotationLayoutManager::KoAnnotationLayoutManager(QObject *parent)
:d(new Private())
{
Q_UNUSED(parent);
}
KoAnnotationLayoutManager::~KoAnnotationLayoutManager()
{
}
void KoAnnotationLayoutManager::setShapeManager(KoShapeManager *shapeManager)
{
if (d->shapeManager) {
disconnect(d->shapeManager, SIGNAL(shapeChanged(KoShape*)), this, SLOT(updateLayout(KoShape*)));
}
d->shapeManager = shapeManager;
connect(d->shapeManager, SIGNAL(shapeChanged(KoShape*)), this, SLOT(updateLayout(KoShape*)));
}
void KoAnnotationLayoutManager::setCanvasBase(KoCanvasBase *canvas)
{
d->canvas = canvas;
}
void KoAnnotationLayoutManager::setViewContentWidth(qreal width)
{
d->x = width;
}
void KoAnnotationLayoutManager::paintConnections(QPainter &painter)
{
painter.save();
QPen pen(QColor(230, 216, 87)); // Color of lines.
pen.setStyle(Qt::DashLine);
pen.setWidth(2);
pen.setJoinStyle(Qt::RoundJoin);
pen.setCapStyle(Qt::RoundCap);
painter.setPen(pen);
QList< QPair < QPointF, KoShape * > >::const_iterator it = d->annotationShapePositions.constBegin();
while (it != d->annotationShapePositions.end() && !d->annotationShapePositions.isEmpty()) {
KoShape *shape = it->second;
// To make it more beautiful start line from shape a little downer of top-left of annotation shape (shape->position().y() + 20.0).
QPointF shapePosition(d->canvas->viewConverter()->documentToView(QPointF(shape->position().x(), (shape->position().y() + 20.0))));
QPointF refTextPosition(d->canvas->viewConverter()->documentToView(QPointF(it->first.x(), (it->first.y()))));
QPointF connectionPoint(d->canvas->viewConverter()->documentToView(QPointF((shape->position().x() - connectionPointLines), (it->first.y()))));
QPointF pointLine(d->canvas->viewConverter()->documentToView(QPointF(it->first.x(), (it->first.y() + 5))));
//Draw first line, from shape to connection Point.
painter.drawLine(shapePosition, connectionPoint);
// Draw second line, from connection point to reftext position.
painter.drawLine(connectionPoint, refTextPosition);
// Draw pointer.
painter.drawLine(refTextPosition, pointLine);
it++;
}
painter.restore();
}
bool KoAnnotationLayoutManager::isAnnotationShape(KoShape *shape)
{
QList< QPair < QPointF, KoShape * > >::iterator it = d->annotationShapePositions.begin();
while (it != d->annotationShapePositions.end()) {
if (shape == it->second) {
return true;
}
++it;
}
return false;
}
void KoAnnotationLayoutManager::registerAnnotationRefPosition(KoShape *annotationShape, QPointF pos)
{
QList< QPair < QPointF, KoShape * > >::iterator it = d->annotationShapePositions.begin();
bool yPositionChanged = false;
while (it != d->annotationShapePositions.end()) {
KoShape *shape = it->second;
if (shape == annotationShape) {
if (it->first.y() != pos.y()) {
yPositionChanged = true;
}
d->annotationShapePositions.erase(it);
break;
}
++it;
}
d->annotationShapePositions.append(QPair< QPointF, KoShape * >(pos, annotationShape));
layoutAnnotationShapes();
if (d->canvas && yPositionChanged) {
d->canvas->canvasWidget()->update();
}
}
void KoAnnotationLayoutManager::removeAnnotationShape(KoShape *annotationShape)
{
QList< QPair < QPointF, KoShape * > >::iterator it = d->annotationShapePositions.begin();
while (it != d->annotationShapePositions.constEnd()) {
if (it->second == annotationShape) {
d->annotationShapePositions.erase(it);
break;
}
++it;
}
layoutAnnotationShapes();
//Should update canvas.
d->canvas->canvasWidget()->update();
}
void KoAnnotationLayoutManager::updateLayout(KoShape *shape)
{
QList< QPair < QPointF, KoShape * > >::const_iterator it = d->annotationShapePositions.constBegin();
while (it != d->annotationShapePositions.end() && !d->annotationShapePositions.isEmpty()) {
if (it->second == shape) {
layoutAnnotationShapes();
break;
}
++it;
}
}
void KoAnnotationLayoutManager::layoutAnnotationShapes()
{
qreal currentY = 0.0;
qStableSort(d->annotationShapePositions.begin(), d->annotationShapePositions.end(), compare);
QList< QPair < QPointF, KoShape * > >::const_iterator it = d->annotationShapePositions.constBegin();
while (it != d->annotationShapePositions.end()) {
KoShape *shape = it->second;
qreal refPosition = it->first.y();
if (refPosition > currentY) {
currentY = refPosition;
}
shape->update();
shape->setSize(QSize(shapeWidth, shape->size().height()));
shape->setPosition(QPointF(d->x, currentY));
// This makes the shape visible. It was set to invisible when it was created.
shape->setVisible(true);
shape->update();
currentY += shape->size().height() + shapeSpace;
++it;
}
}
/* This file is part of the KDE project
* Copyright (C) 2013 Mojtaba Shahi Senobari <mojtaba.shahi3000@gmail.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 KOANNOTATIONLAYOUTMANAGER_H
#define KOANNOTATIONLAYOUTMANAGER_H
#include "flake_export.h"
#include <QObject>
#include <QPointF>
#include <KoViewConverter.h>
#include <KoShapeManager.h>
#include <KoCanvasBase.h>
#include <KoCanvasController.h>
class QPainter;
class KoShape;
class FLAKE_EXPORT KoAnnotationLayoutManager: public QObject
{
Q_OBJECT
public:
static const qreal shapeSpace = 10.0; // Distance between annotation shapes.
static const qreal shapeWidth = 200.0; // Annotation shapes width.
//Connection point of lines from shape to this point and from this point to refText psoition.
static const qreal connectionPointLines = 50.0;
KoAnnotationLayoutManager(QObject *parent = 0);
virtual ~KoAnnotationLayoutManager();
void setShapeManager(KoShapeManager *shapeManager);
void setCanvasBase(KoCanvasBase *canvas);
void setViewContentWidth(qreal width);
void paintConnections(QPainter &painter);
// Return true if shape is in annotaion shapes list.
bool isAnnotationShape(KoShape *shape);
public slots:
/// register the position of an annotation shape.
void registerAnnotationRefPosition(KoShape *annotationShape, QPointF refPosition);
/// Remove annotation shape.
void removeAnnotationShape(KoShape *annotationShape);
/// Update layout annotation shapes. Called when shape size changed.
void updateLayout(KoShape *shape);
private:
/// layout annotation shapes
void layoutAnnotationShapes();
private:
class Private;
Private * const d;
};
#endif // KOANNOTATIONLAYOUTMANAGER_H
......@@ -198,3 +198,8 @@ KoDocumentResourceManager *KoShapeController::resourceManager() const
return 0;
return d->shapeBasedDocument->resourceManager();
}
KoShapeBasedDocumentBase *KoShapeController::documentBase() const
{
return d->shapeBasedDocument;
}
......@@ -49,7 +49,7 @@ public:
* Create a new Controller; typically not called by applications, only
* by the KonCanvasBase constructor.
* @param canvas the canvas this controller works for. The canvas can be 0
* @param shapeController the application provided shapeBasedDocument that we can call.
* @param shapeBasedDocument the application provided shapeBasedDocument that we can call.
*/
KoShapeController(KoCanvasBase *canvas, KoShapeBasedDocumentBase *shapeBasedDocument);
/// destructor
......@@ -102,7 +102,7 @@ public:
/**
* @brief Set the KoShapeBasedDocumentBase used to add/remove shapes.
*
* NOTE: only Tables uses this method. Do not use it in your application. Tables
* NOTE: only Sheets uses this method. Do not use it in your application. Sheets
* has to also call:
* <code>KoToolManager::instance()->updateShapeControllerBase(shapeBasedDocument, canvas->canvasController());</code>
*
......@@ -118,6 +118,13 @@ public:
*/
KoDocumentResourceManager *resourceManager() const;
/**
* @brief Returns the KoShapeBasedDocumentBase used to add/remove shapes.
*
* @return the KoShapeBasedDocumentBase
*/
KoShapeBasedDocumentBase *documentBase() const;
private:
class Private;
Private * const d;
......
......@@ -204,6 +204,10 @@ void KoShapeManager::remove(KoShape *shape)
remove(containerShape);
}
}
// This signal is used in the annotation shape.
// FIXME: Is this really what we want? (and shouldn't it be called shapeDeleted()?)
shapeRemoved(shape);
}
void KoShapeManager::removeAdditional(KoShape *shape)
......@@ -519,6 +523,7 @@ void KoShapeManager::notifyShapeChanged(KoShape *shape)
}
if (wasEmpty && !d->aggregate4update.isEmpty())
QTimer::singleShot(100, this, SLOT(updateTree()));
emit shapeChanged(shape);
}
QList<KoShape*> KoShapeManager::shapes() const
......
......@@ -205,6 +205,10 @@ signals:
void selectionContentChanged();
/// emitted when any object changed (moved/rotated etc)
void contentChanged();
/// emitted when a shape is removed.
void shapeRemoved(KoShape *);
/// emitted when any shape changed.
void shapeChanged(KoShape *);
private:
......
......@@ -100,6 +100,7 @@ set(kotext_LIB_SRCS
commands/ChangeStylesCommand.cpp
commands/ChangeStylesMacroCommand.cpp
commands/DeleteAnchorsCommand.cpp
commands/DeleteAnnotationsCommand.cpp
commands/DeleteCommand.cpp
commands/DeleteTableColumnCommand.cpp
commands/DeleteTableRowCommand.cpp
......@@ -111,6 +112,7 @@ set(kotext_LIB_SRCS
commands/ListItemNumberingCommand.cpp
commands/TextPasteCommand.cpp
commands/AddTextRangeCommand.cpp
commands/AddAnnotationCommand.cpp
commands/ParagraphFormattingCommand.cpp
KoTextDrag.cpp
......
......@@ -30,6 +30,7 @@
#include <KoTextLoader.h>
#include <KoXmlNS.h>
#include <KoTextWriter.h>
#include <KoShape.h>
#include "KoTextDocument.h"
......@@ -44,20 +45,16 @@
class KoAnnotation::Private
{
public:
Private(const QTextDocument *doc)
: document(doc),
posInDocument(0) { }
Private(const QTextDocument *doc):
document(doc),
posInDocument(0) { }
const QTextDocument *document;
int posInDocument;
QTextFrame *textFrame;
// Name of this annotation. It is used to tie together the annotation and annotation-end tags
QString name;
// The actual contents of the annotation
QString creator;
QString date;
QTextDocument contents;
KoShape *shape;
};
KoAnnotation::KoAnnotation(const QTextCursor &cursor)
......@@ -82,79 +79,51 @@ QString KoAnnotation::name() const
return d->name;
}