#include <ArServerHandlerPopup.h>
Public Types | |
enum | PopupType { NOICON = 0, INFORMATION = 1, WARNING = 2, CRITICAL = 3, QUESTION = 4 } |
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 | serverCycleCallback (void) |
Our cycle callback. | |
virtual | ~ArServerHandlerPopup () |
Destructor. | |
Protected Attributes | |
ArMutex | myDataMutex |
ArTypes::Byte4 | myLastID |
ArTime | myLastTimeCheck |
std::map< ArTypes::Byte4, PopupData * > | myMap |
ArFunctor2C< ArServerHandlerPopup, ArServerClient *, ArNetPacket * > | myNetPopupClickedCB |
ArServerBase * | myServer |
ArFunctorC< ArServerHandlerPopup > | myServerCycleCB |
Classes | |
class | PopupData |
Definition at line 42 of file ArServerHandlerPopup.h.
|
Definition at line 61 of file ArServerHandlerPopup.h. |
|
Constructor.
Definition at line 45 of file ArServerHandlerPopup.cpp. References ArServerBase::addCycleCallback(), ArServerBase::addData(), myLastID, myLastTimeCheck, myNetPopupClickedCB, myServer, myServerCycleCB, netPopupClicked(), serverCycleCallback(), and ArTime::setToNow(). |
|
Destructor.
Definition at line 78 of file ArServerHandlerPopup.cpp. |
|
Cancels a popup with the ID.
Definition at line 157 of file ArServerHandlerPopup.cpp. References ArServerBase::broadcastPacketTcp(), ArBasePacket::byte4ToBuf(), ArFunctor2< P1, P2 >::invoke(), ArMutex::lock(), ArLog::log(), ArServerHandlerPopup::PopupData::myCallback, myDataMutex, ArServerHandlerPopup::PopupData::myID, myMap, myServer, ArBasePacket::strToBuf(), and ArMutex::unlock(). |
|
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.
Definition at line 110 of file ArServerHandlerPopup.cpp. References ArServerBase::broadcastPacketTcp(), ArBasePacket::byte4ToBuf(), ArBasePacket::byteToBuf(), ArServerHandlerPopupInfo::getButton0Label(), ArServerHandlerPopupInfo::getButton1Label(), ArServerHandlerPopupInfo::getButton2Label(), ArServerHandlerPopupInfo::getDefaultButtonNumber(), ArServerHandlerPopupInfo::getEscapeButtonNumber(), ArServerHandlerPopupInfo::getIgnoreIdentifier(), ArServerHandlerPopupInfo::getMessage(), ArServerHandlerPopupInfo::getPopupType(), ArServerHandlerPopupInfo::getTitle(), ArMutex::lock(), myDataMutex, myLastID, myMap, ArServerHandlerPopup::PopupData::myPopupInfo, myServer, ArBasePacket::strToBuf(), and ArMutex::unlock(). Referenced by ArServerSimpleComMovementLogging::popupMovementParams(), ArServerSimpleComLogRobotConfig::popupOrigConfig(), SensorDetectPopup::sensorTask(), and ArServerSimplePopup::simplePopup(). |
|
The call from the network that the popup was clicked.
Definition at line 186 of file ArServerHandlerPopup.cpp. References ArServerBase::broadcastPacketTcp(), ArBasePacket::byte4ToBuf(), client, ArServerHandlerPopupInfo::getButton0Pressed(), ArServerHandlerPopupInfo::getButton1Pressed(), ArServerHandlerPopupInfo::getButton2Pressed(), ArFunctor2< P1, P2 >::invoke(), ArMutex::lock(), ArLog::log(), ArServerHandlerPopup::PopupData::myCallback, myDataMutex, ArServerHandlerPopup::PopupData::myID, myMap, ArServerHandlerPopup::PopupData::myPopupInfo, myServer, ArBasePacket::strToBuf(), and ArMutex::unlock(). Referenced by ArServerHandlerPopup(). |
|
|
Definition at line 88 of file ArServerHandlerPopup.h. Referenced by closePopup(), createPopup(), netPopupClicked(), and serverCycleCallback(). |
|
Definition at line 90 of file ArServerHandlerPopup.h. Referenced by ArServerHandlerPopup(), and createPopup(). |
|
Definition at line 91 of file ArServerHandlerPopup.h. Referenced by ArServerHandlerPopup(), and serverCycleCallback(). |
|
Definition at line 89 of file ArServerHandlerPopup.h. Referenced by closePopup(), createPopup(), netPopupClicked(), and serverCycleCallback(). |
|
Definition at line 93 of file ArServerHandlerPopup.h. Referenced by ArServerHandlerPopup(). |
|
Definition at line 69 of file ArServerHandlerPopup.h. Referenced by ArServerHandlerPopup(), closePopup(), createPopup(), netPopupClicked(), and serverCycleCallback(). |
|
Definition at line 94 of file ArServerHandlerPopup.h. Referenced by ArServerHandlerPopup(). |