solanaceae_contact/solanaceae/contact/components.hpp

83 lines
1.3 KiB
C++
Raw Normal View History

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-10-13 20:27:52 +02:00
// tag to signal an avatar change, and the texture needs to be reloaded
2023-08-01 18:23:07 +02:00
struct TagAvatarInvalidate {};
2023-08-01 18:02:42 +02:00
struct AvatarMemory {
2023-10-13 20:27:52 +02:00
// RGBA single-frame
2023-08-01 18:02:42 +02:00
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"