Planeshift
Public Member Functions | Public Attributes | Static Public Attributes

PendingQuestion Class Reference

"Questions" are general requests of information from user. More...

#include <questionmanager.h>

List of all members.

Public Member Functions

virtual void HandleAnswer (const csString &answer)
 This is called when user sends answer to this question, or when the question times out (because the user didn't respond in time)
virtual void HandleTimeout ()
 PendingQuestion (int clientnum, const csString &question, psQuestionMessage::questionType_t type)
 PendingQuestion ()
virtual ~PendingQuestion ()

Public Attributes

int clientnum
psQuestionCancelEvent * event
unsigned id
bool ok
csString question
 Holds data that will be somehow displayed to user

  • can be anything, plain text, XML, encoded bitmap.

psQuestionMessage::questionType_t type
 type of question - clients handles each question type differently

Static Public Attributes

static unsigned nextID

Detailed Description

"Questions" are general requests of information from user.

The lifetime of a question: 1) It is sent to some client 2) Client shows appropriate GUI to present the question to user 3) User chooses answer from the GUI 4) Answer is sent to server which somehow reacts to user's decision

Unanswered questions automatically time out after some time

The questioning framework can be extended to support any forms of questions: e.g. plain text, XML, images If you want to create a new kind of questioning GUI on the client, you will need to add a new question type and write its handler on client side.

One common use for questions are invites - see invitemanager.h This class is the superclass for all questions, If you need a new kind of question (for example new handler of answers), inherit from this class.

Definition at line 66 of file questionmanager.h.


Constructor & Destructor Documentation

PendingQuestion::PendingQuestion ( ) [inline]

Definition at line 84 of file questionmanager.h.

PendingQuestion::PendingQuestion ( int  clientnum,
const csString &  question,
psQuestionMessage::questionType_t  type 
)
virtual PendingQuestion::~PendingQuestion ( ) [inline, virtual]

Definition at line 89 of file questionmanager.h.


Member Function Documentation

virtual void PendingQuestion::HandleAnswer ( const csString &  answer) [inline, virtual]

This is called when user sends answer to this question, or when the question times out (because the user didn't respond in time)

Override this method to react to the answers sent by questioned users

Reimplemented in PendingInvite.

Definition at line 97 of file questionmanager.h.

virtual void PendingQuestion::HandleTimeout ( ) [inline, virtual]

Reimplemented in PendingInvite.

Definition at line 98 of file questionmanager.h.


Member Data Documentation

Definition at line 81 of file questionmanager.h.

psQuestionCancelEvent* PendingQuestion::event

Definition at line 82 of file questionmanager.h.

Definition at line 69 of file questionmanager.h.

Definition at line 70 of file questionmanager.h.

Definition at line 71 of file questionmanager.h.

Holds data that will be somehow displayed to user

  • can be anything, plain text, XML, encoded bitmap.

Client will interpret it according to 'type'

Definition at line 79 of file questionmanager.h.

type of question - clients handles each question type differently

Definition at line 74 of file questionmanager.h.


The documentation for this class was generated from the following file: