summaryrefslogtreecommitdiff
path: root/library/fileselector.h
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /library/fileselector.h
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'library/fileselector.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/fileselector.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/library/fileselector.h b/library/fileselector.h
new file mode 100644
index 0000000..ef8efea
--- a/dev/null
+++ b/library/fileselector.h
@@ -0,0 +1,108 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef FILESELECTOR_H
21#define FILESELECTOR_H
22
23#include <qhbox.h>
24#include <qvbox.h>
25#include <qlistview.h>
26#include <qtoolbutton.h>
27
28#include "filemanager.h"
29#include "applnk.h"
30
31class QPopupMenu;
32class QPushButton;
33
34class FileSelectorItem : public QListViewItem
35{
36public:
37 FileSelectorItem( QListView *parent, const DocLnk& f );
38 ~FileSelectorItem();
39
40 DocLnk file() const { return fl; }
41
42private:
43 DocLnk fl;
44};
45
46class CategoryMenu;
47class FileSelectorViewPrivate;
48class FileSelectorView : public QListView
49{
50 Q_OBJECT
51
52public:
53 FileSelectorView( const QString &mimefilter, QWidget *parent, const char *name );
54 ~FileSelectorView();
55 void reread();
56 int fileCount() { return count; }
57
58 void setCategoryFilter(CategoryMenu *);
59protected:
60 void keyPressEvent( QKeyEvent *e );
61
62protected slots:
63 void cardMessage( const QCString &, const QByteArray &);
64
65 void categoryChanged();
66
67private:
68 QString filter;
69 FileManager *fileManager;
70 int count;
71 FileSelectorViewPrivate *d;
72};
73
74class FileSelectorPrivate;
75class FileSelector : public QVBox
76{
77 Q_OBJECT
78
79public:
80 FileSelector( const QString &mimefilter, QWidget *parent, const char *name, bool newVisible = TRUE, bool closeVisible = TRUE );
81 ~FileSelector();
82 void setNewVisible( bool b );
83 void setCloseVisible( bool b );
84 void setCategoriesVisible( bool b );
85 void reread();
86 int fileCount();
87 const DocLnk *selected();
88
89signals:
90 void fileSelected( const DocLnk & );
91 void newSelected( const DocLnk & );
92 void closeMe();
93
94private slots:
95 void createNew();
96 void fileClicked( int, QListViewItem *, const QPoint &, int );
97 // pressed to get 'right down'
98 void filePressed( int, QListViewItem *, const QPoint &, int );
99 void fileClicked( QListViewItem *);
100
101private:
102 FileSelectorView *view;
103 QString filter;
104 QToolButton *buttonNew, *buttonClose;
105 FileSelectorPrivate *d;
106};
107
108#endif