tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / cui / source / inc / iconcdlg.hxx
blobe31aaa74e0dbd4f1454d9e2c0b8a8d01e84a2c4a
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 <rtl/ustring.hxx>
22 #include <sfx2/tabdlg.hxx>
23 #include <utility>
25 // forward-declarations
26 struct IconChoicePageData;
27 class SvxHpLinkDlg;
28 class IconChoicePage;
29 class SfxItemPool;
30 class SfxItemSet;
32 // Create-Function
33 typedef std::unique_ptr<IconChoicePage> (*CreatePage)(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pAttrSet);
35 class IconChoicePage
37 protected:
38 std::unique_ptr<weld::Builder> xBuilder;
39 std::unique_ptr<weld::Container> xContainer;
41 private:
42 const SfxItemSet* pSet;
43 bool bHasExchangeSupport;
45 protected:
47 IconChoicePage(weld::Container* pParent, const OUString& rUIXMLDescription, const OUString& rID, const SfxItemSet* pItemSet);
49 public:
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
70 OUString sId;
71 std::unique_ptr<IconChoicePage> xPage; ///< the TabPage itself
72 bool bRefresh; ///< Flag: page has to be newly initialized
74 // constructor
75 IconChoicePageData(OUString aId, std::unique_ptr<IconChoicePage> xInPage)
76 : sId(std::move(aId))
77 , xPage(std::move(xInPage))
78 , bRefresh(false)
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */