kgamepropertyhandler.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef __KGAMEPROPERTYHANDLER_H_
00022
#define __KGAMEPROPERTYHANDLER_H_
00023
00024
#include <qobject.h>
00025
#include <qintdict.h>
00026
00027
#include "kgameproperty.h"
00028
00029
class QDataStream;
00030
class KGame;
00031
class KPlayer;
00032
00033
00034
class KGamePropertyHandlerPrivate;
00035
00071 class KGamePropertyHandler :
public QObject
00072 {
00073 Q_OBJECT
00074
00075
public:
00082
KGamePropertyHandler(
QObject* parent = 0);
00083
00089
KGamePropertyHandler(
int id,
const QObject* receiver,
const char* sendf,
const char* emitf,
QObject* parent = 0);
00090 ~
KGamePropertyHandler();
00091
00103
void registerHandler(
int id,
const QObject *receiver,
const char * send,
const char *emit);
00104
00120
bool processMessage(
QDataStream &stream,
int id,
bool isSender );
00121
00125
int id()
const;
00126
00134
bool addProperty(
KGamePropertyBase *data,
QString name=0);
00135
00141
bool removeProperty(
KGamePropertyBase *data);
00142
00149
int uniquePropertyId();
00150
00151
00158
virtual bool load(
QDataStream &stream);
00159
00166
virtual bool save(
QDataStream &stream);
00167
00173
bool sendProperty(
QDataStream &s);
00174
00175
void sendLocked(
bool l);
00176
00182
void emitSignal(
KGamePropertyBase *data);
00183
00190
QString propertyName(
int id)
const;
00191
00196
KGamePropertyBase *
find(
int id);
00197
00211
void clear();
00212
00217
void setId(
int id);
00218
00223
void unlockProperties();
00224
00233
void setPolicy(KGamePropertyBase::PropertyPolicy p,
bool userspace=
true);
00234
00245
void lockDirectEmit();
00246
00251
void unlockDirectEmit();
00252
00257 KGamePropertyBase::PropertyPolicy
policy();
00258
00268
void lockProperties();
00269
00274
void flush();
00275
00279
QIntDict<KGamePropertyBase> &
dict()
const;
00280
00293
QString propertyValue(
KGamePropertyBase* property);
00294
00295
00299
void Debug();
00300
00301
00302 signals:
00313
void signalPropertyChanged(
KGamePropertyBase *);
00314
00322
void signalSendMessage(
int msgid,
QDataStream &,
bool* sent);
00323
00343
void signalRequestValue(
KGamePropertyBase* property,
QString& value);
00344
00345
private:
00346
void init();
00347
00348
private:
00349 KGamePropertyHandlerPrivate* d;
00350 };
00351
00352
#endif
This file is part of the documentation for libkdegames Library Version 3.3.0.