Isis Developer Reference
DisplayProperties.h
Go to the documentation of this file.
1 #ifndef DisplayProperties_H
2 #define DisplayProperties_H
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QObject>
13 
14 // This is required since QColor is in a slot
15 #include <QColor>
16 
17 #include "XmlStackedHandler.h"
18 
19 class QAction;
20 class QBitArray;
21 class QXmlStreamWriter;
22 
23 namespace Isis {
24  class FileName;
25  class Project;
26  class Pvl;
27  class PvlObject;
28 
34  class DisplayProperties : public QObject {
35  Q_OBJECT
36  public:
37  DisplayProperties(QString displayName, QObject *parent = NULL);
38  DisplayProperties(XmlStackedHandlerReader *xmlReader, QObject *parent = NULL);
39  virtual ~DisplayProperties();
40 
41  void fromPvl(const PvlObject &pvl);
42  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
43  PvlObject toPvl() const;
44 
45  void addSupport(int property);
46  bool supports(int property);
47 
48  QVariant getValue(int property) const;
49 
50  void setDisplayName(QString displayName);
51  QString displayName() const;
52 
53  static QColor randomColor();
54 
55  signals:
57  void supportAdded(int);
58 
59  protected:
60  void setValue(int prop, QVariant value);
61 
62  private:
63  Q_DISABLE_COPY(DisplayProperties);
64 
70  class XmlHandler : public XmlStackedHandler {
71  public:
72  XmlHandler(DisplayProperties *displayProperties);
73 
74  virtual bool startElement(const QString &namespaceURI, const QString &localName,
75  const QString &qName, const QXmlAttributes &atts);
76 
77  virtual bool characters(const QString &ch);
78 
79  virtual bool endElement(const QString &namespaceURI, const QString &localName,
80  const QString &qName);
81 
82  private:
83  Q_DISABLE_COPY(XmlHandler);
84 
85  DisplayProperties *m_displayProperties;
86  QString m_hexData;
87  };
88 
89 
90  private:
91 
95  QString m_displayName;
96 
102  int m_propertiesUsed;
103 
108  QMap<int, QVariant> *m_propertyValues;
109  };
110 }
111 
112 #endif
FileName.h
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::DisplayProperties::fromPvl
void fromPvl(const PvlObject &pvl)
Definition: DisplayProperties.cpp:54
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::XmlStackedHandlerReader::pushContentHandler
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
Definition: XmlStackedHandlerReader.cpp:55
Isis::DisplayProperties
Definition: DisplayProperties.h:34
Isis::XmlStackedHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Definition: XmlStackedHandler.cpp:44
Isis::DisplayProperties::addSupport
void addSupport(int property)
Call this with every property you support, otherwise they will not communicate properly between widge...
Definition: DisplayProperties.cpp:108
Isis::DisplayProperties::setValue
void setValue(int prop, QVariant value)
This is the generic mutator for properties.
Definition: DisplayProperties.cpp:131
Isis::DisplayProperties::DisplayProperties
DisplayProperties(QString displayName, QObject *parent=NULL)
DisplayProperties constructor.
Definition: DisplayProperties.cpp:29
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::DisplayProperties::supports
bool supports(int property)
Support may come later, please make sure you are connected to the supportAdded signal.
Definition: DisplayProperties.cpp:122
Isis::ReadWrite
const int ReadWrite
Definition: Process.h:24
Isis::DisplayProperties::propertyChanged
void propertyChanged(DisplayProperties *)
Pvl.h
DisplayProperties.h
Isis::DisplayProperties::supportAdded
void supportAdded(int)
Isis::DisplayProperties::displayName
QString displayName() const
Returns the display name.
Definition: DisplayProperties.cpp:88
Isis::DisplayProperties::randomColor
static QColor randomColor()
Isis::XmlStackedHandler::endElement
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Definition: XmlStackedHandler.cpp:55
Isis::DisplayProperties::toPvl
PvlObject toPvl() const
Convert to Pvl for project files.
Definition: DisplayProperties.cpp:68
Isis::XmlStackedHandler
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:118
QMap< int, QVariant >
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
QObject
Isis::DisplayProperties::save
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Output format:
Definition: DisplayProperties.cpp:159
Isis::DisplayProperties::getValue
QVariant getValue(int property) const
Get a property's associated data.
Definition: DisplayProperties.cpp:147
QAction
Isis::DisplayProperties::setDisplayName
void setDisplayName(QString displayName)
Sets display name.
Definition: DisplayProperties.cpp:97
XmlStackedHandlerReader.h
XmlStackedHandler.h
Isis::DisplayProperties::~DisplayProperties
virtual ~DisplayProperties()
destructor
Definition: DisplayProperties.cpp:50
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16