[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
Public Member Functions
KLFPosSearchable::Pos::PosData Struct Reference

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

#include <klfsearchbar.h>

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

List of all members.

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

Definition at line 125 of file klfsearchbar.h.

virtual KLFPosSearchable::Pos::PosData::~PosData ( ) [inline, virtual]

Definition at line 126 of file klfsearchbar.h.


Member Function Documentation

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.

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.


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

Generated by doxygen 1.7.6.1. The KLatexFormula website is hosted on sourceforge.net