File: point_imp.h

package info (click to toggle)
kig 4%3A25.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,712 kB
  • sloc: cpp: 41,465; xml: 863; python: 486; perl: 23; sh: 17; makefile: 3
file content (77 lines) | stat: -rw-r--r-- 2,166 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// SPDX-FileCopyrightText: 2002 Dominique Devriese <devriese@kde.org>

// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include "../misc/coordinate.h"
#include "object_imp.h"

/**
 * An ObjectImp representing a point.
 */
class PointImp : public ObjectImp
{
    Coordinate mc;

public:
    typedef ObjectImp Parent;
    /**
     * Returns the ObjectImpType representing PointImp's.
     */
    static const ObjectImpType *stype();

    /**
     * Construct a PointImp with coordinate c.
     */
    explicit PointImp(const Coordinate &c);
    ~PointImp();

    Rect surroundingRect() const override;
    Coordinate attachPoint() const override;

    /**
     * Get the coordinate of this PointImp.
     */
    const Coordinate &coordinate() const
    {
        return mc;
    }
    /**
     * Set the coordinate of this PointImp.
     */
    void setCoordinate(const Coordinate &c);

    void draw(KigPainter &p) const override;
    bool contains(const Coordinate &p, int width, const KigWidget &) const override;
    bool inRect(const Rect &r, int width, const KigWidget &) const override;

    int numberOfProperties() const override;
    const QList<KLazyLocalizedString> properties() const override;
    const QByteArrayList propertiesInternalNames() const override;
    ObjectImp *property(int which, const KigDocument &d) const override;
    const char *iconForProperty(int which) const override;
    const ObjectImpType *impRequirementForProperty(int which) const override;
    bool isPropertyDefinedOnOrThroughThisImp(int which) const override;

    ObjectImp *transform(const Transformation &) const override;

    PointImp *copy() const override;

    const ObjectImpType *type() const override;
    void visit(ObjectImpVisitor *vtor) const override;

    void fillInNextEscape(QString &s, const KigDocument &) const override;
    bool canFillInNextEscape() const override;

    bool equals(const ObjectImp &rhs) const override;
};

class BogusPointImp : public PointImp
{
public:
    explicit BogusPointImp(const Coordinate &c);
    ~BogusPointImp();
    static const ObjectImpType *stype();
    const ObjectImpType *type() const override;
};