qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
#include <chatlinestorage.h>
Classes | |
struct | IdxInfo |
Public Types | |
using | size_type = Lines_t::size_type |
using | reference = Lines_t::reference |
using | const_reference = Lines_t::const_reference |
using | const_iterator = Lines_t::const_iterator |
using | iterator = Lines_t::iterator |
Public Member Functions | |
iterator | insertChatMessage (ChatLogIdx idx, QDateTime timestamp, ChatLine::Ptr line) |
iterator | insertDateLine (QDateTime timestamp, ChatLine::Ptr line) |
ChatLogIdx | firstIdx () const |
ChatLogIdx | lastIdx () const |
bool | contains (ChatLogIdx idx) const |
bool | contains (QDateTime timestamp) const |
iterator | find (ChatLogIdx idx) |
iterator | find (ChatLine::Ptr line) |
const_reference | operator[] (size_type idx) const |
const_reference | operator[] (ChatLogIdx idx) const |
size_type | size () const |
iterator | begin () |
iterator | end () |
bool | empty () const |
bool | hasIndexedMessage () const |
void | clear () |
reference | front () |
reference | back () |
void | erase (ChatLogIdx idx) |
iterator | erase (iterator it) |
Private Types | |
using | Lines_t = std::vector< ChatLine::Ptr > |
using | DateLineMap_t = std::map< ChatLine::Ptr, QDateTime > |
using | IdxInfoMap_t = std::map< ChatLogIdx, IdxInfo > |
Private Member Functions | |
iterator | equivalentLineIterator (IdxInfoMap_t::iterator it) |
IdxInfoMap_t::iterator | equivalentInfoIterator (iterator it) |
IdxInfoMap_t::iterator | infoIteratorForIdx (ChatLogIdx idx) |
iterator | adjustItForDate (iterator it, QDateTime timestamp) |
void | incrementLinePosAfter (IdxInfoMap_t::iterator it) |
void | decrementLinePosAfter (IdxInfoMap_t::iterator it) |
bool | shouldRemovePreviousLine (iterator prevIt, iterator it) |
Private Attributes | |
std::vector< ChatLine::Ptr > | lines |
std::map< ChatLine::Ptr, QDateTime > | dateMap |
IdxInfoMap_t | idxInfoMap |
Helper class to keep track of what we're currently rendering and in what order Some constraints that may not be obvious
The class is designed to be used like a vector over the currently rendered items, but with some tweaks for ensuring items tied to the current view are moved correctly (selection indexes, removal of associated date lines, mappings of ChatLogIdx -> ChatLine::Ptr, etc.)
Definition at line 53 of file chatlinestorage.h.
using ChatLineStorage::const_iterator = Lines_t::const_iterator |
Definition at line 70 of file chatlinestorage.h.
using ChatLineStorage::const_reference = Lines_t::const_reference |
Definition at line 69 of file chatlinestorage.h.
|
private |
Definition at line 62 of file chatlinestorage.h.
|
private |
Definition at line 63 of file chatlinestorage.h.
using ChatLineStorage::iterator = Lines_t::iterator |
Definition at line 71 of file chatlinestorage.h.
|
private |
Definition at line 61 of file chatlinestorage.h.
using ChatLineStorage::reference = Lines_t::reference |
Definition at line 68 of file chatlinestorage.h.
using ChatLineStorage::size_type = Lines_t::size_type |
Definition at line 67 of file chatlinestorage.h.
|
private |
|
inline |
Definition at line 110 of file chatlinestorage.h.
|
inline |
Definition at line 95 of file chatlinestorage.h.
|
inline |
Definition at line 102 of file chatlinestorage.h.
|
inline |
Definition at line 82 of file chatlinestorage.h.
bool ChatLineStorage::contains | ( | QDateTime | timestamp | ) | const |
Definition at line 79 of file chatlinestorage.cpp.
|
private |
|
inline |
Definition at line 98 of file chatlinestorage.h.
|
inline |
Definition at line 96 of file chatlinestorage.h.
|
private |
|
private |
void ChatLineStorage::erase | ( | ChatLogIdx | idx | ) |
ChatLineStorage::iterator ChatLineStorage::erase | ( | iterator | it | ) |
ChatLineStorage::iterator ChatLineStorage::find | ( | ChatLine::Ptr | line | ) |
Definition at line 99 of file chatlinestorage.cpp.
ChatLineStorage::iterator ChatLineStorage::find | ( | ChatLogIdx | idx | ) |
|
inline |
Definition at line 78 of file chatlinestorage.h.
|
inline |
Definition at line 109 of file chatlinestorage.h.
|
inline |
Definition at line 100 of file chatlinestorage.h.
|
private |
|
private |
ChatLineStorage::iterator ChatLineStorage::insertChatMessage | ( | ChatLogIdx | idx, |
QDateTime | timestamp, | ||
ChatLine::Ptr | line | ||
) |
ChatLineStorage::iterator ChatLineStorage::insertDateLine | ( | QDateTime | timestamp, |
ChatLine::Ptr | line | ||
) |
|
inline |
Definition at line 80 of file chatlinestorage.h.
|
inline |
Definition at line 91 of file chatlinestorage.h.
|
inline |
Definition at line 89 of file chatlinestorage.h.
|
inline |
Definition at line 93 of file chatlinestorage.h.
|
private |
Definition at line 129 of file chatlinestorage.h.
|
private |
Definition at line 130 of file chatlinestorage.h.
|
private |
Definition at line 128 of file chatlinestorage.h.