Qubet  1.0
The ultimate QGL addicting videogame!
 All Classes Functions Variables Pages
actionlist.h
1 // Qubet - Copyright (C) 2011
2 // Enrico Bacis
3 // Daniele Ciriello
4 
5 // Qubet 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, see <http://www.gnu.org/licenses/>.
17 
18 
19 #ifndef ACTIONLIST_H
20 #define ACTIONLIST_H
21 
22 #include <QList>
23 
51 {
52 
53 public:
54 
58  explicit ActionList();
59 
66  explicit ActionList(int _primaryAction);
67 
73  explicit ActionList(ActionList *other);
74 
78  ~ActionList();
79 
85  void setPrimaryAction(int _primaryAction);
86 
92  int getPrimaryAction();
93 
99  void appendSecondaryAction(int _secondaryAction);
100 
106  void removeSecondaryAction(int _secondaryAction);
107 
113  QList<int> getSecondaryActions();
114 
122  QList<int> getAllActions();
123 
124 
125 private:
126 
128  QList<int> secondaryActions;
129 };
130 
131 #endif // ACTIONLIST_H
~ActionList()
Safely removes an ActionList.
Definition: actionlist.cpp:35
This class is used to keep track of actions to do. For example it can keep track of current view scro...
Definition: actionlist.h:50
void setPrimaryAction(int _primaryAction)
Set the given parameter as the new primaryAction, overriding the old one.
Definition: actionlist.cpp:40
QList< int > getAllActions()
Returns a list of primary and secondary actions.
Definition: actionlist.cpp:65
QList< int > getSecondaryActions()
Returns the secondaryActions list.
Definition: actionlist.cpp:60
int primaryAction
Definition: actionlist.h:127
void removeSecondaryAction(int _secondaryAction)
Removes a secondary action to secondaryActions list.
Definition: actionlist.cpp:55
ActionList()
Creates a new ActionList with no secondaryActions and 0 as primaryAction.
Definition: actionlist.cpp:21
void appendSecondaryAction(int _secondaryAction)
Appends a secondary action to secondaryActions list.
Definition: actionlist.cpp:50
int getPrimaryAction()
Returns the current primaryAction.
Definition: actionlist.cpp:45
QList< int > secondaryActions
Definition: actionlist.h:128