~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to libs/kotext/KoTextAnchor.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
class KoShape;
29
29
class KoTextAnchorPrivate;
30
30
class KoXmlElement;
 
31
class KoShapeLoadingContext;
31
32
 
32
33
/**
33
34
 * This class is the object that is positioned in the text to be an anchor for a shape.
48
49
 *
49
50
 * Steps to use a KoTextAnchor are; <ol>
50
51
 * <li> Create a new instance with e.g. new KoTextAnchor(myshape);
51
 
 * <li> Use loadOdfFromShape() to load additional attributes like the "text:anchor-type"
 
52
 * <li> Use loadOdf() to load additional attributes like the "text:anchor-type"
52
53
 * <li> Position the anchor with updatePosition() what will attach the KoTextAnchor-instance to
53
54
 *    the TextShape's \a KoTextShapeContainerModel . </ol>
54
 
 * The position of the shape relative to the anchor is called the offset. It's loaded by loadOdfFromShape().
 
55
 * The position of the shape relative to the anchor is called the offset. It's loaded by loadOdf().
55
56
 * @see KWAnchorStrategy for more information about the layout of anchors/shapes in KWord.
56
57
 */
57
58
class KOTEXT_EXPORT KoTextAnchor : public KoInlineObject
59
60
public:
60
61
    /// the vertical alignment options for the shape this anchor holds.
61
62
    enum AnchorVertical {
 
63
        TopOfPage,          ///< Align the anchors top to the top of the page
 
64
        BottomOfPage,       ///< Align the anchors bottom to the bottom of the page
 
65
        TopOfPageContent,   ///< Align the anchors top to the top of the page content (top margin of page)
 
66
        BottomOfPageContent,///< Align the anchors bottom to the bottom of the content (bottom margin of page)
62
67
        TopOfFrame,         ///< Align the anchors top to the top of the frame it is laid-out in.
 
68
        BottomOfFrame,      ///< Align the anchors bottom to the bottom of the frame.
63
69
        TopOfParagraph,     ///< Align the anchors top to the top of the paragraph it is anchored in.
 
70
        BottomOfParagraph,  ///< Align the anchors bottom to the bottom of the paragraph it is anchord in.
64
71
        AboveCurrentLine,   ///< Align the anchors top to the top of the line it is anchord in.
65
72
        BelowCurrentLine,   ///< Align the anchors bottom to the bottom of the line it is anchord in.
66
 
        BottomOfParagraph,  ///< Align the anchors bottom to the bottom of the paragraph it is anchord in.
67
 
        BottomOfFrame,      ///< Align the anchors bottom to the bottom of the frame.
68
73
        VerticalOffset      ///< Move the anchor to be an exact vertical distance from the (baseline) of the anchor.
69
74
    };
 
75
 
70
76
    /// the horizontal alignment options for the shape this anchor holds.
71
77
    enum AnchorHorizontal {
 
78
        LeftOfPage,         ///< Align the anchors left to the left of the page
 
79
        RightOfPage,        ///< Align the anchors right to the right of the page
 
80
        CenterOfPage,       ///< Align the anchors center to the center of the page
72
81
        Left,               ///< Align the anchors left to the left of the frame it is laid-out in.
73
82
        Right,              ///< Align the anchors rigth to the rigth of the frame it is laid-out in.
74
83
        Center,             ///< Align the anchors center to the center of the frame it is laid-out in.
132
141
    void setOffset(const QPointF &offset);
133
142
 
134
143
    /// Load the additional attributes.
135
 
    bool loadOdfFromShape(const KoXmlElement &element);
 
144
    bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context);
136
145
    /// Save the additional attributes.
137
146
    void saveOdf(KoShapeSavingContext &context);
138
147