The class declaration should be the first header in the cc file for
[shopper.git] / src / ui / CategoryDialog.h
blobb020f76ebbff8aa104f8b606d7290e3f2bc79013
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_CATEGORYDIALOG_H
21 #define SHOPPER_UI_CATEGORYDIALOG_H
23 #include "shopperList.h"
24 #include <QtGui>
25 #include "LabelEntry.h"
26 #include "QFingerScrollArea.h"
28 namespace Shopper
30 // private helper class
31 class CatView : public QWidget
33 Q_OBJECT;
34 public:
35 CatView(Category &it, List &l,QWidget * parent = 0) ;
36 ~CatView() ;
38 Category* get_cat();
39 void set_pos(int, int);
40 // virtual void setVisible(bool vis);
42 public slots:
43 void name_changed();
44 void delete_category();
45 void activate();
47 signals:
48 void move_up();
49 void move_down();
51 private:
52 struct Private;
53 Private *p;
56 // Allow CatView* to be passed as Qt::QueuedConnection params
57 // must be done outside the namespace
58 Q_DECLARE_METATYPE ( Shopper::CatView * )
59 namespace Shopper
62 // private base for adding/editing an Category
63 class CategoryDialog : public QDialog
65 Q_OBJECT;
66 protected:
67 CategoryDialog(QWidget * parent, Shopper::List*, Shopper::Category*);
68 ~CategoryDialog();
70 public slots:
71 void update_area();
72 void add_category();
73 void move_up();
74 void move_down();
75 void highlightCategory(CatView *);
77 signals:
78 void categoryAdded(CatView *);
80 private:
81 void move(Shopper::CatView *c, int direction);
83 struct Private;
84 Private *p;
88 // Public classes for managing
89 class CategoryManage : public CategoryDialog
91 public:
92 CategoryManage(QWidget * parent, Shopper::List* mylist);
95 #endif