1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
/*
* The TaskJuggler Project Management Software
*
* Copyright (c) 2001, 2002, 2003, 2004, 2005 by Chris Schlaeger <cs@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* $Id: FileManager.h 1287 2006-03-20 14:27:45Z cs $
*/
#ifndef _FileManager_h_
#define _FileManager_h_
#include <list>
#include <qobject.h>
#include "ManagedFileInfo.h"
class QWidgetStack;
class QStringList;
class KConfig;
class KMainWindow;
class KListView;
class KListViewSearchLine;
class KURL;
class CoreAttributes;
class Report;
class FileManager : public QObject
{
Q_OBJECT
public:
FileManager(KMainWindow* m, QWidgetStack* v, KListView* b,
KListViewSearchLine* s);
virtual ~FileManager();
KMainWindow* getMainWindow() const { return mainWindow; }
void updateFileList(const QStringList& fl, const KURL& mf);
void addFile(const KURL& url);
void addFile(const KURL& nf, const KURL& nnf);
void setMasterFile(const KURL& url);
KURL getCurrentFileURL() const;
ManagedFileInfo* getCurrentFile() const;
void readProperties(KConfig* config);
void writeProperties(KConfig* config);
QString getWordUnderCursor() const;
QWidgetStack* getViewStack() const { return viewStack; }
void showEditor();
void hideEditor();
const KURL& getMasterFileURL() const;
ManagedFileInfo* getMasterFile() { return masterFile; }
bool isProjectLoaded() const;
void saveAllFiles(bool ask = false);
void saveCurrentFile(bool ask = false);
void expandMacros();
void clear();
void print();
void configureEditor();
public slots:
void showInEditor(const KURL& url);
void showInEditor(const KURL& url, int line, int col);
void showInEditor(CoreAttributes* ca);
void showInEditor(const Report* report);
void saveCurrentFileAs(const KURL& url);
void closeCurrentFile();
void setCursorPosition(int line, int col);
void enableEditorActions(bool enable);
void enableClipboardActions(bool enable = TRUE);
void enableUndoActions(bool enable = TRUE);
private slots:
void insertDate();
private:
FileManager() { }
KMainWindow* mainWindow;
KConfig* config;
bool editorConfigured;
QString findCommonPath();
void updateFileBrowser();
ManagedFileInfo* getMFI(const KURL& url);
QWidgetStack* viewStack;
KListView* browser;
KListViewSearchLine* searchLine;
std::list<ManagedFileInfo*> files;
ManagedFileInfo* masterFile;
KTextEditor::View* currentGUIClient;
} ;
#endif
|