aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/imap/MCIMAPNamespace.h
blob: 711fb7e5fd761dee10561a52a00702f67e21d463 (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
52
53
#ifndef MAILCORE_MCIMAPNAMESPACE_H

#define MAILCORE_MCIMAPNAMESPACE_H

#include <MailCore/MCBaseTypes.h>

#ifdef __cplusplus

namespace mailcore {
    
    class IMAPNamespaceItem;
    
    class MAILCORE_EXPORT IMAPNamespace : public Object {
    public:
        IMAPNamespace();
        virtual ~IMAPNamespace();
        
        virtual String * mainPrefix();
        virtual char mainDelimiter();
        
        virtual Array * /* String */ prefixes();
        
        virtual String * pathForComponents(Array * components);
        virtual String * pathForComponentsAndPrefix(Array * components, String * prefix);
        
        virtual Array * /* String */ 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();
        virtual HashMap * serializable();
        virtual void importSerializable(HashMap * serializable);

    private:
        Array * /* String */ mItems;
        void init();
        IMAPNamespaceItem * mainItem();
        IMAPNamespaceItem * itemForPath(String * path);
        
    public: // private
        virtual void importIMAPNamespace(struct mailimap_namespace_item * item);
    };
    
}

#endif

#endif