File failed to load: https://isis.astrogeology.usgs.gov/3.9.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Developer Reference
ControlList.h
Go to the documentation of this file.
1 #ifndef ControlList_H
2 #define ControlList_H
3 
4 #include <QDebug>
5 #include <QList>
6 #include <QMetaType>
7 #include <QObject>
8 
9 #include "Control.h"
11 #include "XmlStackedHandler.h"
12 
13 class QStringList;
14 class QXmlStreamWriter;
15 
16 namespace Isis {
17  class FileName;
18  class XmlStackedHandlerReader;
19 
36  class ControlList : public QObject, public QList<Control *> {
37  Q_OBJECT
38 
39  public:
40 
41  ControlList(QString name, QString path, QObject *parent = NULL);
42  explicit ControlList(QObject *parent = NULL);
43  explicit ControlList(QList<Control *>, QObject *parent = NULL);
44  explicit ControlList(Project *project, XmlStackedHandlerReader *xmlReader,
45  QObject *parent = NULL);
46  explicit ControlList(QStringList &);
47  ControlList(const ControlList &);
48  ~ControlList();
49 
50  // These are overridden (-ish) in order to add notifications to the list changing
51  void append(Control * const &value);
52  void append(const QList<Control *> &value);
53 
54  void clear();
55 
56  iterator erase(iterator pos);
57  iterator erase(iterator begin, iterator end);
58 
59  void insert(int i, Control * const &value);
60  iterator insert(iterator before, Control * const &value);
61 
62  void prepend(Control * const &value);
63  void push_back(Control * const &value);
64  void push_front(Control * const &value);
65  int removeAll(Control * const &value);
66  void removeAt(int i);
67  void removeFirst();
68  void removeLast();
69  bool removeOne(Control * const &value);
70  void swap(QList<Control *> &other);
71  Control *takeAt(int i);
72  Control *takeFirst();
73  Control *takeLast();
74 
76  ControlList &operator+=(Control * const &other);
77  ControlList &operator<<(const QList<Control *> &other);
78  ControlList &operator<<(Control * const &other);
80 
81  // This is our own assignment, but it needs to notify just like the operator=(QList)
82  ControlList &operator=(const ControlList &rhs);
83 
84  // Done overriding (-ish)
85 
86 
87  QList<QAction *> supportedActions(Project *project = NULL);
89 
90  void setName(QString newName);
91  void setPath(QString newPath);
92 
93  QString name() const;
94  QString path() const;
95 
96  void deleteFromDisk(Project *project);
97  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
98 
99 
100  signals:
101  void countChanged(int newCount);
102  void deletingList(ControlList *list);
103 
104  private:
105 
106 
118  class CopyControlDataFunctor : public std::unary_function<Control * const &, void *> {
119  public:
120  CopyControlDataFunctor(const Project *project, FileName newProjectRoot);
121  CopyControlDataFunctor(const CopyControlDataFunctor &other);
122  ~CopyControlDataFunctor();
123 
124  void *operator()(Control * const &controlToCopy);
125 
126  CopyControlDataFunctor &operator=(const CopyControlDataFunctor &rhs);
127 
128  private:
129  const Project *m_project;
130  FileName m_newProjectRoot;
131  };
132 
144  class XmlHandler : public XmlStackedHandler {
145  public:
146  XmlHandler(ControlList *controlList, Project *project);
147 
148  virtual bool startElement(const QString &namespaceURI, const QString &localName,
149  const QString &qName, const QXmlAttributes &atts);
150  virtual bool endElement(const QString &namespaceURI, const QString &localName,
151  const QString &qName);
152 
153  private:
154  Q_DISABLE_COPY(XmlHandler);
155 
156  ControlList *m_controlList;
157  Project *m_project;
158  };
159 
160 
161  private:
162  QString m_name;
163 
174  QString m_path;
175  };
176 }
177 
179 
180 #endif
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:79
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Convert this control list into XML format for saving/restoring capabilities.
Definition: ControlList.cpp:613
Property
This is a list of properties and actions that are possible.
Definition: ControlDisplayProperties.h:79
ControlList(QString name, QString path, QObject *parent=NULL)
Create an control list from a control list name and path (does not read Controls).
Definition: ControlList.cpp:51
The main project for ipce.
Definition: Project.h:289
~ControlList()
Destructor.
Definition: ControlList.cpp:123
iterator erase(iterator pos)
Erases a control pointer from the control list at the specified position.
Definition: ControlList.cpp:177
void insert(int i, Control *const &value)
Inserts a control pointer at the specified position in the control list.
Definition: ControlList.cpp:209
File name manipulation and expansion.
Definition: FileName.h:116
void deletingList(ControlList *list)
Maintains a list of Controls so that control nets can easily be copied from one Project to another...
Definition: ControlList.h:36
void setName(QString newName)
Set the human-readable name of this control list.
Definition: ControlList.cpp:532
void push_front(Control *const &value)
Equivalent to prepend(value)
Definition: ControlList.cpp:268
QString path() const
Get the path to these controls in the control list (relative to project root).
Definition: ControlList.cpp:564
bool removeOne(Control *const &value)
Removes the first occurence of the control pointer from the control list.
Definition: ControlList.cpp:338
void removeLast()
Removes the last control pointer from the control list.
Definition: ControlList.cpp:323
void countChanged(int newCount)
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:112
bool allSupport(ControlDisplayProperties::Property prop)
Control * takeFirst()
Removes the first control pointer from the control list and returns it.
Definition: ControlList.cpp:388
void clear()
Clears the control list.
Definition: ControlList.cpp:159
QList< QAction * > supportedActions(Project *project=NULL)
ControlList & operator+=(const QList< Control *> &other)
Appends control pointers from the other list to this control list.
Definition: ControlList.cpp:418
void append(Control *const &value)
Appends a control pointer to the control list.
Definition: ControlList.cpp:135
void prepend(Control *const &value)
Prepends a control pointer to the control list.
Definition: ControlList.cpp:240
QString name() const
Get the human-readable name of this control list.
Definition: ControlList.cpp:553
ControlList & operator<<(const QList< Control *> &other)
Appends a list of other control pointers to this control list.
Definition: ControlList.cpp:454
void push_back(Control *const &value)
Equivalent to append(value)
Definition: ControlList.cpp:254
void swap(QList< Control *> &other)
Swaps this control list&#39;s control pointers with the other list of control pointers.
Definition: ControlList.cpp:356
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Control * takeLast()
Removes the last control pointer from the control list and returns it.
Definition: ControlList.cpp:402
void setPath(QString newPath)
Set the relative path (from the project root) to this control list&#39;s folder.
Definition: ControlList.cpp:543
ControlList & operator=(const QList< Control *> &rhs)
Assigns another list of control pointers to this control list.
Definition: ControlList.cpp:490
Control * takeAt(int i)
Remove the control pointer at the specified index and returns it.
Definition: ControlList.cpp:374
Q_DECLARE_METATYPE(Isis::ControlList *)
void removeAt(int i)
Removes the control pointer at the specified index.
Definition: ControlList.cpp:301
void deleteFromDisk(Project *project)
Delete all of the contained Controls from disk.
Definition: ControlList.cpp:576
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:25
void removeFirst()
Removes the first control pointer from the control list.
Definition: ControlList.cpp:312
int removeAll(Control *const &value)
Removes all occurences of the control pointer in the control list.
Definition: ControlList.cpp:283

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/12/2023 23:16:41