~ubuntu-branches/ubuntu/utopic/smb4k/utopic-proposed

« back to all changes in this revision

Viewing changes to smb4k/dialogs/smb4kpreviewdialog.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-19 18:54:34 UTC
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: package-import@ubuntu.com-20120519185434-kpqpdrg5i47zm7tl
Tags: upstream-1.0.1
ImportĀ upstreamĀ versionĀ 1.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
    smb4kpreviewdialog.h  -  The preview dialog of Smb4K
3
 
                             -------------------
4
 
    begin                : Fre Jul 4 2003
5
 
    copyright            : (C) 2003-2008 by Alexander Reinholdt
6
 
    email                : dustpuppy@users.berlios.de
7
 
 ***************************************************************************/
8
 
 
9
 
/***************************************************************************
10
 
 *   This program is free software; you can redistribute it and/or modify  *
11
 
 *   it under the terms of the GNU General Public License as published by  *
12
 
 *   the Free Software Foundation; either version 2 of the License, or     *
13
 
 *   (at your option) any later version.                                   *
14
 
 *                                                                         *
15
 
 *   This program is distributed in the hope that it will be useful, but   *
16
 
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
17
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
18
 
 *   General Public License for more details.                              *
19
 
 *                                                                         *
20
 
 *   You should have received a copy of the GNU General Public License     *
21
 
 *   along with this program; if not, write to the                         *
22
 
 *   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,   *
23
 
 *   MA  02111-1307 USA                                                    *
24
 
 ***************************************************************************/
25
 
 
26
 
#ifndef SMB4KPREVIEWDIALOG_H
27
 
#define SMB4KPREVIEWDIALOG_H
28
 
 
29
 
#ifdef HAVE_CONFIG_H
30
 
#include <config.h>
31
 
#endif
32
 
 
33
 
// Qt includes
34
 
#include <QStringList>
35
 
 
36
 
// KDE includes
37
 
#include <klistwidget.h>
38
 
#include <kdialog.h>
39
 
#include <ktoolbar.h>
40
 
#include <kcombobox.h>
41
 
#include <kdemacros.h>
42
 
#include <kaction.h>
43
 
 
44
 
// forward declarations
45
 
class Smb4KShare;
46
 
class Smb4KPreviewItem;
47
 
 
48
 
/**
49
 
 * This is the preview dialog of Smb4K. You can preview remote
50
 
 * shares with it.
51
 
 *
52
 
 * @author Alexander Reinholdt <dustpuppy@users.berlios.de>
53
 
 */
54
 
 
55
 
class KDE_EXPORT Smb4KPreviewDialog : public KDialog
56
 
{
57
 
  Q_OBJECT
58
 
 
59
 
  public:
60
 
    /**
61
 
     * This is the constructor of the preview dialog.
62
 
     *
63
 
     * @param share         The Smb4KShare object.
64
 
     *
65
 
     * @param parent        The parent of this widget
66
 
     */
67
 
    Smb4KPreviewDialog( Smb4KShare *share,
68
 
                        QWidget *parent = 0 );
69
 
 
70
 
    /**
71
 
     * The destructor.
72
 
     */
73
 
    ~Smb4KPreviewDialog();
74
 
 
75
 
    /**
76
 
     * This function will request the preview. You should run it before
77
 
     * you show the dialog, but it is not mandatory.
78
 
     */
79
 
    void getPreview();
80
 
 
81
 
  protected slots:
82
 
    /**
83
 
     * This slot receives the results of the attempt to generate
84
 
     * a preview.
85
 
     *
86
 
     * @param item          The Smb4KPreviewItem for which a preview
87
 
     *                      was generated.
88
 
     */
89
 
    void slotReceivedData( Smb4KPreviewItem *item );
90
 
 
91
 
    /**
92
 
     * Is called, if an item has been executed.
93
 
     *
94
 
     * @param item          The item that has been exected.
95
 
     */
96
 
    void slotItemExecuted( QListWidgetItem *item );
97
 
 
98
 
    /**
99
 
     * This slot is called when the "Reload" action has been triggered.
100
 
     *
101
 
     * @param checked       TRUE if the action is checked.
102
 
     */
103
 
    void slotReloadActionTriggered( bool checked );
104
 
 
105
 
    /**
106
 
     * This slot is called when the "Back" action has been triggered.
107
 
     *
108
 
     * @param checked       TRUE if the action is checked.
109
 
     */
110
 
    void slotBackActionTriggered( bool checked );
111
 
 
112
 
    /**
113
 
     * This slot is called when the "Forward" action has been triggered.
114
 
     *
115
 
     * @param checked       TRUE if the action is checked.
116
 
     */
117
 
    void slotForwardActionTriggered( bool checked );
118
 
 
119
 
    /**
120
 
     * This slot is called when the "Up" action has been triggered.
121
 
     *
122
 
     * @param checked       TRUE if the action is checked.
123
 
     */
124
 
    void slotUpActionTriggered( bool checked );
125
 
 
126
 
    /**
127
 
     * Is called, if an item in the combo box is activated.
128
 
     */
129
 
    void slotItemActivated( const QString &item );
130
 
 
131
 
    /**
132
 
     * This slot is called when the close button was clicked.
133
 
     */
134
 
    void slotCloseClicked();
135
 
 
136
 
  private:
137
 
    /**
138
 
     * Enumeration for the buttons.
139
 
     */
140
 
    enum ButtonID{ Reload,
141
 
                   Up,
142
 
                   Back,
143
 
                   Forward,
144
 
                   Combo,
145
 
                   None };
146
 
 
147
 
    /**
148
 
     * Enumeration for the items in the list view.
149
 
     */
150
 
    enum ItemType{ File = 1000,
151
 
                   Directory = 1001 };
152
 
 
153
 
    /**
154
 
     * The current button id
155
 
     */
156
 
    int m_button_id;
157
 
 
158
 
    /**
159
 
     * Sets up the file view.
160
 
     */
161
 
    void setupView();
162
 
 
163
 
    /**
164
 
     * The icon view.
165
 
     */
166
 
    KListWidget *m_view;
167
 
 
168
 
    /**
169
 
     * The toolbar.
170
 
     */
171
 
    KToolBar *m_toolbar;
172
 
 
173
 
    /**
174
 
     * The combo box.
175
 
     */
176
 
    KComboBox *m_combo;
177
 
 
178
 
    /**
179
 
     * The private Smb4KPreviewItem object
180
 
     */
181
 
    Smb4KPreviewItem *m_item;
182
 
 
183
 
    /**
184
 
     * This list holds the history of the session.
185
 
     */
186
 
    QStringList m_history;
187
 
 
188
 
    /**
189
 
     * The index of the current item in the history.
190
 
     */
191
 
    int  m_current_index;
192
 
 
193
 
    /**
194
 
     * Reload action
195
 
     */
196
 
    KAction *m_reload;
197
 
 
198
 
    /**
199
 
     * Back action
200
 
     */
201
 
    KAction *m_back;
202
 
 
203
 
    /**
204
 
     * Forward action
205
 
     */
206
 
    KAction *m_forward;
207
 
 
208
 
    /**
209
 
     * Up action
210
 
     */
211
 
    KAction *m_up;
212
 
};
213
 
#endif