head	1.3;
access;
symbols
	V0-99-8:1.3
	V0-99-7:1.2;
locks; strict;
comment	@ * @;


1.3
date	96.08.13.03.46.40;	author brydon;	state Exp;
branches;
next	1.2;

1.2
date	95.11.07.22.52.03;	author brydon;	state Exp;
branches;
next	1.1;

1.1
date	95.09.27.21.54.17;	author brydon;	state Exp;
branches;
next	;


desc
@Support routines to implement killfile support
@


1.3
log
@add support for killfiles
@
text
@/*
 * $Id: wvclass.h 1.2 1995/11/07 22:52:03 brydon Exp $
 */

/*
 *
 *  WinVN C++ class definitions
 *
 */

#ifndef WVCLASS_H
#define WVCLASS_H

// Action/Killfile constants
#define AA_NOACTION_MASK               1
#define AA_LT_MASK                     2
#define AA_EQ_MASK                     3
#define AA_GT_MASK                     4
#define AA_IS_MASK                     5
#define AA_CONTAINS_MASK               6
#define AA_SELECT_MASK            0x1000
#define AA_MODULO                 0x0010

#define NO_ACTION                      1
#define MARK_SEEN_ART_LINES_BASE       1 * AA_MODULO  // 0x10/16
#define MARK_SEEN_ART_LINES_LT          MARK_SEEN_ART_LINES_BASE + AA_LT_MASK
#define MARK_SEEN_ART_LINES_EQ          MARK_SEEN_ART_LINES_BASE + AA_EQ_MASK
#define MARK_SEEN_ART_LINES_GT          MARK_SEEN_ART_LINES_BASE + AA_GT_MASK
#define MARK_SEEN_ART_FROM_BASE        2 * AA_MODULO  // 0x20/32
#define MARK_SEEN_ART_FROM_IS           MARK_SEEN_ART_FROM_BASE + AA_IS_MASK
#define MARK_SEEN_ART_FROM_CONTAINS     MARK_SEEN_ART_FROM_BASE + AA_CONTAINS_MASK
#define MARK_SEEN_ART_EMAIL_BASE       3 * AA_MODULO  // 0x30/48
#define MARK_SEEN_ART_EMAIL_IS          MARK_SEEN_ART_EMAIL_BASE + AA_IS_MASK
#define MARK_SEEN_ART_EMAIL_CONTAINS    MARK_SEEN_ART_EMAIL_BASE + AA_CONTAINS_MASK
#define MARK_SEEN_ART_SUBJ_BASE        4 * AA_MODULO  // 0x40/64
#define MARK_SEEN_ART_SUBJ_IS           MARK_SEEN_ART_SUBJ_BASE + AA_IS_MASK
#define MARK_SEEN_ART_SUBJ_CONTAINS     MARK_SEEN_ART_SUBJ_BASE + AA_CONTAINS_MASK
#define MARK_SEEN_ART_MSGID_BASE       5 * AA_MODULO  // 0x50/80
#define MARK_SEEN_ART_MSGID_IS          MARK_SEEN_ART_MSGID_BASE + AA_IS_MASK
#define MARK_SEEN_ART_MSGID_CONTAINS    MARK_SEEN_ART_MSGID_BASE + AA_CONTAINS_MASK
#define MARK_SEEN_ART_REF_BASE         6 * AA_MODULO  // 0x60/96
//#define MARK_SEEN_ART_REF_IS            MARK_SEEN_ART_REF_BASE + AA_IS_MASK
#define MARK_SEEN_ART_REF_CONTAINS      MARK_SEEN_ART_REF_BASE + AA_CONTAINS_MASK
#define MARK_SEEN_NGROUP_BASE          7 * AA_MODULO  // 0x70/112
//#define MARK_SEEN_NGROUP_IS             MARK_SEEN_NGROUP_BASE + AA_IS_MASK
#define MARK_SEEN_NGROUP_CONTAINS       MARK_SEEN_NGROUP_BASE + AA_CONTAINS_MASK
#define SELECT_ART_LINES_BASE           AA_SELECT_MASK + MARK_SEEN_ART_LINES_BASE
#define SELECT_ART_LINES_LT             AA_SELECT_MASK + MARK_SEEN_ART_LINES_LT
#define SELECT_ART_LINES_EQ             AA_SELECT_MASK + MARK_SEEN_ART_LINES_EQ
#define SELECT_ART_LINES_GT             AA_SELECT_MASK + MARK_SEEN_ART_LINES_GT
#define SELECT_ART_FROM_BASE            AA_SELECT_MASK + MARK_SEEN_ART_FROM_BASE
#define SELECT_ART_FROM_IS              AA_SELECT_MASK + MARK_SEEN_ART_FROM_IS
#define SELECT_ART_FROM_CONTAINS        AA_SELECT_MASK + MARK_SEEN_ART_FROM_CONTAINS
#define SELECT_ART_EMAIL_BASE           AA_SELECT_MASK + MARK_SEEN_ART_EMAIL_BASE
#define SELECT_ART_EMAIL_IS             AA_SELECT_MASK + MARK_SEEN_ART_EMAIL_IS
#define SELECT_ART_EMAIL_CONTAINS       AA_SELECT_MASK + MARK_SEEN_ART_EMAIL_CONTAINS
#define SELECT_ART_SUBJ_BASE            AA_SELECT_MASK + MARK_SEEN_ART_SUBJ_BASE
#define SELECT_ART_SUBJ_IS              AA_SELECT_MASK + MARK_SEEN_ART_SUBJ_IS
#define SELECT_ART_SUBJ_CONTAINS        AA_SELECT_MASK + MARK_SEEN_ART_SUBJ_CONTAINS
#define SELECT_ART_MSGID_BASE           AA_SELECT_MASK + MARK_SEEN_ART_MSGID_BASE
#define SELECT_ART_MSGID_IS             AA_SELECT_MASK + MARK_SEEN_ART_MSGID_IS
#define SELECT_ART_MSGID_CONTAINS       AA_SELECT_MASK + MARK_SEEN_ART_MSGID_CONTAINS
#define SELECT_ART_REF_BASE             AA_SELECT_MASK + MARK_SEEN_ART_REF_BASE
//#define SELECT_ART_REF_IS               AA_SELECT_MASK + MARK_SEEN_ART_REF_IS
#define SELECT_ART_REF_CONTAINS         AA_SELECT_MASK + MARK_SEEN_ART_REF_CONTAINS
#define SELECT_NGROUP_BASE              AA_SELECT_MASK + MARK_SEEN_NGROUP_BASE
//#define SELECT_NGROUP_IS                AA_SELECT_MASK + MARK_SEEN_NGROUP_IS
#define SELECT_NGROUP_CONTAINS          AA_SELECT_MASK + MARK_SEEN_NGROUP_CONTAINS

