haiku/headers/private/package/ActivationTransaction.h
Ingo Weinhold 85d2badf00 package daemon: Add support for activation change request
* daemon: Handle new request B_MESSAGE_COMMIT_TRANSACTION. It activates
  and deactivates given sets of packages. The new packages must be
  placed in a directory in the administrative directory. The daemon
  moves them to the packages directory and the deactivated packages to
  a subdirectory it creates. It also save the old activation state
  there.
* Add private BActivationTransaction, describing an activation change
  transaction.
* BDaemonClient: Add CommitTransaction(), which sends a given
  BActivationTransaction as a B_MESSAGE_COMMIT_TRANSACTION request to
  the daemon.

Completely untested yet.
2013-04-20 01:28:18 +02:00

71 lines
1.8 KiB
C++

/*
* Copyright 2013, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ingo Weinhold <ingo_weinhold@gmx.de>
*/
#ifndef _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_
#define _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_
#include <package/PackageDefs.h>
#include <StringList.h>
namespace BPackageKit {
namespace BPrivate {
class BActivationTransaction {
public:
BActivationTransaction();
BActivationTransaction(
BPackageInstallationLocation location,
int64 changeCount,
const BString& directoryName,
const BStringList& packagesToActivate,
const BStringList& packagesToDeactivate);
~BActivationTransaction();
status_t InitCheck() const;
status_t SetTo(BPackageInstallationLocation location,
int64 changeCount,
const BString& directoryName,
const BStringList& packagesToActivate,
const BStringList& packagesToDeactivate);
BPackageInstallationLocation Location() const;
void SetLocation(
BPackageInstallationLocation location);
int64 ChangeCount() const;
void SetChangeCount(int64 changeCount);
const BString& TransactionDirectoryName() const;
void SetTransactionDirectoryName(
const BString& directoryName);
const BStringList& PackagesToActivate() const;
void SetPackagesToActivate(
const BStringList& packages);
const BStringList& PackagesToDeactivate() const;
void SetPackagesToDeactivate(
const BStringList& packages);
private:
BPackageInstallationLocation fLocation;
int64 fChangeCount;
BString fTransactionDirectoryName;
BStringList fPackagesToActivate;
BStringList fPackagesToDeactivate;
};
} // namespace BPrivate
} // namespace BPackageKit
#endif // _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_