vfs: check userland buffers before reading them.
[haiku.git] / src / apps / softwareupdater / CheckManager.h
blob3797585d85bc986a95fab4e32771e8111970abe3
1 /*
2 * Copyright 2013-2017, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
7 * Rene Gollent <rene@gollent.com>
8 * Brian Hill <supernova@tycho.email>
9 */
10 #ifndef CHECK_MANAGER_H
11 #define CHECK_MANAGER_H
14 #include <Bitmap.h>
16 #include <package/DaemonClient.h>
17 #include <package/manager/PackageManager.h>
19 #include "constants.h"
20 #include "SoftwareUpdaterWindow.h"
22 class ProblemWindow;
24 //using namespace BPackageKit;
25 using BPackageKit::BPackageInstallationLocation;
26 using BPackageKit::BPrivate::BDaemonClient;
27 using BPackageKit::BManager::BPrivate::BPackageManager;
30 class CheckManager : public BPackageManager,
31 private BPackageManager::UserInteractionHandler {
32 public:
33 CheckManager(
34 BPackageInstallationLocation location,
35 bool verbose);
37 void CheckNetworkConnection();
38 virtual void JobFailed(BSupportKit::BJob* job);
39 virtual void JobAborted(BSupportKit::BJob* job);
40 void NoUpdatesNotification();
42 private:
43 // UserInteractionHandler
44 virtual void HandleProblems();
45 virtual void ConfirmChanges(bool fromMostSpecific);
46 virtual void Warn(status_t error, const char* format, ...);
48 virtual void ProgressPackageDownloadStarted(
49 const char* packageName);
50 virtual void ProgressPackageDownloadActive(
51 const char* packageName,
52 float completionPercentage,
53 off_t bytes, off_t totalBytes);
54 virtual void ProgressPackageDownloadComplete(
55 const char* packageName);
56 virtual void ProgressPackageChecksumStarted(
57 const char* packageName);
58 virtual void ProgressPackageChecksumComplete(
59 const char* packageName);
61 private:
62 void _CountUpdates(InstalledRepository&
63 installationRepository,
64 int32& updateCount);
65 void _SendNotification(const char* title,
66 const char* text);
68 private:
69 BPackageManager::ClientInstallationInterface
70 fClientInstallationInterface;
72 ProblemWindow* fProblemWindow;
73 bool fVerbose;
74 BString fNotificationId;
75 BString fHeaderChecking;
76 BString fTextContacting;
80 #endif // CHECK_MANAGER_H