2 * Copyright (C) 2009 David Greaves <david@dgreaves.com>
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
30 #include <X11/extensions/Xrandr.h>
33 #include "shopperList.h"
35 #include "CatListModel.h"
43 class MainWindow
: public QMainWindow
48 MainWindow(QString file
);
49 void timerEvent(QTimerEvent
*event
);
54 Shopper::List
*mylist
; // Main list that we're acting for
56 // Member UI helpers and components available to multiple methods
58 Shopper::ListView
*lv
;
66 /* Fullscreen mode is on (TRUE) or off (FALSE) */
69 Rotation rotation
; // X type
72 void create_list_view(Shopper::List
*);
77 // Main UI action handlers
79 void on_action_add_item();
80 void on_action_manage_category();
82 // Change current category
83 void on_action_next();
84 void on_action_prev();
86 // List state manipulation
87 void on_action_clear_wanted();
88 void on_action_clear_bought();
89 void on_action_fullList();
90 void on_action_whatsLeft();
91 void on_action_makingList();
94 void on_action_file_new();
95 void on_action_file_open();
96 void on_action_file_save();
97 void on_action_file_saveas();
98 void on_action_preferences();
101 void on_action_help();
102 void on_action_about();
105 void keyPressEvent ( QKeyEvent
* event
);
106 void on_action_rotate();
107 void closeEvent(QCloseEvent
*event
);
109 // Update UI on data change
110 void cat_selected(int i
);
115 void writeSettings();
118 #endif //MAINWINDOW_H