[429088]: kwave / menumanager.h Maximize Restore History

Download this file

menumanager.h    116 lines (91 with data), 2.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
#ifndef _KWAVEMENUMANAGE_H_
#define _KWAVEMENUMANAGE_H_ 1
#include <qobject.h>
#include <qwidget.h>
#include <qlist.h>
#include <qkeycode.h>
#include <kmenubar.h>
//maximum number of menuitem in numberedmenus, e.g. presets, channels
#define MENUMAX 100
//maximum number of top level menus...
#define TOPMENUMAX 16
#define KMENU -1
#define KITEM -2
#define KEND -3
#define KSEP -4
#define KREF -5
#define KCHANNEL -4
#define KNAME -5
#define KFILTER -6
#define KMARKER -7
#define KEXCLUSIVE -2
#define KSHARED -1
class KWavePopMenu: public QPopupMenu //struct used to keep track of allocated menus
{
public:
KWavePopMenu (const char *name,int id);
~KWavePopMenu ();
const char *getName ();
int getId ();
int getMemberId ();
void setMemberId (int);
void insertMenu (KWavePopMenu *);
void removeMenu (const char *name);
KWavePopMenu *findMenu (const char *name);
private:
int id;
int memberId;
QString *name; //name as used internally
QList<KWavePopMenu> children; //list of pointers to children menus
};
struct KWaveMenuItem //structure used by clients to allocate whole menus with submenus
{
int internalID;
const char *name;
int type; //type of menu
int id; //ITEM: id is set to -1 and will be retrieved or is fixed
//MENU: id defines MULTIMENUTYPE
int shortcut; //shortcutkey for the menu
};
class NumberedMenu
{
public:
NumberedMenu (char *name);
~NumberedMenu();
void clear ();
void notifyMenu (KWavePopMenu *menu);
void addEntry (char *name);
void refresh ();
char *name ();
private:
QString *objname;
QList<QString> entries;
QList<KWavePopMenu> notifymenus;
};
class MenuManager:public QObject
{
Q_OBJECT
public:
MenuManager (QWidget *parent,KMenuBar *);
~MenuManager ();
void appendMenus (KWaveMenuItem *); //adds menus
void deleteMenus (KWaveMenuItem *); //deletes menus
NumberedMenu *findNumberedMenu (char *); //return id
bool addNumberedMenu (char *); //special type of menu, where all Items are numbered
void clearNumberedMenu (char *); //delete all entries of a numbered Menu
void addNumberedMenuEntry (char *name,char *entry); //add Entrys to numbered Window
int translateId (KWaveMenuItem *,int ); //returns internal id, if found
signals:
void id(int);
public slots:
void map(int);
protected:
KWavePopMenu *findMenu (const char *name);
int getUniqueId ();
int getIdRange (int);
private:
KMenuBar *bar;
QList<KWavePopMenu> menus;
QList<NumberedMenu> numberedMenus;
};
#endif