forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext.h
More file actions
51 lines (39 loc) · 1.15 KB
/
context.h
File metadata and controls
51 lines (39 loc) · 1.15 KB
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
// Aseprite Document Library
// Copyright (c) 2001-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef DOC_CONTEXT_H_INCLUDED
#define DOC_CONTEXT_H_INCLUDED
#pragma once
#include "base/disable_copying.h"
#include "doc/context_observer.h"
#include "doc/documents.h"
#include "doc/documents_observer.h"
#include "obs/observable.h"
namespace doc {
class Command;
class Document;
class Settings;
class Context : public obs::observable<ContextObserver>
, public DocumentsObserver {
public:
Context();
virtual ~Context();
const Documents& documents() const { return m_docs; }
Documents& documents() { return m_docs; }
Site activeSite() const;
Document* activeDocument() const;
void notifyActiveSiteChanged();
protected:
virtual void onGetActiveSite(Site* site) const;
virtual void onAddDocument(Document* doc) override;
virtual void onRemoveDocument(Document* doc) override;
private:
Settings* m_settings;
Documents m_docs;
Document* m_activeDoc;
DISABLE_COPYING(Context);
};
} // namespace doc
#endif