pqSaveScreenshotReaction.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 pqSaveScreenshotReaction_h
5 #define pqSaveScreenshotReaction_h
6 
7 #include "pqReaction.h"
8 
9 #include <vtkImageData.h>
10 #include <vtkSmartPointer.h>
11 
13 
23 {
24  Q_OBJECT
25  typedef pqReaction Superclass;
26 
27 public:
31  pqSaveScreenshotReaction(QAction* parent, bool clipboardMode = false);
32 
40  static bool saveScreenshot(bool clipboardMode = false);
41 
47  static bool saveScreenshot(
48  const QString& filename, const QSize& size, int quality, bool all_views = false);
49 
53  static bool copyScreenshotToClipboard(const QSize& size, bool all_views = false);
54 
59  static vtkSmartPointer<vtkImageData> takeScreenshot(const QSize& size, bool all_views = false);
60 
65  static QString promptFileName(
66  vtkSMSaveScreenshotProxy* saveProxy, const QString& defaultExtension, vtkTypeUInt32& location);
67 
68 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
72  void updateEnableState() override;
73 
74 protected:
78  void onTriggered() override { pqSaveScreenshotReaction::saveScreenshot(this->ClipboardMode); }
79 
81 
82 private:
83  Q_DISABLE_COPY(pqSaveScreenshotReaction)
84 };
85 
86 #endif
location
void onTriggered() override
Called when the action is triggered.
static bool saveScreenshot(bool clipboardMode=false)
Saves the screenshot.
virtual void updateEnableState()
Definition: pqReaction.h:48
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a superclass just to make it easier to collect all such reactions.
Definition: pqReaction.h:25
size
Reaction to save a screenshot.
proxy to help with saving screenshots for views