PageRenderTime 166ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llviewermenu.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 186 lines | 118 code | 32 blank | 36 comment | 0 complexity | a1cdca6492f3712b388050ea28962f06 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llviewermenu.h
  3. * @brief Builds menus out of objects
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLVIEWERMENU_H
  27. #define LL_LLVIEWERMENU_H
  28. #include "llmenugl.h"
  29. #include "llsafehandle.h"
  30. class LLMessageSystem;
  31. class LLSD;
  32. class LLUICtrl;
  33. class LLView;
  34. class LLParcelSelection;
  35. class LLObjectSelection;
  36. class LLSelectNode;
  37. void initialize_edit_menu();
  38. void init_menus();
  39. void cleanup_menus();
  40. void show_debug_menus(); // checks for if menus should be shown first.
  41. void toggle_debug_menus(void*);
  42. void show_context_menu( S32 x, S32 y, MASK mask );
  43. void show_build_mode_context_menu(S32 x, S32 y, MASK mask);
  44. void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y);
  45. void show_topinfobar_context_menu(LLView* ctrl, S32 x, S32 y);
  46. BOOL enable_save_into_inventory(void*);
  47. void handle_reset_view();
  48. void handle_cut(void*);
  49. void handle_copy(void*);
  50. void handle_paste(void*);
  51. void handle_delete(void*);
  52. void handle_redo(void*);
  53. void handle_undo(void*);
  54. void handle_select_all(void*);
  55. void handle_deselect(void*);
  56. void handle_delete_object();
  57. void handle_duplicate(void*);
  58. void handle_duplicate_in_place(void*);
  59. BOOL enable_not_have_card(void *userdata);
  60. void process_grant_godlike_powers(LLMessageSystem* msg, void**);
  61. BOOL enable_cut(void*);
  62. BOOL enable_copy(void*);
  63. BOOL enable_paste(void*);
  64. BOOL enable_select_all(void*);
  65. BOOL enable_deselect(void*);
  66. BOOL enable_undo(void*);
  67. BOOL enable_redo(void*);
  68. BOOL is_agent_mappable(const LLUUID& agent_id);
  69. void confirm_replace_attachment(S32 option, void* user_data);
  70. void handle_detach_from_avatar(const LLSD& user_data);
  71. void attach_label(std::string& label, const LLSD&);
  72. void detach_label(std::string& label, const LLSD&);
  73. void handle_detach(void*);
  74. BOOL enable_god_full(void* user_data);
  75. BOOL enable_god_liaison(void* user_data);
  76. BOOL enable_god_basic(void* user_data);
  77. void set_underclothes_menu_options();
  78. void exchange_callingcard(const LLUUID& dest_id);
  79. void handle_gestures(void*);
  80. void handle_sit_down(void*);
  81. void handle_object_build(void*);
  82. void handle_object_touch();
  83. bool enable_object_open();
  84. void handle_object_open();
  85. // Buy either contents or object itself
  86. void handle_buy();
  87. void handle_take_copy();
  88. void handle_look_at_selection(const LLSD& param);
  89. void handle_zoom_to_object(LLUUID object_id);
  90. void handle_buy_land();
  91. // Takes avatar UUID, or if no UUID passed, uses last selected object
  92. void handle_avatar_freeze(const LLSD& avatar_id);
  93. // Takes avatar UUID, or if no UUID passed, uses last selected object
  94. void handle_avatar_eject(const LLSD& avatar_id);
  95. bool enable_freeze_eject(const LLSD& avatar_id);
  96. // Can anyone take a free copy of the object?
  97. // *TODO: Move to separate file
  98. bool anyone_copy_selection(LLSelectNode* nodep);
  99. // Is this selected object for sale?
  100. // *TODO: Move to separate file
  101. bool for_sale_selection(LLSelectNode* nodep);
  102. void handle_save_snapshot(void *);
  103. void handle_toggle_flycam();
  104. void handle_object_sit_or_stand();
  105. void handle_give_money_dialog();
  106. bool enable_pay_object();
  107. bool enable_buy_object();
  108. bool handle_go_to();
  109. // Export to XML or Collada
  110. void handle_export_selected( void * );
  111. class LLViewerMenuHolderGL : public LLMenuHolderGL
  112. {
  113. public:
  114. struct Params : public LLInitParam::Block<Params, LLMenuHolderGL::Params>
  115. {};
  116. LLViewerMenuHolderGL(const Params& p);
  117. virtual BOOL hideMenus();
  118. void setParcelSelection(LLSafeHandle<LLParcelSelection> selection);
  119. void setObjectSelection(LLSafeHandle<LLObjectSelection> selection);
  120. virtual const LLRect getMenuRect() const;
  121. protected:
  122. LLSafeHandle<LLParcelSelection> mParcelSelection;
  123. LLSafeHandle<LLObjectSelection> mObjectSelection;
  124. };
  125. extern const std::string SAVE_INTO_INVENTORY;
  126. extern LLMenuBarGL* gMenuBarView;
  127. //extern LLView* gMenuBarHolder;
  128. extern LLMenuGL* gEditMenu;
  129. extern LLMenuGL* gPopupMenuView;
  130. extern LLViewerMenuHolderGL* gMenuHolder;
  131. extern LLMenuBarGL* gLoginMenuBarView;
  132. // Context menus in 3D scene
  133. extern LLContextMenu *gMenuAvatarSelf;
  134. extern LLContextMenu *gMenuAvatarOther;
  135. extern LLContextMenu *gMenuObject;
  136. extern LLContextMenu *gMenuAttachmentSelf;
  137. extern LLContextMenu *gMenuAttachmentOther;
  138. extern LLContextMenu *gMenuLand;
  139. // Needed to build menus when attachment site list available
  140. extern LLMenuGL* gAttachSubMenu;
  141. extern LLMenuGL* gDetachSubMenu;
  142. extern LLMenuGL* gTakeOffClothes;
  143. extern LLContextMenu* gAttachScreenPieMenu;
  144. extern LLContextMenu* gDetachScreenPieMenu;
  145. extern LLContextMenu* gAttachPieMenu;
  146. extern LLContextMenu* gDetachPieMenu;
  147. extern LLContextMenu* gAttachBodyPartPieMenus[8];
  148. extern LLContextMenu* gDetachBodyPartPieMenus[8];
  149. extern LLMenuItemCallGL* gAFKMenu;
  150. extern LLMenuItemCallGL* gBusyMenu;
  151. extern LLMenuItemCallGL* gMutePieMenu;
  152. extern LLMenuItemCallGL* gMuteObjectPieMenu;
  153. extern LLMenuItemCallGL* gBuyPassPieMenu;
  154. #endif