Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAndroidDonations.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-3.0-or-later
3 */
4#ifndef __KISANDROIDDONATIONS_H_
5#define __KISANDROIDDONATIONS_H_
6
7#include <QObject>
8
9#include "kritaui_export.h"
10
11// See DonationHelper.java for notes!
12class KRITAUI_EXPORT KisAndroidDonations : public QObject
13{
14 Q_OBJECT
15 friend class KisApplication;
16
17public:
18 // Keep this in sync with the STATE_ constants in DonationHelper.java!
19 enum class State {
20 // Initial or error state. Assume in-app purchases are unavailable.
21 Unknown = 0,
22 // The billing code is still checking whether any products are available
23 // and if the user owns any of them.
24 Checking = 1,
25 // In-app purchases are unavailable. This may be because of an
26 // unexpected error, but may also be an expected condition, e.g. because
27 // the user is running a debug or nightly build, which have a different
28 // package name and therefore no products assigned to them.
29 Unavailable = 2,
30 // User does not own any support products, but they could purchase one.
31 NoSupport = 3,
32 // User purchased the (legacy) lifetime supporter badge.
33 LifetimeSupporter = 4,
34 };
35
37
38 bool shouldShowDonationLink() const;
39 bool shouldShowSupporterBadge() const;
40
41public Q_SLOTS:
42 void slotStartDonationFlow();
43
44private Q_SLOTS:
45 void slotUpdateState(int state);
46
47Q_SIGNALS:
48 void sigStateUpdateReceived(int state);
50
51private:
52 explicit KisAndroidDonations(QObject *parent = nullptr);
53
54 void syncState();
55
56 State m_state{State::Unknown};
57};
58
59#endif // __KISANDROIDDONATIONS_H
PythonPluginManager * instance
void sigStateUpdateReceived(int state)
Base class for the Krita app.
@ Unknown
Definition psd.h:44