summaryrefslogtreecommitdiffstats
path: root/src/libgui/editor.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
commitf508189682b6fba62e08feeb1596f682bad5fff9 (patch)
tree28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/libgui/editor.h
downloadpiklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz
piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/libgui/editor.h')
-rw-r--r--src/libgui/editor.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/libgui/editor.h b/src/libgui/editor.h
new file mode 100644
index 0000000..9247c80
--- /dev/null
+++ b/src/libgui/editor.h
@@ -0,0 +1,68 @@
+/***************************************************************************
+ * Copyright (C) 2005 Nicolas Hadacek <hadacek@kde.org> *
+ * *
+ * 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. *
+ ***************************************************************************/
+#ifndef EDITOR_H
+#define EDITOR_H
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qvaluevector.h>
+#include "common/common/qflags.h"
+#include <kstdaction.h>
+class KPopupMenu;
+
+#include "common/global/purl.h"
+
+class Editor : public QWidget
+{
+Q_OBJECT
+public:
+ Editor(const QString &title, const QString &tag, QWidget *parent, const char *name);
+ Editor(QWidget *parent, const char *name);
+ virtual QSizePolicy sizePolicy() const;
+ virtual PURL::FileType fileType() const = 0;
+ virtual bool isModified() const = 0;
+ void setModified(bool modified);
+ virtual PURL::Url url() const = 0;
+ QString name() const { return _title; }
+ QString tag() const { return _tag; }
+ void setReadOnly(bool readOnly);
+ virtual bool isReadOnly() const = 0;
+ bool checkSaved();
+ bool reload();
+ virtual void setFocus() = 0;
+ virtual bool open(const PURL::Url &url) = 0;
+ virtual bool save(const PURL::Url &url) = 0;
+ virtual void addGui() = 0;
+ virtual void removeGui() = 0;
+ virtual QValueList<uint> bookmarkLines() const = 0;
+ virtual void setBookmarkLines(const QValueList<uint> &lines) = 0;
+
+public slots:
+ bool slotLoad();
+ bool save();
+ bool saveAs();
+ void toggleReadOnly() { setReadOnly(!isReadOnly()); }
+ virtual void statusChanged() = 0;
+
+signals:
+ void modified();
+ void guiChanged();
+ void statusTextChanged(const QString &text);
+ void dropEventPass(QDropEvent *e);
+
+protected:
+ QString filename() const;
+ virtual void setModifiedInternal(bool modified) = 0;
+ virtual void setReadOnlyInternal(bool readOnly) = 0;
+
+private:
+ QString _title, _tag;
+};
+
+#endif