summaryrefslogtreecommitdiffstats
path: root/src/itemdocument.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/itemdocument.h')
-rw-r--r--src/itemdocument.h104
1 files changed, 53 insertions, 51 deletions
diff --git a/src/itemdocument.h b/src/itemdocument.h
index e9e9f6f..c40bc31 100644
--- a/src/itemdocument.h
+++ b/src/itemdocument.h
@@ -12,9 +12,9 @@
#define ITEMDOCUMENT_H
#include <document.h>
-#include <qcanvas.h>
-#include <qptrstack.h>
-#include <qvaluevector.h>
+#include <tqcanvas.h>
+#include <tqptrstack.h>
+#include <tqvaluevector.h>
class Canvas;
class CanvasTip;
@@ -28,13 +28,13 @@ class KTechlab;
class Operation;
class KActionMenu;
-class QCanvasItem;
+class TQCanvasItem;
-typedef QPtrStack<ItemDocumentData> IDDStack;
-typedef QGuardedPtr<Item> GuardedItem;
-typedef QMap< int, GuardedItem > IntItemMap;
-typedef QValueList<GuardedItem> ItemList;
-typedef QValueList<QPoint> QPointList;
+typedef TQPtrStack<ItemDocumentData> IDDStack;
+typedef TQGuardedPtr<Item> GuardedItem;
+typedef TQMap< int, GuardedItem > IntItemMap;
+typedef TQValueList<GuardedItem> ItemList;
+typedef TQValueList<TQPoint> TQPointList;
/**
@author David Saxton
@@ -42,8 +42,9 @@ typedef QValueList<QPoint> QPointList;
class ItemDocument : public Document
{
Q_OBJECT
+ TQ_OBJECT
public:
- ItemDocument( const QString &caption, KTechlab *ktechlab, const char *name = 0 );
+ ItemDocument( const TQString &caption, KTechlab *ktechlab, const char *name = 0 );
~ItemDocument();
class Z
@@ -84,7 +85,7 @@ class ItemDocument : public Document
/**
* Some things (such as the canvas getting resized, connectors being
- * invalidated, need to be done after editing operations have finished,
+ * tqinvalidated, need to be done after editing operations have finished,
* etc, and they also need to be done in the order given in the
* enumeration below.
*/
@@ -106,13 +107,13 @@ class ItemDocument : public Document
/**
* Attempt to register the item, returning true iff successful
*/
- virtual bool registerItem( QCanvasItem *qcanvasItem );
+ virtual bool registerItem( TQCanvasItem *qcanvasItem );
/**
* Will attempt to create an item with the given id at position p. Some item
* (such as PIC/START) have restrictions, and can only have one instance of
* themselves on the canvas, and adds the operation to the undo list
*/
- virtual Item* addItem( const QString &id, const QPoint &p, bool newItem ) = 0;
+ virtual Item* addItem( const TQString &id, const TQPoint &p, bool newItem ) = 0;
/**
* @returns A pointer to the canvas
*/
@@ -122,16 +123,16 @@ class ItemDocument : public Document
* canvas. If the id does not already exist, will return true; otherwise
* the function will return false.
*/
- bool registerUID( const QString & uid );
+ bool registerUID( const TQString & uid );
/**
* Generates a unique id based on a possibly unique component name.
*/
- QString generateUID( QString name );
+ TQString generateUID( TQString name );
/**
* Unlists the given id as one that is used.
* @see registerUID
*/
- void unregisterUID( const QString & uid );
+ void unregisterUID( const TQString & uid );
/**
* @return Whether or not the item is valid; i.e. is appropriate to the
* document being edited, and does not have other special restrictions
@@ -145,7 +146,7 @@ class ItemDocument : public Document
* on it (such as only allowing one instance of the Start part in
* FlowCode).
*/
- virtual bool isValidItem( const QString &itemId ) = 0;
+ virtual bool isValidItem( const TQString &itemId ) = 0;
/**
* Increases the "height" of the given list of items by "one".
*/
@@ -163,17 +164,17 @@ class ItemDocument : public Document
*/
void unselectAll();
/**
- * Select a list of QCanvasItem's
+ * Select a list of TQCanvasItem's
*/
- void select( const QCanvasItemList & list );
+ void select( const TQCanvasItemList & list );
/**
- * Select a QCanvasItem
+ * Select a TQCanvasItem
*/
- void select( QCanvasItem * item );
+ void select( TQCanvasItem * item );
/**
* Unselects the item
*/
- void unselect( QCanvasItem *qcanvasItem );
+ void unselect( TQCanvasItem *qcanvasItem );
/**
* Deletes anything waiting to be deleted.
*/
@@ -182,12 +183,12 @@ class ItemDocument : public Document
* Returns a rubber-band rectangle that contains all of the items on the
* canvas, padded out by a small border.
*/
- QRect canvasBoundingRect() const;
+ TQRect canvasBoundingRect() const;
/**
* Returns a pointer to a Item on the canvas with the given id,
* or NULL if no such Item exists.
*/
- Item* itemWithID( const QString & );
+ Item* itemWithID( const TQString & );
/**
* Returns true if the the user can perform an undo action
* (i.e. the undo stack is not empty)
@@ -201,21 +202,21 @@ class ItemDocument : public Document
/**
* Returns the top item at point (x, y), or NULL if there is no item there
*/
- QCanvasItem* itemAtTop( const QPoint &pos ) const;
+ TQCanvasItem* itemAtTop( const TQPoint &pos ) const;
/**
* Called when the canvas is clicked on with the right mouse button.
* Popups up a menu for editing operations
*/
- virtual void canvasRightClick( const QPoint &pos, QCanvasItem* item );
+ virtual void canvasRightClick( const TQPoint &pos, TQCanvasItem* item );
/**
* List of items in the ItemDocument
*/
ItemList itemList() const { return m_itemList; }
/**
- * Set the given QCanvasItem (which will attempt to be casted to known
+ * Set the given TQCanvasItem (which will attempt to be casted to known
* items to be deleted.
*/
- virtual void appendDeleteList( QCanvasItem * ) = 0;
+ virtual void appendDeleteList( TQCanvasItem * ) = 0;
/**
* Save the current state of the document to the undo/redo history.
* @param actionTicket if this is non-negative, and the last state save
@@ -237,7 +238,7 @@ class ItemDocument : public Document
*/
void requestEvent( ItemDocumentEvent::type type );
/**
- * Called from Canvas (when QCanvas::advance is called).
+ * Called from Canvas (when TQCanvas::advance is called).
*/
virtual void update();
@@ -291,7 +292,7 @@ class ItemDocument : public Document
void distributeVertically();
/**
* Adds an items not in the Z ordering to the ordering, and removes any
- * items from the Z ordering if they have parents. Then, calls all items
+ * items from the Z ordering if they have tqparents. Then, calls all items
* found in the ordering to tell them their Z position.
*/
void slotUpdateZOrdering();
@@ -304,7 +305,7 @@ class ItemDocument : public Document
* with the given id. Usually called when the user double-clicks on
* the component box.
*/
- void slotSetRepeatedItemId( const QString &id );
+ void slotSetRepeatedItemId( const TQString &id );
/**
* Unsets the editing mode from repeatedly creating a CNItem
*/
@@ -349,7 +350,7 @@ class ItemDocument : public Document
/**
* Reinherit this if you want to add any options to the right-click context
*/
- virtual void fillContextMenu( const QPoint & pos );
+ virtual void fillContextMenu( const TQPoint & pos );
/**
* Reads the background settings (grid-colour, underlying colour) from the Config settings,
* and generates the background pixmap from those settings
@@ -365,11 +366,11 @@ class ItemDocument : public Document
Canvas *m_canvas;
KTechlab *p_ktechlab;
- QStringList m_idList;
+ TQStringList m_idList;
static int m_nextActionTicket;
uint m_nextIdNum;
bool m_bIsLoading;
- QSize m_oldCanvasSize;
+ TQSize m_oldCanvasSize;
CMManager *m_cmManager;
ItemList m_itemDeleteList;
ItemList m_itemList;
@@ -378,11 +379,11 @@ class ItemDocument : public Document
ItemDocumentData * m_currentState;
int m_currentActionTicket;
ItemDocumentData * m_savedState; // Pointer to the document data that holds the state when it saved
- QString m_fileExtensionInfo; // For displaying in the save file dialog
+ TQString m_fileExtensionInfo; // For displaying in the save file dialog
CanvasTip * m_canvasTip;
IntItemMap m_zOrder;
KActionMenu * m_pAlignmentAction;
- QTimer * m_pEventTimer;
+ TQTimer * m_pEventTimer;
unsigned m_queuedEvents; // OR'ed together list of ItemDocumentEvent::type
friend class ICNView;
@@ -393,9 +394,10 @@ class ItemDocument : public Document
/**
@author David Saxton
*/
-class Canvas : public QCanvas
+class Canvas : public TQCanvas
{
Q_OBJECT
+ TQ_OBJECT
public:
Canvas( ItemDocument *itemDocument, const char * name = 0 );
@@ -404,7 +406,7 @@ class Canvas : public QCanvas
* time. If this is called with an empty message, then any existing
* message will be removed.
*/
- void setMessage( const QString & message );
+ void setMessage( const TQString & message );
virtual void update();
@@ -412,36 +414,36 @@ class Canvas : public QCanvas
void slotSetAllChanged() { setAllChanged(); }
protected:
- virtual void drawBackground ( QPainter & painter, const QRect & clip );
- virtual void drawForeground ( QPainter & painter, const QRect & clip );
+ virtual void drawBackground ( TQPainter & painter, const TQRect & clip );
+ virtual void drawForeground ( TQPainter & painter, const TQRect & clip );
ItemDocument *p_itemDocument;
- QString m_message;
- QTimer * m_pMessageTimeout;
+ TQString m_message;
+ TQTimer * m_pMessageTimeout;
};
/**
@author David Saxton
*/
-class CanvasTip : public QCanvasText
+class CanvasTip : public TQCanvasText
{
public:
- CanvasTip( ItemDocument *itemDocument, QCanvas *qcanvas );
+ CanvasTip( ItemDocument *itemDocument, TQCanvas *qcanvas );
virtual ~CanvasTip();
- void displayVI( ECNode *node, const QPoint &pos );
- void displayVI( Connector *connector, const QPoint &pos );
+ void displayVI( ECNode *node, const TQPoint &pos );
+ void displayVI( Connector *connector, const TQPoint &pos );
protected:
- virtual void draw( QPainter &p );
+ virtual void draw( TQPainter &p );
bool updateVI();
- void display( const QPoint &pos );
- QString displayText( unsigned num ) const;
+ void display( const TQPoint &pos );
+ TQString displayText( unsigned num ) const;
- QValueVector<double> m_v;
- QValueVector<double> m_i;
+ TQValueVector<double> m_v;
+ TQValueVector<double> m_i;
ItemDocument *p_itemDocument;
};