PageRenderTime 50ms CodeModel.GetById 23ms app.highlight 22ms 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
  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
 27#ifndef LL_LLVIEWERMENU_H
 28#define LL_LLVIEWERMENU_H
 29
 30#include "llmenugl.h"
 31#include "llsafehandle.h"
 32
 33class LLMessageSystem;
 34class LLSD;
 35class LLUICtrl;
 36class LLView;
 37class LLParcelSelection;
 38class LLObjectSelection;
 39class LLSelectNode;
 40
 41void initialize_edit_menu();
 42void init_menus();
 43void cleanup_menus();
 44
 45void show_debug_menus(); // checks for if menus should be shown first.
 46void toggle_debug_menus(void*);
 47void show_context_menu( S32 x, S32 y, MASK mask );
 48void show_build_mode_context_menu(S32 x, S32 y, MASK mask);
 49void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y);
 50void show_topinfobar_context_menu(LLView* ctrl, S32 x, S32 y);
 51BOOL enable_save_into_inventory(void*);
 52void handle_reset_view();
 53void handle_cut(void*);
 54void handle_copy(void*);
 55void handle_paste(void*);
 56void handle_delete(void*);
 57void handle_redo(void*);
 58void handle_undo(void*);
 59void handle_select_all(void*);
 60void handle_deselect(void*);
 61void handle_delete_object();
 62void handle_duplicate(void*);
 63void handle_duplicate_in_place(void*);
 64BOOL enable_not_have_card(void *userdata);
 65void process_grant_godlike_powers(LLMessageSystem* msg, void**);
 66
 67BOOL enable_cut(void*);
 68BOOL enable_copy(void*);
 69BOOL enable_paste(void*);
 70BOOL enable_select_all(void*);
 71BOOL enable_deselect(void*);
 72BOOL enable_undo(void*);
 73BOOL enable_redo(void*);
 74
 75BOOL is_agent_mappable(const LLUUID& agent_id);
 76
 77void confirm_replace_attachment(S32 option, void* user_data);
 78void handle_detach_from_avatar(const LLSD& user_data);
 79void attach_label(std::string& label, const LLSD&);
 80void detach_label(std::string& label, const LLSD&);
 81void handle_detach(void*);
 82BOOL enable_god_full(void* user_data);
 83BOOL enable_god_liaison(void* user_data);
 84BOOL enable_god_basic(void* user_data);
 85void set_underclothes_menu_options();
 86
 87void exchange_callingcard(const LLUUID& dest_id);
 88
 89void handle_gestures(void*);
 90void handle_sit_down(void*);
 91void handle_object_build(void*);
 92void handle_object_touch();
 93bool enable_object_open();
 94void handle_object_open();
 95
 96// Buy either contents or object itself
 97void handle_buy();
 98void handle_take_copy();
 99void handle_look_at_selection(const LLSD& param);
100void handle_zoom_to_object(LLUUID object_id);
101
102void handle_buy_land();
103
104// Takes avatar UUID, or if no UUID passed, uses last selected object
105void handle_avatar_freeze(const LLSD& avatar_id);
106
107// Takes avatar UUID, or if no UUID passed, uses last selected object
108void handle_avatar_eject(const LLSD& avatar_id);
109
110bool enable_freeze_eject(const LLSD& avatar_id);
111
112// Can anyone take a free copy of the object?
113// *TODO: Move to separate file
114bool anyone_copy_selection(LLSelectNode* nodep);
115
116// Is this selected object for sale?
117// *TODO: Move to separate file
118bool for_sale_selection(LLSelectNode* nodep);
119
120void handle_save_snapshot(void *);
121void handle_toggle_flycam();
122
123void handle_object_sit_or_stand();
124void handle_give_money_dialog();
125bool enable_pay_object();
126bool enable_buy_object();
127bool handle_go_to();
128
129// Export to XML or Collada
130void handle_export_selected( void * );
131
132class LLViewerMenuHolderGL : public LLMenuHolderGL
133{
134public:
135	struct Params : public LLInitParam::Block<Params, LLMenuHolderGL::Params>
136	{};
137
138	LLViewerMenuHolderGL(const Params& p);
139
140	virtual BOOL hideMenus();
141	
142	void setParcelSelection(LLSafeHandle<LLParcelSelection> selection);
143	void setObjectSelection(LLSafeHandle<LLObjectSelection> selection);
144
145	virtual const LLRect getMenuRect() const;
146
147protected:
148	LLSafeHandle<LLParcelSelection> mParcelSelection;
149	LLSafeHandle<LLObjectSelection> mObjectSelection;
150};
151
152extern const std::string SAVE_INTO_INVENTORY;
153
154extern LLMenuBarGL*		gMenuBarView;
155//extern LLView*			gMenuBarHolder;
156extern LLMenuGL*		gEditMenu;
157extern LLMenuGL*		gPopupMenuView;
158extern LLViewerMenuHolderGL*	gMenuHolder;
159extern LLMenuBarGL*		gLoginMenuBarView;
160
161// Context menus in 3D scene
162extern LLContextMenu		*gMenuAvatarSelf;
163extern LLContextMenu		*gMenuAvatarOther;
164extern LLContextMenu		*gMenuObject;
165extern LLContextMenu		*gMenuAttachmentSelf;
166extern LLContextMenu		*gMenuAttachmentOther;
167extern LLContextMenu		*gMenuLand;
168
169// Needed to build menus when attachment site list available
170extern LLMenuGL* gAttachSubMenu;
171extern LLMenuGL* gDetachSubMenu;
172extern LLMenuGL* gTakeOffClothes;
173extern LLContextMenu* gAttachScreenPieMenu;
174extern LLContextMenu* gDetachScreenPieMenu;
175extern LLContextMenu* gAttachPieMenu;
176extern LLContextMenu* gDetachPieMenu;
177extern LLContextMenu* gAttachBodyPartPieMenus[8];
178extern LLContextMenu* gDetachBodyPartPieMenus[8];
179
180extern LLMenuItemCallGL* gAFKMenu;
181extern LLMenuItemCallGL* gBusyMenu;
182extern LLMenuItemCallGL* gMutePieMenu;
183extern LLMenuItemCallGL* gMuteObjectPieMenu;
184extern LLMenuItemCallGL* gBuyPassPieMenu;
185
186#endif