1
/***************************************************************************
2
smb4ksearchdialog_part - This Part encapsulates the search dialog
6
copyright : (C) 2007-2008 by Alexander Reinholdt
7
email : dustpuppy@users.berlios.de
8
***************************************************************************/
10
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
* This program is distributed in the hope that it will be useful, but *
17
* WITHOUT ANY WARRANTY; without even the implied warranty of *
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19
* General Public License for more details. *
21
* You should have received a copy of the GNU General Public License *
22
* along with this program; if not, write to the *
23
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
25
***************************************************************************/
27
#ifndef SMB4KSEARCHDIALOGPART_H
28
#define SMB4KSEARCHDIALOGPART_H
35
#include <kparts/part.h>
36
#include <kparts/genericfactory.h>
37
#include <klistwidget.h>
38
#include <kactionmenu.h>
40
// forward declarations
41
class Smb4KSearchDialog;
47
* This is one of the parts of Smb4K. It contains the search dialog.
49
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
52
class Smb4KSearchDialogPart : public KParts::Part
60
* @param parentWidget The parent widget
62
* @param parent The parent object
64
* @param name The name this object should have
66
Smb4KSearchDialogPart( QWidget *parentWidget = 0,
68
const QStringList &args = QStringList() );
73
virtual ~Smb4KSearchDialogPart();
76
* This function creates the KAboutData on request and returns it.
78
* @returns the KAboutData object.
80
static KAboutData *createAboutData();
84
* Reimplemented from KParts::Part.
86
void customEvent( QEvent *e );
90
* This slot retrieves the search result and puts it into the search
93
* @param item A Smb4KHost object
95
* @param known TRUE if the server is known and FALSE
98
void slotReceivedSearchResult( Smb4KHost *item,
102
* This slot retrieves the search result and puts it into the search
105
* @param item A Smb4KShare object
107
* @param mounted TRUE if the share is mounted and FALSE
110
void slotReceivedSearchResult( Smb4KShare *item,
114
* This slot is connected to the Smb4KSearch::state() signal. It enables/
115
* disables the abort function.
117
* @param state The state of the scanner
119
void slotSearchState( int state );
122
* This slot is connected to the Smb4KSearch::finished() signal. It inserts
123
* the "The search returned no results" item, if necessary.
125
void slotSearchFinished();
128
* This slot is connected to the Smb4KScanner::hostListChanged() signal
129
* and checks whether a host is already known, i.e. it is in the browser,
130
* or if it is "new". If it is already known, this slot will change the icon
131
* of the host item from the default one to one with a tick layed over.
133
void slotCheckItemIsKnown();
136
* This slot is connected to the Smb4KMounter::updated() signal and checks
137
* whether a share is already mounted or not. If it is mounted this slot
138
* will change the icon of the shares item from the default one to the
139
* one that indecates that the item is mounted.
141
void slotCheckItemIsMounted();
144
* This slot is invoked, when a user double clicks an item. It adds the item
145
* to the list of known hosts (if necessary).
147
* @param item The item that has been double clicked.
149
void slotItemDoubleClicked( QListWidgetItem *item );
152
* This slot is invoked when the user pressed the return keyboard key. It
153
* forwards the search request to the slotSearchTriggered() slot.
155
void slotReturnPressed();
158
* This slot is invoked when the Search action is triggered. It disables some
159
* widgets and starts the search.
161
* @param checked TRUE if the action is checked.
163
void slotSearchActionTriggered( bool checked );
166
* This slot is invoked whent the Clear action is triggered. It clears the
167
* combo box and the list widget and diables the actions.
169
* @param checked TRUE if the action is checked.
171
void slotClearActionTriggered( bool checked );
174
* This slot is invoked when the Add action is triggered. It checks whether
175
* the selected search item is valid and adds it to the global list of hosts
178
* @param checked TRUE if the action is checked.
180
void slotAddActionTriggered( bool checked );
183
* This slot is invoked when the Abort action is triggered. It enables and
184
* disables some actions.
186
* @param checked TRUE if the action is checked.
188
void slotAbortActionTriggered( bool checked );
191
* This slot is invoked when the text in the combo box changed. It enables
192
* or disables some actions.
194
* @param text The text in the line edit of the combo box.
196
void slotComboBoxTextChanged( const QString &text );
199
* This slot is invoked when the item selection changed. It enables and
200
* disables some actions.
202
void slotItemSelectionChanged();
205
* This slot is invoked, when the context menu of the search dialog is
208
* @param pos The postition where the context menu should
211
void slotContextMenuRequested( const QPoint &pos );
220
* This is the actual search dialog widget.
222
Smb4KSearchDialog *m_widget;
225
* The context action menu
230
* The menu title action
232
QAction *m_menu_title;