1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_CUI_SOURCE_INC_ICONCDLG_HXX
20 #define INCLUDED_CUI_SOURCE_INC_ICONCDLG_HXX
22 #include <rtl/ustring.hxx>
23 #include <sfx2/tabdlg.hxx>
25 // forward-declarations
26 struct IconChoicePageData
;
33 typedef std::unique_ptr
<IconChoicePage
> (*CreatePage
)(weld::Container
* pParent
, SvxHpLinkDlg
* pDlg
, const SfxItemSet
* pAttrSet
);
35 /// Data-structure for pages in dialog
36 struct IconChoicePageData
39 std::unique_ptr
<IconChoicePage
> xPage
; ///< the TabPage itself
40 bool bRefresh
; ///< Flag: page has to be newly initialized
43 IconChoicePageData(const OString
& rId
, std::unique_ptr
<IconChoicePage
> xInPage
)
45 , xPage(std::move(xInPage
))
53 std::unique_ptr
<weld::Builder
> xBuilder
;
54 std::unique_ptr
<weld::Container
> xContainer
;
57 const SfxItemSet
* pSet
;
58 bool bHasExchangeSupport
;
62 IconChoicePage(weld::Container
* pParent
, const OUString
& rUIXMLDescription
, const OString
& rID
, const SfxItemSet
* pItemSet
);
65 virtual ~IconChoicePage();
67 OString
GetHelpId() const { return xContainer
->get_help_id(); }
69 const SfxItemSet
& GetItemSet() const { return *pSet
; }
71 virtual bool FillItemSet( SfxItemSet
* ) = 0;
72 virtual void Reset( const SfxItemSet
& ) = 0;
74 bool HasExchangeSupport() const { return bHasExchangeSupport
; }
75 void SetExchangeSupport() { bHasExchangeSupport
= true; }
77 virtual void ActivatePage( const SfxItemSet
& );
78 virtual DeactivateRC
DeactivatePage( SfxItemSet
* pSet
);
79 virtual bool QueryClose();
82 #endif // INCLUDED_CUI_SOURCE_INC_ICONCDLG_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */