Get the style color and number just once
[LibreOffice.git] / basctl / source / inc / doceventnotifier.hxx
blob25fd2a7a84ea28a82b167a96572844343ee8ea8a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <com/sun/star/frame/XModel.hpp>
24 #include <rtl/ref.hxx>
27 namespace basctl
31 class ScriptDocument;
34 class SAL_NO_VTABLE DocumentEventListener
36 public:
37 DocumentEventListener(const DocumentEventListener&) = delete;
38 const DocumentEventListener& operator=(const DocumentEventListener&) = delete;
39 DocumentEventListener() = default;
41 virtual void onDocumentCreated( const ScriptDocument& _rDocument ) = 0;
42 virtual void onDocumentOpened( const ScriptDocument& _rDocument ) = 0;
43 virtual void onDocumentSave( const ScriptDocument& _rDocument ) = 0;
44 virtual void onDocumentSaveDone( const ScriptDocument& _rDocument ) = 0;
45 virtual void onDocumentSaveAs( const ScriptDocument& _rDocument ) = 0;
46 virtual void onDocumentSaveAsDone( const ScriptDocument& _rDocument ) = 0;
47 virtual void onDocumentClosed( const ScriptDocument& _rDocument ) = 0;
48 virtual void onDocumentTitleChanged( const ScriptDocument& _rDocument ) = 0;
49 virtual void onDocumentModeChanged( const ScriptDocument& _rDocument ) = 0;
51 virtual ~DocumentEventListener();
55 /** allows registering at theGlobalEventBroadcaster for global document events
57 class DocumentEventNotifier
59 public:
60 /** create a notifier instance which notifies about events of all documents in the whole application
62 DocumentEventNotifier (DocumentEventListener&);
64 /** creates a notifier instance which notifies about events at a single document
66 DocumentEventNotifier (DocumentEventListener&, css::uno::Reference<css::frame::XModel> const& rxDocument);
68 ~DocumentEventNotifier();
70 public:
71 void dispose();
73 private:
74 class Impl;
75 rtl::Reference<Impl> m_pImpl;
79 } // namespace basctl
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */