00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef FLIPSCROLLVIEW_H
00040 #define FLIPSCROLLVIEW_H
00041
00042 #include <tqscrollview.h>
00043 #include <tqlistview.h>
00044 #include <tqframe.h>
00045 #include <tqtimer.h>
00046 #include <tqpainter.h>
00047 #include <kstandarddirs.h>
00048 #include "service_mnu.h"
00049
00050 class ItemView;
00051
00052 class BackFrame : public TQFrame
00053 {
00054 Q_OBJECT
00055
00056 public:
00057 BackFrame( TQWidget *parent );
00058 virtual void drawContents( TQPainter *p );
00059
00060 void enterEvent ( TQEvent * );
00061 void leaveEvent( TQEvent * );
00062 void mousePressEvent ( TQMouseEvent * e );
00063
00064 signals:
00065 void clicked();
00066
00067 private:
00068 TQPixmap left_triangle;
00069 bool mouse_inside;
00070 };
00071
00072 class FlipScrollView : public TQScrollView
00073 {
00074 Q_OBJECT
00075 public:
00076 enum State{ StoppedLeft, StoppedRight, ScrollingLeft, ScrollingRight };
00077 FlipScrollView( TQWidget * parent = 0, const char * name = 0 );
00078 ~FlipScrollView();
00079
00080 ItemView *currentView() const;
00081 ItemView *leftView() const;
00082 ItemView *rightView() const;
00083 ItemView *prepareLeftMove(bool clear=true);
00084 ItemView *prepareRightMove();
00085
00086 void flipScroll(const TQString& selectMenuPath = TQString::null);
00087 void showBackButton(bool enable);
00088 bool showsBackButton() const {return mShowBack;}
00089
00090 protected slots:
00091 void slotScrollTimer();
00092
00093 signals:
00094 void startService(KService::Ptr kservice);
00095 void startURL(const TQString& u);
00096 void rightButtonPressed(TQListViewItem*,const TQPoint&,int);
00097 void backButtonClicked();
00098
00099 protected:
00100 void viewportResizeEvent ( TQResizeEvent * );
00101
00102 private:
00103 ItemView * mLeftView;
00104 ItemView * mRightView;
00105
00106 int mStepsRemaining;
00107 State mState;
00108 TQTimer * mTimer;
00109 BackFrame *mBackrow;
00110 TQString mSelectMenuPath;
00111 int mScrollDirection;
00112 bool mShowBack;
00113 };
00114
00115
00116
00117
00118 #endif