ArServerHandlerPopup Class Reference

#include <ArServerHandlerPopup.h>

List of all members.


Detailed Description

TODO make the callbacks actually happen.
Examples:

popupExample.cpp.


Public Types

 CRITICAL = 3
 A critical problem (program failure likely).
 INFORMATION = 1
 Just an informational message.
 NOICON = 0
 No icon at all.
enum  PopupType {
  NOICON = 0, INFORMATION = 1, WARNING = 2, CRITICAL = 3,
  QUESTION = 4
}
 QUESTION = 4
 A question.
 WARNING = 2
 A warning.

Public Member Functions

 ArServerHandlerPopup (ArServerBase *server)
 Constructor.
void closePopup (ArTypes::Byte4 id, const char *closeMessage)
 Cancels a popup with the ID.
ArTypes::Byte4 createPopup (ArServerHandlerPopupInfo *popupInfo, ArFunctor2< ArTypes::Byte4, int > *callback=NULL)
 Creates a new popup.
void netPopupClicked (ArServerClient *client, ArNetPacket *packet)
 The call from the network that the popup was clicked.
void netPopupList (ArServerClient *client, ArNetPacket *packet)
 The call from the network for getting the popup list.
void serverCycleCallback (void)
 Our cycle callback.
virtual ~ArServerHandlerPopup ()
 Destructor.

Protected Member Functions

void buildPacket (ArNetPacket *sendingPacket, PopupData *popupData)

Protected Attributes

ArMutex myDataMutex
ArTypes::Byte4 myLastID
ArTime myLastTimeCheck
std::map< ArTypes::Byte4,
PopupData * > 
myMap
ArFunctor2C< ArServerHandlerPopup,
ArServerClient *, ArNetPacket * > 
myNetPopupClickedCB
ArFunctor2C< ArServerHandlerPopup,
ArServerClient *, ArNetPacket * > 
myNetPopupListCB
ArServerBasemyServer
ArFunctorC< ArServerHandlerPopupmyServerCycleCB

Classes

class  PopupData


Member Enumeration Documentation

enum ArServerHandlerPopup::PopupType

Enumerator:
NOICON  No icon at all.
INFORMATION  Just an informational message.
WARNING  A warning.
CRITICAL  A critical problem (program failure likely).
QUESTION  A question.


Constructor & Destructor Documentation

ArServerHandlerPopup::ArServerHandlerPopup ( ArServerBase server  ) 

Constructor.

ArServerHandlerPopup::~ArServerHandlerPopup (  )  [virtual]

Destructor.


Member Function Documentation

void ArServerHandlerPopup::buildPacket ( ArNetPacket sendingPacket,
PopupData popupData 
) [protected]

void ArServerHandlerPopup::closePopup ( ArTypes::Byte4  id,
const char *  closeMessage 
)

Cancels a popup with the ID.

ArTypes::Byte4 ArServerHandlerPopup::createPopup ( ArServerHandlerPopupInfo popupInfo,
ArFunctor2< ArTypes::Byte4, int > *  callback = NULL 
)

Creates a new popup.

.. this just describes what happens with the popup...

So you pass in a popupInfo for the popup you want and a functor to call when buttons in the popup are pushed, this returns an id for that popup, which you can use to cancel the popup and so you know which popup this is.... the callback (if there is one) will be called when the popup has a button pushed with the id and the number of the button or -1 if the popup timed out or -2 if it was canceled. The popup has a timeout, so that if no clients are connected watching for popups or if no one is paying attention that things can move on easily.

Parameters:
popupInfo the information that describes the popup... this class makes a copy of the information so you can do whatever you want with the information after you've called this function (ie change the button and call it again or whatever)
callback The class will call this function when one of the buttons is pressed in the popup on one of the clients, the callback will be called with the long int being the ID, and the int being the button that is pushed (or -1 if the timeout happened or -2 if it was closed)
Examples:
popupExample.cpp.

void ArServerHandlerPopup::netPopupClicked ( ArServerClient client,
ArNetPacket packet 
)

The call from the network that the popup was clicked.

void ArServerHandlerPopup::netPopupList ( ArServerClient client,
ArNetPacket packet 
)

The call from the network for getting the popup list.

void ArServerHandlerPopup::serverCycleCallback ( void   ) 

Our cycle callback.


Member Data Documentation

ArMutex ArServerHandlerPopup::myDataMutex [protected]

ArTypes::Byte4 ArServerHandlerPopup::myLastID [protected]

ArTime ArServerHandlerPopup::myLastTimeCheck [protected]

std::map<ArTypes::Byte4, PopupData *> ArServerHandlerPopup::myMap [protected]

ArFunctor2C<ArServerHandlerPopup, ArServerClient*, ArNetPacket *> ArServerHandlerPopup::myNetPopupClickedCB [protected]

ArFunctor2C<ArServerHandlerPopup, ArServerClient*, ArNetPacket *> ArServerHandlerPopup::myNetPopupListCB [protected]

ArServerBase* ArServerHandlerPopup::myServer [protected]

ArFunctorC<ArServerHandlerPopup> ArServerHandlerPopup::myServerCycleCB [protected]


The documentation for this class was generated from the following files:
Generated on Fri Jul 31 12:37:29 2009 for ArNetworking by  doxygen 1.4.7