~inkscape.dev/inkscape/trunk

« back to all changes in this revision

Viewing changes to src/jabber_whiteboard/undo-stack-observer.h

  • Committer: mental
  • Date: 2006-01-16 02:36:01 UTC
  • Revision ID: mental@users.sourceforge.net-20060116023601-wkr0h7edl5veyudq
moving trunk for module inkscape

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Undo / redo / undo log commit listener
 
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
 */
 
11
 
 
12
#ifndef __WHITEBOARD_UNDO_COMMIT_OBSERVER_H__
 
13
#define __WHITEBOARD_UNDO_COMMIT_OBSERVER_H__
 
14
 
 
15
#include <glibmm.h>
 
16
#include "../undo-stack-observer.h"
 
17
#include "jabber_whiteboard/typedefs.h"
 
18
 
 
19
namespace Inkscape {
 
20
 
 
21
namespace Whiteboard {
 
22
 
 
23
class SessionManager;
 
24
 
 
25
/**
 
26
 * Inkboard implementation of Inkscape::UndoStackObserver.
 
27
 */
 
28
class UndoStackObserver : public Inkscape::UndoStackObserver {
 
29
public:
 
30
        enum ObserverType {
 
31
                UNDO_EVENT,
 
32
                REDO_EVENT,
 
33
                UNDO_COMMIT_EVENT
 
34
        };
 
35
 
 
36
        UndoStackObserver(SessionManager* sm);
 
37
        ~UndoStackObserver();
 
38
        void notifyUndoEvent(XML::Event* log);
 
39
        void notifyRedoEvent(XML::Event* log);
 
40
        void notifyUndoCommitEvent(XML::Event* log);
 
41
 
 
42
        void lockObserverFromSending(ObserverType type);
 
43
        void unlockObserverFromSending(ObserverType type);
 
44
 
 
45
private:
 
46
        SessionManager* _sm;
 
47
 
 
48
        // common action handler
 
49
        void _doAction(XML::Event* log);
 
50
 
 
51
        // noncopyable, nonassignable
 
52
        UndoStackObserver(UndoStackObserver const& other);
 
53
        UndoStackObserver& operator=(UndoStackObserver const& other);
 
54
 
 
55
        unsigned int _undoSendEventLocks;
 
56
        unsigned int _redoSendEventLocks;
 
57
        unsigned int _undoCommitSendEventLocks;
 
58
};
 
59
 
 
60
}
 
61
 
 
62
}
 
63
 
 
64
#endif
 
65
 
 
66
/*
 
67
  Local Variables:
 
68
  mode:c++
 
69
  c-file-style:"stroustrup"
 
70
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
71
  indent-tabs-mode:nil
 
72
  fill-column:99
 
73
  End:
 
74
*/
 
75
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :