1
/***************************************************************************
2
smb4ksearchdialogitem - This class is an enhanced version of a list
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 SMB4KSEARCHDIALOGITEM_H
28
#define SMB4KSEARCHDIALOGITEM_H
36
#include <QListWidgetItem>
39
#include <klistwidget.h>
42
#include <core/smb4khost.h>
43
#include <core/smb4kshare.h>
46
* This class is an enhanced version of QListWidgetItem, that is used
47
* by the search dialog of Smb4K to show the search results. It
48
* encapsulates a Smb4KHost which carries all the information needed.
50
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
53
class Smb4KSearchDialog;
54
class Smb4KSearchDialogItem : public QListWidgetItem
58
* This is the type of the item.
60
enum ItemType{ Host = 1001,
65
* The constructor for a search result representing a host. It will
66
* construct a list widget item and set its text according to the
67
* contents of @p host.
69
* @param listWidget The parent list widget.
71
* @param host The host item that represents the search
74
Smb4KSearchDialogItem( KListWidget *listWidget,
78
* The constructor for a search result representing a share. It will
79
* construct a list widget item and set its text according to the
80
* contents of @p share.
82
* @param listWidget The parent list widget.
84
* @param share The share item that represents the search
87
Smb4KSearchDialogItem( KListWidget *listWidget,
91
* The constructor for a "The network search returned no results."
94
* @param listWidget The parent list widget.
96
Smb4KSearchDialogItem( KListWidget *listWidget );
101
~Smb4KSearchDialogItem();
104
* This function returns the Smb4KHost object that is encapsulated
107
* @returns the encapsulated Smb4KHost object.
109
Smb4KHost *hostItem() { return &m_host; }
112
* This function returns the Smb4KShare object that is encapsulated
115
* @returns the encapsulated Smb4KShare object.
117
Smb4KShare *shareItem() { return &m_share; }
120
* This function notifies the item that the host that it represents is
121
* known to the application, i.e. it is in the list of hosts. It will set
122
* the icon and m_is_known accordingly..
124
* @param known Should be TRUE if the host is known.
126
void setKnown( bool known );
129
* This function returns TRUE, if the item is already known to the application.
131
* @returns TRUE if the item is already known.
133
bool isKnown() const { return m_is_known; }
136
* This functions notifies the item that the share that it represents
137
* is mounted, i.e. it is in the list of mounted shares. It will set the
138
* icon and m_is_mounted accordingly.
140
* @param mounted Should be TRUE if the share is mounted.
142
void setMounted( bool mounted );
145
* This function returns TRUE if the item is already mounted.
147
* @returns TRUE if the item is already mounted.
149
bool isMounted() const { return m_is_mounted; }
153
* The Smb4KHost object
158
* The Smb4KShare object
163
* TRUE if the item is known
168
* TRUE if the item is mounted
173
* This function sets up the item.