A Base class for storing abstract position data. More...
#include <klfsearchbar.h>
Public Member Functions | |
PosData () | |
virtual | ~PosData () |
virtual bool | equals (PosData *other) const =0 |
virtual QString | toDebug () |
int | ref () |
int | deref () |
virtual bool | wantAutoDelete () |
A Base class for storing abstract position data.
See KLFPosSearchable::Pos. Derive this class to store relevant data to represent you position and an equality tester function.
Minimal Example:
class MySearchable : public KLFPosSearchable { public: // ... class MyPosData : public Pos::PosData { QTextCursor cursor; bool equals(PosData * other) const { return cursor == dynamic_cast<MyPosData*>(other)->cursor; } }; // ... };
Additionally, this class handles ref()/deref() referencing mechanism that is used by KLFRefPtr. It handles automatically reference counts, and you don't have to worry about deleting the object.
Definition at line 124 of file klfsearchbar.h.
KLFPosSearchable::Pos::PosData::PosData | ( | ) | [inline] |
Definition at line 125 of file klfsearchbar.h.
virtual KLFPosSearchable::Pos::PosData::~PosData | ( | ) | [inline, virtual] |
Definition at line 126 of file klfsearchbar.h.
int KLFPosSearchable::Pos::PosData::deref | ( | ) | [inline] |
Definition at line 136 of file klfsearchbar.h.
virtual bool KLFPosSearchable::Pos::PosData::equals | ( | PosData * | other | ) | const [pure virtual] |
tests for equality with other position.
int KLFPosSearchable::Pos::PosData::ref | ( | ) | [inline] |
Definition at line 135 of file klfsearchbar.h.
virtual QString KLFPosSearchable::Pos::PosData::toDebug | ( | ) | [inline, virtual] |
Subclasses may reimplement to return a string describing the current position for debugging messages.
Definition at line 133 of file klfsearchbar.h.
virtual bool KLFPosSearchable::Pos::PosData::wantAutoDelete | ( | ) | [inline, virtual] |
Subclasses should reimplement to return FALSE if this object should NOT be delete'd
when no longer referenced. There should be no reason to do so, however.
Definition at line 140 of file klfsearchbar.h.