typedef struct tag_ad
{
  int iAction;
  long int iParam;
  char *sParam;
} ACTIONDATA, FAR *LPACTIONDATA;

struct Node
{
  Node * Flink;
  Node * Blink;
  ACTIONDATA ad;
};

// WVArticleAction - 'killfile' et al
class WVArticleAction
{
public:
protected:
  Node *m_Head;
  Node *m_Tail;
  Node *m_Current;
  char m_ProfSect[128];
private:
public:
  WVArticleAction();
  WVArticleAction(WVArticleAction*wv);
  ~WVArticleAction();
  void SetIParam(int i);
  void SetParamText(char*sP);
  void ResetCurrent(){m_Current = m_Head;};
  void ReadActions(char*sGroup);
  void WriteActions();
  Node*GetCurrent(){return m_Current;};
  void Append(int iA, long int iP, char*sP);
  void DeleteNode(Node* pN);
  void DeleteAll();
  void GoToNext();
  void GoToPrev();
  void Switch(Node*nA, Node*nB);
  void Switchwith(WVArticleAction*nB);
  void ActOnArticles(TypGroup far *Group, header_p headers);
  BOOL NeedNgroupHeader();
protected:
private:
};

extern WVArticleAction g_action;

#endif /* WVCLASS_H  */
@


