summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/popuphelper.h
blob: 6d4d4130d24c8d1ccb10227025e1ed6411c3393b (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&, BTDeviceItem*);
    typedef QMap<int,  popupFactory> FactoryMap;
    class PopupHelper {
    public:
        PopupHelper();
        ~PopupHelper();
        void insert( int id, popupFactory fact );
        QPopupMenu* find( int id, const Services&, BTDeviceItem* );
    private:
        void init();
        FactoryMap m_map;

    };
};

#endif