Diffstat (limited to 'noncore/multimedia/showimg/ImageFileSelector.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/showimg/ImageFileSelector.h | 134 |
1 files changed, 0 insertions, 134 deletions
diff --git a/noncore/multimedia/showimg/ImageFileSelector.h b/noncore/multimedia/showimg/ImageFileSelector.h deleted file mode 100644 index 798ebcc..0000000 --- a/noncore/multimedia/showimg/ImageFileSelector.h +++ b/dev/null | |||
@@ -1,134 +0,0 @@ | |||
1 | #ifndef IMAGEFILE_SELECTOR_H | ||
2 | #define IMAGEFILE_SELECTOR_H | ||
3 | |||
4 | |||
5 | #include <qtoolbutton.h> | ||
6 | #include <qlistview.h> | ||
7 | #include <qwidgetstack.h> | ||
8 | #include <qlayout.h> | ||
9 | |||
10 | #include "qpe/filemanager.h" | ||
11 | #include "qpe/applnk.h" | ||
12 | |||
13 | class QScrollView; | ||
14 | class QLabel; | ||
15 | //class QValueList; | ||
16 | |||
17 | class ThumbWidget : public QWidget | ||
18 | { | ||
19 | Q_OBJECT | ||
20 | public: | ||
21 | ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent=0,int width=-1); | ||
22 | ~ThumbWidget() { } | ||
23 | |||
24 | DocLnk file() const { | ||
25 | return fl; | ||
26 | } | ||
27 | |||
28 | |||
29 | signals: | ||
30 | void clicked(const DocLnk &); | ||
31 | |||
32 | protected: | ||
33 | void paintEvent( QPaintEvent * ); | ||
34 | void resizeEvent(QResizeEvent *); | ||
35 | |||
36 | void mouseReleaseEvent(QMouseEvent* event); | ||
37 | |||
38 | private: | ||
39 | QPixmap pixmap; | ||
40 | QLabel *description; | ||
41 | DocLnk fl; | ||
42 | }; | ||
43 | |||
44 | |||
45 | |||
46 | |||
47 | class ImageFileSelectorItem : public QListViewItem | ||
48 | { | ||
49 | public: | ||
50 | ImageFileSelectorItem( QListView *parent, const DocLnk& f ); | ||
51 | ~ImageFileSelectorItem(); | ||
52 | |||
53 | DocLnk file() const { | ||
54 | return fl; | ||
55 | } | ||
56 | private: | ||
57 | DocLnk fl; | ||
58 | }; | ||
59 | |||
60 | class ImageFileSelector : public QWidgetStack | ||
61 | { | ||
62 | Q_OBJECT | ||
63 | |||
64 | public: | ||
65 | |||
66 | enum CURRENT_VIEW { | ||
67 | THUMBNAIL, | ||
68 | DETAILED, | ||
69 | UNKNOWN | ||
70 | }; | ||
71 | |||
72 | |||
73 | ImageFileSelector(CURRENT_VIEW scv=DETAILED, QWidget *parent=0, const char *name=0 ); | ||
74 | ~ImageFileSelector(); | ||
75 | |||
76 | void reread(bool purgeCache=false); | ||
77 | int fileCount(); | ||
78 | const DocLnk *selected(); | ||
79 | |||
80 | void setView(CURRENT_VIEW v); | ||
81 | |||
82 | CURRENT_VIEW view() { | ||
83 | return cView; | ||
84 | } | ||
85 | |||
86 | QValueList<DocLnk> fileList() const { | ||
87 | ((ImageFileSelector*)this)->fileCount(); // ensure all loaded when this is extended | ||
88 | QValueList<DocLnk> list; | ||
89 | ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->firstChild(); | ||
90 | while (item) { | ||
91 | list.append(item->file()); | ||
92 | item = (ImageFileSelectorItem *)item->nextSibling(); | ||
93 | } | ||
94 | return list; | ||
95 | } | ||
96 | |||
97 | public slots: | ||
98 | |||
99 | void switchView(); | ||
100 | |||
101 | signals: | ||
102 | void fileSelected( const DocLnk & ); | ||
103 | void closeMe(); | ||
104 | |||
105 | protected: | ||
106 | |||
107 | void resizeEvent(QResizeEvent *); | ||
108 | |||
109 | |||
110 | private slots: | ||
111 | void fileClicked( int, QListViewItem *, const QPoint &, int ); | ||
112 | // pressed to get 'right down' | ||
113 | void filePressed( int, QListViewItem *, const QPoint &, int ); | ||
114 | void fileClicked( QListViewItem *); | ||
115 | void thumbClicked(const DocLnk &); | ||
116 | |||
117 | private: | ||
118 | |||
119 | void updateSizes(); | ||
120 | |||
121 | |||
122 | CURRENT_VIEW cView; | ||
123 | int count; | ||
124 | |||
125 | QListView *detailed; | ||
126 | QScrollView *thumb; | ||
127 | QList<ThumbWidget> tList; | ||
128 | QWidget *background; | ||
129 | QGridLayout *gl; | ||
130 | |||
131 | }; | ||
132 | #endif // IMAGEFILE_SELECTOR_H | ||
133 | |||
134 | |||