2
// C++ Interface: MapAdapter
7
// Author: Erik Hjortsberg <erik.hjortsberg@gmail.com>, (C) 2007
9
// This program is free software; you can redistribute it and/or modify
10
// it under the terms of the GNU General Public License as published by
11
// the Free Software Foundation; either version 2 of the License, or
12
// (at your option) any later version.
14
// This program 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
17
// GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program; if not, write to the Free Software
21
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.//
23
#ifndef EMBEROGRE_GUI_ADAPTERS_ATLASMAPADAPTER_H
24
#define EMBEROGRE_GUI_ADAPTERS_ATLASMAPADAPTER_H
26
#include "AdapterBase.h"
27
#include "components/ogre/widgets/StackableContainer.h"
46
@author Erik Hjortsberg <erik.hjortsberg@gmail.com>
48
class MapAdapter : public AdapterBase
52
MapAdapter(const ::Atlas::Message::Element& element, CEGUI::Window* childContainer);
54
virtual ~MapAdapter();
56
std::vector<std::string> getAttributeNames();
58
const ::Atlas::Message::Element& valueOfAttr(const std::string& attr) const;
59
bool hasAttr(const std::string& attr) const;
62
Updates the gui with new values.
64
virtual void updateGui(const ::Atlas::Message::Element& element);
66
void addAttributeAdapter(const std::string& attributeName, Adapters::Atlas::AdapterBase* adapter, CEGUI::Window* containerWindow);
67
void removeAdapters();
69
::Atlas::Message::Element getSelectedChangedElements();
72
* @brief Returns true if the map adapter already contains an adapter with the specified name.
73
* This works very much like hasAttr(), with the exception that this also will take into considerations those adapters that have been added but not yet applied to the underlying element.
74
* @param attr The name of the attribute to look for an adapter for.
75
* @return True if an adapter for the named attribute exists.
77
bool hasAdapter(const std::string& attr) const;
80
typedef std::map<std::string, AdapterWrapper> AdapterStore;
82
CEGUI::Window* mChildContainer;
83
// StackableContainer mStackableContainer;
84
const ::Atlas::Message::MapType& mAttributes;
86
AdapterStore mAdapters;
88
virtual void fillElementFromGui();
89
virtual bool _hasChanges();
90
virtual ::Atlas::Message::Element _getChangedElement();