llpreviewgesture.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLPREVIEWGESTURE_H
00033 #define LL_LLPREVIEWGESTURE_H
00034 
00035 #include "llpreview.h"
00036 
00037 class LLMultiGesture;
00038 class LLLineEditor;
00039 class LLTextBox;
00040 class LLCheckBoxCtrl;
00041 class LLComboBox;
00042 class LLScrollListCtrl;
00043 class LLScrollListItem;
00044 class LLButton;
00045 class LLGestureStep;
00046 class LLRadioGroup;
00047 
00048 class LLPreviewGesture : public LLPreview
00049 {
00050 public:
00051         // Pass an object_id if this gesture is inside an object in the world,
00052         // otherwise use LLUUID::null.
00053         static LLPreviewGesture* show(const std::string& title, const LLUUID& item_id, const LLUUID& object_id, BOOL take_focus = TRUE);
00054 
00055         // LLView
00056         virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
00057         virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
00058                                                                          EDragAndDropType cargo_type,
00059                                                                          void* cargo_data,
00060                                                                          EAcceptance* accept,
00061                                                                          LLString& tooltip_msg);
00062 
00063         // LLPanel
00064         virtual BOOL postBuild();
00065 
00066         // LLFloater
00067         virtual BOOL canClose();
00068         virtual void setMinimized(BOOL minimize);
00069         virtual void onClose(bool app_quitting);
00070         virtual void onUpdateSucceeded();
00071         
00072 
00073 protected:
00074         LLPreviewGesture();
00075         virtual ~LLPreviewGesture();
00076 
00077         void init(const LLUUID& item_id, const LLUUID& object_id);
00078 
00079         // Populate various comboboxes
00080         void addModifiers();
00081         void addKeys();
00082         void addAnimations();
00083         void addSounds();
00084 
00085         void refresh();
00086 
00087         void initDefaultGesture();
00088 
00089         void loadAsset();
00090 
00091         static void onLoadComplete(LLVFS *vfs,
00092                                                            const LLUUID& asset_uuid,
00093                                                            LLAssetType::EType type,
00094                                                            void* user_data, S32 status, LLExtStat ext_status);
00095 
00096         void loadUIFromGesture(LLMultiGesture* gesture);
00097 
00098         void saveIfNeeded();
00099 
00100         static void onSaveComplete(const LLUUID& asset_uuid,
00101                                                            void* user_data,
00102                                                            S32 status, LLExtStat ext_status);
00103 
00104         static void handleSaveChangesDialog(S32 option, void* userdata);
00105 
00106         // Write UI back into gesture
00107         LLMultiGesture* createGesture();
00108 
00109         // Add a step.  Pass the name of the step, like "Animation",
00110         // "Sound", "Chat", or "Wait"
00111         LLScrollListItem* addStep(const std::string& step_name);
00112 
00113         static void updateLabel(LLScrollListItem* item);
00114 
00115         static void onCommitSetDirty(LLUICtrl* ctrl, void* data);
00116         static void onCommitLibrary(LLUICtrl* ctrl, void* data);
00117         static void onCommitStep(LLUICtrl* ctrl, void* data);
00118         static void onCommitAnimation(LLUICtrl* ctrl, void* data);
00119         static void onCommitSound(LLUICtrl* ctrl, void* data);
00120         static void onCommitChat(LLUICtrl* ctrl, void* data);
00121         static void onCommitWait(LLUICtrl* ctrl, void* data);
00122         static void onCommitWaitTime(LLUICtrl* ctrl, void* data);
00123 
00124         static void onCommitAnimationTrigger(LLUICtrl* ctrl, void *data);
00125 
00126         // Handy function to commit each keystroke
00127         static void onKeystrokeCommit(LLLineEditor* caller, void* data);
00128 
00129         static void onClickAdd(void* data);
00130         static void onClickUp(void* data);
00131         static void onClickDown(void* data);
00132         static void onClickDelete(void* data);
00133 
00134         static void onCommitActive(LLUICtrl* ctrl, void* data);
00135         static void onClickSave(void* data);
00136         static void onClickPreview(void* data);
00137 
00138         static void onDonePreview(LLMultiGesture* gesture, void* data);
00139 
00140 protected:
00141         // LLPreview contains mDescEditor
00142         LLLineEditor*   mTriggerEditor;
00143         LLTextBox*              mReplaceText;
00144         LLLineEditor*   mReplaceEditor;
00145         LLComboBox*             mModifierCombo;
00146         LLComboBox*             mKeyCombo;
00147 
00148         LLScrollListCtrl*       mLibraryList;
00149         LLButton*                       mAddBtn;
00150         LLButton*                       mUpBtn;
00151         LLButton*                       mDownBtn;
00152         LLButton*                       mDeleteBtn;
00153         LLScrollListCtrl*       mStepList;
00154 
00155         // Options panels for items in gesture list
00156         LLTextBox*                      mOptionsText;
00157         LLRadioGroup*           mAnimationRadio;
00158         LLComboBox*                     mAnimationCombo;
00159         LLComboBox*                     mSoundCombo;
00160         LLLineEditor*           mChatEditor;
00161         LLCheckBoxCtrl*         mWaitAnimCheck;
00162         LLCheckBoxCtrl*         mWaitTimeCheck;
00163         LLLineEditor*           mWaitTimeEditor;
00164 
00165         LLCheckBoxCtrl*         mActiveCheck;
00166         LLButton*                       mSaveBtn;
00167         LLButton*                       mPreviewBtn;
00168 
00169         LLMultiGesture*         mPreviewGesture;
00170         BOOL mDirty;
00171 };
00172 
00173 #endif

Generated on Thu Jul 1 06:09:02 2010 for Second Life Viewer by  doxygen 1.4.7