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

« back to all changes in this revision

Viewing changes to smb4k/search/smb4knetworksearchitem.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-19 18:54:34 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20120519185434-duffny2n87214n1n
Tags: 1.0.1-1
* New upstream release.
* Update debian/compat: bump to 9.
* Update debian/control:
  - bump debhelper to 9.
  - bump kdelibs5-dev build dependency to 4:4.4.0.
  - bump Standards-Version to 3.9.3 (no changes needed).
  - Replace smbfs dependency by cifs-utils. (Closes: #638162)
* Update debian/copyright:
  - update upstream URL.
  - update upstream e-mail.
* Update debian/smb4k.lintian-overrides file.
* Update debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    smb4ksearchdialogitem  -  This class is an enhanced version of a list
 
3
    box item for Smb4K.
 
4
                             -------------------
 
5
    begin                : So Jun 3 2007
 
6
    copyright            : (C) 2007-2011 by Alexander Reinholdt
 
7
    email                : alexander.reinholdt@kdemail.net
 
8
 ***************************************************************************/
 
9
 
 
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.                                   *
 
15
 *                                                                         *
 
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.                              *
 
20
 *                                                                         *
 
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,*
 
24
 *   MA 02110-1335 USA                                                     *
 
25
 ***************************************************************************/
 
26
 
 
27
#ifndef SMB4KNETWORGSEARCHITEM_H
 
28
#define SMB4KNETWORHSEARCHITEM_H
 
29
 
 
30
 
 
31
#ifdef HAVE_CONFIG_H
 
32
#include <config.h>
 
33
#endif
 
34
 
 
35
// Qt includes
 
36
#include <QListWidgetItem>
 
37
 
 
38
// KDE includes
 
39
#include <klistwidget.h>
 
40
 
 
41
// system includes
 
42
#include <core/smb4khost.h>
 
43
#include <core/smb4kshare.h>
 
44
 
 
45
/**
 
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.
 
49
 *
 
50
 * @author Alexander Reinholdt <dustpuppy@users.berlios.de>
 
51
 */
 
52
 
 
53
class Smb4KNetworkSearch;
 
54
class Smb4KNetworkSearchItem : public QListWidgetItem
 
55
{
 
56
  public:
 
57
    /**
 
58
     * This is the type of the item.
 
59
     */
 
60
    enum ItemType{ Share = 1001,
 
61
                   Failure = 1002 };
 
62
 
 
63
    /**
 
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.
 
67
     *
 
68
     * @param listWidget        The parent list widget.
 
69
     *
 
70
     * @param share             The share item that represents the search
 
71
     *                          result.
 
72
     */
 
73
    Smb4KNetworkSearchItem( KListWidget *listWidget,
 
74
                            Smb4KShare *share );
 
75
 
 
76
    /**
 
77
     * The constructor for a "The network search returned no results."
 
78
     * list widget item.
 
79
     *
 
80
     * @param listWidget        The parent list widget.
 
81
     */
 
82
    Smb4KNetworkSearchItem( KListWidget *listWidget );
 
83
 
 
84
    /**
 
85
     * The destructor
 
86
     */
 
87
    ~Smb4KNetworkSearchItem();
 
88
 
 
89
    /**
 
90
     * This function returns the Smb4KShare object that is encapsulated
 
91
     * here.
 
92
     *
 
93
     * @returns the encapsulated Smb4KShare object.
 
94
     */
 
95
    Smb4KShare *shareItem() { return &m_share; }
 
96
 
 
97
    /**
 
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.
 
101
     *
 
102
     * @param mounted           Should be TRUE if the share is mounted.
 
103
     */
 
104
    void setMounted( bool mounted );
 
105
 
 
106
    /**
 
107
     * This function returns TRUE if the item is already mounted.
 
108
     *
 
109
     * @returns TRUE if the item is already mounted.
 
110
     */
 
111
    bool isMounted() const { return m_share.isMounted(); }
 
112
 
 
113
  private:
 
114
    /**
 
115
     * The Smb4KShare object
 
116
     */
 
117
    Smb4KShare m_share;
 
118
 
 
119
    /**
 
120
     * This function sets up the item.
 
121
     */
 
122
    void setupItem();
 
123
};
 
124
 
 
125
 
 
126
#endif