2021-05-29 07:31:33 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
|
|
/*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2021-07-05 05:18:21 -05:00
|
|
|
#pragma once
|
2021-05-29 07:31:33 -05:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include "ConfigUtil.hpp"
|
|
|
|
|
2021-09-13 14:24:50 -05:00
|
|
|
namespace CommandControl
|
2021-05-29 07:31:33 -05:00
|
|
|
{
|
|
|
|
class FreemiumManager
|
|
|
|
{
|
|
|
|
static std::vector<std::string> FreemiumDenyList;
|
|
|
|
static bool _isFreemiumUser;
|
|
|
|
static std::string FreemiumDenyListString;
|
|
|
|
|
|
|
|
static void generateDenyList();
|
|
|
|
|
|
|
|
public:
|
|
|
|
FreemiumManager();
|
|
|
|
static const std::vector<std::string>& getFreemiumDenyList();
|
|
|
|
static const std::string getFreemiumDenyListString();
|
|
|
|
|
|
|
|
static bool isFreemiumUser() { return _isFreemiumUser; }
|
|
|
|
|
|
|
|
static void setFreemiumUser(bool isFreemiumUser) { _isFreemiumUser = isFreemiumUser; }
|
|
|
|
|
|
|
|
static std::string getFreemiumPurchaseTitle() { return config::getString("freemium.purchase_title", ""); }
|
|
|
|
static std::string getFreemiumPurchaseLink() { return config::getString("freemium.purchase_link", ""); }
|
2021-08-30 05:51:02 -05:00
|
|
|
static std::string getFreemiumPurchaseDescription() { return config::getString("freemium.purchase_description", ""); }
|
2021-05-29 07:31:33 -05:00
|
|
|
static std::string getWriterHighlights() { return config::getString("freemium.writer_subscription_highlights", ""); }
|
|
|
|
static std::string getCalcHighlights() { return config::getString("freemium.calc_subscription_highlights", ""); }
|
|
|
|
static std::string getImpressHighlights() { return config::getString("freemium.impress_subscription_highlights", ""); }
|
|
|
|
static std::string getDrawHighlights() { return config::getString("freemium.draw_subscription_highlights", ""); }
|
|
|
|
};
|
2021-09-13 15:02:43 -05:00
|
|
|
|
|
|
|
class RestrictionManager
|
|
|
|
{
|
|
|
|
static std::vector<std::string> RestrictedCommandList;
|
|
|
|
static bool _isRestrictedUser;
|
|
|
|
static std::string RestrictedCommandListString;
|
|
|
|
|
|
|
|
static void generateRestrictedCommandList();
|
|
|
|
|
|
|
|
public:
|
|
|
|
RestrictionManager();
|
|
|
|
static const std::vector<std::string>& getRestrictedCommandList();
|
|
|
|
static const std::string getRestrictedCommandListString();
|
|
|
|
|
|
|
|
static bool isRestrictedUser() { return _isRestrictedUser; }
|
|
|
|
|
|
|
|
static void setRestrictedUser(bool isRestrictedUser) { _isRestrictedUser = isRestrictedUser; }
|
|
|
|
};
|
2021-09-13 14:24:50 -05:00
|
|
|
} // namespace CommandControl
|
2021-05-29 07:31:33 -05:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|