#include <ArServerHandlerPopup.h>
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 |
| ArServerBase * | myServer |
| ArFunctorC< ArServerHandlerPopup > | myServerCycleCB |
Classes | |
| class | PopupData |
| ArServerHandlerPopup::ArServerHandlerPopup | ( | ArServerBase * | server | ) |
Constructor.
| ArServerHandlerPopup::~ArServerHandlerPopup | ( | ) | [virtual] |
Destructor.
| 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.
| 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) |
| 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.
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] |
1.4.7