File: base_type.h

package info (click to toggle)
kig 4%3A25.08.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,716 kB
  • sloc: cpp: 41,465; xml: 851; python: 486; perl: 23; sh: 17; makefile: 3
file content (41 lines) | stat: -rw-r--r-- 1,355 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
// SPDX-FileCopyrightText: 2003 Dominique Devriese <devriese@kde.org>

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

#pragma once

#include "object_type.h"

#include "../misc/argsparser.h"

class LineData;

class ObjectABType : public ArgsParserObjectType
{
protected:
    ObjectABType(const char *fulltypename, const ArgsParser::spec *argsspec, int n);
    ~ObjectABType();

public:
    ObjectImp *calc(const Args &args, const KigDocument &) const override;
    bool canMove(const ObjectTypeCalcer &o) const override;
    bool isFreelyTranslatable(const ObjectTypeCalcer &o) const override;
    std::vector<ObjectCalcer *> movableParents(const ObjectTypeCalcer &ourobj) const override;
    void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const override;
    const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const override;

    // mp: calcx was an overloaded calc, which caused a compilation warning
    virtual ObjectImp *calcx(const Coordinate &a, const Coordinate &b) const = 0;
};

class ObjectLPType : public ArgsParserObjectType
{
protected:
    ObjectLPType(const char *fullname, const ArgsParser::spec *spec, int n);
    ~ObjectLPType();

public:
    ObjectImp *calc(const Args &args, const KigDocument &) const override;

    virtual ObjectImp *calc(const LineData &a, const Coordinate &b) const = 0;
};