aboutsummaryrefslogtreecommitdiffstats
path: root/src/activitypub/apbase.h
blob: 3973886a0d3a0d696a95cb4e6d86e10fce33b46c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <QString>
#include <QLocale>

struct HtmlRenderDetails {
    int text_zone_width;
    QLocale* locale;
};

class APBase {
public:
    // maybe pass HtmlRenderDetails by reference (pointer) instead of by value? will have to be measured
    virtual QString get_html_render(HtmlRenderDetails render_info) = 0;

    // having a virtual destructor never hurts. see https://isocpp.org/wiki/faq/virtual-functions#virtual-dtors
    // it could always be removed by deleting the line below and removing the trivial destructors that are explicitly defined from classes that inherit from APBase.
    virtual ~APBase() {};
protected:
    QString object_url; // this URL represents generally the source of the object. for APObject & derived: object's URL, such as the Note/Statuses' URL for an APPost
    static const QString get_html_template(const QString& template_name);
};