This repository has been archived on 2020-05-10. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon-cpp/src/easy/account.hpp

164 lines
4.1 KiB
C++
Raw Normal View History

2018-03-22 00:33:36 +01:00
/* This file is part of mastodon-cpp.
* Copyright © 2018 tastytea <tastytea@tastytea.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MASTODON_CPP_EASY_ACCOUNT_HPP
#define MASTODON_CPP_EASY_ACCOUNT_HPP
#include <string>
#include <cstdint>
#include <chrono>
// If we are compiling mastodon-cpp, use another include path
#ifdef MASTODON_CPP
#include "mastodon-cpp.hpp"
#include "easy.hpp"
#else
#include <mastodon-cpp/mastodon-cpp.hpp>
#include <mastodon-cpp/easy.hpp>
#endif
using std::string;
2018-03-31 19:43:15 +02:00
using std::uint_fast64_t;
2018-03-30 23:51:09 +02:00
using std::chrono::system_clock;
2018-03-22 00:33:36 +01:00
namespace Mastodon
{
/*!
* @brief Class to hold accounts.
*/
class Easy::Account : public Easy::Entity
{
public:
/*!
* @brief Constructs an Account object from a JSON string.
*
* @param json JSON string
*/
explicit Account(const string &json);
2018-03-30 20:16:31 +02:00
/*!
* @brief Constructs an empty Account object.
*/
Account();
2018-03-22 00:33:36 +01:00
/*!
* @brief Returns username
*
* `username` for users on the same instance, `user@hostname`
* for users on other instances.
*/
const string acct() const;
/*!
* @brief Returns URL of avatar
*/
const string avatar() const;
/*!
* @brief Returns URL of static avatar
*/
const string avatar_static() const;
/*!
* @brief Returns time of creation
*/
2018-03-30 23:51:09 +02:00
const system_clock::time_point created_at() const;
2018-03-22 00:33:36 +01:00
/*!
* @brief Returns display name
*/
const string display_name() const;
/*!
* @brief Returns number of followers
*/
2018-03-31 19:43:15 +02:00
const uint_fast64_t followers_count() const;
2018-03-22 00:33:36 +01:00
/*!
* @brief Returns number of people this account follows
*/
2018-03-31 19:43:15 +02:00
const uint_fast64_t following_count() const;
2018-03-22 00:33:36 +01:00
/*!
* @brief Returns URL of header image
*/
const string header() const;
/*!
* @brief Returns URL of static header image
*/
const string header_static() const;
/*!
* @brief Returns account-ID
*/
2018-03-31 19:43:15 +02:00
const uint_fast64_t id() const;
2018-03-22 00:33:36 +01:00
/*!
* @brief Returns true if the account is locked
*/
const bool locked() const;
/*!
* @brief Returns true if the account has been moved
*/
const bool has_moved() const;
/*!
* @brief If the owner decided to switch accounts, new account is in
* this attribute
*/
const Account moved() const;
/*!
* @brief Returns note
*/
const string note() const;
/*!
* @brief Returns plaintext version of note
*/
const string note_plain() const;
/*!
* @brief Returns default privacy of new toots
*/
2018-03-31 04:29:55 +02:00
const visibility_type privacy() const;
2018-03-22 00:33:36 +01:00
/*!
* @brief Returns if media is marked as sensitive by default
*/
const bool sensitive() const;
/*!
* @brief Returns number of statuses
*/
2018-03-31 19:43:15 +02:00
const uint_fast64_t statuses_count() const;
2018-03-22 00:33:36 +01:00
/*!
* @brief Returns URL of the profile
*/
const string url() const;
/*!
* @brief Returns username (without @hostname)
*/
const string username() const;
};
}
#endif // MASTODON_CPP_EASY_ACCOUNT_HPP