Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
ControlList.h
1#ifndef ControlList_H
2#define ControlList_H
3
9
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <QDebug>
13#include <QList>
14#include <QMetaType>
15#include <QObject>
16
17#include "Control.h"
18#include "ControlDisplayProperties.h"
19
20class QXmlStreamWriter;
21
22namespace Isis {
23 class FileName;
24
41 class ControlList : public QObject, public QList<Control *> {
42 Q_OBJECT
43
44 public:
45
46 ControlList(QString name, QString path, QObject *parent = NULL);
47 explicit ControlList(QObject *parent = NULL);
48 explicit ControlList(QList<Control *>, QObject *parent = NULL);
49 explicit ControlList(QStringList &);
50 ControlList(const ControlList &);
52
53 // These are overridden (-ish) in order to add notifications to the list changing
54 void append(Control * const &value);
55 void append(const QList<Control *> &value);
56
57 void clear();
58
60 iterator erase(iterator begin, iterator end);
61
62 void insert(int i, Control * const &value);
63 iterator insert(iterator before, Control * const &value);
64
65 void prepend(Control * const &value);
66 void push_back(Control * const &value);
67 void push_front(Control * const &value);
68 int removeAll(Control * const &value);
69 void removeAt(int i);
70 void removeFirst();
71 void removeLast();
72 bool removeOne(Control * const &value);
73 void swap(QList<Control *> &other);
74 Control *takeAt(int i);
77
79 ControlList &operator+=(Control * const &other);
81 ControlList &operator<<(Control * const &other);
83
84 // This is our own assignment, but it needs to notify just like the operator=(QList)
86
87 // Done overriding (-ish)
88
89
90 QList<QAction *> supportedActions(Project *project = NULL);
91 bool allSupport(ControlDisplayProperties::Property prop);
92
93 void setName(QString newName);
94 void setPath(QString newPath);
95
96 QString name() const;
97 QString path() const;
98
99 void deleteFromDisk(Project *project);
100 void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
101
102
103 signals:
104 void countChanged(int newCount);
105 void deletingList(ControlList *list);
106
107 private:
108
109
121 class CopyControlDataFunctor : public std::function<void *(Control * const &)> {
122 public:
123 CopyControlDataFunctor(const Project *project, FileName newProjectRoot);
126
127 void *operator()(Control * const &controlToCopy);
128
130
131 private:
134 };
135
136 private:
137 QString m_name;
138
149 QString m_path;
150 };
151}
152
153Q_DECLARE_METATYPE(Isis::ControlList *);
154
155#endif
Property
This is a list of properties and actions that are possible.
This represents an ISIS control net in a project-based GUI interface.
Definition Control.h:65
CopyControlDataFunctor & operator=(const CopyControlDataFunctor &rhs)
CopyControlDataFunctor assignment operator.
~CopyControlDataFunctor()
CopyControlDataFunctor destructor.
void * operator()(Control *const &controlToCopy)
Copies the Control from one project to another.
const Project * m_project
Project to copy the control list to.
FileName m_newProjectRoot
The filename of the destination project's root.
CopyControlDataFunctor(const Project *project, FileName newProjectRoot)
CopyControlDataFunctor constructor.
Maintains a list of Controls so that control nets can easily be copied from one Project to another,...
Definition ControlList.h:41
void deleteFromDisk(Project *project)
Delete all of the contained Controls from disk.
void removeLast()
Removes the last control pointer from the control list.
iterator erase(iterator pos)
Erases a control pointer from the control list at the specified position.
void append(Control *const &value)
Appends a control pointer to the control list.
~ControlList()
Destructor.
void push_back(Control *const &value)
Equivalent to append(value)
ControlList & operator+=(const QList< Control * > &other)
Appends control pointers from the other list to this control list.
void insert(int i, Control *const &value)
Inserts a control pointer at the specified position in the control list.
QString path() const
Get the path to these controls in the control list (relative to project root).
QString name() const
Get the human-readable name of this control list.
void setName(QString newName)
Set the human-readable name of this control list.
void removeAt(int i)
Removes the control pointer at the specified index.
bool removeOne(Control *const &value)
Removes the first occurence of the control pointer from the control list.
void push_front(Control *const &value)
Equivalent to prepend(value)
Control * takeAt(int i)
Remove the control pointer at the specified index and returns it.
Control * takeFirst()
Removes the first control pointer from the control list and returns it.
ControlList & operator=(const QList< Control * > &rhs)
Assigns another list of control pointers to this control list.
int removeAll(Control *const &value)
Removes all occurences of the control pointer in the control list.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Convert this control list into XML format for saving/restoring capabilities.
void setPath(QString newPath)
Set the relative path (from the project root) to this control list's folder.
void prepend(Control *const &value)
Prepends a control pointer to the control list.
QString m_name
Name of the ControlList.
ControlList & operator<<(const QList< Control * > &other)
Appends a list of other control pointers to this control list.
void swap(QList< Control * > &other)
Swaps this control list's control pointers with the other list of control pointers.
void clear()
Clears the control list.
QString m_path
This stores the directory name that contains the controls in this control list.
Control * takeLast()
Removes the last control pointer from the control list and returns it.
void removeFirst()
Removes the first control pointer from the control list.
ControlList(QString name, QString path, QObject *parent=NULL)
Create an control list from a control list name and path (does not read Controls).
The main project for ipce.
Definition Project.h:287
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16