summaryrefslogtreecommitdiff
path: root/plugins/ExternalAPI/m_NewStory.h
blob: ad6c7583a96886de2f4ce6754b1fa37aacce6ea5 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once

#include <vector>

/////////////////////////////////////////////////////////////////////////////////////////
// NS get current event

#define MS_NEWSTORY_GETCURRENT "NewStory/GetCurrent"

__forceinline MEVENT NS_GetCurrent(HANDLE hwnd)
{
	return (MEVENT)CallService(MS_NEWSTORY_GETCURRENT, WPARAM(hwnd), 0);
}

/////////////////////////////////////////////////////////////////////////////////////////
// NS get selection

#define MS_NEWSTORY_GETSELECTION "NewStory/GetSelection"

__forceinline std::vector<MEVENT> NS_GetSelection(HANDLE hwnd)
{
	std::vector<MEVENT> ret;
	CallService(MS_NEWSTORY_GETSELECTION, WPARAM(hwnd), LPARAM(&ret));
	return ret;
}

/////////////////////////////////////////////////////////////////////////////////////////
// NS menu item

struct NSMenuExecParam
{
	char *szServiceName;
	int iParam;
};

__forceinline HGENMENU Menu_AddNewStoryMenuItem(TMO_MenuItem *pmi, int param)
{
	return (HGENMENU)CallService("NSMenu/AddService", (WPARAM)pmi, param);
}

/////////////////////////////////////////////////////////////////////////////////////////
// event for changing NewStory menu items
// wparam = (MCONTACT)hContact - contact id
// lparam = (DB::EventInfo*)dbei - event

#define ME_NS_PREBUILDMENU  "NewStory/PreBuildMenu"