File: nntpfolder.H

package info (click to toggle)
cone 0.89-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 25,628 kB
  • ctags: 14,171
  • sloc: ansic: 85,400; cpp: 82,903; sh: 11,713; makefile: 1,732; perl: 832; yacc: 291; sed: 16
file content (100 lines) | stat: -rw-r--r-- 2,375 bytes parent folder | download
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
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
** Copyright 2003, Double Precision Inc.
**
** See COPYING for distribution information.
*/
#ifndef libmail_nntpfolder_H
#define libmail_nntpfolder_H

#include "libmail_config.h"

#include "nntp.H"

LIBMAIL_START

// An NNTP folder object

class mail::nntp::folder : public mail::folder {

	nntp *myserver;

	std::string path;
	std::string name;

	bool hasMessagesFlag;
	bool hasSubFoldersFlag;

	// Private class used to build hierarchy listings

	std::string newsgroupName() const;

public:
	class hierEntry {
	public:
		bool foundFolder;
		bool foundSubFolders;

		hierEntry() : foundFolder(false), foundSubFolders(false)
		{
		}

		~hierEntry()
		{
		}
	};

	folder(nntp *myserverArg, std::string pathArg,
	       bool hasMessagesArg, bool hasSubFoldersArg);

	folder(const mail::nntp::folder &);
	mail::nntp::folder &operator=(const mail::nntp::folder &);

	~folder();

	void sameServerAsHelperFunc() const;
	std::string getName() const;
	std::string getPath() const;
	bool hasMessages() const;
	bool hasSubFolders() const;
	std::string isNewsgroup() const;
	bool isParentOf(std::string path) const;
	void hasMessages(bool);
	void hasSubFolders(bool);
	void readFolderInfo( callback::folderInfo
			     &callback1,
			     callback &callback2) const;
	void getParentFolder(callback::folderList &callback1,
			     callback &callback2) const;
	void readSubFolders( callback::folderList &callback1,
			     callback &callback2) const;
	mail::addMessage *addMessage(callback &callback) const;
	void createSubFolder(std::string name, bool isDirectory,
			     callback::folderList
			     &callback1,
			     callback &callback2) const;
	void create(bool isDirectory,
		    callback &callback) const;

	void destroy(callback &callback, bool destroyDir) const;
	void renameFolder(const mail::folder *newParent, std::string newName,
			  callback::folderList &callback1,
			  callback &callback2) const;
	mail::folder *clone() const;
	std::string toString() const;
	void open(callback &openCallback,
		  snapshot *restoreSnapshot,
		  callback::folder &folderCallback) const;
};

// Special folder paths

#define FOLDER_SUBSCRIBED "/subscribed" // Subscribed newsrc folders

#define FOLDER_NEWSRC "/newsrc"		// All newsgroups in newsrc

#define FOLDER_CHECKNEW "/newgroups"	// New newsgroups

#define FOLDER_REFRESH "/refresh"	// Refresh newsgroup list

LIBMAIL_END
#endif