LibreOffice Module cui (master)  1
iconcdlg.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_CUI_SOURCE_INC_ICONCDLG_HXX
20 #define INCLUDED_CUI_SOURCE_INC_ICONCDLG_HXX
21 
22 #include <rtl/ustring.hxx>
23 #include <sfx2/tabdlg.hxx>
24 
25 // forward-declarations
26 struct IconChoicePageData;
27 class SvxHpLinkDlg;
28 class IconChoicePage;
29 class SfxItemPool;
30 class SfxItemSet;
31 
32 // Create-Function
33 typedef std::unique_ptr<IconChoicePage> (*CreatePage)(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pAttrSet);
34 
37 {
38  OString sId;
39  std::unique_ptr<IconChoicePage> xPage;
40  bool bRefresh;
41 
42  // constructor
43  IconChoicePageData(const OString& rId, std::unique_ptr<IconChoicePage> xInPage)
44  : sId(rId)
45  , xPage(std::move(xInPage))
46  , bRefresh(false)
47  {}
48 };
49 
51 {
52 protected:
53  std::unique_ptr<weld::Builder> xBuilder;
54  std::unique_ptr<weld::Container> xContainer;
55 
56 private:
57  const SfxItemSet* pSet;
59 
60 protected:
61 
62  IconChoicePage(weld::Container* pParent, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet* pItemSet);
63 
64 public:
65  virtual ~IconChoicePage();
66 
67  OString GetHelpId() const { return xContainer->get_help_id(); }
68 
69  const SfxItemSet& GetItemSet() const { return *pSet; }
70 
71  virtual bool FillItemSet( SfxItemSet* ) = 0;
72  virtual void Reset( const SfxItemSet& ) = 0;
73 
74  bool HasExchangeSupport() const { return bHasExchangeSupport; }
75  void SetExchangeSupport() { bHasExchangeSupport = true; }
76 
77  virtual void ActivatePage( const SfxItemSet& );
78  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet );
79  virtual bool QueryClose();
80 };
81 
82 #endif // INCLUDED_CUI_SOURCE_INC_ICONCDLG_HXX
83 
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet)
Definition: iconcdlg.cxx:57
std::unique_ptr< weld::Builder > xBuilder
Definition: iconcdlg.hxx:53
IconChoicePageData(const OString &rId, std::unique_ptr< IconChoicePage > xInPage)
Definition: iconcdlg.hxx:43
OString GetHelpId() const
Definition: iconcdlg.hxx:67
IconChoicePage(weld::Container *pParent, const OUString &rUIXMLDescription, const OString &rID, const SfxItemSet *pItemSet)
Definition: iconcdlg.cxx:32
const SfxItemSet * pSet
Definition: iconcdlg.hxx:57
std::unique_ptr< weld::Container > xContainer
Definition: iconcdlg.hxx:54
virtual ~IconChoicePage()
Definition: iconcdlg.cxx:42
virtual bool FillItemSet(SfxItemSet *)=0
bool HasExchangeSupport() const
Definition: iconcdlg.hxx:74
const SfxItemSet & GetItemSet() const
Definition: iconcdlg.hxx:69
std::unique_ptr< IconChoicePage > xPage
the TabPage itself
Definition: iconcdlg.hxx:39
void SetExchangeSupport()
Definition: iconcdlg.hxx:75
virtual void ActivatePage(const SfxItemSet &)
Definition: iconcdlg.cxx:52
virtual void Reset(const SfxItemSet &)=0
DeactivateRC
bool bHasExchangeSupport
Definition: iconcdlg.hxx:58
bool bRefresh
Flag: page has to be newly initialized.
Definition: iconcdlg.hxx:40
virtual bool QueryClose()
Definition: iconcdlg.cxx:62
Data-structure for pages in dialog.
Definition: iconcdlg.hxx:36