2010-07-12 23:10:48 +02:00
|
|
|
/*
|
|
|
|
* Cppcheck - A tool for static C/C++ code analysis
|
2015-01-03 12:14:58 +01:00
|
|
|
* Copyright (C) 2007-2015 Daniel Marjamäki and Cppcheck team.
|
2010-07-12 23:10:48 +02:00
|
|
|
*
|
|
|
|
* 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 {
|
2010-07-12 23:10:48 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-03-08 18:18:09 +01:00
|
|
|
explicit Project(QWidget *parent = 0);
|
2010-07-12 23:10:48 +02:00
|
|
|
Project(const QString &filename, QWidget *parent = 0);
|
|
|
|
~Project();
|
|
|
|
|
2011-08-24 21:41:48 +02:00
|
|
|
/**
|
|
|
|
* @brief Return the filename of the project.
|
|
|
|
* @return Project's filename.
|
|
|
|
*/
|
|
|
|
QString Filename() const;
|
|
|
|
|
2010-07-12 23:10:48 +02:00
|
|
|
/**
|
|
|
|
* @brief Set filename for the project file.
|
|
|
|
* @param filename Filename.
|
|
|
|
*/
|
|
|
|
void SetFilename(const QString &filename);
|
|
|
|
|
2011-08-24 21:41:48 +02:00
|
|
|
/**
|
|
|
|
* @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.
|
|
|
|
*/
|
|
|
|
bool IsOpen() const;
|
|
|
|
|
2010-07-12 23:10:48 +02:00
|
|
|
/**
|
|
|
|
* @brief Open existing project file.
|
|
|
|
*/
|
|
|
|
bool Open();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Edit the project file.
|
2012-10-14 14:13:54 +02:00
|
|
|
* @return true if editing was successful.
|
2010-07-12 23:10:48 +02:00
|
|
|
*/
|
2012-10-14 14:13:54 +02:00
|
|
|
bool Edit();
|
2010-07-12 23:10:48 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Create new project file.
|
|
|
|
*/
|
|
|
|
void Create();
|
|
|
|
|
2010-08-15 10:35:46 +02:00
|
|
|
/**
|
|
|
|
* @brief Return current project file.
|
|
|
|
* @return project file.
|
|
|
|
*/
|
2014-11-20 14:20:09 +01:00
|
|
|
ProjectFile * GetProjectFile() const {
|
2010-08-15 10:35:46 +02:00
|
|
|
return mPFile;
|
|
|
|
}
|
|
|
|
|
2010-07-12 23:10:48 +02:00
|
|
|
private:
|
|
|
|
|
|
|
|
QString mFilename;
|
|
|
|
ProjectFile *mPFile;
|
|
|
|
QWidget *mParentWidget;
|
|
|
|
};
|
|
|
|
|
|
|
|
/// @}
|
|
|
|
|
|
|
|
#endif // PROJECT_H
|