pqStandardRecentlyUsedResourceLoaderImplementation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqStandardRecentlyUsedResourceLoaderImplementation_h
5 #define pqStandardRecentlyUsedResourceLoaderImplementation_h
6 
8 
9 #include "pqApplicationComponentsModule.h" // needed for export macros
10 
11 #include "vtkType.h" // needed for vtkTypeUInt32
12 
13 #include <QObject> // needed for QObject
14 #include <QStringList> // needed for QStringList
15 
27  : public QObject
29 {
30  Q_OBJECT
32 
33  typedef QObject Superclass;
34 
35 public:
36  pqStandardRecentlyUsedResourceLoaderImplementation(QObject* parent = nullptr);
38 
39  bool canLoad(const pqServerResource& resource) override;
40  bool load(const pqServerResource& resource, pqServer* server) override;
41  QIcon icon(const pqServerResource& resource) override;
42  QString label(const pqServerResource& resource) override;
43 
47  static bool addDataFilesToRecentResources(
48  pqServer* server, const QStringList& files, const QString& smgroup, const QString& smname);
49 
53  static bool addStateFileToRecentResources(
54  pqServer* server, const QString& file, vtkTypeUInt32 location = 0x10 /*vtkPVSession::CLIENT*/);
55 
56 private:
58 
59  bool loadState(const pqServerResource& resource, pqServer* server,
60  vtkTypeUInt32 location = 0x10 /*vtkPVSession::CLIENT*/);
61  bool loadData(const pqServerResource& resource, pqServer* server);
62 };
63 
64 #endif
location
virtual bool load(const pqServerResource &resource, pqServer *server)=0
Loads the resource and returns the true if successfully loaded, otherwise false.
#define PQAPPLICATIONCOMPONENTS_EXPORT
virtual bool canLoad(const pqServerResource &resource)=0
Return true of the interface supports loading the given resource.
abstract interface used to load recently used resources.
virtual QString label(const pqServerResource &resource)=0
Return label to use for the resource.
support loading states, and data files when loaded from pqRecentFilesMenu.
virtual QIcon icon(const pqServerResource &resource)
Return an icon, if any, to use for the resource.
pqServerResource encapsulates a resource in ParaView.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35