1
2 // ------------------------------------------------------------------
3 // GoldED+
4 // Copyright (C) 1990-1999 Odinn Sorensen
5 // Copyright (C) 1999-2000 Alexander S. Aganichev
6 // ------------------------------------------------------------------
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 // MA 02111-1307 USA
21 // ------------------------------------------------------------------
22 // $Id: gmarea.h,v 1.34 2011/03/14 02:56:12 stas_degteff Exp $
23 // ------------------------------------------------------------------
24 // Area structures and classes.
25 // ------------------------------------------------------------------
26
27 #ifndef __GMAREA_H
28 #define __GMAREA_H
29
30
31 // ------------------------------------------------------------------
32
33 #include <vector>
34 #include <gecfgg.h>
35 #include <gmoarea.h>
36
37
38 // ------------------------------------------------------------------
39 // Internal GoldED message header
40
41 class GMsg : public gmsg {
42
43 public:
44
45 IAdr iorig; // Internet "From:" header address
46 IAdr idest; // Internet "To:" header address
47 IAdr ireplyto; // Internet "Reply-To:" header address
48 IAdr iaddr; // Internet destination address (from ^aREPLYADDR)
49 IAdr igate; // Internet gate FTN-address and gatename (from ^aREPLYTO)
50 INam ifrom; // Internet "From:" header
51 char ito[512]; // Internet "To:" header
52 char icc[512]; // Internet "Cc:" header
53 char ibcc[512]; // Internet "Bcc:" header
54 INam organization; // Internet "Organization:" header
55
56 INam realby; // Real from-name
57 INam realto; // Real to-name
58 INam pseudoto; // Pseudo to-name
59 INam pseudofrom; // Pseudo from-name
60 uint you_and_I; // Mail was to/from me/you
61
62 INam fwdfrom; // FWDFROM kludge
63 ftn_addr fwdorig; // FWDORIG kludge
64 INam fwdto; // FWDTO kludge
65 ftn_addr fwddest; // FWDDEST kludge
66 Subj fwdsubj; // FWDSUBJ kludge
67 Echo fwdarea; // FWDAREA kludge
68 char fwdmsgid[201]; // FWDMSGID kludge
69
70 bool i51; // true if I51 kludge was found
71 char charset[100]; // Charset type
72 int charsetlevel; // Charset level
73 int charsetencoding; // Charset encoding format (GCHENC_*)
74
75 int tzutc; // TZUTC kludge
76
77 char tagline[80]; // Tagline for msg
78 char tearline[80]; // Tearline for msg
79 char origin[160]; // Origin for msg
80
81 Line* lin; // Index of the lines
82 Line** line; // Index of the viewable lines
83 int lines; // Total number of lines
84
85 int quotepct; // Quote/text percentage
86
87 uint foundwhere; // Where searched string was found (GFIND_*)
88 int foundtopline; // First line where a searched string was found
89
90 uint orig_timesread;
91
92 char* messageid; // Internet Message-ID (allocated)
93 char* inreplyto; // Internet In-Reply-To (allocated)
94 char* references; // Internet References (allocated)
95
96 const char* areakludgeid; // Echoid from AREA: kludge or NULL
97
By()98 char* By() { return *realby ? realby : by; }
To()99 char* To() { return *realto ? realto : to; }
100
to_me()101 bool to_me() { return make_bool(you_and_I & TO_ME ); }
to_all()102 bool to_all() { return make_bool(you_and_I & TO_ALL); }
by_me()103 bool by_me() { return make_bool(you_and_I & BY_ME ); }
to_you()104 bool to_you() { return make_bool(you_and_I & TO_YOU); }
by_you()105 bool by_you() { return make_bool(you_and_I & BY_YOU); }
106
107 void TextToLines(int __line_width, bool getvalue = true, bool header_recode = true);
108 void LinesToText();
109 };
110
111
112 // ------------------------------------------------------------------
113
114 class GAreaListScan {
115
116 private:
117
118 std::vector< std::pair<std::string, std::string> > container;
119 std::vector< std::pair<std::string, std::string> >::iterator currposn;
120
121 public:
122
GAreaListScan()123 inline GAreaListScan() { currposn = container.end(); }
~GAreaListScan()124 inline ~GAreaListScan() {}
125
Add(std::pair<std::string,std::string> p)126 inline void Add(std::pair<std::string, std::string> p) { container.push_back(p); currposn = container.end(); }
127
Reset()128 inline void Reset() { container.clear(); currposn = container.end(); }
129
First()130 inline bool First() { currposn = container.begin(); return currposn != container.end(); }
Next()131 inline bool Next() { currposn++; return currposn != container.end(); }
132
CurrNo(int posn)133 inline void CurrNo(int posn) { First(); while(posn--) if(not Next()) break; }
134
MenuText()135 inline const char* MenuText() { return currposn != container.end() ? currposn->first.c_str() : ""; }
File()136 inline const char* File() { return currposn != container.end() ? currposn->second.c_str() : ""; }
137
MenuText(unsigned i)138 inline const char* MenuText(unsigned i) { return i < container.size() ? container[i].first.c_str() : ""; }
File(unsigned i)139 inline const char* File(unsigned i) { return i < container.size() ? container[i].second.c_str() : ""; }
140 };
141
142
143 // ------------------------------------------------------------------
144
145 const word CUR_GOLDLAST_VER = 0x1A02;
146
147 #if defined(GOLD_CANPACK)
148 #pragma pack(1)
149 #endif
150
151 struct ggoldlast {
152 dword crcechoid;
153 dword lastread;
154 dword msgncount;
155 dword unread;
156 word marks;
157
158 byte flags;
159 };
160
161 #if defined(GOLD_CANPACK)
162 #pragma pack()
163 #endif
164
165
166 // ------------------------------------------------------------------
167 // Arealist class
168
169 class Area;
170
171 typedef std::vector<Area *>::iterator area_iterator;
172
173 class AreaList {
174
175 private:
176
177 Desc alistselections[16];
178 byte mask;
179
180 friend class Area;
181 friend class SelMaskPick;
182
183 public:
184
185 // Index of areas in the list
186 std::vector<Area *> idx;
187
188 // Area pointer
189 area_iterator item;
190
191 // Sort specs (for external compare func)
192 char sortspec[AREALISTSORTSIZE];
193
194 // Active msgbases (bitmap of MT_* contants)
195 std::vector<std::string> basetypes;
196
197 // Additional items to the area scan menu
198 GAreaListScan ListScan;
199
200 // void Set_Mask(word value = 1) { mask = value; }
201 void Select_Mask(void);
202
203 // Con/destructor
204 AreaList();
205 ~AreaList();
206
207 // Subscript operator, returns pointer to area
208 inline Area* operator[](size_t n) { return (n < idx.size()) ? idx[n] : (Area*)NULL; }
size()209 inline size_t size() { return idx.size(); }
210
211 // Allocate and initialize data
212 void Init();
213
214 // Deallocate and reset data
215 void Reset();
216
217 // Return pointer to a new'd area of the specified format
218 Area* NewArea(const char *basetype);
219 Area* NewArea(const std::string &basetype);
220
221 // Sort areas
222 void Sort(const char* specs=NULL, int first=0, int last=-1);
223
224 // Default marks names
225 void SetDefaultMarks();
226
227 // Read/write GOLDLAST.LST
228 void ReadGoldLast();
229 void WriteGoldLast();
230
231 // Miscellaneous
232 void AddNewArea(AreaCfg* aa);
233 int AreaIdToNo(int __areaid);
234 Area* AreaIdToPtr(int __areaid);
235 int AreaNoToId(int __areano);
236 Area* AreaNoToPtr(int __areano);
237 int AreaScan(int mode, uint currno, int pmscan, int& pmails, int& pmareas, const char* file=NULL);
238 int AreaEchoToNo(const char* echoid);
239 Area* AreaEchoToPtr(const char* echoid);
240 void GetAreafile(char* val);
241 void GetArea(char* val);
242 bool GetAreaFirstPart(AreaCfg& aa, char*& key, char*& val);
243 void GetAreaDef(char* val);
244 void GetAreaSep(char* val);
245 void GetAreaDesc(char* val);
246 void ReadEcholist(char* val);
247 int SetActiveAreaId(int __areaid);
248 int SetActiveAreaNo(int __areano);
249 void SetAreaDesc(char* echoid, char* desc);
250 void SortAreaGroup(const char* options, int beginarea, int endarea);
251 void WriteAreaDef(const char* file);
252 };
253
254
255 // ------------------------------------------------------------------
256 // Msgbase function prototypes
257
258 int AreaCmp(const Area** __a, const Area** __b);
259
260
261 // ------------------------------------------------------------------
262 // Area data (collected from global/Random System)
263
264 struct AreaData
265 {
AreaDataAreaData266 AreaData()
267 {
268 akamatching = false;
269 areacopyaddid = false;
270 areacopydirect = false;
271 areaforwarddirect = false;
272 areafreqdirect = false;
273 areareplydirect = false;
274 dispsoftcr = false;
275 edithardterm = false;
276 editmixcase = false;
277 forcetemplate = false;
278 hidestylies = false;
279 usestylies = false;
280 internetmsgid = false;
281 msglistfast = false;
282 msglistfirst = false;
283 msglistheader = false;
284 msglistwidesubj = false;
285 quotewraphard = false;
286 taglinesupport = false;
287 templatematch = false;
288 usearea = false;
289 usesoftcrxlat = false;
290 usetzutc = false;
291 inittwit = false;
292 viewhidden = false;
293 viewkludge = false;
294 viewquote = false;
295 striphtml = false;
296
297 ctrlinfo = 0;
298 internetrfcbody = 0;
299 msglistdate = 0;
300 quotectrl = 0;
301 replyre = 0;
302 usefwd = 0;
303 twitmode = 0;
304 writeheader = 0;
305
306 taglinechar = 0;
307
308 memset(origin, 0, sizeof(origin));
309 memset(quotechars, 0, sizeof(quotechars));
310 memset(quotestring, 0, sizeof(quotestring));
311 memset(quotestops, 0, sizeof(quotestops));
312 #if defined(GCFG_SPELL_INCLUDED)
313 memset(scheckerdeflang, 0, sizeof(scheckerdeflang));
314 #endif
315 memset(tagline, 0, sizeof(tagline));
316 memset(areacopyto, 0, sizeof(areacopyto));
317 memset(areafreqto, 0, sizeof(areafreqto));
318 memset(areareplyto, 0, sizeof(areareplyto));
319 memset(areayouwroteto, 0, sizeof(areayouwroteto));
320 memset(loadlanguage, 0, sizeof(loadlanguage));
321 memset(quotebuffile, 0, sizeof(quotebuffile));
322 memset(tpl, 0, sizeof(tpl));
323 memset(wtpl, 0, sizeof(wtpl));
324 memset(inputfile, 0, sizeof(inputfile));
325 memset(outputfile, 0, sizeof(outputfile));
326 memset(internetaddress, 0, sizeof(internetaddress));
327 memset(whoto, 0, sizeof(whoto));
328 memset(nickname, 0, sizeof(nickname));
329 memset(netname, 0, sizeof(netname));
330 memset(organization, 0, sizeof(organization));
331 memset(searchfor, 0, sizeof(searchfor));
332 memset(tearline, 0, sizeof(tearline));
333 memset(xlatexport, 0, sizeof(xlatexport));
334 memset(xlatimport, 0, sizeof(xlatimport));
335
336 //classes
337 memset(&aka, 0, sizeof(aka));
338 memset(&attributes, 0, sizeof(attributes));
339 memset(&internetgate, 0, sizeof(internetgate));
340 memset(&play, 0, sizeof(play));
341 memset(&username, 0, sizeof(username));
342 }
343
344 // Area
345 gaka aka;
346 bool akamatching;
347 Attr attributes;
348 bool areacopyaddid;
349 bool areacopydirect;
350 Echo areacopyto;
351 bool areaforwarddirect;
352 bool areafreqdirect;
353 Echo areafreqto;
354 bool areareplydirect;
355 Echo areareplyto;
356 Echo areayouwroteto;
357 int ctrlinfo;
358 bool dispsoftcr;
359 bool edithardterm;
360 bool editmixcase;
361 bool forcetemplate;
362 bool hidestylies;
363 bool usestylies;
364 IAdr internetaddress;
365 Node internetgate;
366 bool internetmsgid;
367 int internetrfcbody;
368 Path loadlanguage;
369 int msglistdate;
370 bool msglistfast;
371 bool msglistfirst;
372 bool msglistheader;
373 bool msglistwidesubj;
374 Name nickname;
375 Name netname;
376 INam organization;
377 char origin[160];
378 Path quotebuffile;
379 char quotechars[11];
380 int quotectrl;
381 char quotestring[10];
382 char quotestops[41];
383 bool quotewraphard;
384 GPlay play;
385 int replyre;
386 #if defined(GCFG_SPELL_INCLUDED)
387 char scheckerdeflang[10240];
388 #endif
389 char tagline[76];
390 char taglinechar;
391 bool taglinesupport;
392 Tear tearline;
393 Path tpl;
394 bool templatematch;
395 bool usearea;
396 int usefwd;
397 Node username;
398 bool usesoftcrxlat;
399 bool usetzutc;
400 IAdr whoto;
401 Path wtpl;
402 XlatName xlatexport;
403 XlatName xlatimport;
404
405 // Reader
406 Path inputfile;
407 Path outputfile;
408 INam searchfor;
409 int twitmode;
410 bool inittwit;
411 std::vector<Node> twitname;
412 gstrarray twitsubj;
413 bool viewhidden;
414 bool viewkludge;
415 bool viewquote;
416 bool striphtml;
417 int writeheader;
418 };
419
420 // ------------------------------------------------------------------
421
422 extern AreaList AL;
423
424
425 // ------------------------------------------------------------------
426 // Area information structures
427
428 class Area {
429
430 private:
431
432 bool findfirst;
433 uint findtype; //1 - FindAll, 2 - FindHdr
434 word marks; // storing 16 different marks
435
436 friend class AreaList;
437
438 public:
439
440 // ----------------------------------------------------------------
441 // Config data
442
443 gmo_area* area;
444 AreaData* adat;
445
446
447 // ----------------------------------------------------------------
448 // Constructor and destructor
449
450 Area(gmo_area* a);
451 virtual ~Area();
452
453
454 // ----------------------------------------------------------------
455 // Data members
456
457 GTag Msgn; // Message numbers
458 GTag Mark; // Message marks
459 GTag PMrk; // Personal mail marks
460 GTag Expo; // Messages to be exported
461
462 uint32_t bookmark; // Current bookmark message number
463
464 uint unread; // Number of unread messages at last scan
465
466 uint lastread() const; // Number of last message read
467 uint32_t lastreadentry() const; // Lastread message number at entry to area
468
469 void set_lastread(uint lr);
470
set_findfirst(bool ff)471 void set_findfirst(bool ff) { findfirst = ff; }
set_findtype(uint ft)472 void set_findtype(uint ft) { findtype = ft; }
get_findfirst()473 bool get_findfirst() { return findfirst; }
get_findtype()474 uint get_findtype() { return findtype; }
475
isopen()476 bool isopen() { return make_bool(area->isopen); }
477
478 bool isunreadchg : 1; // TRUE if unread was changed since last scan
479 bool isreadmark : 1; // TRUE if in read marked mode
480 bool isreadpm : 1; // TRUE if in read personal mail mode
481 bool isvalidchg : 1; // TRUE if isunreadchg is valid
482 bool isscanned : 1; // TRUE if scanned
483 bool ispmscanned : 1; // TRUE if pmscanned
484 bool istossed : 1; // TRUE if msgs were tossed to this area
485
486
487 // ----------------------------------------------------------------
488 // Access config data
489
areaid()490 int areaid() const { return area->areaid(); }
groupid()491 int groupid() const { return area->groupid(); }
type()492 uint type() const { return area->type(); }
basetype()493 const std::string &basetype() const { return area->basetype(); }
board()494 uint board() const { return area->board(); }
aka()495 const ftn_addr& aka() const { return area->aka(); }
originno()496 int originno() const { return area->originno(); }
attr()497 Attr& attr() { return area->attr(); }
498
scan()499 bool scan() { return area->ascan(); }
scanexcl()500 bool scanexcl() { return area->ascanexcl(); }
scanincl()501 bool scanincl() { return area->ascanincl(); }
pmscan()502 bool pmscan() { return area->pmscan(); }
pmscanexcl()503 bool pmscanexcl() { return area->pmscanexcl(); }
pmscanincl()504 bool pmscanincl() { return area->pmscanincl(); }
ismarked()505 bool ismarked() const { return make_bool(marks & (1<<AL.mask)); }
506
isnewmail()507 bool isnewmail() const { return (isvalidchg and isunreadchg); }
508
echoid()509 const char* echoid() const { return area->echoid(); }
desc()510 const char* desc() const { return area->desc(); }
path()511 const char* path() const { return area->path(); }
512
set_marked(bool value)513 void set_marked(bool value) { if(value) marks |= (word)(1<<AL.mask); else marks &= (word)(~(1<<AL.mask)); }
514
set_areaid(int a)515 void set_areaid(int a) { area->set_areaid(a); }
set_groupid(int g)516 void set_groupid(int g) { area->set_groupid(g); }
set_type(uint t)517 void set_type(uint t) { area->set_type(t); }
set_basetype(const char * m)518 void set_basetype(const char *m) { area->set_basetype(m); }
set_basetype(const std::string & m)519 void set_basetype(const std::string &m) { area->set_basetype(m); }
set_board(uint b)520 void set_board(uint b) { area->set_board(b); }
set_aka(ftn_addr & a)521 void set_aka(ftn_addr& a) { area->set_aka(a); }
set_originno(int o)522 void set_originno(int o) { area->set_originno(o); }
set_attr(Attr & a)523 void set_attr(Attr& a) { area->set_attr(a); }
set_origin(char * o)524 void set_origin(char* o) { area->set_origin(o); }
525
set_scan(bool s)526 void set_scan(bool s) { area->set_scan(s); }
set_scanexcl(bool s)527 void set_scanexcl(bool s) { area->set_scanexcl(s); }
set_scanincl(bool s)528 void set_scanincl(bool s) { area->set_scanincl(s); }
set_pmscan(bool s)529 void set_pmscan(bool s) { area->set_pmscan(s); }
set_pmscanexcl(bool s)530 void set_pmscanexcl(bool s) { area->set_pmscanexcl(s); }
set_pmscanincl(bool s)531 void set_pmscanincl(bool s) { area->set_pmscanincl(s); }
532
set_echoid(const char * s)533 void set_echoid(const char* s) { area->set_echoid(s); }
set_desc(const char * s)534 void set_desc(const char* s) { area->set_desc(s); }
set_path(const char * s)535 void set_path(const char* s) { area->set_path(s); }
536
537
538 // ----------------------------------------------------------------
539 // Determine msgbase format
540 bool isseparator() const;
541
542
543 // ----------------------------------------------------------------
544 // Determine area features
545
546 bool issoftdelete() const;
547 bool havearrivedstamp() const;
548 bool havereceivedstamp() const;
549 bool requirehardterm() const;
550 bool requiresoftterm() const;
551
552
553 // ----------------------------------------------------------------
554 // Determine area type
555
556 int isnet() const;
557 int isecho() const;
558 int islocal() const;
559 int isemail() const;
560 int isnewsgroup() const;
561 int isinternet() const;
562 int isqwk() const;
563 int issoup() const;
564
565
566 // ----------------------------------------------------------------
567 // Miscellaneous
568
569 void SetBookmark(uint __relno);
570 void DeleteMsg(GMsg* msg, int direction);
571 void DelMsg(bool force = false);
572 void DelMsgs(GMsg* msg, bool force = false);
573 void SigExportlistUpdate();
574 void UpdateAreadata();
575
576 void SetHighwaterMark();
577 void ResetHighwaterMark();
578
579
580 // ----------------------------------------------------------------
581 // High-level messagebase member functions
582
583 void Open();
584 void Close();
585
586 void Suspend();
587 void Resume();
588
589 void Lock();
590 void Unlock();
591
592 void Scan();
593 void ScanArea();
594 void ScanAreaPM();
595
596 int LoadHdr(GMsg* msg, uint32_t msgno, bool enable_recode = true);
597 int LoadMsg(GMsg* msg, uint32_t msgno, int margin, int mode=0);
598
599 void SaveHdr(int mode, GMsg* msg);
600 void SaveMsg(int mode, GMsg* msg);
601
602 void DelMsg(GMsg* msg);
603
604 void NewMsgno(GMsg* msg);
605 char* UserLookup(char* lookfor);
606 int Renumber();
607
608 Line* MakeDumpMsg(GMsg* msg, char* lng_head);
609
610 void UpdateTimesread(GMsg* msg);
611
612
613 // ----------------------------------------------------------------
614 // Random System access functions
615
616 void InitData();
617 void RandomizeData(int mode=0);
618
Aka()619 const ftn_aka& Aka() const { return adat->aka; }
Akamatching()620 bool Akamatching() const { return adat->akamatching; }
Attributes()621 const Attr& Attributes() const { return adat->attributes; }
Areacopyaddid()622 bool Areacopyaddid() const { return adat->areacopyaddid; }
Areacopydirect()623 bool Areacopydirect() const { return adat->areacopydirect; }
Areacopyto()624 const char* Areacopyto() const { return adat->areacopyto; }
Areaforwarddirect()625 bool Areaforwarddirect() const{ return adat->areaforwarddirect; }
Areafreqdirect()626 bool Areafreqdirect() const { return adat->areafreqdirect; }
Areafreqto()627 const char* Areafreqto() const { return adat->areafreqto; }
Areareplydirect()628 bool Areareplydirect() const { return adat->areareplydirect; }
Areareplyto()629 const char* Areareplyto() const { return adat->areareplyto; }
Areayouwroteto()630 const char* Areayouwroteto() const { return adat->areayouwroteto; }
Ctrlinfo()631 int Ctrlinfo() const { return adat->ctrlinfo; }
Edithardterm()632 bool Edithardterm() const { return adat->edithardterm; }
Editmixcase()633 bool Editmixcase() const { return adat->editmixcase; }
Forcetemplate()634 bool Forcetemplate() const { return adat->forcetemplate; }
Inputfile()635 const char* Inputfile() const { return adat->inputfile; }
Internetaddress()636 const char* Internetaddress() const { return adat->internetaddress; }
Internetgate()637 const Node& Internetgate() const { return adat->internetgate; }
Internetmsgid()638 bool Internetmsgid() const { return adat->internetmsgid; }
Internetrfcbody()639 int Internetrfcbody() const { return adat->internetrfcbody; }
Loadlanguage()640 const char* Loadlanguage() const { return adat->loadlanguage; }
Msglistdate()641 int Msglistdate() const { return adat->msglistdate; }
Msglistfast()642 bool Msglistfast() const { return adat->msglistfast; }
Msglistfirst()643 bool Msglistfirst() const { return adat->msglistfirst; }
Msglistheader()644 bool Msglistheader() const { return adat->msglistheader; }
Msglistwidesubj()645 bool Msglistwidesubj() const { return adat->msglistwidesubj; }
Nickname()646 const char* Nickname() const { return adat->nickname; }
Netname()647 const char* Netname() const { return adat->netname; }
Organization()648 const char* Organization() const { return adat->organization; }
Origin()649 const char* Origin() const { return adat->origin; }
Outputfile()650 const char* Outputfile() const { return adat->outputfile; }
Quotebuffile()651 const char* Quotebuffile() const { return adat->quotebuffile; }
Quotechars()652 const char* Quotechars() const { return adat->quotechars; }
Quotectrl()653 int Quotectrl() const { return adat->quotectrl; }
Quotestring()654 const char* Quotestring() const { return adat->quotestring; }
Quotestops()655 const char* Quotestops() const { return adat->quotestops; }
Quotewraphard()656 bool Quotewraphard() const { return adat->quotewraphard; }
Play()657 const GPlay& Play() const { return adat->play; }
Replyre()658 const int Replyre() const { return adat->replyre; }
StripHTML()659 bool StripHTML() const { return adat->striphtml; }
Searchfor()660 const char* Searchfor() const { return adat->searchfor; }
Tagline()661 const char* Tagline() const { return adat->tagline; }
Taglinechar()662 char Taglinechar() const { return adat->taglinechar; }
Taglinesupport()663 bool Taglinesupport() const { return adat->taglinesupport; }
Tearline()664 const char* Tearline() const { return adat->tearline; }
Tpl()665 const char* Tpl() const { return adat->tpl; }
Templatematch()666 bool Templatematch() const { return adat->templatematch; }
Twitmode()667 int Twitmode() const { return adat->twitmode; }
Usearea()668 bool Usearea() const { return adat->usearea; }
Usefwd()669 int Usefwd() const { return adat->usefwd; }
Username()670 const Node& Username() const { return adat->username; }
Usetzutc()671 bool Usetzutc() const { return adat->usetzutc; }
Viewhidden()672 bool Viewhidden() const { return adat->viewhidden; }
Viewkludge()673 bool Viewkludge() const { return adat->viewkludge; }
Viewquote()674 bool Viewquote() const { return adat->viewquote; }
Whoto()675 const char* Whoto() const { return adat->whoto; }
Writeheader()676 int Writeheader() const { return adat->writeheader; }
WTpl()677 const char* WTpl() const { return adat->wtpl; }
Xlatexport()678 const char* Xlatexport() const { return adat->xlatexport; }
Xlatimport()679 const char* Xlatimport() const { return adat->xlatimport; }
680
NextMsglistdate()681 int NextMsglistdate() { adat->msglistdate++; if(adat->msglistdate > MSGLISTDATE_RECEIVED) adat->msglistdate = MSGLISTDATE_NONE; return adat->msglistdate; }
SetAka(const ftn_addr & a)682 const ftn_aka& SetAka(const ftn_addr& a) { adat->aka.addr = a; return adat->aka; }
SetInputfile(const TCHAR * i)683 const TCHAR *SetInputfile(const TCHAR *i) { return strxcpy(adat->inputfile, i, ARRAYSIZE(adat->inputfile)); }
SetMsglistdate(int m)684 int SetMsglistdate(int m) { adat->msglistdate = m; return adat->msglistdate; }
SetOrigin(const char * o)685 const char* SetOrigin(const char* o) { return strxcpy(adat->origin, o, sizeof(adat->origin)); }
SetOutputfile(const char * o)686 const char* SetOutputfile(const char* o) { return strxcpy(adat->outputfile, o, sizeof(adat->outputfile)); }
SetSearchfor(const char * s)687 const char* SetSearchfor(const char* s) { return strxcpy(adat->searchfor, s, sizeof(adat->searchfor)); }
SetTagline(const char * t)688 const char* SetTagline(const char* t) { return strxcpy(adat->tagline, t, sizeof(adat->tagline)); }
SetTpl(const char * t)689 const char* SetTpl(const char* t) { return strxcpy(adat->tpl, t, sizeof(adat->tpl)); }
SetTwitmode(int m)690 int SetTwitmode(int m) { adat->twitmode = m; return adat->twitmode; }
SetUsername(const Node & n)691 const Node& SetUsername(const Node& n) { adat->username = n; return adat->username; }
SetXlatexport(const TCHAR * x)692 const TCHAR *SetXlatexport(const TCHAR *x) { return strxcpy(adat->xlatexport, x, ARRAYSIZE(adat->xlatexport)); }
SetXlatimport(const TCHAR * x)693 const TCHAR *SetXlatimport(const TCHAR *x) { return strxcpy(adat->xlatimport, x, ARRAYSIZE(adat->xlatimport)); }
ToggleMsglistwidesubj()694 int ToggleMsglistwidesubj() { adat->msglistwidesubj = not adat->msglistwidesubj; return adat->msglistwidesubj; }
ToggleViewhidden()695 int ToggleViewhidden() { adat->viewhidden = not adat->viewhidden; return adat->viewhidden; }
ToggleViewkludge()696 int ToggleViewkludge() { adat->viewkludge = not adat->viewkludge; return adat->viewkludge; }
ToggleViewquote()697 int ToggleViewquote() { adat->viewquote = not adat->viewquote; return adat->viewquote; }
ToggleStripHTML()698 bool ToggleStripHTML() { adat->striphtml = not adat->striphtml; return adat->striphtml; }
699 };
700
701
702 // ------------------------------------------------------------------
703 // Inline implementations
704
isseparator()705 inline bool Area::isseparator() const { return area->isseparator(); }
706
issoftdelete()707 inline bool Area::issoftdelete() const { return area->issoftdelete(); }
havearrivedstamp()708 inline bool Area::havearrivedstamp() const { return area->havearrivedstamp(); }
havereceivedstamp()709 inline bool Area::havereceivedstamp() const { return area->havereceivedstamp(); }
requirehardterm()710 inline bool Area::requirehardterm() const { return area->requirehardterm(); }
requiresoftterm()711 inline bool Area::requiresoftterm() const { return area->requiresoftterm(); }
712
isnet()713 inline int Area::isnet() const { return area->isnet(); }
isecho()714 inline int Area::isecho() const { return area->isecho(); }
islocal()715 inline int Area::islocal() const { return area->islocal(); }
isemail()716 inline int Area::isemail() const { return area->isemail(); }
isnewsgroup()717 inline int Area::isnewsgroup() const { return area->isnewsgroup(); }
isinternet()718 inline int Area::isinternet() const { return area->isinternet(); }
isqwk()719 inline int Area::isqwk() const { return area->isqwk(); }
issoup()720 inline int Area::issoup() const { return area->issoup(); }
721
lastread()722 inline uint Area::lastread() const { return area->lastread; }
lastreadentry()723 inline uint32_t Area::lastreadentry() const { return area->lastreadentry; }
set_lastread(uint lr)724 inline void Area::set_lastread(uint lr) { area->lastread = lr; }
725
SetBookmark(uint __relno)726 inline void Area::SetBookmark(uint __relno) { bookmark = Msgn.CvtReln(__relno); /*Book.Add(bookmark);*/ }
727
Suspend()728 inline void Area::Suspend() { area->suspend(); }
Resume()729 inline void Area::Resume() { area->resume(); }
730
Lock()731 inline void Area::Lock() { area->lock(); }
Unlock()732 inline void Area::Unlock() { area->unlock(); }
733
DelMsg(GMsg * msg)734 inline void Area::DelMsg(GMsg* msg) { area->del_msg(msg); }
735
NewMsgno(GMsg * msg)736 inline void Area::NewMsgno(GMsg* msg) { area->new_msgno(msg); }
UserLookup(char * lookfor)737 inline char* Area::UserLookup(char* lookfor) { return area->user_lookup(lookfor); }
Renumber()738 inline int Area::Renumber() { return area->renumber(); }
739
MakeDumpMsg(GMsg * msg,char * lng_head)740 inline Line* Area::MakeDumpMsg(GMsg* msg, char* lng_head) { return area->make_dump_msg(msg->lin, msg, lng_head); }
741
SetHighwaterMark()742 inline void Area::SetHighwaterMark() { area->set_highwater_mark(); }
ResetHighwaterMark()743 inline void Area::ResetHighwaterMark() { area->reset_highwater_mark(); }
744
UpdateTimesread(GMsg * msg)745 inline void Area::UpdateTimesread(GMsg* msg) { area->update_timesread(msg); }
746
747
748 // ------------------------------------------------------------------
749 // Arealist picker class
750
751 class GPickArealist : public gwinpick {
752
753 private:
754
755 int areawin;
756 int tempwin;
757 int tempwin1;
758 int areawin1;
759 int areawin2;
760 int tempwin2;
761 uint area_fuzidx;
762
763 int pmails;
764 int pmareas;
765 bool pmscan;
766
767 void jump_to();
768 void jumpmatch();
769 void center();
770 void AreasRenumber();
771 void AreaCatchUp(uint n);
772 void AreaDropMsgMarks(uint n);
773 void dispbuf(char* buf, int areano);
774
775 protected:
776
777 public:
778
779 uint area_maxfuz;
780 bool esc_abort;
781
782 void open(); // Called after window is opened
783 void close(); // Called after window is closed
784 void precursor(); // Called before any cursor movement
785 void do_delayed(); // Called after a delay
786 void print_line(uint idx, uint pos, bool isbar);
787 bool handle_key(); // Handles keypress
788 bool is_selectable(uint idx); // is not separator ?
789
790 void close_all();
update()791 void update() { display_page(); display_bar(); }
792
793 int Run(const char* _title, int wpos, int& idx);
794
795 GPickArealist();
796 };
797
798
799 // ------------------------------------------------------------------
800
801 #endif
802