00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Jussi Laitinen - jussi.laitinen@ixonos.com 00006 00007 Situare is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 version 2 as published by the Free Software Foundation. 00010 00011 Situare is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Situare; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 00022 00023 #ifndef EXTENDEDLISTITEM_H 00024 #define EXTENDEDLISTITEM_H 00025 00026 #include "listitem.h" 00027 00028 class ExtendedListItemStore; 00029 00035 class ExtendedListItem : public ListItem 00036 { 00037 public: 00043 ExtendedListItem(); 00044 00050 virtual ~ExtendedListItem(); 00051 00052 /******************************************************************************* 00053 * MEMBER FUNCTIONS AND SLOTS 00054 ******************************************************************************/ 00055 public: 00063 void addSubItem(const QString &text, const QPixmap &icon = QPixmap()); 00064 00071 void clearSubItems(); 00072 00078 void setSelected(bool selected); 00079 00085 void setSubitemTextWidth(int width); 00086 00092 bool toggleSelection(); 00093 00094 private: 00102 QRect boundingRect(const QString &text); 00103 00111 QRect calculateExpandedTextRect(const QString &text); 00112 00113 /****************************************************************************** 00114 * DATA MEMBERS 00115 ******************************************************************************/ 00116 private: 00117 bool m_selected; 00118 int m_expandedHeight; 00119 int m_normalHeight; 00120 int m_subItemTextWidth; 00121 00122 QList<ExtendedListItemStore *> *m_subItemStoreList; 00123 }; 00124 00125 #endif // EXTENDEDLISTITEM_H