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 #ifndef LISTITEM_H 00023 #define LISTITEM_H 00024 00025 #include <QListWidgetItem> 00026 00034 class ListItem : public QListWidgetItem 00035 { 00036 00037 public: 00041 ListItem(); 00042 00046 enum TextSize{TEXT_SIZE_NORMAL, TEXT_SIZE_SMALL}; 00047 00048 /****************************************************************************** 00049 * MEMBER FUNCTIONS AND SLOTS 00050 ******************************************************************************/ 00051 public: 00057 void setImage(const QPixmap &image); 00058 00064 void setTitle(const QString &name); 00065 00071 virtual void setSelected(bool selected) = 0; 00072 00078 void setSize(const QSize &size); 00079 00088 QString shortenText(const QString &text, int textWidth, TextSize textSize); 00089 00095 QString title() const; 00096 00102 virtual bool toggleSelection() = 0; 00103 00104 /******************************************************************************* 00105 * DATA MEMBERS 00106 ******************************************************************************/ 00107 private: 00108 QPixmap m_image; 00109 QString m_name; 00110 }; 00111 00112 #endif // LISTITEM_H