Code

moving trunk for module inkscape
[inkscape.git] / src / jabber_whiteboard / session-file.h
1 /**
2  * Whiteboard session file object
3  *
4  * Authors:
5  * David Yip <yipdw@rose-hulman.edu>
6  *
7  * Copyright (c) 2005 Authors
8  *
9  * Released under GNU GPL, read the file 'COPYING' for more information
10  */
12 #ifndef __WHITEBOARD_SESSION_FILE_H__
13 #define __WHITEBOARD_SESSION_FILE_H__
15 #include <glibmm.h>
16 #include "util/list-container.h"
18 struct SPDesktop;
20 namespace Inkscape {
22 namespace Whiteboard {
24 typedef Glib::RefPtr< Glib::IOChannel > SessionFilePtr;
25 typedef Util::ListContainer< Glib::ustring const > SessionQueue;
27 class SessionFile {
28 public:
29         SessionFile(Glib::ustring const& filename, bool reading, bool compress);
30         ~SessionFile();
32         gint64 nextMessageFrom(gint64 from, Glib::ustring& buf);
34         void addMessage(Glib::ustring const& message);
35         void commit();
36         void close();
38         Glib::ustring const& filename()
39         {
40                 return this->_filename;
41         }
43         bool isReadOnly()
44         {
45                 return this->_reading;
46         }
48         bool eof()
49         {
50                 return this->_ateof;
51         }
53 private:
54         SessionQueue changes;
55         SessionFilePtr fptr;
56         Glib::ustring _filename;
58         bool _ateof;
59         bool _compress;
60         bool _reading;
61 };
63 }       
65 }
66 #endif
69 /*
70   Local Variables:
71   mode:c++
72   c-file-style:"stroustrup"
73   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
74   indent-tabs-mode:nil
75   fill-column:99
76   End:
77 */
78 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :