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 = false);
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 confirmPublish(S32 option);
00099 
00100     static void processClassifiedInfoReply(LLMessageSystem* msg, void**);
00101 
00102         static void callbackGotPriceForListing(S32 option, LLString text, void* data);
00103         static void callbackConfirmPublish(S32 option, void* data);
00104 
00105 protected:
00106         static void saveCallback(S32 option, void* data);
00107 
00108         static void onClickUpdate(void* data);
00109     static void onClickTeleport(void* data);
00110     static void onClickMap(void* data);
00111         static void onClickProfile(void* data);
00112     static void onClickSet(void* data);
00113 
00114         static void onFocusReceived(LLUICtrl* ctrl, void* data);
00115         static void onCommitAny(LLUICtrl* ctrl, void* data);
00116 
00117         void sendClassifiedClickMessage(const char* type);
00118         BOOL checkDirty();              // Update and return mDirty
00119 
00120 protected:
00121         BOOL mInFinder;
00122         bool mFromSearch;
00123         BOOL mDirty;
00124         bool mForceClose;
00125         bool mLocationChanged;
00126         LLUUID mClassifiedID;
00127         LLUUID mRequestedID;
00128         LLUUID mCreatorID;
00129         LLUUID mParcelID;
00130         S32 mPriceForListing;
00131 
00132         // Needed for stat tracking
00133         S32 mTeleportClicksOld;
00134         S32 mMapClicksOld;
00135         S32 mProfileClicksOld;
00136         S32 mTeleportClicksNew;
00137         S32 mMapClicksNew;
00138         S32 mProfileClicksNew;
00139 
00140         // Data will be requested on first draw
00141         BOOL mDataRequested;
00142 
00143         // For avatar panel classifieds only, has the user been charged
00144         // yet for this classified?  That is, have they saved once?
00145         BOOL mPaidFor;
00146 
00147         LLString mSimName;
00148         LLVector3d mPosGlobal;
00149 
00150         // Values the user may change
00151         LLTextureCtrl*  mSnapshotCtrl;
00152         LLLineEditor*   mNameEditor;
00153         LLTextEditor*   mDescEditor;
00154         LLLineEditor*   mLocationEditor;
00155         LLComboBox*             mCategoryCombo;
00156         LLCheckBoxCtrl* mMatureCheck;
00157         LLCheckBoxCtrl* mAutoRenewCheck;
00158 
00159         LLButton*    mUpdateBtn;
00160         LLButton*    mTeleportBtn;
00161         LLButton*    mMapBtn;
00162         LLButton*        mProfileBtn;
00163 
00164         LLTextBox*              mInfoText;
00165         LLButton*               mSetBtn;
00166         LLTextBox*              mClickThroughText;
00167 
00168         LLRect          mSnapshotSize;
00169         typedef std::list<LLPanelClassified*> panel_list_t;
00170         static panel_list_t sAllPanels;
00171 };
00172 
00173 
00174 class LLFloaterPriceForListing
00175 : public LLFloater
00176 {
00177 public:
00178         LLFloaterPriceForListing();
00179         virtual ~LLFloaterPriceForListing();
00180         virtual BOOL postBuild();
00181 
00182         static void show( void (*callback)(S32 option, LLString value, void* userdata), void* userdata );
00183 
00184 private:
00185         static void onClickSetPrice(void*);
00186         static void onClickCancel(void*);
00187         static void buttonCore(S32 button, void* data);
00188 
00189 private:
00190         void (*mCallback)(S32 option, LLString, void*);
00191         void* mUserData;
00192 };
00193 
00194 
00195 #endif // LL_LLPANELCLASSIFIED_H

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