AdopterWindow to inherit from MainBase.
[dorian] / widgets / mainbase.h
1 #ifndef MAINBASE_H\r
2 #define MAINBASE_H\r
3 \r
4 #include <QMainWindow>\r
5 \r
6 class QToolBar;\r
7 \r
8 /**\r
9  * Main window with a toolbar.\r
10  */\r
11 class MainBase: public QMainWindow\r
12 {\r
13     Q_OBJECT\r
14 \r
15 public:\r
16     explicit MainBase(QWidget *parent = 0);\r
17 \r
18     /**\r
19      * Add action that is visible on the tool bar.\r
20      * @param   receiver    Object receiving "activated" signal.\r
21      * @param   slot        Slot receiving "activated" signal.\r
22      * @param   iconName    Base name of tool bar icon in resource file.\r
23      * @param   text        Tool bar item text.\r
24      * @param   important   On Symbian, only "important" actions are added to\r
25      *                      the tool bar. All actions are added to the Options\r
26      *                      menu though.\r
27      */\r
28     QAction *addToolBarAction(QObject *receiver, const char *slot,\r
29                               const QString &iconName, const QString &text,\r
30                               bool important = false);\r
31 \r
32     /** Add spacing to tool bar. */\r
33     void addToolBarSpace();\r
34 \r
35 public slots:\r
36     void show();\r
37 \r
38 protected:\r
39     /** Handle resize event: Manage tool bar visibility. */\r
40     void resizeEvent(QResizeEvent *event);\r
41 \r
42     /** Handle show event: Manage tool bar visibility. */\r
43     void showEvent(QShowEvent *event);\r
44 \r
45     /**\r
46      * Update toolb ar visibility.\r
47      * On Symbian, the tool bar is not visible in landscape mode.\r
48      */\r
49     void updateToolBar();\r
50 \r
51     /** Hide tool bar if visible. */\r
52     void hideToolBar();\r
53 \r
54     /** Return true if the tool bar is present and hidden. */\r
55     bool isToolBarHidden();\r
56 \r
57     /** Return the height of the tool bar (or 0 if there is no tool bar). */\r
58     int toolBarHeight();\r
59 \r
60 private:\r
61     QToolBar *toolBar;      /**< Tool bar. */\r
62 };\r
63 \r
64 #endif // MAINBASE_H\r