~ubuntu-branches/debian/sid/ember/sid

« back to all changes in this revision

Viewing changes to src/components/ogre/manipulation/GUIAdapterBindings.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2009-07-23 07:46:40 UTC
  • Revision ID: james.westby@ubuntu.com-20090723074640-wh0ukzis0kda36qv
Tags: upstream-0.5.6
ImportĀ upstreamĀ versionĀ 0.5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
        Copyright (C) 2008  Alexey Torkhov <atorkhov@gmail.com>
 
3
 
 
4
        This program is free software; you can redistribute it and/or modify
 
5
        it under the terms of the GNU General Public License as published by
 
6
        the Free Software Foundation; either version 2 of the License, or
 
7
        (at your option) any later version.
 
8
 
 
9
        This program is distributed in the hope that it will be useful,
 
10
        but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
        GNU General Public License for more details.
 
13
 
 
14
        You should have received a copy of the GNU General Public License
 
15
        along with this program; if not, write to the Free Software
 
16
        Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
17
*/
 
18
 
 
19
#ifndef EMBEROGRE_GUIADAPTERBINDINGS_H
 
20
#define EMBEROGRE_GUIADAPTERBINDINGS_H
 
21
 
 
22
#include "components/ogre/EmberOgrePrerequisites.h"
 
23
#include "framework/tinyxml/tinyxml.h"
 
24
#include <Atlas/Message/Element.h>
 
25
 
 
26
namespace EmberOgre {
 
27
 
 
28
/**
 
29
 * Contains bindings of one placeholder to many GUI adapters.
 
30
 */
 
31
class GUIAdapterBindings
 
32
{
 
33
public:
 
34
        /**
 
35
         * Constructor.
 
36
         */
 
37
        GUIAdapterBindings();
 
38
 
 
39
        /**
 
40
         * Destructor.
 
41
         */
 
42
        virtual ~GUIAdapterBindings();
 
43
 
 
44
        /**
 
45
         * Returns bound function
 
46
         */
 
47
        const std::string& getFunc();
 
48
 
 
49
        /**
 
50
         * Sets bound function
 
51
         */
 
52
        void setFunc(std::string func);
 
53
 
 
54
        /**
 
55
         * Add bound adapter
 
56
         */
 
57
        void addAdapter(std::string adapterName);
 
58
 
 
59
        /**
 
60
         * Return adapters list
 
61
         */
 
62
        std::vector<std::string>& getAdapters();
 
63
 
 
64
        /**
 
65
         * Associates this bindings with XML element
 
66
         */
 
67
        void associateXmlElement(TiXmlNode& element);
 
68
 
 
69
        /**
 
70
         * Sets value to associated element
 
71
         */
 
72
        void setValue(Atlas::Message::Element& val);
 
73
 
 
74
        /**
 
75
         * Helper function, converting Atlas node into TinyXml node
 
76
         */
 
77
        static TiXmlNode* convertAtlasToXml(Atlas::Message::Element& val);
 
78
 
 
79
protected:
 
80
        /**
 
81
         * Bound function name
 
82
         */
 
83
        std::string mFunc;
 
84
 
 
85
        /**
 
86
         * List of bound adapters.
 
87
         */
 
88
        std::vector<std::string> mAdapters;
 
89
 
 
90
        /**
 
91
         * Associated XML element
 
92
         */
 
93
        TiXmlNode* mElement;
 
94
};
 
95
 
 
96
}
 
97
 
 
98
#endif