/src/libreoffice/vcl/source/control/wizimpldata.hxx
Line | Count | Source |
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 | | |
20 | | #pragma once |
21 | | |
22 | | #include <rtl/ustring.hxx> |
23 | | #include <vcl/builderpage.hxx> |
24 | | #include <vcl/roadmapwizardmachine.hxx> |
25 | | #include <vcl/wizardmachine.hxx> |
26 | | |
27 | | #include <map> |
28 | | #include <set> |
29 | | #include <stack> |
30 | | |
31 | | constexpr OUString HID_WIZARD_NEXT = u"SVT_HID_WIZARD_NEXT"_ustr; |
32 | | constexpr OUString HID_WIZARD_PREVIOUS = u"SVT_HID_WIZARD_PREVIOUS"_ustr; |
33 | | |
34 | | struct WizPageData |
35 | | { |
36 | | WizPageData* mpNext; |
37 | | std::unique_ptr<BuilderPage> mxPage; |
38 | | }; |
39 | | |
40 | | namespace vcl |
41 | | { |
42 | | using namespace RoadmapWizardTypes; |
43 | | namespace |
44 | | { |
45 | | typedef ::std::set< WizardTypes::WizardState > StateSet; |
46 | | |
47 | | typedef ::std::map< |
48 | | PathId, |
49 | | WizardPath |
50 | | > Paths; |
51 | | } |
52 | | |
53 | | struct RoadmapWizardImpl |
54 | | { |
55 | | Paths aPaths; |
56 | | PathId nActivePath; |
57 | | StateSet aDisabledStates; |
58 | | bool bActivePathIsDefinite; |
59 | | |
60 | | RoadmapWizardImpl() |
61 | 0 | :nActivePath( PathId::INVALID ) |
62 | 0 | ,bActivePathIsDefinite( false ) |
63 | 0 | { |
64 | 0 | } |
65 | | |
66 | | /// returns the index of the current state in given path, or -1 |
67 | | static sal_Int32 getStateIndexInPath( WizardTypes::WizardState _nState, const WizardPath& _rPath ); |
68 | | /// returns the index of the current state in the path with the given id, or -1 |
69 | | sal_Int32 getStateIndexInPath( WizardTypes::WizardState _nState, PathId _nPathId ); |
70 | | /// returns the index of the first state in which the two given paths differ |
71 | | static sal_Int32 getFirstDifferentIndex( const WizardPath& _rLHS, const WizardPath& _rRHS ); |
72 | | }; |
73 | | |
74 | | struct WizardMachineImplData |
75 | | { |
76 | | OUString sTitleBase; // the base for the title |
77 | | std::stack<WizardTypes::WizardState> aStateHistory; // the history of all states (used for implementing "Back") |
78 | | |
79 | | WizardTypes::WizardState nFirstUnknownPage; |
80 | | // the WizardDialog does not allow non-linear transitions (e.g. it's |
81 | | // not possible to add pages in a non-linear order), so we need some own maintenance data |
82 | | |
83 | | bool m_bAutoNextButtonState; |
84 | | |
85 | | bool m_bTravelingSuspended; |
86 | | |
87 | | WizardMachineImplData() |
88 | 0 | :nFirstUnknownPage( 0 ) |
89 | 0 | ,m_bAutoNextButtonState( false ) |
90 | 0 | ,m_bTravelingSuspended( false ) |
91 | 0 | { |
92 | 0 | } |
93 | | }; |
94 | | } // namespace vcl |
95 | | |
96 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |