File indexing completed on 2023-10-01 08:44:29
0001 /*************************************************************************** 0002 The item for Smb4K's shares view. 0003 ------------------- 0004 begin : Di Dez 5 2006 0005 copyright : (C) 2006-2019 by Alexander Reinholdt 0006 email : alexander.reinholdt@kdemail.net 0007 ***************************************************************************/ 0008 0009 /*************************************************************************** 0010 * This program is free software; you can redistribute it and/or modify * 0011 * it under the terms of the GNU General Public License as published by * 0012 * the Free Software Foundation; either version 2 of the License, or * 0013 * (at your option) any later version. * 0014 * * 0015 * This program is distributed in the hope that it will be useful, but * 0016 * WITHOUT ANY WARRANTY; without even the implied warranty of * 0017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 0018 * General Public License for more details. * 0019 * * 0020 * You should have received a copy of the GNU General Public License * 0021 * along with this program; if not, write to the * 0022 * Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston,* 0023 * MA 02110-1335, USA * 0024 ***************************************************************************/ 0025 0026 #ifndef SMB4KSHARESVIEWITEM_H 0027 #define SMB4KSHARESVIEWITEM_H 0028 0029 // application specific includes 0030 #include "core/smb4kglobal.h" 0031 #include "smb4ktooltip.h" 0032 0033 // Qt includes 0034 #include <QListWidgetItem> 0035 0036 // forward declarations 0037 class Smb4KSharesView; 0038 0039 /** 0040 * This class provides the items for the shares icon view 0041 * of Smb4K. 0042 * 0043 * @author Alexander Reinholdt <alexander.reinholdt@kdemail.net> 0044 */ 0045 0046 class Smb4KSharesViewItem : public QListWidgetItem 0047 { 0048 public: 0049 /** 0050 * The constructor. 0051 * 0052 * @param share The Smb4KShare object that represents the share. 0053 * 0054 * @param parent The parent widget of this item. 0055 */ 0056 Smb4KSharesViewItem(Smb4KSharesView *parent, const SharePtr &share); 0057 0058 /** 0059 * The destructor 0060 */ 0061 ~Smb4KSharesViewItem(); 0062 0063 /** 0064 * This function returns the encapsulated Smb4KShare item. 0065 * 0066 * @returns the encapsulated Smb4KShare item. 0067 */ 0068 const SharePtr &shareItem() { return m_share; } 0069 0070 /** 0071 * This function updates the encapsulated Smb4KShare object. 0072 */ 0073 void update(); 0074 0075 /** 0076 * This function returns the tool tip of this item. 0077 * 0078 * @returns the tool tip. 0079 */ 0080 Smb4KToolTip *tooltip(); 0081 0082 /** 0083 * This function modifies the alignment according to the @p mode used in 0084 * the parent list widget. 0085 */ 0086 void setItemAlignment(QListView::ViewMode mode); 0087 0088 private: 0089 /** 0090 * The Smb4KShare item 0091 */ 0092 SharePtr m_share; 0093 0094 /** 0095 * The tool tip 0096 */ 0097 Smb4KToolTip *m_tooltip; 0098 }; 0099 0100 #endif 0101