Well don't that own? Sorted all the #include's.
[UnsignedByte.git] / src / Core / Editors / EditorChunk.h
blobe08358d480b991661a31a62ab8073b5f376ce8a4
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 ChunkImporter;
29 typedef SmartPtr<ChunkImporter> ChunkImporterPtr;
31 class EditorChunk : public OLCEditor
33 public:
34 typedef CommandInfoObject<EditorChunk> ChunkCommand; /**< The type of a CommandInfoObject for this Editor. */
36 EditorChunk(UBSocket* sock);
37 EditorChunk(UBSocket* sock, mud::RoomPtr parentRoom);
38 ~EditorChunk(void);
40 void OnFocus();
42 std::string name() { return "Chunk"; };
43 std::string prompt() { return "Chunk> "; };
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 editName(const std::string& argument);
56 void editDescription(const std::string& argument);
57 void editTags(const std::string& argument);
58 void editRoom(const std::string& argument);
59 void startDetails(const std::string& argument);
60 void importChunk(const std::string& argument);
61 void showChunk(const std::string& argument);
62 void saveChunk(const std::string& argument);
63 void clearParentRoom(const std::string& argument);
64 void setParentRoom(const std::string& argument);
66 private:
67 enum E_TARGET
69 M_NONE,
70 M_IMPORT,
71 M_IMPORTACCEPT,
72 M_IMPORTSAVECHUNK,
75 CommandTable<EditorChunk> m_commands;
76 mud::ChunkPtr m_chunk;
77 mud::RoomPtr m_parentRoom;
79 std::string m_value;
80 bool m_yesno;
81 EditorChunk::E_TARGET m_target;
82 ChunkImporterPtr m_importer;
84 EditorChunk(const EditorChunk& rhs);
85 EditorChunk operator=(const EditorChunk& rhs);