1
/***************************************************************************
2
smb4knetworkbrowsertooltip - Tool tip for the network browser.
5
copyright : (C) 2007-2008 by Alexander Reinholdt
6
email : dustpuppy@users.berlios.de
7
***************************************************************************/
9
/***************************************************************************
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
15
* This program is distributed in the hope that it will be useful, but *
16
* WITHOUT ANY WARRANTY; without even the implied warranty of *
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18
* General Public License for more details. *
20
* You should have received a copy of the GNU General Public License *
21
* along with this program; if not, write to the *
22
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
24
***************************************************************************/
26
#ifndef SMB4KNETWORKBROWSERTOOLTIP_H
27
#define SMB4KNETWORKBROWSERTOOLTIP_H
36
#include <QGridLayout>
38
// Forward declarations:
39
class Smb4KNetworkBrowserItem;
43
* This class provides the tool tip for the network browser
44
* of Smb4K. It shows information about the associated share.
46
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
49
class Smb4KNetworkBrowserToolTip : public QLabel
57
* @param parent The parent widget of the tool tip.
59
Smb4KNetworkBrowserToolTip( QWidget *parent = 0 );
64
~Smb4KNetworkBrowserToolTip();
67
* If you need to update the tool tip while it is shown, this is the function
68
* you want to use. It rereads the entries from the assossiated
69
* Smb4KNetworkBrowserItem object and modifies the tool tip if changes happened.
74
* Returns the Smb4KNetworkBrowserItem object for which the tool tip
77
* @returns a pointer to a Smb4KNetworkBrowserItem object.
79
Smb4KNetworkBrowserItem *item() { return m_item; }
82
* Set up the tool tip. This function takes the network browser item @p item
83
* for which the tool tip should be shown. Before the tool tip is set up according
84
* to the data of @p item, the tool tip is cleared.
86
* @param item The network browser item for which the tool tip should
89
void setupToolTip( Smb4KNetworkBrowserItem *item );
92
* Clear the tool tip and reset the internal pointer to the network item. The
93
* tool tip will be blank after this function was called.
98
* This function returns TRUE if the tool tip is cleared, i.e. is blank, and
101
* @returns TRUE if the tool tip is cleared.
103
bool isCleared() const { return m_cleared; }
107
* This signal is emitted when the tool tip is about to be shown.
109
* @param item The network item that carries the data that
110
* is about to be shown.
112
void aboutToShow( Smb4KNetworkBrowserItem *item );
115
* This signal is emitted when the tool tip is about to be hidden.
121
* Reimplemented from QLabel.
123
void mousePressEvent( QMouseEvent *e );
126
* Reimplemented from QLabel.
128
void leaveEvent( QEvent *e );
131
* Reimplemented from QLabel.
133
void showEvent( QShowEvent *e );
136
* Reimplemented from QLabel.
138
void hideEvent( QHideEvent *e );
142
* The pointer to the Smb4KNetworkBrowserItem object
144
Smb4KNetworkBrowserItem *m_item;
147
* The layout for the tool tip
149
QGridLayout *m_layout;
154
QLabel *m_workgroup_label;
162
* Master browser label
164
QLabel *m_master_browser_label;
169
QLabel *m_master_browser;
174
QLabel *m_host_label;
184
QLabel *m_comment_label;
202
* Operating system label
214
QLabel *m_server_label;
229
QLabel *m_share_label;
239
QLabel *m_type_label;
249
QLabel *m_mounted_label;
262
* Is the tool tip cleared?