00001 #ifndef IGUANA_STUDIO_IG_QT_APP_MENU_SERVICE_H
00002 # define IGUANA_STUDIO_IG_QT_APP_MENU_SERVICE_H
00003
00004
00005
00006 # include "Iguana/Studio/interface/config.h"
00007 # include "Iguana/Framework/interface/IgStateElement.h"
00008
00009
00010
00011
00012
00013 class QWidget;
00014 class QMainWindow;
00015 class QMenuBar;
00016 class QPopupMenu;
00017 class QMenuData;
00018 class QString;
00019 class QObject;
00020
00021
00022
00023
00024
00025 class IGUANA_STUDIO_API IgQtAppMenuService : public IgStateElement
00026 {
00027 IG_DECLARE_STATE_ELEMENT (IgQtAppMenuService);
00028 public:
00029 static const int MENU_GROUP_RANGE = 1000;
00030 static const int MENU_SUBGROUP_RANGE = 50;
00031
00032 static const int MENU_ID_FILE = 0;
00033 static const int MENU_ID_FILE_SAVE = 1;
00034 static const int MENU_ID_FILE_PRINT = 2;
00035 static const int MENU_ID_FILE_QUIT = (MENU_ID_FILE
00036 + 10 * MENU_SUBGROUP_RANGE);
00037 static const int MENU_ID_HELP = 100 * MENU_GROUP_RANGE;
00038
00039 IgQtAppMenuService (IgState *state, QWidget *mainWindow);
00040 ~IgQtAppMenuService (void);
00041
00042
00043
00044
00045
00046
00047 QMenuBar * menuBar (void);
00048 QPopupMenu * subMenu (int id);
00049 QPopupMenu * subMenu (int id1, int id2);
00050 QPopupMenu * findByName (QMenuData *menu,
00051 const char *itemName);
00052
00053 static int index (QMenuData *menu, int id);
00054 static int isIdThere (QMenuData *menu, int id);
00055 static void insertItem (QMenuData *parentMenu,
00056 const QString &text,
00057 QObject *target,
00058 const char *slot,
00059 int id,
00060 IgState *state = 0);
00061 private:
00062 IgState *m_state;
00063 QMainWindow *m_mainWindow;
00064
00065
00066 IgQtAppMenuService (const IgQtAppMenuService &);
00067 IgQtAppMenuService &operator= (const IgQtAppMenuService &);
00068 };
00069
00070
00071
00072
00073 #endif // IGUANA_STUDIO_IG_QT_APP_MENU_SERVICE_H