Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/shell/problemmodel.h
Show All 20 Lines | |||||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #ifndef PROBLEMMODEL_H | 23 | #ifndef PROBLEMMODEL_H | ||
24 | #define PROBLEMMODEL_H | 24 | #define PROBLEMMODEL_H | ||
25 | 25 | | |||
26 | #include <shell/shellexport.h> | 26 | #include <shell/shellexport.h> | ||
27 | #include <QAbstractItemModel> | 27 | #include <QAbstractItemModel> | ||
28 | #include <shell/problem.h> | 28 | #include <shell/problem.h> | ||
29 | #include <language/editor/documentrange.h> | ||||
29 | 30 | | |||
30 | namespace KDevelop { | 31 | namespace KDevelop { | ||
31 | class IDocument; | 32 | class IDocument; | ||
32 | class IndexedString; | 33 | class IndexedString; | ||
33 | class ProblemStore; | 34 | class ProblemStore; | ||
34 | 35 | | |||
35 | /** | 36 | /** | ||
36 | * @brief Wraps a ProblemStore and adds the QAbstractItemModel interface, so the it can be used in a model/view architecture. | 37 | * @brief Wraps a ProblemStore and adds the QAbstractItemModel interface, so the it can be used in a model/view architecture. | ||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 80 | public: | |||
125 | void setProblems(const QVector<IProblem::Ptr> &problems); | 126 | void setProblems(const QVector<IProblem::Ptr> &problems); | ||
126 | 127 | | |||
127 | /// Clears the problems | 128 | /// Clears the problems | ||
128 | void clearProblems(); | 129 | void clearProblems(); | ||
129 | 130 | | |||
130 | /// Retrieve problems for selected document | 131 | /// Retrieve problems for selected document | ||
131 | QVector<IProblem::Ptr> problems(const KDevelop::IndexedString& document) const; | 132 | QVector<IProblem::Ptr> problems(const KDevelop::IndexedString& document) const; | ||
132 | 133 | | |||
134 | /** | ||||
135 | * Add new "placeholder" item (problem). The item will be displayed whenever the model is empty. | ||||
136 | * | ||||
137 | * The method should be used to notify user about some events. For example, analyzer plugin | ||||
138 | * can set placeholders at analysis state changes - started/finished without errors/etc. | ||||
139 | * | ||||
140 | * \param[in] text Sets problem description. | ||||
141 | * \param[in] location Sets problem final location. | ||||
142 | * \param[in] source Sets problem source string. | ||||
143 | */ | ||||
144 | void setPlaceholderText(const QString& text, | ||||
145 | const KDevelop::DocumentRange& location = KDevelop::DocumentRange::invalid(), | ||||
146 | const QString& source = QString()); | ||||
147 | | ||||
133 | /// Retrieve the supported features | 148 | /// Retrieve the supported features | ||
134 | Features features() const; | 149 | Features features() const; | ||
135 | 150 | | |||
136 | /// Retrieve 'show imports' filter setting | 151 | /// Retrieve 'show imports' filter setting | ||
137 | bool showImports(); | 152 | bool showImports(); | ||
138 | 153 | | |||
139 | /// Set the supported features | 154 | /// Set the supported features | ||
140 | void setFeatures(Features features); | 155 | void setFeatures(Features features); | ||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |