[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
Public Member Functions | List of all members
KLFPosSearchable::Pos::PosData Struct Referenceabstract

A Base class for storing abstract position data. More...

#include <klfsearchbar.h>

Inheritance diagram for KLFPosSearchable::Pos::PosData:
Inheritance graph
[legend]

Public Member Functions

 PosData ()
 
virtual ~PosData ()
 
virtual bool equals (PosData *other) const =0
 
virtual QString toDebug ()
 
int ref ()
 
int deref ()
 
virtual bool wantAutoDelete ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PosData()

KLFPosSearchable::Pos::PosData::PosData ( )
inline

Definition at line 125 of file klfsearchbar.h.

◆ ~PosData()

virtual KLFPosSearchable::Pos::PosData::~PosData ( )
inlinevirtual

Definition at line 126 of file klfsearchbar.h.

Member Function Documentation

◆ deref()

int KLFPosSearchable::Pos::PosData::deref ( )
inline

◆ equals()

virtual bool KLFPosSearchable::Pos::PosData::equals ( PosData other) const
pure virtual

tests for equality with other position.

◆ ref()

int KLFPosSearchable::Pos::PosData::ref ( )
inline

◆ toDebug()

virtual QString KLFPosSearchable::Pos::PosData::toDebug ( )
inlinevirtual

Subclasses may reimplement to return a string describing the current position for debugging messages.

Definition at line 133 of file klfsearchbar.h.

◆ wantAutoDelete()

virtual bool KLFPosSearchable::Pos::PosData::wantAutoDelete ( )
inlinevirtual

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.


The documentation for this struct was generated from the following file:

Generated by doxygen 1.8.13