kpilot/lib

PilotAppCategory Class Reference

#include <pilotAppCategory.h>

Inheritance diagram for PilotAppCategory:

PilotRecordBase PilotDateEntry PilotTodoEntry List of all members.

Detailed Description

Base class for interpretations of the binary blobs.

Also exposes the common characteristics of all entries (in general, these characteristics are copied from the binary blob that this interpretation represents).

Since this is the base of interpretation of the binary blobs, we include codec() here, which is used to translate from and to the handheld native (8 bit) encoding.

Definition at line 60 of file pilotAppCategory.h.


Public Member Functions

 PilotAppCategory (int a=0, recordid_t i=0, int c=0)
 PilotAppCategory (const PilotRecord *rec)
 PilotAppCategory (const PilotAppCategory &copyFrom)
PilotAppCategoryoperator= (const PilotAppCategory &r)
bool operator== (const PilotAppCategory &compareTo)
virtual ~PilotAppCategory (void)
virtual PilotRecordpack ()
virtual QString getTextRepresentation (bool rt=false)
void setCategory (int c)
bool setCategory (struct CategoryAppInfo &info, const QString &label)
bool KDE_DEPRECATED setCat (struct CategoryAppInfo &info, const QString &label)

Static Public Member Functions

static QString fromPilot (const char *c, int len)
static int toPilot (const QString &s, char *buf, int len)
static QTextCodec * codec ()
static QTextCodec * setupPilotCodec (const QString &name)
static QString codecName ()

Protected Member Functions

virtual void * pack_ (void *buf, int *size)=0
virtual void unpack (const void *buf, int size)=0

Static Protected Attributes

static QTextCodec * pilotCodec = 0L

Constructor & Destructor Documentation

PilotAppCategory::PilotAppCategory int  a = 0,
recordid_t  i = 0,
int  c = 0
[inline]
 

Constructor with no data.

Use the indicated values of the characteristics. Note that the order of the parameters is subtly different from that in PilotRecordBase .

Definition at line 89 of file pilotAppCategory.h.

PilotAppCategory::PilotAppCategory const PilotRecord rec  )  [inline]
 

Constructor.

Use the common characteristics values from the given record rec.

Definition at line 96 of file pilotAppCategory.h.

PilotAppCategory::PilotAppCategory const PilotAppCategory copyFrom  )  [inline]
 

Copy constructor.

Definition at line 104 of file pilotAppCategory.h.

virtual PilotAppCategory::~PilotAppCategory void   )  [inline, virtual]
 

Destructor.

VIrtual, since we will be subclassed.

Definition at line 130 of file pilotAppCategory.h.


Member Function Documentation

static QTextCodec* PilotAppCategory::codec  )  [inline, static]
 

Get the codec for use in translating strings from handheld native encoding to QString and vice-versa.

Definition at line 184 of file pilotAppCategory.h.

QString PilotAppCategory::codecName  )  [static]
 

Returns the name of the codec being used.

Definition at line 159 of file pilotRecord.cc.

QString PilotAppCategory::fromPilot const char *  c,
int  len
[static]
 

Static translaion function that maps handheld native (8 bit, usually latin1 but sometimes someting else) encoded data to a Unicode string.

Converts the len characters in c to a Unicode string.

Definition at line 194 of file pilotRecord.cc.

virtual QString PilotAppCategory::getTextRepresentation bool  rt = false  )  [inline, virtual]
 

Returns a text representation of this (interpreted) data.

The text may use Qt rich text tags if rt is true. The default implementation just returns a junk message.

Parameters:
rt Use right text (if needed) if and only if rt is true.

Reimplemented in PilotDateEntry, and PilotTodoEntry.

Definition at line 144 of file pilotAppCategory.h.

PilotAppCategory& PilotAppCategory::operator= const PilotAppCategory r  )  [inline]
 

Assignment operator.

I rather doubt that this is useful.

Definition at line 111 of file pilotAppCategory.h.

bool PilotAppCategory::operator== const PilotAppCategory compareTo  )  [inline]
 

Comparison operator.

Not really useful, since it also wants the same record ID.

Definition at line 122 of file pilotAppCategory.h.

PilotRecord * PilotAppCategory::pack  )  [virtual]
 

Returns:
a PilotRecord that contains all of the info of the subclass. Remember to delete the PilotRecord when finished. Calls pack_() to get the work done.

Definition at line 184 of file pilotRecord.cc.

virtual void* PilotAppCategory::pack_ void *  buf,
int *  size
[protected, pure virtual]
 

Pack whatever data the interpreted record holds into the given buffer, of length size; return NULL to indicate failure, otherwise buf.

Set size to the actual size of data returned. (all of this is dictated by the pilot-link interfaces).

Subclasses must reimplement this to give a specific meaning to the binary blob.

Parameters:
buf Data buffer containing the blob.
size Size of the buffer (in bytes). As input, the maximum size of the buffer. As output, the number of bytes used.

Implemented in PilotDateEntry, and PilotTodoEntry.

bool PilotAppCategory::setCategory struct CategoryAppInfo &  info,
const QString &  label
 

Sets the category number by looking up the string label in the category table info .

Sets the category to 0 (unfiled) if no match is found.

Parameters:
info AppInfo structure containing the labels (in handheld native encoding).
label The label to look for.

Definition at line 164 of file pilotRecord.cc.

void PilotAppCategory::setCategory int  c  )  [inline]
 

Sets the category number to c in the range 0 <= c < PILOT_CATEGORY_MAX).

Using an invalid category number results in category 0.

Reimplemented from PilotRecordBase.

Definition at line 151 of file pilotAppCategory.h.

QTextCodec * PilotAppCategory::setupPilotCodec const QString &  name  )  [static]
 

Create a codec for translating handheld native 8 bit to Unicode, using the given codec name -- this will often be latin1, but might be something else for, say, Russian-language Pilots.

If name is empty, use latin1.

Definition at line 139 of file pilotRecord.cc.

int PilotAppCategory::toPilot const QString &  s,
char *  buf,
int  len
[static]
 

Static translation function that maps a QString onto the native 8 bit encoding of the handheld.

Writes the result into the buffer buf which has size len. Returns the length of the result. Zero-fills the buffer as needed.

Definition at line 199 of file pilotRecord.cc.

virtual void PilotAppCategory::unpack const void *  buf,
int  size
[protected, pure virtual]
 

Unpack the binary blob buf of size size into some structure with meaning.

Implemented in PilotDateEntry, and PilotTodoEntry.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys