kexi
kexiscrollview.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KEXISCROLLVIEW_H
00022 #define KEXISCROLLVIEW_H
00023
00024 #include <qscrollview.h>
00025 #include <qtimer.h>
00026
00027 class QColor;
00028 class QFont;
00029 class KexiRecordNavigator;
00030
00032
00034 class KEXIEXTWIDGETS_EXPORT KexiScrollView : public QScrollView
00035 {
00036 Q_OBJECT
00037
00038 public:
00039 KexiScrollView(QWidget *parent, bool preview);
00040 virtual ~KexiScrollView();
00041
00042 void setWidget(QWidget *w);
00043 void setSnapToGrid(bool enable, int gridSize=10);
00044
00045 void setResizingEnabled(bool enabled) { m_enableResizing = enabled; }
00046 void setRecordNavigatorVisible(bool visible);
00047
00048 void setOuterAreaIndicatorVisible(bool visible) { m_outerAreaVisible = visible; }
00049
00050 void refreshContentsSizeLater(bool horizontal, bool vertical);
00051 void updateNavPanelGeometry();
00052
00053 KexiRecordNavigator* recordNavigator() const;
00054
00055 inline bool preview() const { return m_preview; }
00056
00057 public slots:
00059 virtual void refreshContentsSize();
00060
00061 signals:
00062 void outerAreaClicked();
00063 void resizingStarted();
00064 void resizingEnded();
00065
00066 protected:
00067 virtual void contentsMousePressEvent(QMouseEvent * ev);
00068 virtual void contentsMouseReleaseEvent(QMouseEvent * ev);
00069 virtual void contentsMouseMoveEvent(QMouseEvent * ev);
00070 virtual void drawContents( QPainter * p, int clipx, int clipy, int clipw, int cliph );
00071 virtual void leaveEvent( QEvent *e );
00072 virtual void setHBarGeometry( QScrollBar & hbar, int x, int y, int w, int h );
00073 void setupPixmapBuffer(QPixmap& pixmap, const QString& text, int lines);
00074
00075 bool m_resizing;
00076 bool m_enableResizing;
00077 QWidget *m_widget;
00078
00079 int m_gridSize;
00080 QFont m_helpFont;
00081 QColor m_helpColor;
00082 QTimer m_delayedResize;
00084 QScrollView::ScrollBarMode m_vsmode, m_hsmode;
00085 bool m_snapToGrid : 1;
00086 bool m_preview : 1;
00087 bool m_smodeSet : 1;
00088 bool m_outerAreaVisible : 1;
00089 KexiRecordNavigator* m_scrollViewNavPanel;
00090 };
00091
00092 #endif
00093
|