kpilot
PilotRecordBase Class Reference
All entries in the Handheld -- whether interpreted or binary blobs -- have some common characteristics, viz. More...
#include <pilotRecord.h>
Public Member Functions | |
int | attributes () const |
int | category () const |
recordid_t | id () const |
bool | isArchived () const |
bool | isDeleted () const |
bool | isModified () const |
bool | isSecret () const |
PilotRecordBase (const PilotRecordBase *b) | |
PilotRecordBase (int attrib=0, int cat=0, recordid_t id=0) | |
void | setAttributes (int attrib) |
bool | setCategory (const struct CategoryAppInfo *info, const QString &label) |
void | setCategory (int cat) |
void | setDeleted (bool d=true) SETTER(dlpRecAttrDeleted) inline void setSecret(bool d |
void | setID (recordid_t id) |
virtual | ~PilotRecordBase () |
Detailed Description
All entries in the Handheld -- whether interpreted or binary blobs -- have some common characteristics, viz.an ID number, a category, and some attributes defined by the handheld. PilotRecordBase is a common base class collecting methods to manipulate those common characteristics.
Definition at line 48 of file pilotRecord.h.
Constructor & Destructor Documentation
PilotRecordBase::PilotRecordBase | ( | int | attrib = 0 , |
|
int | cat = 0 , |
|||
recordid_t | id = 0 | |||
) | [inline] |
Constructor.
Initialize the characteristics to the given values.
- Parameters:
-
attrib Attributes (bitfield) for this entry. cat Category for this entry. Should be in the range 0 <= cat < Pilot::CATEGORY_COUNT . Using an invalid category means 0 (unfiled) is used. id Unique ID for this entry. May be 0 (non-unique) as well.
Definition at line 60 of file pilotRecord.h.
PilotRecordBase::PilotRecordBase | ( | const PilotRecordBase * | b | ) | [inline] |
Constructor.
Initializes the characteristics from the values the given record b
has. When b
is NULL (which is allowed), everything is assumed zero. No ownership is transferred.
- Parameters:
-
b Record to take characteristics from.
Definition at line 73 of file pilotRecord.h.
virtual PilotRecordBase::~PilotRecordBase | ( | ) | [inline, virtual] |
Member Function Documentation
int PilotRecordBase::attributes | ( | ) | const [inline] |
Attributes of this record (deleted, secret, .
..); it's a bitfield.
Definition at line 90 of file pilotRecord.h.
int PilotRecordBase::category | ( | ) | const [inline] |
Returns the category number [ 0 .
. Pilot::CATEGORY_COUNT-1] of this record.
Definition at line 104 of file pilotRecord.h.
recordid_t PilotRecordBase::id | ( | ) | const [inline] |
Returns the record ID for this record.
Record IDs are unique for a given handheld and database.
Definition at line 155 of file pilotRecord.h.
bool PilotRecordBase::isArchived | ( | ) | const [inline] |
Accessor for one bit of the record's attributes.
Is this record a to-be-archived record? When a record is deleted, it may be marked as "archive on PC" which means the PC should keep a copy. The PC data correspondng to an archived-but-deleted record must not be deleted.
Definition at line 192 of file pilotRecord.h.
bool PilotRecordBase::isDeleted | ( | ) | const [inline] |
Accessor for one bit of the record's attributes.
Is this record marked deleted (on the handheld) ? Deleted records are not removed from the database until a HotSync is done (which normally calls purge deleted or so to really get rid of the records from storage.
Definition at line 173 of file pilotRecord.h.
bool PilotRecordBase::isModified | ( | void | ) | const [inline] |
Accessor for one bit of the record's attributes.
Is this record modified? Modified records are those that have been modified since the last HotSync.
Reimplemented in Memofile.
Definition at line 200 of file pilotRecord.h.
bool PilotRecordBase::isSecret | ( | ) | const [inline] |
Accessor for one bit of the record's attributes.
Is this record secret? Secret records are not displayed on the desktop by default.
Definition at line 181 of file pilotRecord.h.
void PilotRecordBase::setAttributes | ( | int | attrib | ) | [inline] |
bool PilotRecordBase::setCategory | ( | const struct CategoryAppInfo * | info, | |
const QString & | label | |||
) | [inline] |
Sets the category number by looking up the string label
in the category table info
.
Leaves the category unchanged if no match is found and returns false
.
- Parameters:
-
info AppInfo structure containing the labels (in handheld native encoding). label The label to look for.
- Returns:
true
on success,false
on failure
Definition at line 133 of file pilotRecord.h.
void PilotRecordBase::setCategory | ( | int | cat | ) | [inline] |
Sets the category number [ 0 .
. Pilot::CATEGORY_COUNT-1] of this record. Trying to set an illegal category number files this one under "Unfiled" (which is 0).
Definition at line 114 of file pilotRecord.h.
void PilotRecordBase::setDeleted | ( | bool | d = true |
) | [inline] |
Mark a record as deleted (or not).
Mark a record as secret (or not).
void PilotRecordBase::setID | ( | recordid_t | id | ) | [inline] |
Sets the record ID for this record.
Use with caution -- you ca confuse the handheld by doing weird things here.
Reimplemented in Memofile.
Definition at line 163 of file pilotRecord.h.
The documentation for this class was generated from the following file: