rocs/RocsCore
#include <Project.h>
Public Member Functions | |
Project () | |
Project (const KUrl &projectFile) | |
Project (const KUrl &projectArchive, const KUrl &projectDirectory) | |
virtual | ~Project () |
int | addCodeFile (const KUrl &file) |
void | addCodeFileNew (KTextEditor::Document *document) |
int | addGraphFile (const KUrl &file) |
void | addGraphFileNew (Document *document) |
QList< KUrl > | codeFiles () const |
QList< KTextEditor::Document * > | codeFilesNew () const |
bool | exportProject (const KUrl &exportUrl) |
QList< KUrl > | graphFiles () const |
bool | isModified () const |
bool | isTemporary () |
KUrl | journalFile () const |
QString | name () const |
QString | projectDirectory () const |
KUrl | projectFile () const |
void | removeCodeFile (int fileID) |
void | removeCodeFileNew (KTextEditor::Document *document) |
void | removeGraphFile (int fileID) |
void | removeGraphFileNew (Document *document) |
void | saveCodeFileNew (KTextEditor::Document *document, const KUrl &file) |
void | saveGraphFileAs (Document *document, const QString &file) |
void | saveGraphFileNew (Document *document, const QString &file) |
void | setJournalFile (const KUrl &file) |
void | setModified (bool modified=true) |
void | setName (const QString &name) |
void | setProjectFile (const KUrl &fileUrl) |
bool | writeProjectFile (const QString &fileUrl=QString()) |
Detailed Description
A "Project" object represents the compilation of file pointers that form a Rocs project.
Use this class to maintain the set of all files belonging to the project. Thus, files specified by the project file are a (not necessarily strict) superset of file currently displayed at the main window widget.
Constructor & Destructor Documentation
|
explicit |
Constructor for project that creates a new project with empty configuration.
A temporary project file is used and
- See also
- temporary() will return true until project is saved.
Definition at line 73 of file Project.cpp.
|
explicit |
Constructor for project that creates a project by configuration given in file projectFile
.
- Parameters
-
projectFile is the absolute path to the project file
Definition at line 88 of file Project.cpp.
|
explicit |
Constructor for project that creates a project by configuration given in file projectFile
inside directory projectDirectory
.
- Parameters
-
projectArchive the local file path to the project file projectDirectory the local file path to the project directory
Definition at line 102 of file Project.cpp.
|
virtual |
Definition at line 125 of file Project.cpp.
Member Function Documentation
int Project::addCodeFile | ( | const KUrl & | file | ) |
Add code file to project.
The file is specified by file
.
- Parameters
-
file is the local file URL
Definition at line 161 of file Project.cpp.
void Project::addCodeFileNew | ( | KTextEditor::Document * | document | ) |
Add a new temporary code file to the project.
This file has not a file name and must be saved before it can be added to the project. Use
- See also
- saveCodeFileNew(...) to save temporary file to actually file and update project configuration.
- Parameters
-
document is the temporary code file
Definition at line 204 of file Project.cpp.
int Project::addGraphFile | ( | const KUrl & | file | ) |
Add graph file to project.
The file is specified by file
.
- Parameters
-
file is the local file URL
Definition at line 221 of file Project.cpp.
void Project::addGraphFileNew | ( | Document * | document | ) |
Add a new temporary graph document to the project.
This file has not a file name and must be saved before it can be added to the project. Use
- See also
- saveGraphFileNew(...) to save temporary file to actually file and update project configuration.
- Parameters
-
document is the temporary code file
Definition at line 259 of file Project.cpp.
QList< KUrl > Project::codeFiles | ( | ) | const |
Get list of all code files of the project that have a path.
- Returns
- list of URLs
Definition at line 184 of file Project.cpp.
QList< KTextEditor::Document * > Project::codeFilesNew | ( | ) | const |
Get list of all temporary code files of the project, i.e., code files that do not have a path.
- Returns
- list of URLs
Definition at line 199 of file Project.cpp.
bool Project::exportProject | ( | const KUrl & | exportUrl | ) |
Exports the project with all its components (scripts, graph, journal) to an archive file.
- Parameters
-
exportUrl the path to the newly created archive
- Returns
- true if archive was created, else false
Definition at line 360 of file Project.cpp.
QList< KUrl > Project::graphFiles | ( | ) | const |
Get list of all graph files of the project that have a path.
- Returns
- list of local file URLs
Definition at line 244 of file Project.cpp.
bool Project::isModified | ( | ) | const |
Returns true if the poject is modified.
- Returns
- modification status
Definition at line 442 of file Project.cpp.
bool Project::isTemporary | ( | ) |
Specifies if the project file is only temporary or not.
The status changes to non-temporary if a temporary file is saved.
- Returns
- true if this is a project not associated to a file, otherwise false
Definition at line 437 of file Project.cpp.
KUrl Project::journalFile | ( | ) | const |
Returns URL to local file containing the project journal.
- Returns
- URL to local file
Definition at line 294 of file Project.cpp.
QString Project::name | ( | ) | const |
Returns name of the project.
Name can be set with
- See also
- setName(...).
- Returns
- name of the project
Definition at line 136 of file Project.cpp.
QString Project::projectDirectory | ( | ) | const |
Gives the working directory of the project.
If no directory was set or the loaded project files does not specify a directory, QString() is returned.
- Returns
- project directory
Definition at line 142 of file Project.cpp.
KUrl Project::projectFile | ( | ) | const |
Definition at line 150 of file Project.cpp.
void Project::removeCodeFile | ( | int | fileID | ) |
Remove code file from the project.
File is specified by its identifier in internal list.
- Parameters
-
fileID is key for QMap that organizes the files
Definition at line 178 of file Project.cpp.
void Project::removeCodeFileNew | ( | KTextEditor::Document * | document | ) |
Remove code file document
from list of temporary code files of the project.
- Parameters
-
document is the temporary document to be removed
Definition at line 209 of file Project.cpp.
void Project::removeGraphFile | ( | int | fileID | ) |
Remove graph file from the project.
File is specified by its identifier in internal list.
- Parameters
-
fileID is key for QMap that organizes the files
Definition at line 238 of file Project.cpp.
void Project::removeGraphFileNew | ( | Document * | document | ) |
Remove graph file document
from list of temporary graph files of the project.
- Parameters
-
document is the temporary document to be removed
Definition at line 265 of file Project.cpp.
void Project::saveCodeFileNew | ( | KTextEditor::Document * | document, |
const KUrl & | file | ||
) |
Save a temporary code document to a code file and update association to the project.
This method calls save method of document
, saves it to file
, removes file from set of temporary code files and puts it into the list of code files of the project.
- Parameters
-
document is the temporary code file file is the local file URL to where the code file shall be saved
Definition at line 214 of file Project.cpp.
void Project::saveGraphFileAs | ( | Document * | document, |
const QString & | file | ||
) |
Save existing graph document file under new filename.
Definition at line 277 of file Project.cpp.
void Project::saveGraphFileNew | ( | Document * | document, |
const QString & | file | ||
) |
Save a temporary graph document to a graph file and update association to the project.
This method calls save method of document
, saves it to file
, removes file from set of temporary graph files and puts it into the list of graph files of the project.
- Parameters
-
document is the temporary graph file file is the file url to where the graph file shall be saved
Definition at line 270 of file Project.cpp.
void Project::setJournalFile | ( | const KUrl & | file | ) |
Set journal file of the project.
- Parameters
-
file is a local file url pointing to the journal file
void Project::setModified | ( | bool | modified = true | ) |
Set modified value of project to modified
.
Definition at line 447 of file Project.cpp.
void Project::setName | ( | const QString & | name | ) |
Set project name.
- Parameters
-
name is the new name of the project
Definition at line 129 of file Project.cpp.
void Project::setProjectFile | ( | const KUrl & | fileUrl | ) |
Set path of project to fileUrl
and set project to being non-temporary.
- Parameters
-
fileUrl is the designated path to the project
Definition at line 155 of file Project.cpp.
bool Project::writeProjectFile | ( | const QString & | fileUrl = QString() | ) |
Save the project to its current file if empty or no filename is given.
Otherwise if filename is given, save the project in file fileUrl
. If the project is temporary, i.e., isTemporary() returns true, a file URL is mandatory.
- Parameters
-
fileUrl is the target file, expected as absolute path
- Returns
- true if save was successful, otherwise false
Definition at line 315 of file Project.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.