The class declaration should be the first header in the cc file for
[shopper.git] / src / ui / ItemDialog.h
blob4a53813df468730c381a21df43a417e712812e65
1 /* Shopper
2 * Copyright (C) 2008 David Greaves
4 * This software is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
9 * This software is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this software; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17 * 02110-1301 USA
20 #ifndef SHOPPER_UI_ITEMDIALOG_H
21 #define SHOPPER_UI_ITEMDIALOG_H
22 #include "shopperList.h"
23 #include <QtGui>
24 #include "CatListModel.h"
26 namespace Shopper
28 // private base for adding/editing an Item
29 class ItemDialog : public QDialog
31 Q_OBJECT;
32 protected:
33 ItemDialog(QWidget * parent, Shopper::List*, Shopper::Item*);
34 ~ItemDialog();
36 // accessor
37 Shopper::Category* get_category();
39 // Data
40 Shopper::List *mylist;
41 Shopper::Item *myitem;
43 CatListModel *model;
44 // State
45 int catSelected;
47 // GUI
48 QLabel *descLabel;
49 QLineEdit *desc_e;
50 QLabel *catLabel;
51 QComboBox *catCombo;
52 QPushButton *plusButton;
54 // int update_combo();
55 public slots:
56 void plus_category();
57 void add_or_edit();
59 class ItemEdit : public ItemDialog
61 public:
62 ItemEdit(QWidget * parent, Shopper::List* mylist, Shopper::Item* it);
64 class ItemAdd : public ItemDialog
66 public:
67 ItemAdd(QWidget * parent, Shopper::List* mylist);
71 #endif