Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

621 lines
18 KiB

  1. //---------------------------------------------------------------------------
  2. // OERules.idl
  3. //---------------------------------------------------------------------------
  4. import "objidl.idl";
  5. import "ocidl.idl";
  6. import "mimeole.idl";
  7. import "oestore.idl";
  8. //---------------------------------------------------------------------------
  9. // Interfaces
  10. //---------------------------------------------------------------------------
  11. interface IOERulesManager;
  12. interface IOEEnumRules;
  13. interface IOEExecRules;
  14. interface IOERule;
  15. interface IOECriteria;
  16. interface IOEActions;
  17. // Make sure we only bring in this file only once
  18. cpp_quote("// Bring in only once")
  19. cpp_quote("#if _MSC_VER > 1000")
  20. cpp_quote("#pragma once")
  21. cpp_quote("#endif")
  22. cpp_quote("")
  23. //---------------------------------------------------------------------------
  24. // HRESULT Macros
  25. //---------------------------------------------------------------------------
  26. cpp_quote("#ifndef FACILITY_INTERNET")
  27. cpp_quote("#define FACILITY_INTERNET 12")
  28. cpp_quote("#endif")
  29. cpp_quote("#ifndef HR_E")
  30. cpp_quote("#define HR_E(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_INTERNET, n)")
  31. cpp_quote("#endif")
  32. cpp_quote("#ifndef HR_S")
  33. cpp_quote("#define HR_S(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_INTERNET, n)")
  34. cpp_quote("#endif")
  35. cpp_quote("#ifndef HR_CODE")
  36. cpp_quote("#define HR_CODE(hr) (INT)(hr & 0xffff)")
  37. cpp_quote("#endif")
  38. cpp_quote("")
  39. typedef struct tagRULEFOLDERDATA
  40. {
  41. FILETIME ftStamp;
  42. FOLDERID idFolder;
  43. } RULEFOLDERDATA, * PRULEFOLDERDATA;
  44. typedef enum tagRULE_TYPE
  45. {
  46. RULE_TYPE_MAIL = 0,
  47. RULE_TYPE_NEWS,
  48. RULE_TYPE_FILTER,
  49. RULE_TYPE_MAX
  50. } RULE_TYPE;
  51. typedef DWORD RULE_SESSION;
  52. typedef enum tagACT_TYPE
  53. {
  54. ACT_TYPE_NULL = 0,
  55. ACT_TYPE_COPY,
  56. ACT_TYPE_FWD,
  57. ACT_TYPE_NOTIFYMSG,
  58. ACT_TYPE_NOTIFYSND,
  59. ACT_TYPE_REPLY,
  60. ACT_TYPE_MOVE,
  61. ACT_TYPE_DELETE,
  62. ACT_TYPE_DELETESERVER,
  63. ACT_TYPE_DONTDOWNLOAD,
  64. ACT_TYPE_HIGHLIGHT,
  65. ACT_TYPE_FLAG,
  66. ACT_TYPE_STOP,
  67. ACT_TYPE_READ,
  68. ACT_TYPE_MARKDOWNLOAD,
  69. ACT_TYPE_SHOW,
  70. ACT_TYPE_JUNKMAIL,
  71. ACT_TYPE_WATCH,
  72. ACT_TYPE_MAX
  73. } ACT_TYPE;
  74. const DWORD ACT_FLAG_DEFAULT = 0x00000000;
  75. const DWORD ACT_FLAG_INVERT = 0x00000001;
  76. typedef struct tagACT_ITEM
  77. {
  78. ACT_TYPE type;
  79. DWORD dwFlags;
  80. PROPVARIANT propvar;
  81. } ACT_ITEM, * PACT_ITEM;
  82. typedef struct tagRULEINFO
  83. {
  84. RULEID ridRule;
  85. IOERule * pIRule;
  86. } RULEINFO, *PRULEINFO;
  87. //---------------------------------------------------------------------------
  88. // Rules Manager IDs
  89. //---------------------------------------------------------------------------
  90. // For Rules
  91. const RULEID RULEID_JUNK = (RULEID) -3;
  92. const RULEID RULEID_SENDERS = (RULEID) -2;
  93. // For Views
  94. const RULEID RULEID_VIEW_ALL = (RULEID) 0x00000FFA;
  95. const RULEID RULEID_VIEW_UNREAD = (RULEID) 0x00000FFB;
  96. const RULEID RULEID_VIEW_DOWNLOADED = (RULEID) 0x00000FFC;
  97. const RULEID RULEID_VIEW_DELETED = (RULEID) 0x00000FFD;
  98. const RULEID RULEID_VIEW_REPLIES = (RULEID) 0x00000FFE;
  99. const RULEID RULEID_VIEW_IGNORED = (RULEID) 0x00000FFF;
  100. //---------------------------------------------------------------------------
  101. // Rules Manager HRESULTs
  102. //---------------------------------------------------------------------------
  103. //---------------------------------------------------------------------------
  104. // IOERulesManager interface
  105. //---------------------------------------------------------------------------
  106. [
  107. object,
  108. uuid(626bafe0-e5d6-11d1-b1dd-006097d503d9),
  109. pointer_default(unique),
  110. version(1.0)
  111. ]
  112. interface IOERulesManager : IUnknown
  113. {
  114. const DWORD RULESMGR_VERSION = 0x00050000;
  115. HRESULT Initialize(
  116. [in] DWORD dwFlags);
  117. HRESULT GetRule(
  118. [in] RULEID ridRule,
  119. [in] RULE_TYPE type,
  120. [in] DWORD dwFlags,
  121. [out] IOERule ** ppIRule);
  122. HRESULT FindRule(
  123. [in] LPCSTR pszRuleName,
  124. [in] RULE_TYPE type,
  125. [out] IOERule ** ppIRule);
  126. const DWORD GETF_ALL = 0x00000000;
  127. const DWORD GETF_EDIT = 0x00000001;
  128. const DWORD GETF_SENDER = 0x00000002;
  129. const DWORD GETF_JUNK = 0x00000004;
  130. const DWORD GETF_POP3 = 0x00000008;
  131. const DWORD GETF_NNTP = 0x00000010;
  132. const DWORD GETF_IMAP = 0x00000020;
  133. const DWORD GETF_HTTPMAIL = 0x00000040;
  134. HRESULT GetRules(
  135. [in] DWORD dwFlags,
  136. [in] RULE_TYPE typeRule,
  137. [in] RULEINFO ** ppinfoRule,
  138. [in] ULONG * pcpinfoRule);
  139. const DWORD SETF_APPEND = 0x00000000;
  140. const DWORD SETF_CLEAR = 0x00000001;
  141. const DWORD SETF_SENDER = 0x00000002;
  142. const DWORD SETF_JUNK = 0x00000004;
  143. const DWORD SETF_REPLACE = 0x00000008;
  144. HRESULT SetRules(
  145. [in] DWORD dwFlags,
  146. [in] RULE_TYPE typeRule,
  147. [in] RULEINFO * pinfoRule,
  148. [in] ULONG cpIRule);
  149. const DWORD ENUMF_ALL = 0x00000001;
  150. const DWORD ENUMF_EDIT = 0x00000002;
  151. const DWORD ENUMF_SENDER = 0x00000004;
  152. const DWORD ENUMF_POP3 = 0x00000008;
  153. const DWORD ENUMF_NNTP = 0x00000010;
  154. const DWORD ENUMF_IMAP = 0x00000020;
  155. const DWORD ENUMF_HTTPMAIL = 0x00000040;
  156. HRESULT EnumRules(
  157. [in] DWORD dwFlags,
  158. [in] RULE_TYPE type,
  159. [out] IOEEnumRules ** ppIEnumRules);
  160. HRESULT GetState(
  161. [in] RULE_TYPE type,
  162. [in] DWORD dwFlags,
  163. [out] DWORD * pdwState);
  164. const DWORD EXECF_ALL = 0x00000001;
  165. const DWORD EXECF_APPLY = 0x00000002;
  166. HRESULT ExecRules(
  167. [in] DWORD dwFlags,
  168. [in] RULE_TYPE type,
  169. [out] IOEExecRules ** ppIExecRules);
  170. HRESULT ExecuteRules(
  171. [in] RULE_TYPE typeRule,
  172. [in] DWORD dwFlags,
  173. [in] HWND hwndUI,
  174. [in] IOEExecRules * pIExecRules,
  175. [in] MESSAGEINFO * pMsgInfo,
  176. [in] IMessageFolder * pFolder,
  177. [in] IMimeMessage * pIMMsg);
  178. };
  179. //---------------------------------------------------------------------------
  180. // Interface IOEEnumRules
  181. //---------------------------------------------------------------------------
  182. [
  183. object,
  184. uuid(626bafe2-e5d6-11d1-b1dd-006097d503d9),
  185. pointer_default(unique),
  186. version(1.0)
  187. ]
  188. interface IOEEnumRules : IUnknown
  189. {
  190. typedef [unique] IOEEnumRules *LPENUMRULES;
  191. HRESULT Next(
  192. [in] ULONG cpIRule,
  193. [out, size_is(cpIRule), length_is(*pcpIRuleFetched)]
  194. IOERule ** rgpIRule,
  195. [out] ULONG * pcpIRuleFetched);
  196. HRESULT Skip(
  197. [in] ULONG cpIRule);
  198. HRESULT Reset();
  199. HRESULT Clone(
  200. [out] IOEEnumRules ** ppIEnumRules);
  201. };
  202. //---------------------------------------------------------------------------
  203. // Interface IOEExecRules
  204. //---------------------------------------------------------------------------
  205. [
  206. object,
  207. uuid(626bafe4-e5d6-11d1-b1dd-006097d503d9),
  208. pointer_default(unique),
  209. version(1.0)
  210. ]
  211. interface IOEExecRules : IUnknown
  212. {
  213. typedef [unique] IOEExecRules *LPEXECRULES;
  214. HRESULT GetState(
  215. [out] DWORD * pdwState);
  216. const DWORD ERF_ONLYSERVER = 0x00000001;
  217. const DWORD ERF_NOSERVER = 0x00000002;
  218. const DWORD ERF_SKIPPARTIALS = 0x00000004;
  219. HRESULT ExecuteRules(
  220. [in] DWORD dwFlags,
  221. [in] LPCSTR pszAcct,
  222. [in] MESSAGEINFO * pMsgInfo,
  223. [in] IMessageFolder * pFolder,
  224. [in] IMimePropertySet * pIMPropSet,
  225. [in] IMimeMessage * pIMMsg,
  226. [in] ULONG cbMsgSize,
  227. [out] ACT_ITEM ** ppActions,
  228. [out] ULONG * pcActions);
  229. HRESULT ReleaseObjects();
  230. HRESULT GetRuleFolder(
  231. [in] FOLDERID idfolder,
  232. [out] DWORD_PTR * pdwFolder);
  233. const DWORD RFT_FILE = 0x00000000;
  234. const DWORD RFT_HTML = 0x00000001;
  235. const DWORD RFT_TEXT = 0x00000002;
  236. const DWORD RFT_MESSAGE = 0x00000003;
  237. HRESULT GetRuleFile(
  238. [in] LPCSTR pszFile,
  239. [out] IStream ** ppstmFile,
  240. [out] DWORD * pdwType);
  241. const DWORD ASF_PLAYIFNEW = 0x00000001;
  242. HRESULT AddSoundFile(
  243. [in] DWORD dwFlags,
  244. [in] LPCSTR pszSndFile);
  245. HRESULT PlaySounds(
  246. [in] DWORD dwFlags);
  247. };
  248. //---------------------------------------------------------------------------
  249. // Interface IOERule
  250. //---------------------------------------------------------------------------
  251. [
  252. object,
  253. uuid(626bafe6-e5d6-11d1-b1dd-006097d503d9),
  254. pointer_default(unique),
  255. version(1.0)
  256. ]
  257. interface IOERule : IUnknown
  258. {
  259. typedef enum tagRULE_PROP
  260. {
  261. RULE_PROP_NAME = 0,
  262. RULE_PROP_DISABLED,
  263. RULE_PROP_CRITERIA,
  264. RULE_PROP_ACTIONS,
  265. RULE_PROP_STATE,
  266. RULE_PROP_VERSION,
  267. RULE_PROP_READONLY,
  268. RULE_PROP_JUNKPCT,
  269. RULE_PROP_EXCPT_WAB,
  270. RULE_PROP_MAX
  271. } RULE_PROP;
  272. HRESULT Reset();
  273. const DWORD RULE_STATE_NULL = 0x00000000;
  274. const DWORD RULE_STATE_HEADER = 0x00000001;
  275. const DWORD RULE_STATE_ALL = 0x00000002;
  276. HRESULT GetState(
  277. [out] DWORD * pdwState);
  278. HRESULT Validate(
  279. [in] DWORD dwFlags);
  280. HRESULT GetProp(
  281. [in] RULE_PROP prop,
  282. [in] DWORD dwFlags,
  283. [in, out] PROPVARIANT * pvarResult);
  284. HRESULT SetProp(
  285. [in] RULE_PROP prop,
  286. [in] DWORD dwFlags,
  287. [in] PROPVARIANT * pvarValue);
  288. HRESULT Evaluate(
  289. [in] LPCSTR pszAcct,
  290. [in] MESSAGEINFO * pMsgInfo,
  291. [in] IMessageFolder * pFolder,
  292. [in] IMimePropertySet * pIMPropSet,
  293. [in] IMimeMessage * pIMMsg,
  294. [in] ULONG cbMsgSize,
  295. [out] ACT_ITEM ** ppActions,
  296. [out] ULONG * pcActions);
  297. HRESULT LoadReg(
  298. [in] LPCSTR szRegPath);
  299. HRESULT SaveReg(
  300. [in] LPCSTR szRegPath,
  301. [in] BOOL fClearDirty);
  302. HRESULT Clone(
  303. [out] IOERule ** ppIRule);
  304. };
  305. //---------------------------------------------------------------------------
  306. // Interface IOECriteria
  307. //---------------------------------------------------------------------------
  308. [
  309. object,
  310. uuid(626bafe8-e5d6-11d1-b1dd-006097d503d9),
  311. pointer_default(unique),
  312. version(1.0)
  313. ]
  314. interface IOECriteria : IUnknown
  315. {
  316. typedef enum tagCRIT_TYPE
  317. {
  318. CRIT_TYPE_NULL = 0,
  319. CRIT_TYPE_NEWSGROUP,
  320. CRIT_TYPE_TOME,
  321. CRIT_TYPE_CCME,
  322. CRIT_TYPE_BCCME,
  323. CRIT_TYPE_TOADDR,
  324. CRIT_TYPE_CCADDR,
  325. CRIT_TYPE_FROMADDR,
  326. CRIT_TYPE_SUBJECT,
  327. CRIT_TYPE_BODY,
  328. CRIT_TYPE_TO,
  329. CRIT_TYPE_CC,
  330. CRIT_TYPE_FROM,
  331. CRIT_TYPE_PRIORITY,
  332. CRIT_TYPE_ATTACH,
  333. CRIT_TYPE_SIZE,
  334. CRIT_TYPE_DATE,
  335. CRIT_TYPE_HEADER,
  336. CRIT_TYPE_JUNK,
  337. CRIT_TYPE_ACCOUNT,
  338. CRIT_TYPE_ALL,
  339. CRIT_TYPE_TOORCCADDR,
  340. CRIT_TYPE_TOORCC,
  341. CRIT_TYPE_SENDER,
  342. CRIT_TYPE_REPLIES,
  343. CRIT_TYPE_DOWNLOADED,
  344. CRIT_TYPE_DELETED,
  345. CRIT_TYPE_THREADSTATE,
  346. CRIT_TYPE_READ,
  347. CRIT_TYPE_LINES,
  348. CRIT_TYPE_AGE,
  349. CRIT_TYPE_SECURE,
  350. CRIT_TYPE_FLAGGED,
  351. CRIT_TYPE_MAX
  352. } CRIT_TYPE;
  353. const DWORD CRIT_FLAG_DEFAULT = 0x00000000;
  354. const DWORD CRIT_FLAG_INVERT = 0x00000001;
  355. const DWORD CRIT_FLAG_MULTIPLEAND = 0x00000002;
  356. const DWORD CRIT_DATA_IGNORETHREAD = 0x00000002;
  357. const DWORD CRIT_DATA_WATCHTHREAD = 0x00000001;
  358. const DWORD CRIT_DATA_NORMALTHREAD = 0x00000000;
  359. const DWORD CRIT_DATA_HIPRI = 0x00000002;
  360. const DWORD CRIT_DATA_LOPRI = 0x00000001;
  361. const DWORD CRIT_DATA_NORMALPRI = 0x00000000;
  362. const DWORD CRIT_DATA_ENCRYPTSECURE = 0x00000002;
  363. const DWORD CRIT_DATA_SIGNEDSECURE = 0x00000001;
  364. const DWORD CRIT_DATA_NOSECURE = 0x00000000;
  365. typedef enum tagCRIT_LOGIC
  366. {
  367. CRIT_LOGIC_NULL = 0,
  368. CRIT_LOGIC_OR,
  369. CRIT_LOGIC_AND,
  370. CRIT_LOGIC_MAX
  371. } CRIT_LOGIC;
  372. typedef struct tagCRIT_ITEM
  373. {
  374. CRIT_TYPE type;
  375. DWORD dwFlags;
  376. PROPVARIANT propvar;
  377. CRIT_LOGIC logic;
  378. } CRIT_ITEM, * PCRIT_ITEM;
  379. HRESULT Reset();
  380. const DWORD CRIT_STATE_NULL = 0x00000000;
  381. const DWORD CRIT_STATE_DIRTY = 0x00000001;
  382. const DWORD CRIT_STATE_LOADED = 0x00000002;
  383. const DWORD CRIT_STATE_HEADER = 0x00010000;
  384. const DWORD CRIT_STATE_ALL = 0x00020000;
  385. const DWORD CRIT_STATE_MASK = 0x00FF0000;
  386. HRESULT GetState(
  387. [out] DWORD * pdwState);
  388. HRESULT GetCriteria(
  389. [in] DWORD dwFlags,
  390. [out] PCRIT_ITEM * ppItem,
  391. [out] ULONG * pcItem);
  392. HRESULT SetCriteria(
  393. [in] DWORD dwFlags,
  394. [in] CRIT_ITEM * pItem,
  395. [in] ULONG cItem);
  396. HRESULT Validate(
  397. [in] DWORD dwFlags);
  398. HRESULT AppendCriteria(
  399. [in] DWORD dwFlags,
  400. [in] CRIT_LOGIC logic,
  401. [in] CRIT_ITEM * pItem,
  402. [in] ULONG cItem,
  403. [out] ULONG * pcItemAppended);
  404. HRESULT MatchMessage(
  405. [in] LPCSTR pszAcct,
  406. [in] MESSAGEINFO * pMsgInfo,
  407. [in] IMessageFolder * pFolder,
  408. [in] IMimePropertySet * pIMPropSet,
  409. [in] IMimeMessage * pIMMsg,
  410. [in] ULONG cbMsgSize);
  411. HRESULT LoadReg(
  412. [in] LPCSTR szRegPath);
  413. HRESULT SaveReg(
  414. [in] LPCSTR szRegPath,
  415. [in] BOOL fClearDirty);
  416. HRESULT Clone(
  417. [out] IOECriteria ** ppICriteria);
  418. };
  419. //---------------------------------------------------------------------------
  420. // Interface IOEActions
  421. //---------------------------------------------------------------------------
  422. [
  423. object,
  424. uuid(626bafea-e5d6-11d1-b1dd-006097d503d9),
  425. pointer_default(unique),
  426. version(1.0)
  427. ]
  428. interface IOEActions : IUnknown
  429. {
  430. const DWORD ACT_DATA_NULL = 0x00000000;
  431. const DWORD ACT_DATA_WATCHTHREAD = 0x00000001;
  432. const DWORD ACT_DATA_IGNORETHREAD = 0x00000002;
  433. const DWORD ACT_DATA_SHOW = 0x00000001;
  434. const DWORD ACT_DATA_HIDE = 0x00000002;
  435. HRESULT Reset();
  436. const DWORD ACT_STATE_NULL = 0x00000000;
  437. const DWORD ACT_STATE_DIRTY = 0x00000100;
  438. const DWORD ACT_STATE_LOADED = 0x00000200;
  439. const DWORD ACT_STATE_SERVER = 0x01000000;
  440. const DWORD ACT_STATE_LOCAL = 0x02000000;
  441. const DWORD ACT_STATE_MASK = 0xFF000000;
  442. HRESULT GetState(
  443. [out] DWORD * pdwState);
  444. HRESULT GetActions(
  445. [in] DWORD dwFlags,
  446. [out] PACT_ITEM * ppItem,
  447. [out] ULONG * pcItem);
  448. HRESULT SetActions(
  449. [in] DWORD dwFlags,
  450. [in] ACT_ITEM * pItem,
  451. [in] ULONG cItem);
  452. HRESULT Validate(
  453. [in] DWORD dwFlags);
  454. HRESULT AppendActions(
  455. [in] DWORD dwFlags,
  456. [in] ACT_ITEM * pItem,
  457. [in] ULONG cItem,
  458. [out] ULONG * pcItemAppended);
  459. HRESULT LoadReg(
  460. [in] LPCSTR szRegPath);
  461. HRESULT SaveReg(
  462. [in] LPCSTR szRegPath,
  463. [in] BOOL fClearDirty);
  464. HRESULT Clone(
  465. [out] IOEActions ** ppIActions);
  466. };
  467. //---------------------------------------------------------------------------
  468. // OE Rules Type Library
  469. //---------------------------------------------------------------------------
  470. [
  471. uuid(626bafec-e5d6-11d1-b1dd-006097d503d9),
  472. version(1.0),
  473. helpstring("Microsoft Outlook Express Rules Type Library")
  474. ]
  475. library OERules
  476. {
  477. importlib("stdole2.tlb");
  478. [
  479. uuid(626bafe1-e5d6-11d1-b1dd-006097d503d9),
  480. ]
  481. coclass OERulesManager
  482. {
  483. [default] interface IOERulesManager;
  484. };
  485. [
  486. uuid(626bafe3-e5d6-11d1-b1dd-006097d503d9),
  487. ]
  488. coclass OEEnumRules
  489. {
  490. [default] interface IOEEnumRules;
  491. };
  492. [
  493. uuid(626bafe5-e5d6-11d1-b1dd-006097d503d9),
  494. ]
  495. coclass OEExecRules
  496. {
  497. [default] interface IOEExecRules;
  498. };
  499. [
  500. uuid(626bafe7-e5d6-11d1-b1dd-006097d503d9),
  501. ]
  502. coclass OERule
  503. {
  504. [default] interface IOERule;
  505. interface IPersistStream;
  506. };
  507. [
  508. uuid(626bafe9-e5d6-11d1-b1dd-006097d503d9),
  509. ]
  510. coclass OECriteria
  511. {
  512. [default] interface IOECriteria;
  513. interface IPersistStream;
  514. };
  515. [
  516. uuid(626bafeb-e5d6-11d1-b1dd-006097d503d9),
  517. ]
  518. coclass OEActions
  519. {
  520. [default] interface IOEActions;
  521. interface IPersistStream;
  522. };
  523. };