2 * Copyright (C) 2009 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
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();
99 void on_action_file_quit();
102 void on_action_help();
103 void on_action_about();
106 void keyPressEvent ( QKeyEvent
* event
);
107 bool on_signal_window_closed();
108 void on_action_rotate();
109 void closeEvent(QCloseEvent
*event
);
111 // Update UI on data change
112 void cat_selected(int i
);
117 void writeSettings();
120 #endif //MAINWINDOW_H