1 // Aseprite 2 // Copyright (c) 2001-2018 David Capello 3 // 4 // This program is distributed under the terms of 5 // the End-User License Agreement for Aseprite. 6 7 #ifndef APP_DOCS_OBSERVER_H_INCLUDED 8 #define APP_DOCS_OBSERVER_H_INCLUDED 9 #pragma once 10 11 namespace app { 12 class Doc; 13 14 class CreateDocArgs { 15 public: CreateDocArgs()16 CreateDocArgs() : m_doc(nullptr) { } document()17 Doc* document() { return m_doc; } setDocument(Doc * doc)18 void setDocument(Doc* doc) { m_doc = doc; } 19 private: 20 Doc* m_doc; 21 }; 22 23 class DocsObserver { 24 public: ~DocsObserver()25 virtual ~DocsObserver() { } onCreateDocument(CreateDocArgs * args)26 virtual void onCreateDocument(CreateDocArgs* args) { } onAddDocument(Doc * doc)27 virtual void onAddDocument(Doc* doc) { } onRemoveDocument(Doc * doc)28 virtual void onRemoveDocument(Doc* doc) { } 29 }; 30 31 } // namespace app 32 33 #endif 34