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.

69 lines
2.4 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Criteria.h
  4. //
  5. ///////////////////////////////////////////////////////////////////////////////
  6. #ifndef _CRITERIA_H_
  7. #define _CRITERIA_H_
  8. // Bring in only once
  9. #if _MSC_VER > 1000
  10. #pragma once
  11. #endif
  12. #include "oerules.h"
  13. class COECriteria : public IOECriteria, IPersistStream
  14. {
  15. private:
  16. enum {CRIT_COUNT_MIN = 0, CRIT_COUNT_MAX = 0x1000};
  17. enum {CCH_CRIT_ORDER = 4};
  18. enum {CRIT_VERSION = 0x00050000};
  19. private:
  20. LONG m_cRef;
  21. CRIT_ITEM * m_rgItems;
  22. ULONG m_cItems;
  23. ULONG m_cItemsAlloc;
  24. DWORD m_dwState;
  25. public:
  26. // Constructor/destructor
  27. COECriteria() : m_cRef(0), m_rgItems(NULL), m_cItems(0), m_cItemsAlloc(0), m_dwState(0) {}
  28. ~COECriteria();
  29. // IUnknown members
  30. STDMETHODIMP QueryInterface(REFIID riid, void ** ppvObject);
  31. STDMETHODIMP_(ULONG) AddRef(void);
  32. STDMETHODIMP_(ULONG) Release(void);
  33. // IOECriteria members
  34. STDMETHODIMP Reset(void);
  35. STDMETHODIMP GetState(DWORD * pdwState);
  36. STDMETHODIMP GetCriteria(DWORD dwFlags, PCRIT_ITEM * ppItem, ULONG * pcItem);
  37. STDMETHODIMP SetCriteria(DWORD dwFlags, CRIT_ITEM * pItem, ULONG cItem);
  38. STDMETHODIMP Validate(DWORD dwFlags);
  39. STDMETHODIMP AppendCriteria(DWORD dwFlags, CRIT_LOGIC logic, CRIT_ITEM * pItem,
  40. ULONG cItem, ULONG * pcItemAppended);
  41. STDMETHODIMP MatchMessage(LPCSTR pszAcct, MESSAGEINFO * pMsgInfo,
  42. IMessageFolder * pFolder, IMimePropertySet * pIMPropSet,
  43. IMimeMessage * pIMMsg, ULONG cbMsgSize);
  44. STDMETHODIMP LoadReg(LPCSTR szRegPath);
  45. STDMETHODIMP SaveReg(LPCSTR szRegPath, BOOL fClearDirty);
  46. STDMETHODIMP Clone(IOECriteria ** ppICriteria);
  47. // IPersistStream members
  48. STDMETHODIMP GetClassID(CLSID * pclsid);
  49. STDMETHODIMP IsDirty(void);
  50. STDMETHODIMP Load(IStream * pStm);
  51. STDMETHODIMP Save(IStream * pStm, BOOL fClearDirty);
  52. STDMETHODIMP GetSizeMax(ULARGE_INTEGER * pcbSize) { return E_NOTIMPL; }
  53. };
  54. HRESULT HrCreateCriteria(IOECriteria ** ppICriteria);
  55. #endif // !_CRITERIA_H_