2023-07-21 17:13:59 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "./contact_model3.hpp"
|
|
|
|
|
|
|
|
#include <string>
|
2023-08-01 18:02:42 +02:00
|
|
|
#include <vector>
|
2023-07-21 17:13:59 +02:00
|
|
|
|
|
|
|
// fwd
|
|
|
|
struct ContactModel3I;
|
|
|
|
|
|
|
|
namespace Contact::Components {
|
2023-07-22 22:36:47 +02:00
|
|
|
|
2023-07-21 17:13:59 +02:00
|
|
|
struct TagSelfWeak {};
|
|
|
|
struct TagSelfStrong {};
|
|
|
|
struct TagBig {};
|
|
|
|
|
2023-07-29 19:45:37 +02:00
|
|
|
struct RequestIncoming {
|
|
|
|
bool name = false;
|
|
|
|
bool password = false;
|
|
|
|
};
|
|
|
|
struct TagRequestOutgoing {};
|
|
|
|
|
2023-07-21 17:13:59 +02:00
|
|
|
// self counterpart
|
|
|
|
struct Self {
|
|
|
|
Contact3 self;
|
|
|
|
};
|
|
|
|
|
2023-07-22 23:10:07 +02:00
|
|
|
// tier 1
|
|
|
|
struct Parent {
|
2023-07-21 17:13:59 +02:00
|
|
|
Contact3 parent;
|
|
|
|
};
|
|
|
|
|
2023-07-22 23:10:07 +02:00
|
|
|
// TODO: maybe rename to children
|
2023-07-21 17:13:59 +02:00
|
|
|
struct ParentOf {
|
|
|
|
std::vector<Contact3> subs;
|
|
|
|
};
|
|
|
|
|
|
|
|
// TODO: this is very hacky
|
|
|
|
// maybe refwrapper?
|
|
|
|
using ContactModel = ContactModel3I*;
|
|
|
|
|
|
|
|
struct Name {
|
|
|
|
std::string name;
|
|
|
|
};
|
|
|
|
|
|
|
|
// (display)alias
|
|
|
|
|
2023-08-01 18:23:07 +02:00
|
|
|
// tag to signify a avatar change, and the texture needs to be reloaded
|
|
|
|
struct TagAvatarInvalidate {};
|
|
|
|
|
2023-08-01 18:02:42 +02:00
|
|
|
struct AvatarMemory {
|
|
|
|
// RGBA
|
|
|
|
std::vector<uint8_t> data;
|
|
|
|
uint64_t width;
|
|
|
|
uint64_t height;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AvatarFile {
|
|
|
|
std::string file_path;
|
|
|
|
};
|
|
|
|
|
2023-07-21 17:13:59 +02:00
|
|
|
// status
|
|
|
|
|
|
|
|
struct ConnectionState {
|
|
|
|
enum State {
|
|
|
|
disconnected,
|
|
|
|
direct, // tox udp-direct?
|
|
|
|
cloud, // tox tcp-relayed / most messengers ?
|
|
|
|
} state = disconnected;
|
|
|
|
};
|
|
|
|
|
|
|
|
// status message
|
|
|
|
struct StatusMessage {
|
|
|
|
std::string msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
// last seen (not disconnected?)
|
|
|
|
|
2023-07-22 22:36:47 +02:00
|
|
|
} // Contact::Components
|
2023-07-21 17:13:59 +02:00
|
|
|
|
|
|
|
#include "./components_id.inl"
|
|
|
|
|