fileselector.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FILESELECTOR_H
00021 #define FILESELECTOR_H
00022
00023 #include <qhbox.h>
00024 #include <qvbox.h>
00025 #include <qtoolbutton.h>
00026 #include <qlistview.h>
00027
00028 #include "filemanager.h"
00029 #include "applnk.h"
00030
00031 class QPopupMenu;
00032 class QPushButton;
00033 class FileSelectorView;
00034
00035 class FileSelectorItem : public QListViewItem
00036 {
00037 public:
00038 FileSelectorItem( QListView *parent, const DocLnk& f );
00039 ~FileSelectorItem();
00040
00041 DocLnk file() const { return fl; }
00042
00043 private:
00044 DocLnk fl;
00045 };
00046
00047 class FileSelectorPrivate;
00048 class FileSelector : public QVBox
00049 {
00050 Q_OBJECT
00051
00052 public:
00053 FileSelector( const QString &mimefilter, QWidget *parent, const char *name=0, bool newVisible = TRUE, bool closeVisible = TRUE );
00054 ~FileSelector();
00055 void setNewVisible( bool b );
00056 void setCloseVisible( bool b );
00057 void setTypeComboVisible( bool b = TRUE );
00058 void setCategorySelectVisible( bool b = TRUE );
00059 void reread();
00060 int fileCount();
00061 DocLnk selectedDocument() const
00062 {
00063 const DocLnk* rp = ((FileSelector*)this)->selected();
00064 if (!rp) {
00065 DocLnk r;
00066 return r;
00067 }
00068 DocLnk r(*rp);
00069 delete rp;
00070 return r;
00071 }
00072
00073 QValueList<DocLnk> fileList() const
00074 {
00075 ((FileSelector*)this)->fileCount();
00076
00077 QValueList<DocLnk> list;
00078 FileSelectorItem *item = (FileSelectorItem *)((QListView*)view)->firstChild();
00079 while (item) {
00080 list.append(item->file());
00081 item = (FileSelectorItem *)item->nextSibling();
00082 }
00083
00084 return list;
00085 }
00086
00087 signals:
00088 void fileSelected( const DocLnk & );
00089 void newSelected( const DocLnk & );
00090 void closeMe();
00091
00092 private slots:
00093 void createNew();
00094 void fileClicked( int, QListViewItem *, const QPoint &, int );
00095
00096 void filePressed( int, QListViewItem *, const QPoint &, int );
00097 void fileClicked( QListViewItem *);
00098 void typeSelected( const QString &type );
00099 void catSelected( int );
00100 void cardMessage( const QCString &, const QByteArray &);
00101
00102 private:
00103 void updateView();
00104 void updateWhatsThis();
00105
00106 private:
00107
00108 const DocLnk *selected();
00109 FileSelectorView *view;
00110 QString filter;
00111 QToolButton *buttonNew, *buttonClose;
00112 FileSelectorPrivate *d;
00113 };
00114
00115 #endif
This file is part of the documentation for OPIE Version 1.5.5.