summaryrefslogtreecommitdiffstats
path: root/kpresenter/KPrCanvas.h
diff options
context:
space:
mode:
Diffstat (limited to 'kpresenter/KPrCanvas.h')
-rw-r--r--kpresenter/KPrCanvas.h249
1 files changed, 125 insertions, 124 deletions
diff --git a/kpresenter/KPrCanvas.h b/kpresenter/KPrCanvas.h
index ca81fdfc..9ab7de16 100644
--- a/kpresenter/KPrCanvas.h
+++ b/kpresenter/KPrCanvas.h
@@ -23,14 +23,14 @@
#ifndef __KPRCANVAS__
#define __KPRCANVAS__
-#include <qwidget.h>
-#include <qptrlist.h>
-#include <qpicture.h>
-#include <qvaluelist.h>
-#include <qpixmap.h>
-#include <qpointarray.h>
-#include <qvaluevector.h>
-#include <qtimer.h>
+#include <tqwidget.h>
+#include <tqptrlist.h>
+#include <tqpicture.h>
+#include <tqvaluelist.h>
+#include <tqpixmap.h>
+#include <tqpointarray.h>
+#include <tqvaluevector.h>
+#include <tqtimer.h>
#include <KoGuides.h>
#include <KoRuler.h>
@@ -45,25 +45,25 @@ class KURL;
class KoTextFormatInterface;
class KPrView;
class KPrDocument;
-class QPainter;
+class TQPainter;
class KTextEdit;
class KPrTextObject;
class KPrObject;
class KPopupMenu;
-class QResizeEvent;
-class QPaintEvent;
-class QDragEnterEvent;
-class QDragMoveEvent;
-class QDropEvent;
-class QFocusEvent;
-class QMouseEvent;
-class QWheelEvent;
-class QKeyEvent;
+class TQResizeEvent;
+class TQPaintEvent;
+class TQDragEnterEvent;
+class TQDragMoveEvent;
+class TQDropEvent;
+class TQFocusEvent;
+class TQMouseEvent;
+class TQWheelEvent;
+class TQKeyEvent;
class KPrPixmapObject;
class KPrBackGround;
-class QRect;
-class QSize;
-class QPoint;
+class TQRect;
+class TQSize;
+class TQPoint;
class KPrSoundPlayer;
class KoTextObject;
class KoParagCounter;
@@ -79,20 +79,21 @@ class KPrPageEffects;
*
* It manages the graphical representation of all the objects.
*/
-class KPrCanvas : public QWidget
+class KPrCanvas : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/// constructor
- KPrCanvas( QWidget *parent=0,const char *name=0,KPrView *_view=0 );
+ KPrCanvas( TQWidget *tqparent=0,const char *name=0,KPrView *_view=0 );
/// destructor
~KPrCanvas();
KPrView * getView()const { return m_view; }
- // The equivalent of contentsX() and contentsY() for a QScrollView
+ // The equivalent of contentsX() and contentsY() for a TQScrollView
// The Canvas is a widget, not a scrollview (because we handle the scrollbars ourselves,
// to have the "goto page" buttons at the bottom of the scrollbars etc.)
int diffx() const { return m_xOffset; }
@@ -109,8 +110,8 @@ public:
void deSelectObj( KPrObject* );
void setTextFormat(const KoTextFormat &format, int flags);
- void setTextColor( const QColor & );
- void setTextBackgroundColor( const QColor & );
+ void setTextColor( const TQColor & );
+ void setTextBackgroundColor( const TQColor & );
void setTextAlign( int );
void setTextDepthPlus();
void setTextDepthMinus();
@@ -123,7 +124,7 @@ public:
void setTextItalic( bool b );
void setTextUnderline( bool b );
void setTextStrikeOut( bool b );
- void setTextFamily( const QString &f );
+ void setTextFamily( const TQString &f );
void setTextPointSize( int s );
void setTextSubScript( bool b );
void setTextSuperScript( bool b );
@@ -160,21 +161,21 @@ public:
int numPresSteps() const { return m_pageEffectSteps.count(); }
int numPresPages() const { return m_presentationSlides.count(); }
- bool canAssignEffect( QPtrList<KPrObject> &objs ) const;
+ bool canAssignEffect( TQPtrList<KPrObject> &objs ) const;
- void print( QPainter*, KPrinter*, float, float );
+ void print( TQPainter*, KPrinter*, float, float );
void setPartEntry( KoDocumentEntry& _e )
{ partEntry = _e; }
void setToolEditMode( ToolEditMode _m, bool updateView = true );
- void setAutoForm( const QString &_autoform )
+ void setAutoForm( const TQString &_autoform )
{ autoform = _autoform; }
/**
- \brief Draw page into QPixmap.
+ \brief Draw page into TQPixmap.
- Draws page pgnum of the currently open presentation into a QPixmap
+ Draws page pgnum of the currently open presentation into a TQPixmap
using the specified zoom factor (or fixed width/height dimensions, resp.)
Set forceWidth and/or forceHeight to override the zoom factor
@@ -184,7 +185,7 @@ public:
\sa exportPage
*/
- void drawPageInPix( QPixmap&, int pgnum, int zoom,
+ void drawPageInPix( TQPixmap&, int pgnum, int zoom,
bool forceRealVariableValue = false,
int forceWidth = 0,
int forceHeight = 0 );
@@ -194,16 +195,16 @@ public:
Export a page of the currently open presentation to disk
using a bitmap format like e.g. PNG.
- This method uses a QPixmap::save() call.
+ This method uses a TQPixmap::save() call.
\param nPage the internally used <b>0-based</b> page number
\param nWidth the desired image width in px
\param nHeight the desired image height in px
\param fileURL the URL of the image file to be created: if this
- does not point to a local file a KTempFile is created by QPixmap::save()
+ does not point to a local file a KTempFile is created by TQPixmap::save()
which is then copied over to the desired location.
- \param format the format of the image file (see QPixmap::save())
- \param quality the quality of the image (see QPixmap::save())
+ \param format the format of the image file (see TQPixmap::save())
+ \param quality the quality of the image (see TQPixmap::save())
example:
\verbatim
@@ -232,17 +233,17 @@ exportPage( 0, s, 800, 600, "/home/khz/page0.png", "PNG", 100 );
bool oneObjectTextSelected() const;
bool isOneObjectSelected() const;
/** Returns the list of selected text objects */
- QPtrList<KPrTextObject> selectedTextObjs() const;
+ TQPtrList<KPrTextObject> selectedTextObjs() const;
/**
* Returns the list of interfaces to use for changing the text format.
* This can be either the currently edited text object,
* or the list of text objects currently selected
*/
- QPtrList<KoTextFormatInterface> applicableTextInterfaces() const;
+ TQPtrList<KoTextFormatInterface> applicableTextInterfaces() const;
/**
* Returns the list of text objects, either selected or activated.
*/
- QPtrList<KPrTextObject> applicableTextObjects() const;
+ TQPtrList<KPrTextObject> applicableTextObjects() const;
void setMouseSelectedObject(bool b);
@@ -252,18 +253,18 @@ exportPage( 0, s, 800, 600, "/home/khz/page0.png", "PNG", 100 );
KPrTextView *currentTextObjectView() const { return m_currentTextObjectView; }
- QPtrList<KPrObject> objectList() const;
+ TQPtrList<KPrObject> objectList() const;
// get - set data
- const QPtrList<KPrObject> & getObjectList() const;
+ const TQPtrList<KPrObject> & getObjectList() const;
- void playSound( const QString &soundFileName );
+ void playSound( const TQString &soundFileName );
void stopSound();
///for KPrTextView
void dragStarted() { mousePressed = false; }
- void setXimPosition( int x, int y, int w, int h, QFont *f );
+ void setXimPosition( int x, int y, int w, int h, TQFont *f );
void createEditing( KPrTextObject *textObj );
@@ -309,7 +310,7 @@ exportPage( 0, s, 800, 600, "/home/khz/page0.png", "PNG", 100 );
* @param rect the size and position of the picture
*/
void insertPicture( const KoRect &rect );
- void changePicture( const KURL & url, QWidget *window );
+ void changePicture( const KURL & url, TQWidget *window );
int numberOfObjectSelected() const;
KPrObject *getSelectedObj() const;
@@ -334,7 +335,7 @@ exportPage( 0, s, 800, 600, "/home/khz/page0.png", "PNG", 100 );
*/
KoRect objectRect( bool all ) const;
- void scrollTopLeftPoint( const QPoint & pos );
+ void scrollTopLeftPoint( const TQPoint & pos );
void textContentsToHeight();
void textObjectToContents();
@@ -355,15 +356,15 @@ exportPage( 0, s, 800, 600, "/home/khz/page0.png", "PNG", 100 );
void alignObjects( AlignType at );
bool canMoveOneObject()const;
- QPtrList<KPrTextObject> listOfTextObjs() const;
+ TQPtrList<KPrTextObject> listOfTextObjs() const;
- QPixmap getPicturePixmap() const;
+ TQPixmap getPicturePixmap() const;
void closeObject(bool _close);
- void layout();
- void alignVertical( VerticalAlignmentType _type );
+ void tqlayout();
+ void alignVertical(VerticalAlignmentType _type );
void savePicture();
- void dropImage( QMimeSource * data, bool resizeImageToOriginalSize = false , int posX = 10, int posY=10 );
+ void dropImage( TQMimeSource * data, bool resizeImageToOriginalSize = false , int posX = 10, int posY=10 );
KoGuides & guideLines() { return m_gl; }
/**
@@ -372,11 +373,11 @@ exportPage( 0, s, 800, 600, "/home/khz/page0.png", "PNG", 100 );
* @param object the selected object
* @param point where the popup should be displayed
*/
- void objectPopup( KPrObject *object, const QPoint &point );
+ void objectPopup( KPrObject *object, const TQPoint &point );
public slots:
- // use repaint = false when the KPrCanvas is destroyed to avaid a possible crash
- void exitEditMode( bool repaint = true );
+ // use tqrepaint = false when the KPrCanvas is destroyed to avaid a possible crash
+ void exitEditMode( bool tqrepaint = true );
void clipCut();
void clipCopy();
@@ -406,8 +407,8 @@ public slots:
signals:
// signals to notify of changes
- void fontChanged( const QFont & );
- void colorChanged( const QColor & );
+ void fontChanged( const TQFont & );
+ void colorChanged( const TQColor & );
void alignChanged( int );
/**
* Emmitted when presentation should be restarted
@@ -425,45 +426,45 @@ signals:
void currentObjectEditChanged();
void selectionChanged( bool hasSelection );
- void sigMouseWheelEvent( QWheelEvent * );
+ void sigMouseWheelEvent( TQWheelEvent * );
protected:
struct PicCache
{
- QPicture pic;
+ TQPicture pic;
int num;
int subPresStep;
};
// functions for displaying
/**
- * This method is used for repainting the canvas.
+ * This method is used for tqrepainting the canvas.
*/
- virtual void paintEvent( QPaintEvent* );
+ virtual void paintEvent( TQPaintEvent* );
/**
* Draws the background of page to painter.
* Set edit to true if in edit mode, false in presentation mode.
*/
- void drawBackground( QPainter* painter, const QRect& rect, KPrPage * page, bool edit = false ) const;
+ void drawBackground( TQPainter* painter, const TQRect& rect, KPrPage * page, bool edit = false ) const;
/**
* Draw obj to painter.
*/
- void drawAllObjectsInPage( QPainter *painter, const QPtrList<KPrObject> & obj, int pageNum ) const;
+ void drawAllObjectsInPage( TQPainter *painter, const TQPtrList<KPrObject> & obj, int pageNum ) const;
/**
* Draw _objects shown at step to painter.
* This method is used for presentation mode, printing.
*/
- void drawObjectsPres( QPainter *painter, const QPtrList<KPrObject> &_objects, PresStep step ) const;
+ void drawObjectsPres( TQPainter *painter, const TQPtrList<KPrObject> &_objects, PresStep step ) const;
/**
* Draw _objects to painter.
* Only rect is painted.
* This method is used for edit mode.
*/
- void drawObjectsEdit( QPainter *painter, const KoRect &rect, const QPtrList<KPrObject> &_objects,
+ void drawObjectsEdit( TQPainter *painter, const KoRect &rect, const TQPtrList<KPrObject> &_objects,
SelectionMode selectionMode, int page ) const;
/**
@@ -473,24 +474,24 @@ protected:
* textView if set print editable textobject (used by drawObjectsEdit)
* This method is used by drawObjectsPres and drawObjectsEdit.
*/
- void drawObjects( QPainter *painter, const QPtrList<KPrObject> &objects, SelectionMode selectionMode,
+ void drawObjects( TQPainter *painter, const TQPtrList<KPrObject> &objects, SelectionMode selectionMode,
bool contour, KPrTextView * textView, int pageNum ) const;
/**
* Draw _objects of page to painter.
* This method is used for edit mode.
*/
- void drawEditPage( QPainter *painter, const QRect &_rect,
+ void drawEditPage( TQPainter *painter, const TQRect &_rect,
KPrPage *page, SelectionMode selectionMode ) const;
/**
* Draw _objects of page shown at step to painter.
* This method is used for presentation mode, printing.
*/
- void drawPresPage( QPainter *painter, const QRect &_rect, PresStep step ) const;
+ void drawPresPage( TQPainter *painter, const TQRect &_rect, PresStep step ) const;
/// draw grid
- void drawGrid(QPainter *painter, const QRect &rect2) const;
+ void drawGrid(TQPainter *painter, const TQRect &rect2) const;
/**
* Finish the object effects.
@@ -501,13 +502,13 @@ protected:
bool finishPageEffect( bool cancel = false );
- void drawCurrentPageInPix( QPixmap& ) const;
- virtual void mousePressEvent( QMouseEvent *e );
- virtual void mouseReleaseEvent( QMouseEvent *e );
- virtual void mouseMoveEvent( QMouseEvent *e );
- virtual void mouseDoubleClickEvent( QMouseEvent *e );
- virtual void wheelEvent( QWheelEvent *e );
- virtual void resizeEvent( QResizeEvent *e );
+ void drawCurrentPageInPix( TQPixmap& ) const;
+ virtual void mousePressEvent( TQMouseEvent *e );
+ virtual void mouseReleaseEvent( TQMouseEvent *e );
+ virtual void mouseMoveEvent( TQMouseEvent *e );
+ virtual void mouseDoubleClickEvent( TQMouseEvent *e );
+ virtual void wheelEvent( TQWheelEvent *e );
+ virtual void resizeEvent( TQResizeEvent *e );
virtual bool close( bool alsoDelete );
/**
* Returns the object at position pos
@@ -516,41 +517,41 @@ protected:
* @return the object at position pos
*/
KPrObject *getObjectAt( const KoPoint &pos, bool withoutProtected = false );
- virtual void focusInEvent( QFocusEvent* ) {}
- virtual void focusOutEvent( QFocusEvent* ) {}
- virtual void enterEvent( QEvent *e );
- virtual void leaveEvent( QEvent *e );
- virtual void dragEnterEvent( QDragEnterEvent *e );
- virtual void dragMoveEvent( QDragMoveEvent *e );
- virtual void dropEvent( QDropEvent *e );
- virtual void keyPressEvent( QKeyEvent *e );
- virtual void keyReleaseEvent( QKeyEvent *e );
- virtual void imStartEvent( QIMEvent * e );
- virtual void imComposeEvent( QIMEvent * e );
- virtual void imEndEvent( QIMEvent * e );
-
- void eraseEmptySpace( QPainter * painter, const QRegion & emptySpaceRegion, const QBrush & brush ) const;
+ virtual void focusInEvent( TQFocusEvent* ) {}
+ virtual void focusOutEvent( TQFocusEvent* ) {}
+ virtual void enterEvent( TQEvent *e );
+ virtual void leaveEvent( TQEvent *e );
+ virtual void dragEnterEvent( TQDragEnterEvent *e );
+ virtual void dragMoveEvent( TQDragMoveEvent *e );
+ virtual void dropEvent( TQDropEvent *e );
+ virtual void keyPressEvent( TQKeyEvent *e );
+ virtual void keyReleaseEvent( TQKeyEvent *e );
+ virtual void imStartEvent( TQIMEvent * e );
+ virtual void imComposeEvent( TQIMEvent * e );
+ virtual void imEndEvent( TQIMEvent * e );
+
+ void eraseEmptySpace( TQPainter * painter, const TQRegion & emptySpaceRegion, const TQBrush & brush ) const;
/// setup popupmenus
void setupMenus();
unsigned int currPgNum() const;
- QColor txtBackCol() const;
+ TQColor txtBackCol() const;
bool spInfiniteLoop() const;
bool spShowEndOfPresentationSlide() const;
bool spManualSwitch() const;
- QRect getPageRect( bool decBorders = true ) const;
+ TQRect getPageRect( bool decBorders = true ) const;
unsigned int pageNums() const;
- void _repaint( bool erase=true );
- void _repaint( const QRect &r );
- void _repaint( KPrObject *o );
+ void _tqrepaint( bool erase=true );
+ void _tqrepaint( const TQRect &r );
+ void _tqrepaint( KPrObject *o );
/**
* Draw page defined in step to painter.
* This method is used for printing a presentation.
*/
- void printPage( QPainter*, PresStep step, KPrinter *printer, int rows, int cols );
+ void printPage( TQPainter*, PresStep step, KPrinter *printer, int rows, int cols );
/**
* This method animates the objects in the presentation.
@@ -580,10 +581,10 @@ protected:
void selectPrev();
void scalePixmapToBeOrigIn( const KoSize &currentSize, const KoSize &pgSize,
- const QSize &presSize, KPrPixmapObject *obj );
+ const TQSize &presSize, KPrPixmapObject *obj );
bool getPixmapOrigAndCurrentSize( KPrPixmapObject *&obj, KoSize *origSize, KoSize *currentSize );
void setTextBackground( KPrTextObject *obj );
- virtual bool eventFilter( QObject *o, QEvent *e );
+ virtual bool eventFilter( TQObject *o, TQEvent *e );
virtual bool focusNextPrevChild( bool );
void endDrawPolyline();
@@ -591,7 +592,7 @@ protected:
/**
* @brief Draw a cubic bezier curve.
*/
- void drawCubicBezierCurve( QPainter &p, KoPointArray &points );
+ void drawCubicBezierCurve( TQPainter &p, KoPointArray &points );
//void drawCubicBezierCurve( int _dx, int _dy );
void endDrawCubicBezierCurve();
@@ -600,7 +601,7 @@ protected:
*
* @param p painter used for drawing
*/
- void redrawCubicBezierCurve( QPainter &p );
+ void redrawCubicBezierCurve( TQPainter &p );
#ifndef NDEBUG
@@ -632,7 +633,7 @@ private:
/// resize the m_resizeObject
void resizeObject( ModifyType _modType, const KoPoint & point, bool keepRatio, bool scaleAroundCenter );
/// create KPrResizeCmd
- void finishResizeObject( const QString &name, bool layout = true );
+ void finishResizeObject( const TQString &name, bool tqlayout = true );
/**
* @brief Display object above the other objects in editiong mode
@@ -656,7 +657,7 @@ private:
*
* @return List of objects
*/
- const QPtrList<KPrObject> displayObjectList() const;
+ const TQPtrList<KPrObject> displayObjectList() const;
/**
* This is used in automatic presentation mode.
@@ -667,19 +668,19 @@ private:
bool m_setPageTimer;
/// Helper function to draw a polygon
- void drawPolygon( QPainter &p, const KoRect &rect );
+ void drawPolygon( TQPainter &p, const KoRect &rect );
/// Helper function to draw a pie/arc/chord
- void drawPieObject( QPainter *p, const KoRect &rect );
+ void drawPieObject( TQPainter *p, const KoRect &rect );
- QPoint limitOfPoint(const QPoint& _point) const;
+ TQPoint limitOfPoint(const TQPoint& _point) const;
/**
* Return true if object is a header/footer which is hidden.
*/
bool objectIsAHeaderFooterHidden(KPrObject *obj) const;
- KPrTextObject* textUnderMouse( const QPoint & point );
+ KPrTextObject* textUnderMouse( const TQPoint & point );
bool checkCurrentTextEdit( KPrTextObject * textObj );
/**
@@ -689,13 +690,13 @@ private:
* If so it returns the position it has snapped to.
*
* @param pos the point which should be snapped
- * @param repaintSnapping true if the guides should be repainted.
- * @param repaintSnapping false when the guides should not be repainted.
- * You have to call repaint by yourself.
+ * @param tqrepaintSnapping true if the guides should be tqrepainted.
+ * @param tqrepaintSnapping false when the guides should not be tqrepainted.
+ * You have to call tqrepaint by yourself.
*
* @return the position of the snapped point
*/
- KoPoint snapPoint( KoPoint &pos, bool repaintSnapping = true );
+ KoPoint snapPoint( KoPoint &pos, bool tqrepaintSnapping = true );
/**
* @brief Find the next grid in distance
@@ -731,7 +732,7 @@ private:
* @param The state of the mouse and modifier buttons
*
*/
- void updateInsertRect( const KoPoint &point, Qt::ButtonState state );
+ void updateInsertRect( const KoPoint &point, TQt::ButtonState state );
/**
* @brief Popup context menu
@@ -742,8 +743,8 @@ private:
void popupContextMenu();
private slots:
- void toFontChanged( const QFont &font ) { emit fontChanged( font ); }
- void toColorChanged( const QColor &color ) { emit colorChanged( color ); }
+ void toFontChanged( const TQFont &font ) { emit fontChanged( font ); }
+ void toColorChanged( const TQColor &color ) { emit colorChanged( color ); }
void toAlignChanged( int a ) { emit alignChanged( a ); }
/**
* Switch to drawing mode. In drawing mode it is possible to draw on the
@@ -775,13 +776,13 @@ private slots:
/**
* Scroll canvas when receiving this signal
*/
- void slotAutoScroll(const QPoint &scrollDist);
+ void slotAutoScroll(const TQPoint &scrollDist);
/**
* Speak the text object under the mouse. This slot is normally
* connected to the kospeaker customSpeakWidget signal.
*/
- void speakTextUnderMouse(QWidget* w, const QPoint& p, uint flags);
+ void speakTextUnderMouse(TQWidget* w, const TQPoint& p, uint flags);
private:
/// Distance for snapping to guide line with mouse
@@ -818,10 +819,10 @@ private:
* This is used for paint events.
* Used in drawing mode.
*/
- QValueVector<QPointArray> m_drawModeLines;
+ TQValueVector<TQPointArray> m_drawModeLines;
/**
- * Index into the QPointArray for the next point of the line in draw mode.
+ * Index into the TQPointArray for the next point of the line in draw mode.
* Used in drawing mode.
*/
int m_drawModeLineIndex;
@@ -832,20 +833,20 @@ private:
float _presFakt;
int m_showOnlyPage; // 1-based (-1 = all)
/// list of all effect steps occuring on the active page
- QValueList<int> m_pageEffectSteps;
+ TQValueList<int> m_pageEffectSteps;
/// List of the slides used in the presentation
- QValueList<int> m_presentationSlides;
+ TQValueList<int> m_presentationSlides;
/// Iterator over the slides of a presentation
- QValueList<int>::Iterator m_presentationSlidesIterator;
+ TQValueList<int>::Iterator m_presentationSlidesIterator;
/// KPrEffectHandler for object effects
KPrEffectHandler *m_effectHandler;
KPrPageEffects *m_pageEffect;
/// EffectTimer
- QTimer m_effectTimer;
+ TQTimer m_effectTimer;
- QTimer m_pageEffectTimer;
+ TQTimer m_pageEffectTimer;
/// menu identifier for draw mode
int PM_DM;
@@ -881,15 +882,15 @@ private:
/// The rect of the object during insert.
KoRect m_insertRect;
KoDocumentEntry partEntry;
- QString autoform;
- QPixmap buffer;
+ TQString autoform;
+ TQPixmap buffer;
KPrTextView *m_currentTextObjectView;
KPrSoundPlayer *soundPlayer;
KoPointArray m_pointArray, m_oldCubicBezierPointArray;
- QPoint m_dragStartPoint, m_dragEndPoint, m_dragSymmetricEndPoint;
+ TQPoint m_dragStartPoint, m_dragEndPoint, m_dragSymmetricEndPoint;
/// The start position of an insert for line objects
KoPoint m_startPoint;
/// The end position of an insert for line objects