Commit 8ba057f3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Move IProjectUiCb in its own file

parent f181c7e8
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#ifndef GUIPROJECTMANAGER_H #ifndef GUIPROJECTMANAGER_H
#define GUIPROJECTMANAGER_H #define GUIPROJECTMANAGER_H
#include "Project/Project.h" #include "Project/ProjectCallbacks.h"
class GUIProjectManager : public IProjectUiCb class GUIProjectManager : public IProjectUiCb
{ {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "AutomaticBackup.h" #include "AutomaticBackup.h"
#include "Library/Library.h" #include "Library/Library.h"
#include "Project.h" #include "Project.h"
#include "ProjectCallbacks.h"
#include "RecentProjects.h" #include "RecentProjects.h"
#include "Settings/Settings.h" #include "Settings/Settings.h"
#include "Workflow/MainWorkflow.h" #include "Workflow/MainWorkflow.h"
......
...@@ -36,51 +36,13 @@ class QUndoStack; ...@@ -36,51 +36,13 @@ class QUndoStack;
class QXmlStreamWriter; class QXmlStreamWriter;
class AutomaticBackup; class AutomaticBackup;
class IProjectUiCb;
class Library; class Library;
class MainWorkflow; class MainWorkflow;
class ProjectManager; class ProjectManager;
class Settings; class Settings;
class Workspace; class Workspace;
class IProjectUiCb
{
public:
enum SaveMode
{
Save, // Save the project
Discard, // Discard it
Cancel // Don't do anything
};
virtual ~IProjectUiCb() {}
/**
* @brief shouldSaveBeforeClose Ask the user if she wants to save the project in case
* it's about to be closed
* @return True if the project should be saved. False if changes are to be discarded.
*/
virtual SaveMode shouldSaveBeforeClose() = 0;
/**
* @brief getProjectFile Ask the user where to save a new project
* @param defaultPath A default project location, if any.
* @return The selected project file
*/
virtual QString getProjectFileDestination( const QString& defaultPath ) = 0;
/**
* @brief shouldLoadBackupFile
* @return True if the user wants to load the backup file.
*/
virtual bool shouldLoadBackupFile() = 0;
/**
* @brief shouldDeleteOutdatedBackupFile
* @return True if the user wants to delete this backup file
*/
virtual bool shouldDeleteOutdatedBackupFile() = 0;
};
class Project : public QObject, public Singleton<Project> class Project : public QObject, public Singleton<Project>
{ {
Q_OBJECT Q_OBJECT
......
/*****************************************************************************
* ProjectCallbacks.h: Defines some project related callback interfaces
*****************************************************************************
* Copyright (C) 2008-2014 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* 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 2
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef PROJECTCALLBACKS_H
#define PROJECTCALLBACKS_H
#include <QString>
class IProjectUiCb
{
public:
enum SaveMode
{
Save, // Save the project
Discard, // Discard it
Cancel // Don't do anything
};
virtual ~IProjectUiCb() {}
/**
* @brief shouldSaveBeforeClose Ask the user if she wants to save the project in case
* it's about to be closed
* @return True if the project should be saved. False if changes are to be discarded.
*/
virtual SaveMode shouldSaveBeforeClose() = 0;
/**
* @brief getProjectFile Ask the user where to save a new project
* @param defaultPath A default project location, if any.
* @return The selected project file
*/
virtual QString getProjectFileDestination( const QString& defaultPath ) = 0;
/**
* @brief shouldLoadBackupFile
* @return True if the user wants to load the backup file.
*/
virtual bool shouldLoadBackupFile() = 0;
/**
* @brief shouldDeleteOutdatedBackupFile
* @return True if the user wants to delete this backup file
*/
virtual bool shouldDeleteOutdatedBackupFile() = 0;
};
#endif // PROJECTCALLBACKS_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment