2 * Copyright (C) 2008 David Greaves <david@dgreaves.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
19 #ifndef SHOPPER_UI_ITEMVIEW_H
20 #define SHOPPER_UI_ITEMVIEW_H
23 #include <QHBoxLayout>
26 class QContextMenuEvent
;
34 class ItemView
: public QWidget
39 ItemView(Shopper::Item
&it
, Shopper::List
&l
, QWidget
*parent
);
41 virtual void setVisible(bool vis
);
42 QCheckBox
*tick
; /* display either the 'bought/not
43 * bought' or the 'wanted/not wanted'
44 * state depending on the current
45 * mode. This also includes the
50 ActiveLabel
*desc
; /* This displays the item description */
51 NoteWidget
*note
; /* This displays the notes. When
52 * clicked on it transforms into a
54 Item
*myitem
; /* the item being displayed */
55 List
*mylist
; /* the parent list */
57 // This handles right clicks (or equiv)
58 void contextMenuEvent( QContextMenuEvent
* event
);
59 static const int BASEFONTSIZE
, MINFONTSIZE
, MAXFONTSIZE
;
63 void desc_clicked(); // toggles the check
64 void tick_changed(int s
);// changes the state when check changes
65 void note_changed(); // EntryLabel calls to change note
66 void edit_item(); // menu calls this to open edit dialog
67 void delete_item(); // menu calls this to removes item
71 void updateVisibility();
75 #endif // SHOPPER_UI_ITEMVIEW_H