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 | |||
@@ -13,17 +13,14 @@ | |||
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 | } |
@@ -46,12 +43,26 @@ private: | |||
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, |
@@ -69,9 +80,18 @@ class ImageFileSelector : public QWidgetStack | |||
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: |
@@ -110,25 +130,4 @@ private: | |||
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 | ||