author | llornkcor <llornkcor> | 2002-11-03 17:59:00 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-03 17:59:00 (UTC) |
commit | 16e8fad81f7ee6045990f48edc84542638bf07d7 (patch) (unidiff) | |
tree | 96d836f914e0d1104d7c84830acac08a43ee4ac2 /noncore/multimedia/showimg/ImageFileSelector.h | |
parent | 2981b8f55f4a33860452f4571ef9f04781267489 (diff) | |
download | opie-16e8fad81f7ee6045990f48edc84542638bf07d7.zip opie-16e8fad81f7ee6045990f48edc84542638bf07d7.tar.gz opie-16e8fad81f7ee6045990f48edc84542638bf07d7.tar.bz2 |
added preferences dialog, and added slidshow
Diffstat (limited to 'noncore/multimedia/showimg/ImageFileSelector.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/showimg/ImageFileSelector.h | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/noncore/multimedia/showimg/ImageFileSelector.h b/noncore/multimedia/showimg/ImageFileSelector.h index 2c346c4..798ebcc 100644 --- a/noncore/multimedia/showimg/ImageFileSelector.h +++ b/noncore/multimedia/showimg/ImageFileSelector.h | |||
@@ -3,85 +3,105 @@ | |||
3 | 3 | ||
4 | 4 | ||
5 | #include <qtoolbutton.h> | 5 | #include <qtoolbutton.h> |
6 | #include <qlistview.h> | 6 | #include <qlistview.h> |
7 | #include <qwidgetstack.h> | 7 | #include <qwidgetstack.h> |
8 | #include <qlayout.h> | 8 | #include <qlayout.h> |
9 | 9 | ||
10 | #include "qpe/filemanager.h" | 10 | #include "qpe/filemanager.h" |
11 | #include "qpe/applnk.h" | 11 | #include "qpe/applnk.h" |
12 | 12 | ||
13 | class QScrollView; | 13 | class QScrollView; |
14 | class QLabel; | 14 | class QLabel; |
15 | //class QValueList; | ||
15 | 16 | ||
16 | class ThumbWidget : public QWidget | 17 | class ThumbWidget : public QWidget |
17 | { | 18 | { |
18 | Q_OBJECT | 19 | Q_OBJECT |
19 | public: | 20 | public: |
20 | ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent=0,int width=-1); | 21 | ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent=0,int width=-1); |
21 | ~ThumbWidget() | 22 | ~ThumbWidget() { } |
22 | { | ||
23 | |||
24 | } | ||
25 | 23 | ||
26 | DocLnk file() const | 24 | DocLnk file() const { |
27 | { | ||
28 | return fl; | 25 | return fl; |
29 | } | 26 | } |
30 | 27 | ||
31 | 28 | ||
32 | signals: | 29 | signals: |
33 | void clicked(const DocLnk &); | 30 | void clicked(const DocLnk &); |
34 | 31 | ||
35 | protected: | 32 | protected: |
36 | void paintEvent( QPaintEvent * ); | 33 | void paintEvent( QPaintEvent * ); |
37 | void resizeEvent(QResizeEvent *); | 34 | void resizeEvent(QResizeEvent *); |
38 | 35 | ||
39 | void mouseReleaseEvent(QMouseEvent* event); | 36 | void mouseReleaseEvent(QMouseEvent* event); |
40 | 37 | ||
41 | private: | 38 | private: |
42 | QPixmap pixmap; | 39 | QPixmap pixmap; |
43 | QLabel *description; | 40 | QLabel *description; |
44 | DocLnk fl; | 41 | DocLnk fl; |
45 | }; | 42 | }; |
46 | 43 | ||
47 | 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 | |||
48 | class ImageFileSelector : public QWidgetStack | 60 | class ImageFileSelector : public QWidgetStack |
49 | { | 61 | { |
50 | Q_OBJECT | 62 | Q_OBJECT |
51 | 63 | ||
52 | public: | 64 | public: |
53 | 65 | ||
54 | enum CURRENT_VIEW | 66 | enum CURRENT_VIEW { |
55 | { | ||
56 | THUMBNAIL, | 67 | THUMBNAIL, |
57 | DETAILED, | 68 | DETAILED, |
58 | UNKNOWN | 69 | UNKNOWN |
59 | }; | 70 | }; |
60 | 71 | ||
61 | 72 | ||
62 | ImageFileSelector(CURRENT_VIEW scv=DETAILED, QWidget *parent=0, const char *name=0 ); | 73 | ImageFileSelector(CURRENT_VIEW scv=DETAILED, QWidget *parent=0, const char *name=0 ); |
63 | ~ImageFileSelector(); | 74 | ~ImageFileSelector(); |
64 | 75 | ||
65 | void reread(bool purgeCache=false); | 76 | void reread(bool purgeCache=false); |
66 | int fileCount(); | 77 | int fileCount(); |
67 | const DocLnk *selected(); | 78 | const DocLnk *selected(); |
68 | 79 | ||
69 | void setView(CURRENT_VIEW v); | 80 | void setView(CURRENT_VIEW v); |
70 | 81 | ||
71 | CURRENT_VIEW view() | 82 | CURRENT_VIEW view() { |
72 | { | ||
73 | return cView; | 83 | return cView; |
74 | } | 84 | } |
75 | 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 | } | ||
76 | 96 | ||
77 | public slots: | 97 | public slots: |
78 | 98 | ||
79 | void switchView(); | 99 | void switchView(); |
80 | 100 | ||
81 | signals: | 101 | signals: |
82 | void fileSelected( const DocLnk & ); | 102 | void fileSelected( const DocLnk & ); |
83 | void closeMe(); | 103 | void closeMe(); |
84 | 104 | ||
85 | protected: | 105 | protected: |
86 | 106 | ||
87 | void resizeEvent(QResizeEvent *); | 107 | void resizeEvent(QResizeEvent *); |
@@ -100,36 +120,15 @@ private: | |||
100 | 120 | ||
101 | 121 | ||
102 | CURRENT_VIEW cView; | 122 | CURRENT_VIEW cView; |
103 | int count; | 123 | int count; |
104 | 124 | ||
105 | QListView *detailed; | 125 | QListView *detailed; |
106 | QScrollView *thumb; | 126 | QScrollView *thumb; |
107 | QList<ThumbWidget> tList; | 127 | QList<ThumbWidget> tList; |
108 | QWidget *background; | 128 | QWidget *background; |
109 | QGridLayout *gl; | 129 | QGridLayout *gl; |
110 | 130 | ||
111 | }; | 131 | }; |
112 | |||
113 | |||
114 | class ImageFileSelectorItem : public QListViewItem | ||
115 | { | ||
116 | public: | ||
117 | ImageFileSelectorItem( QListView *parent, const DocLnk& f ); | ||
118 | ~ImageFileSelectorItem(); | ||
119 | |||
120 | DocLnk file() const | ||
121 | { | ||
122 | return fl; | ||
123 | } | ||
124 | |||
125 | |||
126 | private: | ||
127 | DocLnk fl; | ||
128 | }; | ||
129 | |||
130 | |||
131 | |||
132 | |||
133 | #endif // IMAGEFILE_SELECTOR_H | 132 | #endif // IMAGEFILE_SELECTOR_H |
134 | 133 | ||
135 | 134 | ||