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 .
21 #include <rtl/ustring.hxx>
22 #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
);
38 std::unique_ptr
<weld::Builder
> xBuilder
;
39 std::unique_ptr
<weld::Container
> xContainer
;
42 const SfxItemSet
* pSet
;
43 bool bHasExchangeSupport
;
47 IconChoicePage(weld::Container
* pParent
, const OUString
& rUIXMLDescription
, const OUString
& rID
, const SfxItemSet
* pItemSet
);
50 virtual ~IconChoicePage();
52 OUString
GetHelpId() const { return xContainer
->get_help_id(); }
54 const SfxItemSet
& GetItemSet() const { return *pSet
; }
56 virtual bool FillItemSet( SfxItemSet
* ) = 0;
57 virtual void Reset( const SfxItemSet
& ) = 0;
59 bool HasExchangeSupport() const { return bHasExchangeSupport
; }
60 void SetExchangeSupport() { bHasExchangeSupport
= true; }
62 virtual void ActivatePage( const SfxItemSet
& );
63 virtual DeactivateRC
DeactivatePage( SfxItemSet
* pSet
);
64 virtual bool QueryClose();
67 /// Data-structure for pages in dialog
68 struct IconChoicePageData
71 std::unique_ptr
<IconChoicePage
> xPage
; ///< the TabPage itself
72 bool bRefresh
; ///< Flag: page has to be newly initialized
75 IconChoicePageData(OUString aId
, std::unique_ptr
<IconChoicePage
> xInPage
)
77 , xPage(std::move(xInPage
))
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */