Well don't that own? Sorted all the #include's.
[UnsignedByte.git] / src / Core / Editors / EditorDetail.h
blobcaf33266503d6bdb6f5df45319d8260588e08875
1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #pragma once
22 #include "CommandInfoObject.h"
23 #include "CommandTable.h"
24 #include "OLCEditor.h"
25 #include "SavableTypes.h"
26 #include "Types.h"
28 class EditorDetail : public OLCEditor
30 public:
31 typedef CommandInfoObject<EditorDetail> DetailCommand; /**< The type of a CommandInfoObject for this Editor. */
33 EditorDetail(UBSocket* sock);
34 EditorDetail(UBSocket* sock, mud::DetailPtr detail);
35 EditorDetail(UBSocket* sock, mud::AreaPtr parentArea);
36 EditorDetail(UBSocket* sock, mud::RoomPtr parentRoom);
37 EditorDetail(UBSocket* sock, mud::ChunkPtr parentChunk);
38 ~EditorDetail(void);
40 void OnFocus();
42 std::string name() { return "Detail"; };
43 std::string prompt() { return "Detail> "; };
45 std::string lookup(const std::string& action);
46 void dispatch(const std::string& action, const std::string& argument);
48 SavablePtr getEditing();
49 TableImplPtr getTable();
50 KeysPtr addNew();
51 std::vector<std::string> getList();
52 std::vector<std::string> getCommands();
53 void setEditing(KeysPtr keys);
55 void editKey(const std::string& argument);
56 void editDescription(const std::string& argument);
57 void showDetail(const std::string& argument);
58 void saveDetail(const std::string& argument);
59 void clearParents(const std::string& argument);
60 void setParent(const std::string& argument);
62 private:
63 enum E_TARGET
65 M_NONE,
66 M_DESCRIPTION,
69 CommandTable<EditorDetail> m_commands;
70 mud::DetailPtr m_detail;
71 mud::AreaPtr m_parentArea;
72 mud::RoomPtr m_parentRoom;
73 mud::ChunkPtr m_parentChunk;
75 std::string m_value;
76 EditorDetail::E_TARGET m_target;
78 EditorDetail(const EditorDetail& rhs);
79 EditorDetail operator=(const EditorDetail& rhs);