vdr-plugin-skindesigner/services.h

87 lines
2.9 KiB
C
Raw Normal View History

2014-11-15 09:47:22 +01:00
#ifndef __SKINDESIGNERSERVICES_H
#define __SKINDESIGNERSERVICES_H
using namespace std;
#include <string>
#include <map>
/*********************************************************************
* Data Structures for Service Calls
*********************************************************************/
// Data structure for service "RegisterPlugin"
class RegisterPlugin {
public:
2015-02-12 18:50:58 +01:00
RegisterPlugin(void) {
name = "";
};
void SetMenu(int key, string templateName) {
menus.insert(pair<int, string>(key, templateName));
}
void SetView(int key, string templateName) {
views.insert(pair<int, string>(key, templateName));
}
2015-03-12 17:28:35 +01:00
void SetSubView(int view, int subView, string templateName) {
pair<int, string> sub = make_pair(subView, templateName);
subViews.insert(pair<int, pair<int, string> >(view, sub));
}
2015-02-12 18:50:58 +01:00
void SetViewElement(int view, int viewElement, string name) {
map< int, map<int, string> >::iterator hit = viewElements.find(view);
if (hit == viewElements.end()) {
map<int, string> vE;
vE.insert(pair<int, string >(viewElement, name));
viewElements.insert(pair<int, map < int, string > >(view, vE));
} else {
(hit->second).insert(pair<int, string >(viewElement, name));
}
}
void SetViewGrid(int view, int viewGrid, string name) {
map< int, map<int, string> >::iterator hit = viewGrids.find(view);
if (hit == viewGrids.end()) {
map<int, string> vG;
vG.insert(pair<int, string >(viewGrid, name));
viewGrids.insert(pair<int, map < int, string > >(view, vG));
} else {
(hit->second).insert(pair<int, string >(viewGrid, name));
}
}
2014-11-15 09:47:22 +01:00
// in
2015-03-12 17:28:35 +01:00
string name; //name of plugin
map< int, string > menus; //menus as key -> templatename hashmap
map< int, string> views; //standalone views as key -> templatename hashmap
multimap< int, pair <int, string> > subViews; //subviews of standalone views as view -> (subview, templatename) multimap
map< int, map <int, string> > viewElements; //viewelements as key -> (viewelement, viewelementname) hashmap
map< int, map <int, string> > viewGrids; //viewgrids as key -> (viewgrid, viewgridname) hashmap
2014-11-15 09:47:22 +01:00
//out
};
// Data structure for service "GetDisplayMenu"
class GetDisplayMenu {
public:
2015-02-12 18:50:58 +01:00
GetDisplayMenu(void) {
displayMenu = NULL;
};
2014-11-15 09:47:22 +01:00
// in
//out
2015-02-12 18:50:58 +01:00
cSDDisplayMenu *displayMenu;
2014-11-15 09:47:22 +01:00
};
// Data structure for service "GetDisplayPlugin"
class GetDisplayPlugin {
public:
2015-02-12 18:50:58 +01:00
GetDisplayPlugin(void) {
pluginName = "";
viewID = -1;
2015-03-12 17:28:35 +01:00
subViewID = -1;
2015-02-12 18:50:58 +01:00
displayPlugin = NULL;
};
// in
2015-02-12 18:50:58 +01:00
string pluginName;
int viewID;
2015-03-12 17:28:35 +01:00
int subViewID;
//out
2015-02-12 18:50:58 +01:00
cSkinDisplayPlugin *displayPlugin;
};
2015-02-12 18:50:58 +01:00
#endif //__SKINDESIGNERSERVICES_H