summaryrefslogtreecommitdiffstats
path: root/src/documentiface.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 01:49:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 01:49:02 +0000
commit5de3dd4762ca33a0f92e79ffa4fe2ff67069d531 (patch)
treebad482b7afa4cdf47422d60a5dd2c61c7e333b09 /src/documentiface.h
downloadktechlab-5de3dd4762ca33a0f92e79ffa4fe2ff67069d531.tar.gz
ktechlab-5de3dd4762ca33a0f92e79ffa4fe2ff67069d531.zip
Added KDE3 version of ktechlab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1095338 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/documentiface.h')
-rw-r--r--src/documentiface.h193
1 files changed, 193 insertions, 0 deletions
diff --git a/src/documentiface.h b/src/documentiface.h
new file mode 100644
index 0000000..5f32cfe
--- /dev/null
+++ b/src/documentiface.h
@@ -0,0 +1,193 @@
+/***************************************************************************
+ * Copyright (C) 2005 by David Saxton *
+ * david@bluehaze.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 DOCUMENTIFACE_H
+#define DOCUMENTIFACE_H
+
+#include "config.h"
+
+#include <dcopobject.h>
+#include <dcopref.h>
+
+class CircuitDocument;
+class Document;
+class FlowCodeDocument;
+class ICNDocument;
+class ItemDocument;
+class MechanicsDocument;
+class TextDocument;
+class View;
+
+/**
+@author David Saxton
+*/
+class DocumentIface : public DCOPObject
+{
+ K_DCOP
+
+ public:
+ DocumentIface( Document * document );
+ virtual ~DocumentIface();
+
+ k_dcop:
+ QString caption() const;
+ DCOPRef activeView();
+ uint numberOfViews();
+// View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = 0l );
+ QString url();
+ bool openURL( const QString & url );
+ bool isModified();
+ bool isUndoAvailable();
+ bool isRedoAvailable();
+ void save();
+ void saveAs();
+ bool close();
+ void print();
+ void cut();
+ void copy();
+ void paste();
+ void undo();
+ void redo();
+ void selectAll();
+
+ protected:
+ DCOPRef viewToRef( View * view );
+
+ Document * m_pDocument;
+};
+
+class TextDocumentIface : public DocumentIface
+{
+ K_DCOP
+
+ public:
+ TextDocumentIface( TextDocument * document );
+
+ k_dcop:
+ void formatAssembly();
+ void convertToMicrobe();
+ void convertToHex();
+ void convertToPIC();
+ void convertToAssembly();
+ void clearBookmarks();
+ bool isDebugging();
+ void debugRun();
+ void debugInterrupt();
+ void debugStop();
+ void debugStep();
+ void debugStepOver();
+ void debugStepOut();
+
+ protected:
+ TextDocument * m_pTextDocument;
+};
+
+class ItemDocumentIface : public DocumentIface
+{
+ K_DCOP
+
+ public:
+ ItemDocumentIface( ItemDocument * document );
+
+ k_dcop:
+ QCStringList validItemIDs();
+ /**
+ * Create an item with the given id (e.g. "ec/resistor") at the given
+ * position.
+ * @return name of item (assigned to it by KTechlab)
+ */
+ QString addItem( const QString & id, int x, int y );
+ void selectItem( const QString & id );
+ void unselectItem( const QString & id );
+ void clearHistory();
+ void unselectAll();
+ void alignHorizontally();
+ void alignVertically();
+ void distributeHorizontally();
+ void distributeVertically();
+ void deleteSelection();
+
+ protected:
+ ItemDocument * m_pItemDocument;
+};
+
+class MechanicsDocumentIface : public ItemDocumentIface
+{
+ K_DCOP
+
+ public:
+ MechanicsDocumentIface( MechanicsDocument * document );
+
+ protected:
+ MechanicsDocument * m_pMechanicsDocument;
+};
+
+class ICNDocumentIface : public ItemDocumentIface
+{
+ K_DCOP
+
+ public:
+ ICNDocumentIface( ICNDocument * document );
+
+ k_dcop:
+ void exportToImage();
+ QCStringList nodeIDs( const QString & id );
+ /**
+ * Makes a connection from node1 on item1 to node2 on item2
+ */
+ QString makeConnection( const QString & item1, const QString & node1, const QString & item2, const QString & node2 );
+ void selectConnector( const QString & id );
+ void unselectConnector( const QString & id );
+
+ protected:
+ ICNDocument * m_pICNDocument;
+};
+
+class CircuitDocumentIface : public ICNDocumentIface
+{
+ K_DCOP
+
+ public:
+ CircuitDocumentIface( CircuitDocument * document );
+
+ k_dcop:
+ void setOrientation0();
+ void setOrientation90();
+ void setOrientation180();
+ void setOrientation270();
+ void rotateCounterClockwise();
+ void rotateClockwise();
+ void flip();
+ void displayEquations();
+ void createSubcircuit();
+
+ protected:
+ CircuitDocument * m_pCircuitDocument;
+};
+
+class FlowCodeDocumentIface : public ICNDocumentIface
+{
+ K_DCOP
+
+ public:
+ FlowCodeDocumentIface( FlowCodeDocument * document );
+ void convertToMicrobe();
+ void convertToHex();
+ void convertToPIC();
+ void convertToAssembly();
+
+ k_dcop:
+ void setPicType( const QString & id );
+
+ protected:
+ FlowCodeDocument * m_pFlowCodeDocument;
+};
+
+#endif