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

« back to all changes in this revision

Viewing changes to smb4k/sharesview/smb4ksharesviewitemdata.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-19 18:54:34 UTC
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: package-import@ubuntu.com-20120519185434-kpqpdrg5i47zm7tl
Tags: upstream-1.0.1
ImportĀ upstreamĀ versionĀ 1.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
    smb4ksharesviewitemdata  -  This class is a container for the widget
3
 
    independed data needed by the various parts of the shares view.
4
 
                             -------------------
5
 
    begin                : Di Jun 3 2008
6
 
    copyright            : (C) 2008 by Alexander Reinholdt
7
 
    email                : dustpuppy@users.berlios.de
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., 59 Temple Place, Suite 330, Boston,   *
24
 
 *   MA  02111-1307 USA                                                    *
25
 
 ***************************************************************************/
26
 
 
27
 
#ifndef SMB4KSHARESVIEWITEMDATA_H
28
 
#define SMB4KSHARESVIEWITEMDATA_H
29
 
 
30
 
// Qt includes
31
 
#include <QPixmap>
32
 
#include <QIcon>
33
 
 
34
 
// KDE includes
35
 
#include <kicon.h>
36
 
 
37
 
// application specific includes
38
 
#include <core/smb4kshare.h>
39
 
 
40
 
/**
41
 
 * This class is a container for the widget independed data needed by the
42
 
 * shares view KPart and the tool tip.
43
 
 *
44
 
 * @author Alexander Reinholdt <dustpuppy@users.berlios.de>
45
 
 */
46
 
 
47
 
class Smb4KSharesViewItemData
48
 
{
49
 
  public:
50
 
    /**
51
 
     * The constructor.
52
 
     */
53
 
    Smb4KSharesViewItemData();
54
 
 
55
 
    /**
56
 
     * The destructor.
57
 
     */
58
 
    ~Smb4KSharesViewItemData();
59
 
 
60
 
    /**
61
 
     * Set the share object.
62
 
     *
63
 
     * @param share         The Smb4KShare object
64
 
     */
65
 
    void setShare( Smb4KShare *share );
66
 
 
67
 
    /**
68
 
     * Return the share object.
69
 
     *
70
 
     * @returns the Smb4KShare object.
71
 
     */
72
 
    Smb4KShare *share() { return &m_share; }
73
 
 
74
 
    /**
75
 
     * Set if the mount point should be shown.
76
 
     *
77
 
     * @param show          Set this value to TRUE if the mount point
78
 
     *                      should be shown.
79
 
     */
80
 
    void setShowMountPoint( bool show );
81
 
 
82
 
    /**
83
 
     * Returns TRUE if the mount point should be shown and FALSE otherwise.
84
 
     *
85
 
     * @returns TRUE if the mount point should be shown.
86
 
     */
87
 
    bool showMountPoint() const { return m_show_mountpoint; }
88
 
 
89
 
    /**
90
 
     * Set the item's icon. It is used to return the various pixmaps this
91
 
     * class offers.
92
 
     *
93
 
     * @param icon          The item's icon.
94
 
     *
95
 
     * @param mode          The mode the icon should be in.
96
 
     *
97
 
     * @param
98
 
     */
99
 
    void setIcon( const QIcon &icon,
100
 
                  QIcon::Mode mode = QIcon::Normal,
101
 
                  QIcon::State state = QIcon::Off );
102
 
 
103
 
    /**
104
 
     * Returns the item's pixmap according to @param size.
105
 
     *
106
 
     * @returns the icon's pixmap.
107
 
     */
108
 
    QPixmap pixmap( int size ) const;
109
 
 
110
 
    /**
111
 
     * Returns the item's pixmap according to @param size.
112
 
     *
113
 
     * @returns the icon's pixmap.
114
 
     */
115
 
    QPixmap pixmap( const QSize &size ) const;
116
 
 
117
 
 
118
 
  private:
119
 
    /**
120
 
     * The share
121
 
     */
122
 
    Smb4KShare m_share;
123
 
 
124
 
    /**
125
 
     * Do we show the mount point?
126
 
     */
127
 
    bool m_show_mountpoint;
128
 
 
129
 
    /**
130
 
     * The items icon
131
 
     */
132
 
    QIcon m_icon;
133
 
 
134
 
    /**
135
 
     * The icon mode
136
 
     */
137
 
    QIcon::Mode m_mode;
138
 
 
139
 
    /**
140
 
     * The icon state
141
 
     */
142
 
    QIcon::State m_state;
143
 
 
144
 
    /**
145
 
     * Desktop pixmap
146
 
     */
147
 
    QPixmap m_desktop_icon;
148
 
};
149
 
 
150
 
#endif