summaryrefslogtreecommitdiffstats
path: root/examples/tqdir/tqdir.h
blob: cbe4f68b57d3e0bec0590467109db5967f4da59d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/****************************************************************************
**
** Copyright (C) 1992-2008 Trolltech ASA.  All rights reserved.
**
** This file is part of an example program for TQt.  This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/

#ifndef TQDIREXAMPLE_H
#define TQDIREXAMPLE_H

#include <ntqscrollview.h>
#include <tqfiledialog.h>
#include <tqwidgetstack.h>
#include <ntqvbox.h>
#include <tqurl.h>
#include <ntqpixmap.h>
#include <tqstringlist.h>

class TQMultiLineEdit;
class TQTextView;
class DirectoryView;
class TQSpinBox;
class TQShowEvent;
class TQPopupMenu;

class PixmapView : public TQScrollView
{
    TQ_OBJECT

public:
    PixmapView( TQWidget *parent );
    void setPixmap( const TQPixmap &pix );
    void drawContents( TQPainter *p, int, int, int, int );

private:
    TQPixmap pixmap;

};

class Preview : public TQWidgetStack
{
    TQ_OBJECT

public:
    Preview( TQWidget *parent );
    void showPreview( const TQUrl &u, int size );

private:
    TQMultiLineEdit *normalText;
    TQTextView *html;
    PixmapView *pixmap;

};

class PreviewWidget : public TQVBox,
		      public TQFilePreview
{
    TQ_OBJECT

public:
    PreviewWidget( TQWidget *parent );
    void previewUrl( const TQUrl &u );

private:
    TQSpinBox *sizeSpinBox;
    Preview *preview;

};

class CustomFileDialog : public TQFileDialog
{
    TQ_OBJECT

public:
    CustomFileDialog();
    ~CustomFileDialog();

protected:
    void showEvent( TQShowEvent *e );

public slots:
    void setDir2( const TQString & );

private slots:
    void bookmarkChosen( int i );
    void goHome();

private:
    DirectoryView *dirView;
    TQPopupMenu *bookmarkMenu;
    TQStringList bookmarkList;
    int addId;

};

#endif