cppcheck/gui/project.h

96 lines
2.2 KiB
C
Raw Normal View History

/*
* Cppcheck - A tool for static C/C++ code analysis
2016-01-01 14:34:45 +01:00
* Copyright (C) 2007-2016 Cppcheck team.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PROJECT_H
#define PROJECT_H
#include <QObject>
#include <QString>
class QWidget;
class ProjectFile;
/// @addtogroup GUI
/// @{
/**
* @brief A class that contains project data and manages projects.
* Currently only project file creation and editing is implemented.
*/
2011-10-13 20:53:06 +02:00
class Project : public QObject {
Q_OBJECT
public:
explicit Project(QWidget *parent = 0);
Project(const QString &filename, QWidget *parent = 0);
~Project();
/**
* @brief Return the filename of the project.
* @return Project's filename.
*/
2017-07-28 04:57:28 +02:00
QString getFilename() const;
/**
* @brief Set filename for the project file.
* @param filename Filename.
*/
2017-07-28 04:57:28 +02:00
void setFilename(const QString &filename);
/**
* @brief Is the project open?
* The project is considered to be open if it has an opened project file.
* @return true if the project is open, false otherwise.
*/
2017-07-28 04:57:28 +02:00
bool isOpen() const;
/**
* @brief Open existing project file.
*/
2017-07-28 04:57:28 +02:00
bool open();
/**
* @brief Edit the project file.
* @return true if editing was successful.
*/
2017-07-28 04:57:28 +02:00
bool edit();
/**
* @brief Create new project file.
*/
2017-07-28 04:57:28 +02:00
void create();
/**
* @brief Return current project file.
* @return project file.
*/
2017-07-28 04:57:28 +02:00
ProjectFile * getProjectFile() const {
2016-11-19 21:12:32 +01:00
return mProjectFile;
}
private:
QString mFilename;
2016-11-19 21:12:32 +01:00
ProjectFile *mProjectFile;
QWidget *mParentWidget;
};
/// @}
#endif // PROJECT_H