Allow multiple cards to be selected in a card list,

Allow card actions to add/remove multiple cards.
not yet: actually use these multicard actions.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@853 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-05-17 01:51:50 +00:00
parent 1b516e781f
commit c666e98645
14 changed files with 145 additions and 149 deletions
+5 -9
View File
@@ -18,9 +18,11 @@
#include <util/action_stack.hpp>
#include <util/error.hpp>
#include <data/field/text.hpp>
#include <data/action/generic.hpp>
class Set;
DECLARE_POINTER_TYPE(Keyword);
DECLARE_TYPEOF_COLLECTION(GenericAddAction<KeywordP>::Step);
// ----------------------------------------------------------------------------- : Add Keyword
@@ -34,22 +36,16 @@ class KeywordListAction : public Action {
// therefore we don't need a smart pointer
};
enum Adding {ADD};
enum Removing {REMOVE};
/// Adding or removing a keyword from a set
class AddKeywordAction : public KeywordListAction {
public:
AddKeywordAction(Adding, Set& set, const KeywordP& keyword = KeywordP());
AddKeywordAction(Removing, Set& set, const KeywordP& keyword);
AddKeywordAction(Set& set);
AddKeywordAction(AddingOrRemoving, Set& set, const KeywordP& keyword);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
//private:
const bool adding; ///< Was a keyword added? (as opposed to removed)
const KeywordP keyword; ///< The new/removed keyword
const size_t keyword_id; ///< Position of the keyword in the set
const GenericAddAction<KeywordP> action;
};
// ----------------------------------------------------------------------------- : Changing keywords