summaryrefslogtreecommitdiffstats
path: root/src/libgui/object_view.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/object_view.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/object_view.h')
-rw-r--r--src/libgui/object_view.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/libgui/object_view.h b/src/libgui/object_view.h
new file mode 100644
index 0000000..358101b
--- /dev/null
+++ b/src/libgui/object_view.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+ * Copyright (C) 2006 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 OBJECT_VIEW_H
+#define OBJECT_VIEW_H
+
+#include "text_editor.h"
+#include "coff/base/coff_archive.h"
+#include "coff/base/coff_object.h"
+namespace Device { class Data; }
+class HexEditor;
+
+namespace Coff
+{
+class Base;
+class TextObject;
+
+//-----------------------------------------------------------------------------
+class BaseEditor : public SimpleTextEditor, public Log::Base
+{
+Q_OBJECT
+public:
+ BaseEditor(const PURL::Url &source, const Device::Data *data, QWidget *parent);
+ virtual ~BaseEditor();
+ virtual PURL::Url url() const { return _url; }
+
+protected:
+ PURL::Url _source, _url;
+ bool _ok;
+ Coff::Base *_created;
+ const Device::Data *_device;
+};
+
+//-----------------------------------------------------------------------------
+class CoffEditor : public BaseEditor
+{
+Q_OBJECT
+public:
+ CoffEditor(const PURL::Url &source, const Device::Data &data, QWidget *parent);
+ CoffEditor(const TextObject &object, QWidget *parent);
+ virtual PURL::FileType fileType() const { return PURL::Coff; }
+ virtual bool open(const PURL::Url &url);
+
+private:
+ const TextObject *_provided;
+};
+
+//-----------------------------------------------------------------------------
+class ObjectEditor : public BaseEditor
+{
+Q_OBJECT
+public:
+ ObjectEditor(const PURL::Url &source, QWidget *parent);
+ virtual PURL::FileType fileType() const { return PURL::Unknown; }
+ virtual bool open(const PURL::Url &url);
+
+private:
+ const Coff::Object *coff() const { return static_cast<const Coff::Object *>(_created); }
+};
+
+//-----------------------------------------------------------------------------
+class LibraryEditor : public BaseEditor
+{
+Q_OBJECT
+public:
+ LibraryEditor(const PURL::Url &source, QWidget *parent);
+ virtual PURL::FileType fileType() const { return PURL::Unknown; }
+ virtual bool open(const PURL::Url &url);
+
+private:
+ const Coff::Archive *coff() const { return static_cast<const Coff::Archive *>(_created); }
+};
+
+} // namespace
+
+//-----------------------------------------------------------------------------
+class DisassemblyEditor : public SimpleTextEditor, public Log::Base
+{
+Q_OBJECT
+public:
+ DisassemblyEditor(const PURL::Url &hexUrl, const Device::Data &data, QWidget *parent);
+ DisassemblyEditor(const HexEditor &e, const Device::Data &data, QWidget *parent);
+ virtual PURL::FileType fileType() const { return PURL::AsmGPAsm; }
+ virtual bool open(const PURL::Url &url);
+ virtual PURL::Url url() const { return _url; }
+
+private:
+ PURL::Url _source, _url;
+ const Device::Data &_device;
+ const HexEditor *_editor;
+};
+
+
+#endif