You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
165 lines
3.7 KiB
165 lines
3.7 KiB
15 years ago
|
#ifndef KDOCKWIDGETDEMO_H
|
||
|
#define KDOCKWIDGETDEMO_H
|
||
|
|
||
|
#include <kdockwidget.h>
|
||
|
|
||
15 years ago
|
#include <tqdialog.h>
|
||
|
#include <tqlistview.h>
|
||
|
#include <tqstring.h>
|
||
|
#include <tqfile.h>
|
||
|
#include <tqfileinfo.h>
|
||
|
#include <tqtimer.h>
|
||
|
#include <tqscrollview.h>
|
||
|
#include <tqfiledialog.h>
|
||
|
#include <tqwidgetstack.h>
|
||
|
#include <tqvbox.h>
|
||
|
#include <tqurl.h>
|
||
|
#include <tqpixmap.h>
|
||
15 years ago
|
|
||
14 years ago
|
class TQMultiLineEdit;
|
||
|
class TQTextView;
|
||
|
class TQToolButton;
|
||
|
class TQSpinBox;
|
||
|
class TQShowEvent;
|
||
|
class TQPopupMenu;
|
||
15 years ago
|
|
||
|
class DirectoryView;
|
||
|
class CustomFileDialog;
|
||
|
class Preview;
|
||
|
class DirectoryView;
|
||
|
|
||
14 years ago
|
class SFileDialog : public TQDialog
|
||
15 years ago
|
{Q_OBJECT
|
||
|
|
||
|
public:
|
||
15 years ago
|
SFileDialog( TQString initially = TQString::null,
|
||
|
const TQStringList& filter = "All Files ( * )", const char* name = 0 );
|
||
15 years ago
|
~SFileDialog();
|
||
|
|
||
15 years ago
|
static TQString getOpenFileName( TQString initially = TQString::null,
|
||
|
const TQStringList& filter = "All Files ( * )",
|
||
|
const TQString caption = TQString::null, const char* name = 0 );
|
||
15 years ago
|
|
||
15 years ago
|
static TQStringList getOpenFileNames( TQString initially = TQString::null,
|
||
|
const TQStringList& filter = "All Files ( * )",
|
||
|
const TQString caption = TQString::null, const char* name = 0 );
|
||
15 years ago
|
|
||
|
|
||
|
protected:
|
||
15 years ago
|
void showEvent( TQShowEvent *e );
|
||
15 years ago
|
|
||
|
protected slots:
|
||
|
void dockChange();
|
||
|
void setDockDefaultPos( KDockWidget* );
|
||
15 years ago
|
void changeDir( const TQString& );
|
||
15 years ago
|
|
||
|
private:
|
||
|
DirectoryView* dirView;
|
||
|
CustomFileDialog* fd;
|
||
|
Preview* preview;
|
||
|
|
||
|
KDockManager* dockManager;
|
||
|
KDockWidget* d_dirView;
|
||
|
KDockWidget* d_preview;
|
||
|
KDockWidget* d_fd;
|
||
|
|
||
15 years ago
|
TQToolButton *b_tree;
|
||
|
TQToolButton *b_preview;
|
||
15 years ago
|
};
|
||
|
/******************************************************************************************************/
|
||
14 years ago
|
class Directory : public TQListViewItem
|
||
15 years ago
|
{
|
||
|
public:
|
||
15 years ago
|
Directory( TQListView * parent, const TQString& filename );
|
||
|
Directory( Directory * parent, const TQString& filename );
|
||
15 years ago
|
|
||
15 years ago
|
TQString text( int column ) const;
|
||
15 years ago
|
|
||
15 years ago
|
TQString fullName();
|
||
15 years ago
|
|
||
|
void setOpen( bool );
|
||
|
void setup();
|
||
|
|
||
|
private:
|
||
15 years ago
|
TQFile f;
|
||
15 years ago
|
Directory * p;
|
||
|
bool readable;
|
||
|
};
|
||
|
|
||
14 years ago
|
class DirectoryView : public TQListView
|
||
15 years ago
|
{Q_OBJECT
|
||
|
public:
|
||
15 years ago
|
DirectoryView( TQWidget *parent = 0, const char *name = 0 );
|
||
|
virtual void setOpen ( TQListViewItem *, bool );
|
||
15 years ago
|
|
||
15 years ago
|
TQString selectedDir();
|
||
15 years ago
|
|
||
|
public slots:
|
||
15 years ago
|
void setDir( const TQString & );
|
||
15 years ago
|
|
||
|
signals:
|
||
15 years ago
|
void folderSelected( const TQString & );
|
||
15 years ago
|
|
||
|
protected slots:
|
||
15 years ago
|
void slotFolderSelected( TQListViewItem * );
|
||
15 years ago
|
|
||
|
private:
|
||
15 years ago
|
TQString fullPath(TQListViewItem* item);
|
||
15 years ago
|
};
|
||
|
/******************************************************************************************************/
|
||
14 years ago
|
class PixmapView : public TQScrollView
|
||
15 years ago
|
{Q_OBJECT
|
||
|
public:
|
||
15 years ago
|
PixmapView( TQWidget *parent );
|
||
|
void setPixmap( const TQPixmap &pix );
|
||
|
void drawContents( TQPainter *p, int, int, int, int );
|
||
15 years ago
|
|
||
|
private:
|
||
15 years ago
|
TQPixmap pixmap;
|
||
15 years ago
|
};
|
||
|
|
||
14 years ago
|
class Preview : public TQWidgetStack
|
||
15 years ago
|
{Q_OBJECT
|
||
|
public:
|
||
15 years ago
|
Preview( TQWidget *parent );
|
||
15 years ago
|
|
||
|
public slots:
|
||
15 years ago
|
void showPreview( const TQString& );
|
||
15 years ago
|
|
||
|
private:
|
||
15 years ago
|
TQMultiLineEdit *normalText;
|
||
|
TQTextView *html;
|
||
15 years ago
|
PixmapView *pixmap;
|
||
|
};
|
||
|
|
||
14 years ago
|
class CustomFileDialog : public TQFileDialog
|
||
15 years ago
|
{Q_OBJECT
|
||
|
public:
|
||
15 years ago
|
CustomFileDialog( TQWidget* parent );
|
||
15 years ago
|
~CustomFileDialog();
|
||
|
|
||
15 years ago
|
void addToolButton( TQButton * b, bool separator = false ){ TQFileDialog::addToolButton(b,separator); }
|
||
|
void setBookmark( TQStringList& );
|
||
|
TQStringList getBookmark(){ return bookmarkList; }
|
||
15 years ago
|
|
||
|
public slots:
|
||
15 years ago
|
void setDir2( const TQString & );
|
||
15 years ago
|
|
||
|
signals:
|
||
|
void signalDone( int );
|
||
|
|
||
|
protected slots:
|
||
|
void bookmarkChosen( int i );
|
||
|
void goHome();
|
||
|
virtual void done( int );
|
||
|
|
||
|
private:
|
||
15 years ago
|
TQPopupMenu *bookmarkMenu;
|
||
|
TQStringList bookmarkList;
|
||
15 years ago
|
int addId, clearId;
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|
||
|
|