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