2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jussi Laitinen - jussi.laitinen@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25 #include <QListWidgetItem>
30 * @brief Base class for list items.
32 * Stores item's name and image. Defines methods that sub
33 * classes have to implement.
35 class ListItem : public QListWidgetItem
43 /******************************************************************************
44 * MEMBER FUNCTIONS AND SLOTS
45 ******************************************************************************/
47 * @brief Returns item's ID.
51 virtual QString id() const = 0;
54 * @brief Returns item's image.
56 * @return image's pixmap
58 QPixmap image() const;
61 * @brief Returns item's name.
68 * @brief Sets item's image.
70 * @param image QPixmap
72 void setImage(const QPixmap &image);
75 * @brief Sets item's name.
77 * @param name item's name
79 void setName(const QString &name);
82 * @brief Sets item selected.
84 * @param selected true if selected, false otherwise
86 virtual void setSelected(bool selected) = 0;
89 * @brief Toggles selection.
91 * @return true if selection was toggled, false otherwise
93 virtual bool toggleSelection() = 0;
96 * @brief Returns item's coordinates.
98 * @return item's coordinates
100 virtual QPointF coordinates() = 0;
102 /*******************************************************************************
104 ******************************************************************************/
106 QPixmap m_image; ///< Item's image
107 QString m_name; ///< Item's name