summaryrefslogtreecommitdiff
path: root/plugins/ExternalAPI/m_NewStory.h
blob: 8fd108fd8fe1ced93ea2e108d8b1e58d8697f725 (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
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
#pragma once

#include <vector>

#define NS_PROTO_MENU_POS 1000001

enum
{
	NSM_FIRST = WM_USER + 100,

	// wParam = fist item
	// lParam = iLast item
	// result = number of total selected items
	NSM_SELECTITEMS = NSM_FIRST,

	//
	NSM_SEEKTIME,

	// 
	NSM_SET_OPTIONS,  // options were changed

	NSM_LAST
};

/////////////////////////////////////////////////////////////////////////////////////////
// NS get SRMM dialog
// returns a pointer to the parent SRMM dialog, if used as a log window, or nullptr otherwise

__forceinline CSrmmBaseDialog* NS_GetSrmm(HANDLE hwnd)
{
	return (CSrmmBaseDialog *)CallService("NewStory/GetSrmm", WPARAM(hwnd), 0);
}

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

__forceinline MEVENT NS_GetCurrent(HANDLE hwnd)
{
	return (MEVENT)CallService("NewStory/GetCurrent", WPARAM(hwnd), 0);
}

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

__forceinline std::vector<MEVENT> NS_GetSelection(HANDLE hwnd)
{
	std::vector<MEVENT> ret;
	CallService("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);
}

/////////////////////////////////////////////////////////////////////////////////////////
// service for refreshing downloaded files

__forceinline void NS_NotifyFileReady(const wchar_t *pwszFileName)
{
	CallService("NewStory/FileReady", (WPARAM)pwszFileName, 0);
}

/////////////////////////////////////////////////////////////////////////////////////////
// service for refreshing downloaded files

__forceinline void NS_NotifyRemoteRead(MCONTACT hContact, MEVENT hEvent)
{
	CallService("NewStory/RemoteRead", hContact, hEvent);
}

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

#define ME_NS_PREBUILDMENU  "NewStory/PreBuildMenu"