PageRenderTime 30ms CodeModel.GetById 14ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llui/lleditmenuhandler.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 74 lines | 27 code | 14 blank | 33 comment | 0 complexity | 9ee4a36fb6753131444ddb31ee10bdd2 MD5 | raw file
 1/** 
 2* @file lleditmenuhandler.h
 3* @authors Aaron Yonas, James Cook
 4*
 5* $LicenseInfo:firstyear=2006&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 LLEDITMENUHANDLER_H
28#define LLEDITMENUHANDLER_H
29
30// Interface used by menu system for plug-in hotkey/menu handling
31class LLEditMenuHandler
32{
33public:
34	// this is needed even though this is just an interface class.
35	virtual ~LLEditMenuHandler();
36	
37	virtual void	undo() {};
38	virtual BOOL	canUndo() const { return FALSE; }
39	
40	virtual void	redo() {};
41	virtual BOOL	canRedo() const { return FALSE; }
42	
43	virtual void	cut() {};
44	virtual BOOL	canCut() const { return FALSE; }
45	
46	virtual void	copy() {};
47	virtual BOOL	canCopy() const { return FALSE; }
48	
49	virtual void	paste() {};
50	virtual BOOL	canPaste() const { return FALSE; }
51	
52	// "delete" is a keyword
53	virtual void	doDelete() {};
54	virtual BOOL	canDoDelete() const { return FALSE; }
55	
56	virtual void	selectAll() {};
57	virtual BOOL	canSelectAll() const { return FALSE; }
58	
59	virtual void	deselect() {};
60	virtual BOOL	canDeselect() const { return FALSE; }
61	
62	virtual void	duplicate() {};
63	virtual BOOL	canDuplicate() const { return FALSE; }
64
65	// TODO: Instead of being a public data member, it would be better to hide it altogether
66	// and have a "set" method and then a bunch of static versions of the cut, copy, paste
67	// methods, etc that operate on the current global instance. That would drastically
68	// simplify the existing code that accesses this global variable by putting all the
69	// null checks in the one implementation of those static methods. -MG
70	static LLEditMenuHandler* gEditMenuHandler;
71};
72
73
74#endif