1 #ifndef KDOCKWIDGETDEMO_H
2 #define KDOCKWIDGETDEMO_H
4 #include <k3dockwidget.h>
6 #include <QtGui/QDialog>
7 #include <Qt3Support/Q3ListView>
8 #include <QtCore/QString>
9 #include <QtCore/QFile>
10 #include <QtCore/QFileInfo>
11 #include <QtCore/QTimer>
12 #include <Qt3Support/Q3ScrollView>
13 #include <Qt3Support/Q3FileDialog>
14 #include <Qt3Support/Q3WidgetStack>
15 #include <QtGui/QPixmap>
17 class Q3MultiLineEdit
;
24 class CustomFileDialog
;
28 class SFileDialog
: public QDialog
32 SFileDialog( QString initially
= QString(),
33 const QStringList
& filter
= QStringList("All Files ( * )"), const char* name
= 0 );
36 static QString
getOpenFileName( QString initially
= QString(),
37 const QStringList
& filter
= QStringList("All Files ( * )"),
38 const QString caption
= QString(), const char* name
= 0 );
40 static QStringList
getOpenFileNames( QString initially
= QString(),
41 const QStringList
& filter
= QStringList("All Files ( * )"),
42 const QString caption
= QString(), const char* name
= 0 );
46 void showEvent( QShowEvent
*e
);
50 void setDockDefaultPos( K3DockWidget
* );
51 void changeDir( const QString
& );
54 DirectoryView
* dirView
;
58 K3DockManager
* dockManager
;
59 K3DockWidget
* d_dirView
;
60 K3DockWidget
* d_preview
;
64 QToolButton
*b_preview
;
66 /******************************************************************************************************/
67 class Directory
: public Q3ListViewItem
70 Directory( Q3ListView
* parent
, const QString
& filename
);
71 Directory( Directory
* parent
, const QString
& filename
);
73 QString
text( int column
) const;
86 class DirectoryView
: public Q3ListView
89 DirectoryView( QWidget
*parent
= 0, const char *name
= 0 );
90 virtual void setOpen ( Q3ListViewItem
*, bool );
92 QString
selectedDir();
95 void setDir( const QString
& );
98 void folderSelected( const QString
& );
101 void slotFolderSelected( Q3ListViewItem
* );
104 QString
fullPath(Q3ListViewItem
* item
);
106 /******************************************************************************************************/
107 class PixmapView
: public Q3ScrollView
110 PixmapView( QWidget
*parent
);
111 void setPixmap( const QPixmap
&pix
);
112 void drawContents( QPainter
*p
, int, int, int, int );
118 class Preview
: public Q3WidgetStack
121 Preview( QWidget
*parent
);
124 void showPreview( const QString
& );
127 Q3MultiLineEdit
*normalText
;
132 class CustomFileDialog
: public Q3FileDialog
135 CustomFileDialog( QWidget
* parent
);
138 void addToolButton( QAbstractButton
* b
, bool separator
= false ){ Q3FileDialog::addToolButton(b
,separator
); }
139 void setBookmark( QStringList
& );
140 QStringList
getBookmark(){ return bookmarkList
; }
143 void setDir2( const QString
& );
146 void signalDone( int );
149 void bookmarkChosen( int i
);
151 virtual void done( int );
154 Q3PopupMenu
*bookmarkMenu
;
155 QStringList bookmarkList
;