btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / servers / package / ProblemWindow.h
blobaf990e61a96b854140b6f869259325423d6c5580
1 /*
2 * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef PROBLEM_WINDOW_H
6 #define PROBLEM_WINDOW_H
9 #include <map>
10 #include <set>
12 #include <Window.h>
15 namespace BPackageKit {
16 class BSolver;
17 class BSolverPackage;
18 class BSolverProblem;
19 class BSolverProblemSolution;
20 class BSolverProblemSolutionElement;
23 using BPackageKit::BSolver;
24 using BPackageKit::BSolverPackage;
25 using BPackageKit::BSolverProblem;
26 using BPackageKit::BSolverProblemSolution;
27 using BPackageKit::BSolverProblemSolutionElement;
29 class BButton;
30 class BGroupView;
31 class BRadioButton;
34 class ProblemWindow : public BWindow {
35 public:
36 typedef std::set<BSolverPackage*> SolverPackageSet;
38 public:
39 ProblemWindow();
40 virtual ~ProblemWindow();
42 bool Go(BSolver* solver,
43 const SolverPackageSet& packagesAddedByUser,
44 const SolverPackageSet&
45 packagesRemovedByUser);
47 virtual bool QuitRequested();
48 virtual void MessageReceived(BMessage* message);
50 private:
51 struct Solution;
53 typedef std::map<BRadioButton*, Solution> SolutionMap;
55 private:
56 void _ClearProblemsGui();
57 void _AddProblemsGui(BSolver* solver);
58 void _AddProblem(BSolverProblem* problem,
59 const float backgroundTint);
60 BString _SolutionElementText(
61 const BSolverProblemSolutionElement*
62 element) const;
63 bool _AnySolutionSelected() const;
65 private:
66 sem_id fDoneSemaphore;
67 bool fClientWaiting;
68 bool fAccepted;
69 BGroupView* fContainerView;
70 BButton* fCancelButton;
71 BButton* fRetryButton;
72 SolutionMap fSolutions;
73 const SolverPackageSet* fPackagesAddedByUser;
74 const SolverPackageSet* fPackagesRemovedByUser;
78 #endif // PROBLEM_WINDOW_H