home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 Mobile
/
Chip_Mobile_2001.iso
/
palm
/
business
/
printcar
/
printcar.exe
/
src
/
AddressList.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-06-10
|
2KB
|
62 lines
//
// $Id: AddressList.h,v 1.4 2000/06/10 00:19:39 sergey Exp $
//
#ifndef _AddressList_h_
#define _AddressList_h_
#include "DB/Database.h"
#include "DB/AddressAppInfo.h"
#include "DB/AdresseRecord.h"
//
// This class represents a list of address items.
// The data will be read from the AdresseDB.
//
class AddressList
{
public:
AddressList();
private:
AddressList(const AddressList&);
AddressList& operator =(const AddressList&);
// operations
public:
const DB::AddressAppInfo& appInfo() const;
int recordCount() const;
const DB::AdresseRecord& record(int index) const;
// Returns display name in form "firstName, lastName"
const char* getDisplayName(int index, char* result, int maxResultSize) const;
// Returns index of the record found by the record's
// "lastName" entry first letter. Return -1 if record not found.
int findByFirstLetter(int startIndex, char letter) const;
// attributes
bool isRecord(int index) const;
// implementation
private:
bool ensureDatabaseOpened() const;
bool ensureRecordLoaded(int index) const;
int copyString(const char* src, char* dest, int maxDestSize) const;
// Checks the record name for first letter match.
bool isFirstLetterMatch(int index, char letter) const;
// data members
private:
mutable int _lastIndex;
mutable DB::Database _database;
mutable DB::AddressAppInfo _appInfo;
mutable DB::AdresseRecord _currentRecord;
};
#endif // _AddressList_h_