Mantid
Loading...
Searching...
No Matches
Cell.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
11#pragma once
13#include <string>
14#include <vector>
15
16namespace MantidQt {
17namespace MantidWidgets {
18namespace Batch {
19
21public:
22 // Cell values may be user inputs or algorithm outputs
23 enum class Direction { INPUT, OUTPUT };
24 static constexpr const char *INPUT_FOREGROUND_COLOR = "#000000";
25 static constexpr const char *OUTPUT_FOREGROUND_COLOR = "#808080";
26
27 Cell(std::string contentText);
28 Cell(std::string contentText, std::string backgroundColor, int borderThickness, std::string color, int borderOpacity,
29 bool isEditable);
30
31 void setContentText(std::string const &contentText);
32 std::string const &contentText() const;
33
34 void setIconFilePath(std::string const &iconPath);
35 std::string const &iconFilePath() const;
36
37 void setBorderColor(std::string const &borderColor);
38 std::string const &borderColor() const;
39
40 void setBackgroundColor(std::string const &backgroundColor);
41 std::string const &backgroundColor() const;
42 void setForegroundColor(std::string const &foregroundColor);
43 std::string const &foregroundColor() const;
44
45 void setBorderOpacity(int transparency);
46 int borderOpacity() const;
47
48 int borderThickness() const;
49 void setBorderThickness(int borderThickness);
50
51 void setToolTip(std::string const &toolTip);
52 std::string const &toolTip() const;
53
54 bool isEditable() const;
55 void setEditable(bool isEditable);
56 void disableEditing();
57 void enableEditing();
58
59 bool isInput() const;
60 bool isOutput() const;
61 void setInput();
62 void setOutput();
63
64private:
65 std::string m_contentText;
66 std::string m_backgroundColor;
67 std::string m_foregroundColor;
70 std::string m_borderColor;
71 std::string m_iconFilePath;
73 std::string m_toolTip;
75};
76
77EXPORT_OPT_MANTIDQT_COMMON std::ostream &operator<<(std::ostream &os, Cell const &cell);
78EXPORT_OPT_MANTIDQT_COMMON bool operator==(Cell const &lhs, Cell const &rhs);
79EXPORT_OPT_MANTIDQT_COMMON bool operator!=(Cell const &lhs, Cell const &rhs);
80EXPORT_OPT_MANTIDQT_COMMON std::vector<Cell> paddedCellsToWidth(std::vector<Cell> const &cells, Cell const &paddingCell,
81 int paddedWidth);
82} // namespace Batch
83} // namespace MantidWidgets
84} // namespace MantidQt
const std::vector< double > & rhs
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
void setIconFilePath(QStandardItem &item, QString const &iconFilePath)
void setForegroundColor(QStandardItem &item, std::string const &foregroundColor)
void setBackgroundColor(QStandardItem &item, std::string const &backgroundColor)
EXPORT_OPT_MANTIDQT_COMMON std::vector< Cell > paddedCellsToWidth(std::vector< Cell > const &cells, Cell const &paddingCell, int paddedWidth)
Definition: Cell.cpp:95
EXPORT_OPT_MANTIDQT_COMMON std::ostream & operator<<(std::ostream &os, Cell const &cell)
Definition: Cell.cpp:83
EXPORT_OPT_MANTIDQT_COMMON bool operator==(Cell const &lhs, Cell const &rhs)
Definition: Cell.cpp:88
EXPORT_OPT_MANTIDQT_COMMON bool operator!=(Cell const &lhs, Cell const &rhs)
Definition: Cell.cpp:93
void setBorderColor(QStandardItem &item, std::string const &borderColor, int alpha)
void setBorderThickness(QStandardItem &item, int borderThickness)
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...