1
/***************************************************************************
2
smb4ksearchdialogitem - This class is an enhanced version of a list
6
copyright : (C) 2007-2011 by Alexander Reinholdt
7
email : alexander.reinholdt@kdemail.net
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., 51 Franklin Street, Suite 500, Boston,*
25
***************************************************************************/
27
#ifndef SMB4KNETWORGSEARCHITEM_H
28
#define SMB4KNETWORHSEARCHITEM_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 Smb4KNetworkSearch;
54
class Smb4KNetworkSearchItem : public QListWidgetItem
58
* This is the type of the item.
60
enum ItemType{ Share = 1001,
64
* The constructor for a search result representing a share. It will
65
* construct a list widget item and set its text according to the
66
* contents of @p share.
68
* @param listWidget The parent list widget.
70
* @param share The share item that represents the search
73
Smb4KNetworkSearchItem( KListWidget *listWidget,
77
* The constructor for a "The network search returned no results."
80
* @param listWidget The parent list widget.
82
Smb4KNetworkSearchItem( KListWidget *listWidget );
87
~Smb4KNetworkSearchItem();
90
* This function returns the Smb4KShare object that is encapsulated
93
* @returns the encapsulated Smb4KShare object.
95
Smb4KShare *shareItem() { return &m_share; }
98
* This functions notifies the item that the share that it represents
99
* is mounted, i.e. it is in the list of mounted shares. It will set the
100
* icon and m_is_mounted accordingly.
102
* @param mounted Should be TRUE if the share is mounted.
104
void setMounted( bool mounted );
107
* This function returns TRUE if the item is already mounted.
109
* @returns TRUE if the item is already mounted.
111
bool isMounted() const { return m_share.isMounted(); }
115
* The Smb4KShare object
120
* This function sets up the item.