home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 Mobile
/
Chip_Mobile_2001.iso
/
palm
/
business
/
printcar
/
printcar.exe
/
src
/
PrintCardModel.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-06-10
|
2KB
|
83 lines
//
// $Id: PrintCardModel.h,v 1.6 2000/06/10 00:19:44 sergey Exp $
//
#ifndef _PrintCardModel_h_
#define _PrintCardModel_h_
#include "Util/Serializable.h"
#include "AddressList.h"
#include "CardList.h"
#include "PrintCardPreferences.h"
using namespace Util;
namespace UI { class ListChoices; }
namespace Util { class InputStream; }
namespace IrDA { class Callback; }
//
// Data model of the PrintCard application
//
class PrintCardModel: private Serializable
{
public:
PrintCardModel();
~PrintCardModel();
private:
PrintCardModel(const PrintCardModel&);
PrintCardModel& operator =(const PrintCardModel&);
// operations
public:
UI::ListChoices createNameChoices() const;
UI::ListChoices createCardChoices() const;
// Changes position (nameIndex) when finds the record with requested first letter.
bool findNameByFirstLetter(char letter);
// Returns card' preview image by it's index or 0 if no image was found.
BitmapPtr getPreviewImage() const;
// Print selected card by its index. Pass callback reference as a parameter in order to
// receive notifications from the printing layer.
void print(IrDA::Callback& irCallback);
// attributes
int namesIndex() const { return _namesIndex; }
void setNamesIndex(int index) { _namesIndex = index; }
int cardsIndex() const { return _cardsIndex; }
void setCardsIndex(int index) { _cardsIndex = index; }
const PrintCardPreferences& preferences() const { return _preferences; }
PrintCardPreferences& preferences() { return _preferences; }
// serialization interface
private:
virtual void serialize(DataOutputStream& stream) const;
virtual void restore(const DataInputStream& stream);
// implementation
private:
void loadPreferences();
void savePreferences();
void printScript(IrDA::Callback& irCallback, const CardRecord& card);
// data memebars
private:
int _namesIndex;
int _cardsIndex;
AddressList _addressList;
CardList _cardList;
PrintCardPreferences _preferences;
};
#endif // _PrintCardModel_h_