pqProxyInfo.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef pqProxyInfo_h
4 #define pqProxyInfo_h
5 
7 
8 #include <QObject>
9 
10 #include <QMap> // for QMap
11 #include <QPointer> // for QPointer
12 #include <QString> // for QString
13 
14 class pqProxyCategory;
15 class vtkPVXMLElement;
16 
20 class pqProxyInfo : public QObject
21 {
22  Q_OBJECT
23  typedef QObject Superclass;
24 
25 public:
26  pqProxyInfo(pqProxyCategory* parent, const QString& name, const QString& group,
27  const QString& label, const QString& icon = "",
28  const QStringList& omitFromToolbar = QStringList(), bool hideFromMenu = false);
29 
33  pqProxyInfo(pqProxyCategory* parent, pqProxyInfo* other);
34  pqProxyInfo(pqProxyCategory* parent, vtkPVXMLElement* xmlElement);
35  pqProxyInfo() = default;
36 
40  void setLabel(const QString& label);
41 
45  void setHideFromMenu(bool hidden);
46 
50  void setIcon(const QString& iconPath);
51 
57  void merge(pqProxyInfo* other);
58 
62  static QMap<QString, QPointer<pqProxyInfo>> mergeProxies(
63  const QMap<QString, QPointer<pqProxyInfo>>& proxies,
64  const QMap<QString, QPointer<pqProxyInfo>>& otherProxies);
65 
69  void convertToXML(vtkPVXMLElement* root);
70 
72 
75  QString name() { return this->Name; }
76  QString group() { return this->Group; }
78  QString label();
79  QString icon() { return this->Icon; }
80  QStringList omitFromToolbar() { return this->OmitFromToolbar; }
81  bool hideFromMenu();
83 
84 private:
86  QString Name;
88  QString Group;
90  QString Label;
92  QString Icon;
94  QStringList OmitFromToolbar;
96  bool HideFromMenu = false;
97 };
98 
100 using pqProxyInfoMap = QMap<QString, pqProxyInfo*>;
101 
102 #endif
QStringList omitFromToolbar()
Return member.
Definition: pqProxyInfo.h:80
QMap< QString, pqProxyInfo * > pqProxyInfoMap
map a proxy name to its pqProxyInfo
Definition: pqProxyInfo.h:100
void setIcon(const QString &iconPath)
Set Icon path.
QString name()
Return member.
Definition: pqProxyInfo.h:75
void merge(pqProxyInfo *other)
Merge pqProxyInfo meta data into self.
QString icon()
Return member.
Definition: pqProxyInfo.h:79
Proxy meta data structure for the User Interface.
Definition: pqProxyInfo.h:20
bool hideFromMenu()
Return member.
QString group()
Return member.
Definition: pqProxyInfo.h:76
void setLabel(const QString &label)
Set label.
pqProxyInfo()=default
QString label()
return the translated label, or create one from name if empty.
void setHideFromMenu(bool hidden)
Set HideFromMenu.
static QMap< QString, QPointer< pqProxyInfo > > mergeProxies(const QMap< QString, QPointer< pqProxyInfo >> &proxies, const QMap< QString, QPointer< pqProxyInfo >> &otherProxies)
Merge otherProxies into proxies and return a new map.
The pqProxyCategory class reads and writes XML that describes the proxies organisation into categorie...
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
void convertToXML(vtkPVXMLElement *root)
Create the xml element and add it under given root.