~ubuntu-branches/ubuntu/quantal/smb4k/quantal

« back to all changes in this revision

Viewing changes to core/smb4kbasicnetworkitem.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
    smb4kbasicnetworkitem  -  This class provides the basic network item
 
3
    for the core library of Smb4K.
 
4
                             -------------------
 
5
    begin                : Do Apr 2 2009
 
6
    copyright            : (C) 2009-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, 51 Franklin Street, Suite 500, Boston,      *
 
24
 *   MA 02110-1335, USA                                                    *
 
25
 ***************************************************************************/
 
26
 
 
27
#ifndef SMB4KBASICNETWORKITEM_H
 
28
#define SMB4KBASICNETWORKITEM_H
 
29
 
 
30
#ifdef HAVE_CONFIG_H
 
31
#include <config.h>
 
32
#endif
 
33
 
 
34
// Qt includes
 
35
#include <QString>
 
36
#include <QIcon>
 
37
 
 
38
// KDE includes
 
39
#include <kdemacros.h>
 
40
 
 
41
class KDE_EXPORT Smb4KBasicNetworkItem
 
42
{
 
43
  public:
 
44
    /**
 
45
     * Enumeration to determine the type of the network
 
46
     * item.
 
47
     *
 
48
     * @enum Workgroup      The network item is a workgroup or domain.
 
49
     * @enum Host           The network item is a host.
 
50
     * @enum Share          The network item is a share.
 
51
     * @enum Unknown        The network item type is unknown.
 
52
     */
 
53
    enum Type { 
 
54
      Workgroup,
 
55
      Host,
 
56
      Share,
 
57
      Unknown };
 
58
 
 
59
    /**
 
60
     * The constructor
 
61
     */
 
62
    Smb4KBasicNetworkItem( Smb4KBasicNetworkItem::Type type = Unknown );
 
63
 
 
64
    /**
 
65
     * The copy constructor
 
66
     */
 
67
    Smb4KBasicNetworkItem( const Smb4KBasicNetworkItem &item );
 
68
    
 
69
    /**
 
70
     * The destructor
 
71
     */
 
72
    ~Smb4KBasicNetworkItem();
 
73
 
 
74
    /**
 
75
     * This function returns the type of the basic network
 
76
     * item.
 
77
     *
 
78
     * @returns the type.
 
79
     */
 
80
    Type type() const { return m_type; }
 
81
 
 
82
    /**
 
83
     * With this function you can set a key, that can be used to identify
 
84
     * a certain network item.
 
85
     *
 
86
     * @param key           The key
 
87
     */
 
88
    void setKey( const QString &key );
 
89
 
 
90
    /**
 
91
     * This function returns the key for this network item. By default,
 
92
     * this is a random number that was generated by the constructor.
 
93
     *
 
94
     * @returns the identifying string for this item.
 
95
     */
 
96
    const QString &key() const { return m_key; }
 
97
    
 
98
    /**
 
99
     * This function sets the icon of the network item.
 
100
     * 
 
101
     * @param icon          The icon
 
102
     */
 
103
    void setIcon( const QIcon &icon );
 
104
    
 
105
    /**
 
106
     * This function returns the icon of the network item. By default, it
 
107
     * is the null icon. You must set the appropriate icon either in
 
108
     * a class that inherits this one or from somewhere else.
 
109
     * 
 
110
     * @returns the network item's icon.
 
111
     */
 
112
    const QIcon &icon() const { return m_icon; }
 
113
    
 
114
  private:
 
115
    /**
 
116
     * The type
 
117
     */
 
118
    Type m_type;
 
119
 
 
120
    /**
 
121
     * The key
 
122
     */
 
123
    QString m_key;
 
124
    
 
125
    /**
 
126
     * The icon
 
127
     */
 
128
    QIcon m_icon;
 
129
};
 
130
 
 
131
#endif