clang-tidy: Mark several settingspage methods as final
[quassel.git] / src / client / treemodel.h
index 574dc6a..716e07c 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2013 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -18,8 +18,9 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef TREEMODEL_H
-#define TREEMODEL_H
+#pragma once
+
+#include "client-export.h"
 
 #include <QList>
 #include <QStringList>
@@ -31,7 +32,7 @@
 /*****************************************
  *  general item used in the Tree Model
  *****************************************/
-class AbstractTreeItem : public QObject
+class CLIENT_EXPORT AbstractTreeItem : public QObject
 {
     Q_OBJECT
 
@@ -100,7 +101,7 @@ private:
 /*****************************************
  * SimpleTreeItem
  *****************************************/
-class SimpleTreeItem : public AbstractTreeItem
+class CLIENT_EXPORT SimpleTreeItem : public AbstractTreeItem
 {
     Q_OBJECT
 
@@ -121,33 +122,27 @@ private:
 /*****************************************
  * PropertyMapItem
  *****************************************/
-class PropertyMapItem : public AbstractTreeItem
+class CLIENT_EXPORT PropertyMapItem : public AbstractTreeItem
 {
     Q_OBJECT
 
 public:
-    PropertyMapItem(const QStringList &propertyOrder, AbstractTreeItem *parent = 0);
     PropertyMapItem(AbstractTreeItem *parent = 0);
 
-    virtual ~PropertyMapItem();
+    virtual QStringList propertyOrder() const = 0;
 
     virtual QVariant data(int column, int role) const;
     virtual bool setData(int column, const QVariant &value, int role);
 
     virtual QString toolTip(int column) const { Q_UNUSED(column) return QString(); }
     virtual int columnCount() const;
-
-    void appendProperty(const QString &property);
-
-private:
-    QStringList _propertyOrder;
 };
 
 
 /*****************************************
  * TreeModel
  *****************************************/
-class TreeModel : public QAbstractItemModel
+class CLIENT_EXPORT TreeModel : public QAbstractItemModel
 {
     Q_OBJECT
 
@@ -160,6 +155,8 @@ public:
     TreeModel(const QList<QVariant> &, QObject *parent = 0);
     virtual ~TreeModel();
 
+    AbstractTreeItem *root() const;
+
     virtual QVariant data(const QModelIndex &index, int role) const;
     virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
 
@@ -208,6 +205,3 @@ private slots:
     void debug_rowsRemoved(const QModelIndex &parent, int start, int end);
     void debug_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
 };
-
-
-#endif