Modified UserInfo to use TextModifier class.
[situare] / src / ui / listcommon.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Jussi Laitinen - jussi.laitinen@ixonos.com
6
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.
10
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.
15
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,
19    USA.
20 */
21
22 #ifndef LISTCOMMON_H
23 #define LISTCOMMON_H
24
25 #include <Qt>
26
27 const int ITEM_WIDTH = 368;     ///< Item minimum width
28 const int ICON_HEIGHT = 24;     ///< Icon height
29 const int ICON_MARGIN = 2;      ///< Icon margin
30 const int ICON_WIDTH = 24;      ///< Icon width
31 const int IMAGE_HEIGHT = 64;    ///< Friend image height
32 const int IMAGE_WIDTH = 64;     ///< Friend image width
33 const int ITEM_MIN_HEIGHT = 70; ///< Minimum height for item
34 const int MARGIN = 5;           ///< Text and image margin
35
36 /**
37 * @var NAME_TEXT_MAX_WIDTH
38 *
39 * @brief Name label's maximum width
40 */
41 const int NAME_TEXT_MAX_WIDTH = ITEM_WIDTH - 3 * MARGIN - IMAGE_WIDTH;
42
43 /**
44 * @var SUBITEM_TEXT_MAX_WIDTH
45 *
46 * @brief All label's maximum width
47 */
48 const int SUBITEM_TEXT_MAX_WIDTH = ITEM_WIDTH - 3 * MARGIN - IMAGE_WIDTH - MARGIN - ICON_WIDTH
49                                    - MARGIN * 2;
50
51 const int SUBITEM_TEXT_ROW_HEIGHT = 21;     ///< Subitems text row height
52
53 const int TITLE_DISPLAY_INDEX = Qt::DisplayRole;
54 const int AVATAR_IMAGE_INDEX = Qt::DecorationRole;
55
56 const int ITEM_SIZE_HINT_INDEX = Qt::SizeHintRole;
57 const int DISTANCE_SIZE_HINT_INDEX = Qt::SizeHintRole + 1;
58
59
60 const int SUBITEM_STORE_INDEX = Qt::UserRole;
61 const int ITEM_EXPANDED_INDEX = Qt::UserRole + 1;
62 const int ITEM_HAS_IMAGE_INDEX = Qt::UserRole + 2;
63 const int DISTANCE_TEXT_DISPLAY_INDEX = Qt::UserRole + 3;
64 const int DISTANCE_IMAGE_INDEX = Qt::UserRole + 4;
65
66 #endif // LISTCOMMON_H