swift
statusmessagelistmodel.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_MODELS_STATUSMESSAGELISTMODEL_H
7 #define SWIFT_GUI_MODELS_STATUSMESSAGELISTMODEL_H
8 
10 #include "gui/swiftguiexport.h"
11 #include "misc/statusmessagelist.h"
12 
13 namespace swift::gui::models
14 {
19  public CListModelTimestampObjects<swift::misc::CStatusMessageList, true>
20  {
21  Q_OBJECT
22 
23  public:
25  enum Mode
26  {
27  Detailed,
28  DetailedWithOrder,
29  Simplified,
30  SimplifiedWithOrder
31  };
32 
34  explicit CStatusMessageListModel(QObject *parent = nullptr);
35 
37  virtual ~CStatusMessageListModel() override {}
38 
40  void setMode(Mode mode);
41 
43  void setMode(Mode mode, const swift::misc::CStatusMessageList &messages);
44 
46  void adjustOrderColumn(const swift::misc::CStatusMessageList &messages);
47 
49  virtual QVariant data(const QModelIndex &index, int role) const override;
50 
52  bool isSortedByTimestampOrOrder() const;
53 
55  static bool sortedByTimestampOrOrder(const swift::misc::CPropertyIndex &p);
56 
57  private:
58  Mode m_mode;
59  };
60 } // namespace swift::gui::models
61 #endif // SWIFT_GUI_MODELS_STATUSMESSAGELISTMODEL_H
List model for timestamp based objects with offset.
Status messages, e.g. from Core -> GUI.
Models to be used with views, mainly QTableView.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.