tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / sfx2 / inc / sidebar / ContextChangeBroadcaster.hxx
blobd88ba98f9de96f6a65ef43b7711c8c056ef73c9d
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 .
19 #pragma once
21 #include <com/sun/star/frame/XFrame.hpp>
24 namespace sfx2::sidebar {
27 /** This class is a helper for broadcasting context changes that are
28 tied to shells being activated or deactivated.
30 class ContextChangeBroadcaster
32 public:
33 ContextChangeBroadcaster();
34 ~ContextChangeBroadcaster();
36 void Initialize (const OUString& rsContextName);
38 void Activate (const css::uno::Reference<css::frame::XFrame>& rxFrame);
39 void Deactivate (const css::uno::Reference<css::frame::XFrame>& rxFrame);
41 /** Enable or disable the broadcaster.
42 @param bIsEnabled
43 The new value of the "enabled" state.
44 @return
45 The old value of the "enabled" state is returned.
47 bool SetBroadcasterEnabled (const bool bIsEnabled);
49 private:
50 OUString msContextName;
51 bool mbIsBroadcasterEnabled;
53 void BroadcastContextChange (
54 const css::uno::Reference<css::frame::XFrame>& rxFrame,
55 const OUString& rsModuleName,
56 const OUString& rsContextName);
57 static OUString GetModuleName (
58 const css::uno::Reference<css::frame::XFrame>& rxFrame);
62 } // end of namespace ::sd::sidebar
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */