summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/popuphelper.h
blob: 7541ac5f6ba3d156bcf03ae6e4484202a08ee3a7 (plain)
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

#ifndef OPIE_TOOTH_POPUP_HELPER
#define OPIE_TOOTH_POPUP_HELPER

#include <qlistview.h>
#include <qpopupmenu.h>
#include <qmap.h>

#include <services.h>

namespace OpieTooth {
    typedef QPopupMenu* (*popupFactory)(const Services&, QListViewItem*);
    typedef QMap<int,  popupFactory> FactoryMap;
    class PopupHelper {
    public:
        PopupHelper();
        ~PopupHelper();
        void insert( int id, popupFactory fact );
        QPopupMenu* find( int id, const Services&, QListViewItem* );
    private:
        void init();
        FactoryMap m_map;

    };
};

#endif