aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/imap/MCIMAPNamespace.h
blob: 09c029e237acc299fd9bfe5f808192f14a2723d5 (plain)
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
#ifndef __MAILCORE_MCIMAPNAMESPACE_H_

#define __MAILCORE_MCIMAPNAMESPACE_H_

#include <MailCore/MCBaseTypes.h>

#ifdef __cplusplus

namespace mailcore {

	class IMAPNamespaceItem;

	class IMAPNamespace : public Object {
	public:
		IMAPNamespace();
		virtual ~IMAPNamespace();
		
		virtual String * mainPrefix();
		virtual char mainDelimiter();

		virtual Array * prefixes();

		virtual String * pathForComponents(Array * components);
		virtual String * pathForComponentsAndPrefix(Array * components, String * prefix);

		virtual Array * componentsFromPath(String * path);

		virtual bool containsFolderPath(String * path);

		static IMAPNamespace * namespaceWithPrefix(String * prefix, char delimiter);
        
    public: // subclass behavior
		IMAPNamespace(IMAPNamespace * other);
		virtual String * description();
		virtual Object * copy();
        
	private:
		Array * mItems;
		void init();
		IMAPNamespaceItem * mainItem();
		IMAPNamespaceItem * itemForPath(String * path);
        
    public: // private
		virtual void importIMAPNamespace(struct mailimap_namespace_item * item);
	};

}

#endif

#endif