Release 0.4.3-3maemo with patches to disable menus/actions, add ScrollArea and fix...
[keepassx] / src / main.h
1 /***************************************************************************
2  *   Copyright (C) 2005 by Tarek Saidi                                     *
3  *   tarek.saidi@arcor.de                                                  *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; version 2 of the License.               *
8  *                                                                         *
9  *   This program 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         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18  ***************************************************************************/
19
20 #ifndef _MAIN_H_
21 #define _MAIN_H_
22
23 #include "mainwindow.h"
24
25 QString findPlugin(const QString& filename);
26 void loadImages();
27 void initAppPaths(int argc, char **argv);
28
29 class CmdLineArgs {
30 public:
31         CmdLineArgs();
32         bool parse(const QStringList& argv);
33         bool preparse(int argc,char** argv);
34         static void printHelp();
35         QString error() {return Error;}
36         QString file() {return File;}
37         QString configLocation() {return ConfigLocation;}
38         QString language() {return Language;}
39         bool startMinimized() {return StartMinimized;}
40         bool startLocked() {return StartLocked;}
41         bool help() {return Help;}
42         void setFile(const QString& filename) {File = filename;};
43 private:
44         QString Error;
45         QString File;
46         QString ConfigLocation;
47         QString Language;
48         bool StartMinimized;
49         bool StartLocked;
50         bool Help;
51 };
52
53 class EventListener : public QObject {
54         Q_OBJECT
55         
56 #ifdef Q_WS_MAC
57         public:
58                 EventListener() { pMainWindow = NULL; };
59                 inline QString file() { return pFile; };
60                 inline void setMainWin(KeepassMainWindow* mainWin) {
61                         pMainWindow = mainWin;
62                 };
63         
64         private:
65                 QString pFile;
66                 KeepassMainWindow* pMainWindow;
67 #endif
68         
69         protected:
70                 bool eventFilter(QObject*, QEvent* event);
71 };
72
73 #endif