llgivemoney.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLGIVEMONEY_H
00033 #define LL_LLGIVEMONEY_H
00034 
00035 #include "lluuid.h"
00036 #include "llfloater.h"
00037 #include "lllslconstants.h"
00038 
00039 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00040 // Class LLFloaterPay
00041 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00042 
00043 class LLViewerRegion;
00044 class LLLineEditor;
00045 class LLTextBox;
00046 class LLButton;
00047 class LLObjectSelection;
00048 struct LLGiveMoneyInfo;
00049 
00050 typedef void (*money_callback)(const LLUUID&, LLViewerRegion*,S32,BOOL,S32,const LLString&);
00051 
00052 class LLFloaterPay : public LLFloater
00053 {
00054 public:
00055         LLFloaterPay(const std::string& name, 
00056                                  money_callback callback,
00057                                  const LLUUID& target_id,
00058                                  BOOL target_is_object);
00059         virtual ~LLFloaterPay();
00060 
00061         // Pay into an in-world object, which will trigger scripts and eventually
00062         // transfer the L$ to the resident or group that owns the object.
00063         // Object must be selected.  Must pass object id, because it may be
00064         // a child of the selected object.
00065         static void payViaObject(money_callback callback, const LLUUID& object_id);
00066         
00067         // Pay an avatar or group directly, not via an object in the world.
00068         // Scripts are not notified, L$ can be direcly transferred.
00069         static void payDirectly(money_callback callback,
00070                                                         const LLUUID& target_id,
00071                                                         BOOL is_group);
00072 
00073 private:
00074         static void onCancel(void* data);
00075         static void onKeystroke(LLLineEditor* editor, void* data);
00076         static void onGive(void* data);
00077         void give(S32 amount);
00078         static void processPayPriceReply(LLMessageSystem* msg, void **userdata);
00079         static void onCacheOwnerName(const LLUUID& owner_id,
00080                                                                  const char* firstname,
00081                                                                  const char* lastname,
00082                                                                  BOOL is_group,
00083                                                                  void* userdata);
00084         void finishPayUI(const LLUUID& target_id, BOOL is_group);
00085 
00086 protected:
00087         std::vector<LLGiveMoneyInfo*> mCallbackData;
00088         money_callback mCallback;
00089         LLTextBox* mObjectNameText;
00090         LLUUID mTargetUUID;
00091         BOOL mTargetIsObject;
00092         BOOL mTargetIsGroup;
00093         BOOL mHaveName;
00094 
00095         LLButton* mQuickPayButton[MAX_PAY_BUTTONS];
00096         LLGiveMoneyInfo* mQuickPayInfo[MAX_PAY_BUTTONS];
00097 
00098         LLHandle<LLObjectSelection> mObjectSelection;
00099 
00100         static S32 sLastAmount;
00101 };
00102 
00103 
00104 #endif // LL_LLGIVEMONEY_H

Generated on Thu Jul 1 06:08:39 2010 for Second Life Viewer by  doxygen 1.4.7