1.2
log
@Added low level support for KillFiles
@
text
@d2 1
a2 1
 * $Id: wvclass.h,v 1.1 1995/09/27 21:54:17 brydon Exp $
a13 6
#ifdef _DEBUG
#define DEBUG_BREAK _asm { int 3 }
#else
#define DEBUG_BREAK
#endif

d15 54
a68 10
#define SEEN_ART_LT             10
#define SEEN_ART_EQ             11
#define SEEN_ART_GT             12
#define SEEN_ART_FROM_IS        20
#define SEEN_ART_FROM_CONTAINS  21
#define SEEN_ART_SUBJ_IS        30
#define SEEN_ART_SUBJ_CONTAINS  31
#define SEEN_ART_MSGID_IS       40
#define SEEN_ART_MSGID_CONTAINS 41
#define SEEN_ART_REF_CONTAINS   51
a69 1
// Superset of 'killfile'
d77 8
d87 1
a87 1
private:
a88 5
  struct Node
  {
    ACTIONDATA ad;
    Node * Next;
  };
a92 1
public:
a93 1
protected:
d96 1
d98 6
d105 1
a106 1
  void ResetCurrent(){m_Current = m_Head;};
d108 3
a110 3
  ACTIONDATA*GetCurrent(){return m_Current ? &(m_Current->ad) : NULL;};
  void ReadActions(char*sGroup);
  void WriteActions();
d112 3
d119 1
a119 7
#endif WVCLASS_H

//
// Local variables:
// tab-width: 4
// end:
//
@


1.1
log
@Initial revision
@
text
@d1 77
a77 77
/*
 * $Id: wvclass.h 1.01 1995/09/27 23:34:16 dumoulin Exp $
 */

/*
 *
 *  WinVN C++ class definitions
 *
 */

#ifndef WVCLASS_H
#define WVCLASS_H

#ifdef _DEBUG
#define DEBUG_BREAK _asm { int 3 }
#else
#define DEBUG_BREAK
#endif

// Action/Killfile constants
#define SEEN_ART_LT             10
#define SEEN_ART_EQ             11
#define SEEN_ART_GT             12
#define SEEN_ART_FROM_IS        20
#define SEEN_ART_FROM_CONTAINS  21
#define SEEN_ART_SUBJ_IS        30
#define SEEN_ART_SUBJ_CONTAINS  31
#define SEEN_ART_MSGID_IS       40
#define SEEN_ART_MSGID_CONTAINS 41
#define SEEN_ART_REF_CONTAINS   51

// Superset of 'killfile'
typedef struct tag_ad
{
  int iAction;
  long int iParam;
  char *sParam;
} ACTIONDATA, FAR *LPACTIONDATA;

class WVArticleAction
{
private:
protected:
  struct Node
  {
    ACTIONDATA ad;
    Node * Next;
  };
  Node *m_Head;
  Node *m_Tail;
  Node *m_Current;
  char m_ProfSect[128];
public:
private:
protected:
public:
  WVArticleAction();
  ~WVArticleAction();
  void Append(int iA, long int iP, char*sP);
  void DeleteAll();
  void ResetCurrent(){m_Current = m_Head;};
  void GoToNext();
  ACTIONDATA*GetCurrent(){return m_Current ? &(m_Current->ad) : NULL;};
  void ReadActions(char*sGroup);
  void WriteActions();
  void ActOnArticles(TypGroup far *Group, header_p headers);
};

extern WVArticleAction g_action;

#endif WVCLASS_H

//
// Local variables:
// tab-width: 4
// end:
//
@
