Avoid potential negative array index access to cached text.
[LibreOffice.git] / extensions / source / abpilot / typeselectionpage.hxx
blob7c908057d642b5ae04443532ddeb68431183d649
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 .
20 #pragma once
22 #include "abspage.hxx"
23 #include "addresssettings.hxx"
24 #include <vcl/weld.hxx>
26 namespace abp
29 class TypeSelectionPage final : public AddressBookSourcePage
31 std::unique_ptr<weld::RadioButton> m_xEvolution;
32 std::unique_ptr<weld::RadioButton> m_xEvolutionGroupwise;
33 std::unique_ptr<weld::RadioButton> m_xEvolutionLdap;
34 std::unique_ptr<weld::RadioButton> m_xThunderbird;
35 std::unique_ptr<weld::RadioButton> m_xKab;
36 std::unique_ptr<weld::RadioButton> m_xMacab;
37 std::unique_ptr<weld::RadioButton> m_xOther;
39 struct ButtonItem {
40 weld::RadioButton* m_pItem;
41 AddressSourceType m_eType;
42 bool m_bVisible;
44 ButtonItem( weld::RadioButton *pItem,
45 AddressSourceType eType,
46 bool bVisible ) :
47 m_pItem( pItem ),
48 m_eType( eType ),
49 m_bVisible( bVisible )
53 std::vector< ButtonItem > m_aAllTypes;
55 public:
56 explicit TypeSelectionPage(weld::Container* pPage, OAddressBookSourcePilot* pController);
57 virtual ~TypeSelectionPage() override;
59 // retrieves the currently selected type
60 AddressSourceType getSelectedType() const;
62 private:
63 // OWizardPage overridables
64 virtual void initializePage() override;
65 virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
67 // BuilderPage overridables
68 virtual void Activate() override;
69 virtual void Deactivate() override;
71 // OImportPage overridables
72 virtual bool canAdvance() const override;
74 DECL_LINK( OnTypeSelected, weld::Toggleable&, void );
76 void selectType( AddressSourceType _eType );
80 } // namespace abp
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */