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
00052
00053 static LLPreviewGesture* show(const std::string& title, const LLUUID& item_id, const LLUUID& object_id, BOOL take_focus = TRUE);
00054
00055
00056 virtual BOOL handleKeyHere(KEY key, MASK mask);
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
00064 virtual BOOL postBuild();
00065
00066
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
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
00107 LLMultiGesture* createGesture();
00108
00109
00110
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
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 virtual const char *getTitleName() const { return "Gesture"; }
00141
00142 protected:
00143
00144 LLLineEditor* mTriggerEditor;
00145 LLTextBox* mReplaceText;
00146 LLLineEditor* mReplaceEditor;
00147 LLComboBox* mModifierCombo;
00148 LLComboBox* mKeyCombo;
00149
00150 LLScrollListCtrl* mLibraryList;
00151 LLButton* mAddBtn;
00152 LLButton* mUpBtn;
00153 LLButton* mDownBtn;
00154 LLButton* mDeleteBtn;
00155 LLScrollListCtrl* mStepList;
00156
00157
00158 LLTextBox* mOptionsText;
00159 LLRadioGroup* mAnimationRadio;
00160 LLComboBox* mAnimationCombo;
00161 LLComboBox* mSoundCombo;
00162 LLLineEditor* mChatEditor;
00163 LLCheckBoxCtrl* mWaitAnimCheck;
00164 LLCheckBoxCtrl* mWaitTimeCheck;
00165 LLLineEditor* mWaitTimeEditor;
00166
00167 LLCheckBoxCtrl* mActiveCheck;
00168 LLButton* mSaveBtn;
00169 LLButton* mPreviewBtn;
00170
00171 LLMultiGesture* mPreviewGesture;
00172 BOOL mDirty;
00173 };
00174
00175 #endif