llpanelclassified.h

Go to the documentation of this file.
00001 
00032 // Display of a classified used both for the global view in the
00033 // Find directory, and also for each individual user's classified in their
00034 // profile.
00035 
00036 #ifndef LL_LLPANELCLASSIFIED_H
00037 #define LL_LLPANELCLASSIFIED_H
00038 
00039 #include "llpanel.h"
00040 #include "llclassifiedinfo.h"
00041 #include "v3dmath.h"
00042 #include "lluuid.h"
00043 #include "llfloater.h"
00044 //#include "llrect.h"
00045 
00046 class LLButton;
00047 class LLCheckBoxCtrl;
00048 class LLComboBox;
00049 class LLIconCtrl;
00050 class LLLineEditor;
00051 class LLTextBox;
00052 class LLTextEditor;
00053 class LLTextureCtrl;
00054 class LLUICtrl;
00055 class LLMessageSystem;
00056 
00057 class LLPanelClassified : public LLPanel
00058 {
00059 public:
00060     LLPanelClassified(bool in_finder, bool from_search);
00061     /*virtual*/ ~LLPanelClassified();
00062 
00063         void reset();
00064 
00065     /*virtual*/ BOOL postBuild();
00066 
00067     /*virtual*/ void draw();
00068 
00069         /*virtual*/ void refresh();
00070 
00071         void apply();
00072 
00073         // If can close, return TRUE.  If cannot close, pop save/discard dialog
00074         // and return FALSE.
00075         BOOL canClose();
00076 
00077         // Setup a new classified, including creating an id, giving a sane
00078         // initial position, etc.
00079         void initNewClassified();
00080 
00081         void setClassifiedID(const LLUUID& id);
00082         void setClickThroughText(const std::string& text);
00083         static void setClickThrough(const LLUUID& classified_id,
00084                                                                 S32 teleport, S32 map, S32 profile, bool from_new_table);
00085 
00086         // check that the title is valid (E.G. starts with a number or letter)
00087         BOOL titleIsValid();
00088 
00089         // Schedules the panel to request data
00090         // from the server next time it is drawn.
00091         void markForServerRequest();
00092 
00093         std::string getClassifiedName();
00094         const LLUUID& getClassifiedID() const { return mClassifiedID; }
00095 
00096     void sendClassifiedInfoRequest();
00097         void sendClassifiedInfoUpdate();
00098         void resetDirty();
00099 
00100     static void processClassifiedInfoReply(LLMessageSystem* msg, void**);
00101 
00102         // Confirmation dialogs flow in this order
00103         static void callbackConfirmMature(S32 option, void* data);
00104         void confirmMature(S32 option);
00105         void gotMature();
00106         static void callbackGotPriceForListing(S32 option, LLString text, void* data);
00107         static void callbackConfirmPublish(S32 option, void* data);
00108         void confirmPublish(S32 option);
00109 
00110         void sendClassifiedClickMessage(const char* type);
00111 
00112 protected:
00113         static void saveCallback(S32 option, void* data);
00114 
00115         static void onClickUpdate(void* data);
00116     static void onClickTeleport(void* data);
00117     static void onClickMap(void* data);
00118         static void onClickProfile(void* data);
00119     static void onClickSet(void* data);
00120 
00121         static void focusReceived(LLFocusableElement* ctrl, void* data);
00122         static void onCommitAny(LLUICtrl* ctrl, void* data);
00123 
00124         BOOL checkDirty();              // Update and return mDirty
00125 
00126 protected:
00127         bool mInFinder;
00128         bool mFromSearch;               // from web-based "All" search sidebar
00129         BOOL mDirty;
00130         bool mForceClose;
00131         bool mLocationChanged;
00132         LLUUID mClassifiedID;
00133         LLUUID mRequestedID;
00134         LLUUID mCreatorID;
00135         LLUUID mParcelID;
00136         S32 mPriceForListing;
00137 
00138         // Needed for stat tracking
00139         S32 mTeleportClicksOld;
00140         S32 mMapClicksOld;
00141         S32 mProfileClicksOld;
00142         S32 mTeleportClicksNew;
00143         S32 mMapClicksNew;
00144         S32 mProfileClicksNew;
00145 
00146         // Data will be requested on first draw
00147         BOOL mDataRequested;
00148 
00149         // For avatar panel classifieds only, has the user been charged
00150         // yet for this classified?  That is, have they saved once?
00151         BOOL mPaidFor;
00152 
00153         LLString mSimName;
00154         LLVector3d mPosGlobal;
00155 
00156         // Values the user may change
00157         LLTextureCtrl*  mSnapshotCtrl;
00158         LLLineEditor*   mNameEditor;
00159         LLTextEditor*   mDescEditor;
00160         LLLineEditor*   mLocationEditor;
00161         LLComboBox*             mCategoryCombo;
00162         LLComboBox*             mMatureCombo;
00163         LLCheckBoxCtrl* mAutoRenewCheck;
00164 
00165         LLButton*    mUpdateBtn;
00166         LLButton*    mTeleportBtn;
00167         LLButton*    mMapBtn;
00168         LLButton*        mProfileBtn;
00169 
00170         LLTextBox*              mInfoText;
00171         LLButton*               mSetBtn;
00172         LLTextBox*              mClickThroughText;
00173 
00174         LLRect          mSnapshotSize;
00175         typedef std::list<LLPanelClassified*> panel_list_t;
00176         static panel_list_t sAllPanels;
00177 };
00178 
00179 
00180 class LLFloaterPriceForListing
00181 : public LLFloater
00182 {
00183 public:
00184         LLFloaterPriceForListing();
00185         virtual ~LLFloaterPriceForListing();
00186         virtual BOOL postBuild();
00187 
00188         static void show( void (*callback)(S32 option, LLString value, void* userdata), void* userdata );
00189 
00190 private:
00191         static void onClickSetPrice(void*);
00192         static void onClickCancel(void*);
00193         static void buttonCore(S32 button, void* data);
00194 
00195 private:
00196         void (*mCallback)(S32 option, LLString, void*);
00197         void* mUserData;
00198 };
00199 
00200 
00201 #endif // LL_LLPANELCLASSIFIED_H

Generated on Fri May 16 08:33:49 2008 for SecondLife by  doxygen 1.5.5