2 * Copyright (C) 2008 David Greaves
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., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 #ifndef __ITEMVIEW_H__
20 #define __ITEMVIEW_H__
22 #include "shopperList.h"
23 #include "LabelEntry.h"
26 #include "QFingerScrollArea.h"
27 #include <QScrollArea>
28 #include <QHBoxLayout>
29 #include <QVBoxLayout>
37 class ItemView
: public QWidget
42 ItemView(Shopper::Item
&it
, Shopper::List
&l
, QWidget
*parent
);
44 virtual void setVisible(bool vis
);
45 QCheckBox
*tick
; /* display either the 'bought/not
46 * bought' or the 'wanted/not wanted'
47 * state depending on the current
48 * mode. This also includes the
53 SLabel
*desc
; /* This displays the item description */
54 LabelEntry
*note
; /* This displays the notes. When
55 * clicked on it transforms into a
57 Item
*myitem
; /* the item being displayed */
58 List
*mylist
; /* the parent list */
60 // This handles right clicks (or equiv)
61 void contextMenuEvent( QContextMenuEvent
* event
);
65 void desc_clicked(); // toggles the check
66 void tick_changed(int s
);// changes the state when check changes
67 void note_changed(); // EntryLabel calls to change note
68 void edit_item(); // menu calls this to open edit dialog
69 void delete_item(); // menu calls this to removes item
73 void updateVisibility();
77 #endif /* __ITEMVIEW_H__ */