2
JuffEd - An advanced text editor
3
Copyright 2007-2010 Mikhail Murzin
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License
7
version 2 as published by the Free Software Foundation.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
#ifndef __JUFFED_DOC_HANDLER_INT_H__
20
#define __JUFFED_DOC_HANDLER_INT_H__
22
#include "LibConfig.h"
31
class LIBJUFF_EXPORT DocHandlerInt {
34
* Returns app's main window.
36
virtual QWidget* mainWindow() const = 0;
39
* Returns current document. If there is no documents then returns a NullDoc.
41
virtual Juff::Document* curDoc() const = 0;
44
* Returns document by file name. If there is no such document opened then returns a NullDoc.
46
virtual Juff::Document* getDoc(const QString&) const = 0;
49
* Returns current project.
51
virtual Juff::Project* curPrj() const = 0;
54
* Opens a document with a given file name or activates it if it is already opened.
56
virtual void openDoc(const QString&, Juff::PanelIndex panel = Juff::PanelCurrent) = 0;
59
* Closes the document with a given file name.
61
virtual void closeDoc(const QString&) = 0;
64
* Closes all document at the given panel.
66
virtual void closeAllDocs(Juff::PanelIndex panel) = 0;
69
* Closes all document except for the given index at the given panel.
71
virtual void closeAllOtherDocs(int index, Juff::PanelIndex panel) = 0;
74
* Saves the document with a given file name.
76
virtual void saveDoc(const QString&) = 0;
79
* Returns the number of currently opened documents for the given panel.
81
virtual int docCount(Juff::PanelIndex) const = 0;
84
* Returns the list of currently opened documents.
86
virtual QStringList docList() const = 0;
91
#endif // __JUFFED_DOC_HANDLER_INT_H__