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 #pragma once
20 
21 #include <rtl/ustring.hxx>
22 #include <sfx2/tabdlg.hxx>
23 
24 // forward-declarations
25 struct IconChoicePageData;
26 class SvxHpLinkDlg;
27 class IconChoicePage;
28 class SfxItemPool;
29 class SfxItemSet;
30 
31 // Create-Function
32 typedef std::unique_ptr<IconChoicePage> (*CreatePage)(weld::Container* pParent, SvxHpLinkDlg* pDlg, const SfxItemSet* pAttrSet);
33 
36 {
37  OString sId;
38  std::unique_ptr<IconChoicePage> xPage;
39  bool bRefresh;
40 
41  // constructor
42  IconChoicePageData(const OString& rId, std::unique_ptr<IconChoicePage> xInPage)
43  : sId(rId)
44  , xPage(std::move(xInPage))
45  , bRefresh(false)
46  {}
47 };
48 
50 {
51 protected:
52  std::unique_ptr<weld::Builder> xBuilder;
53  std::unique_ptr<weld::Container> xContainer;
54 
55 private:
56  const SfxItemSet* pSet;
58 
59 protected:
60 
61  IconChoicePage(weld::Container* pParent, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet* pItemSet);
62 
63 public:
64  virtual ~IconChoicePage();
65 
66  OString GetHelpId() const { return xContainer->get_help_id(); }
67 
68  const SfxItemSet& GetItemSet() const { return *pSet; }
69 
70  virtual bool FillItemSet( SfxItemSet* ) = 0;
71  virtual void Reset( const SfxItemSet& ) = 0;
72 
73  bool HasExchangeSupport() const { return bHasExchangeSupport; }
74  void SetExchangeSupport() { bHasExchangeSupport = true; }
75 
76  virtual void ActivatePage( const SfxItemSet& );
77  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet );
78  virtual bool QueryClose();
79 };
80 
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet)
Definition: iconcdlg.cxx:58
std::unique_ptr< weld::Builder > xBuilder
Definition: iconcdlg.hxx:52
IconChoicePageData(const OString &rId, std::unique_ptr< IconChoicePage > xInPage)
Definition: iconcdlg.hxx:42
OString GetHelpId() const
Definition: iconcdlg.hxx:66
IconChoicePage(weld::Container *pParent, const OUString &rUIXMLDescription, const OString &rID, const SfxItemSet *pItemSet)
Definition: iconcdlg.cxx:33
const SfxItemSet * pSet
Definition: iconcdlg.hxx:56
std::unique_ptr< weld::Container > xContainer
Definition: iconcdlg.hxx:53
virtual ~IconChoicePage()
Definition: iconcdlg.cxx:43
virtual bool FillItemSet(SfxItemSet *)=0
bool HasExchangeSupport() const
Definition: iconcdlg.hxx:73
const SfxItemSet & GetItemSet() const
Definition: iconcdlg.hxx:68
std::unique_ptr< IconChoicePage > xPage
the TabPage itself
Definition: iconcdlg.hxx:38
void SetExchangeSupport()
Definition: iconcdlg.hxx:74
virtual void ActivatePage(const SfxItemSet &)
Definition: iconcdlg.cxx:53
virtual void Reset(const SfxItemSet &)=0
DeactivateRC
bool bHasExchangeSupport
Definition: iconcdlg.hxx:57
bool bRefresh
Flag: page has to be newly initialized.
Definition: iconcdlg.hxx:39
virtual bool QueryClose()
Definition: iconcdlg.cxx:63
Data-structure for pages in dialog.
Definition: iconcdlg.hxx:35