Add watching support for installation location package changes
Can be requested/stopped via BPackageRoster::{Start,Stop}Watching().
The notification message has the what code B_PACKAGE_UPDATE and contains
fields "event", "location", and "change count".
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011, Haiku, Inc.
|
||||
* Copyright 2011-2014, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PACKAGE__PACKAGE_ROSTER_H_
|
||||
@@ -34,6 +34,23 @@ class BRepositoryCache;
|
||||
class BRepositoryConfig;
|
||||
|
||||
|
||||
// watchable events
|
||||
enum {
|
||||
B_WATCH_PACKAGE_INSTALLATION_LOCATIONS = 0x0001,
|
||||
// de-/activation of packages in standard installation locations
|
||||
};
|
||||
|
||||
// notification message "event" field values
|
||||
enum {
|
||||
B_INSTALLATION_LOCATION_PACKAGES_CHANGED,
|
||||
// "location": int32
|
||||
// the installation location
|
||||
// (B_PACKAGE_INSTALLATION_LOCATION_{SYSTEM,HOME}
|
||||
// "change count": int64
|
||||
// the installation location change count
|
||||
};
|
||||
|
||||
|
||||
class BPackageRoster {
|
||||
public:
|
||||
BPackageRoster();
|
||||
@@ -68,6 +85,10 @@ public:
|
||||
BPackageInstallationLocation location,
|
||||
BPackageInfoSet& packageInfos);
|
||||
|
||||
status_t StartWatching(const BMessenger& target,
|
||||
uint32 eventMask);
|
||||
status_t StopWatching(const BMessenger& target);
|
||||
|
||||
private:
|
||||
status_t _GetRepositoryPath(BPath* path, bool create,
|
||||
directory_which whichDir) const;
|
||||
|
||||
Reference in New Issue
Block a user