summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/WinterSpeak/speak/announce/announce_database.h
blob: b3c950cd8d7a088c8a635332d8e7bc1aad2c2e0f (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
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
#ifndef guard_speak_announce_announce_database_h
#define guard_speak_announce_announce_database_h
//==============================================================================
// 	Miranda Speak Plugin, © 2002 Ryan Winter
//==============================================================================

#include <string>

class AnnounceDatabase
{
  public:
	AnnounceDatabase();
	~AnnounceDatabase();

    enum StatusFlag
    {
        StatusFlag_Offline = 0,
        StatusFlag_Online,
        StatusFlag_Away,
        StatusFlag_Dnd,
        StatusFlag_Na,
        StatusFlag_Occupied,
        StatusFlag_FreeForChat,
        StatusFlag_Invisible,
        StatusFlag_SpeakStatusMsg,
        StatusFlag_SuppressConnect,
    };

    enum EventFlag
    {
        EventFlag_Message = 0,
        EventFlag_Url,
        EventFlag_Added,
        EventFlag_AuthRequest,
        EventFlag_File,
        EventFlag_ReadMsgLength,
        EventFlag_DialogOpen,
        EventFlag_DialogFocused,
    };

	//--------------------------------------------------------------------------
	// Description : get/set a status flags
	//--------------------------------------------------------------------------
    bool getStatusFlag(StatusFlag flag) const;
	void setStatusFlag(StatusFlag flag, bool state);

	//--------------------------------------------------------------------------
	// Description : get/set an event flags
	//--------------------------------------------------------------------------
    bool getEventFlag(EventFlag flag) const;
	void setEventFlag(EventFlag flag, bool state);
	
	//--------------------------------------------------------------------------
	// Description : get/set an event flags
	//--------------------------------------------------------------------------
    unsigned int getMaxMsgSize() const    { return m_max_msg; }
	void setMaxMsgSize(unsigned int size) { m_max_msg = size; }
    
	//--------------------------------------------------------------------------
	// Description : load/save the settings from the miranda database
	//--------------------------------------------------------------------------
	void load();
	void save();

  private:
    unsigned int m_status_flags;
    unsigned int m_event_flags;

    unsigned int m_max_msg;
};

//==============================================================================
//
//  Summary     : encapsulate the access to the miranda database
//
//  Description : see summary
//
//==============================================================================

#endif