repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / haikudepot / ui / RatePackageWindow.h
blob1835df97a43bd17debb5bedb0417c3b4127b8121
1 /*
2 * Copyright 2014, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef RATE_PACKAGE_WINDOW_H
6 #define RATE_PACKAGE_WINDOW_H
8 #include <Window.h>
10 #include "Model.h"
11 #include "PackageInfo.h"
12 #include "TextDocument.h"
13 #include "TextEditor.h"
16 class BButton;
17 class BCheckBox;
18 class BMenuField;
19 class SetRatingView;
20 class TextDocumentView;
23 class RatePackageWindow : public BWindow {
24 public:
25 RatePackageWindow(BWindow* parent, BRect frame,
26 Model& model);
27 virtual ~RatePackageWindow();
29 virtual void MessageReceived(BMessage* message);
31 void SetPackage(const PackageInfoRef& package);
33 private:
34 void _SendRating();
36 void _SetWorkerThread(thread_id thread);
38 static int32 _QueryRatingThreadEntry(void* data);
39 void _QueryRatingThread();
41 static int32 _SendRatingThreadEntry(void* data);
42 void _SendRatingThread();
44 private:
45 Model& fModel;
46 TextDocumentRef fRatingText;
47 TextEditorRef fTextEditor;
48 float fRating;
49 BString fStability;
50 StabilityRatingList fStabilityCodes;
51 BString fCommentLanguage;
52 BString fRatingID;
53 bool fRatingActive;
54 PackageInfoRef fPackage;
56 SetRatingView* fSetRatingView;
57 BMenuField* fStabilityField;
58 BMenuField* fCommentLanguageField;
59 TextDocumentView* fTextView;
60 BCheckBox* fRatingActiveCheckBox;
61 BButton* fCancelButton;
62 BButton* fSendButton;
64 thread_id fWorkerThread;
68 #endif // RATE_PACKAGE_WINDOW_H