2013-04-20 03:28:18 +04:00
|
|
|
/*
|
|
|
|
* 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_
|
|
|
|
|
|
|
|
|
2013-09-10 20:37:59 +04:00
|
|
|
#include <Archivable.h>
|
2013-04-20 03:28:18 +04:00
|
|
|
#include <package/PackageDefs.h>
|
|
|
|
#include <StringList.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace BPackageKit {
|
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
|
2013-09-10 20:37:59 +04:00
|
|
|
class BActivationTransaction : public BArchivable {
|
2013-04-20 03:28:18 +04:00
|
|
|
public:
|
|
|
|
BActivationTransaction();
|
2021-02-03 01:27:06 +03:00
|
|
|
BActivationTransaction(BMessage* archive,
|
|
|
|
status_t* _error = NULL);
|
2013-09-10 20:37:59 +04:00
|
|
|
virtual ~BActivationTransaction();
|
2013-04-20 03:28:18 +04:00
|
|
|
|
|
|
|
status_t SetTo(BPackageInstallationLocation location,
|
|
|
|
int64 changeCount,
|
2013-04-20 23:24:28 +04:00
|
|
|
const BString& directoryName);
|
|
|
|
|
|
|
|
status_t InitCheck() const;
|
2013-04-20 03:28:18 +04:00
|
|
|
|
|
|
|
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;
|
2013-04-20 23:24:28 +04:00
|
|
|
bool SetPackagesToActivate(
|
2013-04-20 03:28:18 +04:00
|
|
|
const BStringList& packages);
|
2013-04-20 23:24:28 +04:00
|
|
|
bool AddPackageToActivate(const BString& package);
|
2013-04-20 03:28:18 +04:00
|
|
|
|
|
|
|
const BStringList& PackagesToDeactivate() const;
|
2013-04-20 23:24:28 +04:00
|
|
|
bool SetPackagesToDeactivate(
|
2013-04-20 03:28:18 +04:00
|
|
|
const BStringList& packages);
|
2013-04-20 23:24:28 +04:00
|
|
|
bool AddPackageToDeactivate(const BString& package);
|
2013-04-20 03:28:18 +04:00
|
|
|
|
2021-02-03 01:27:06 +03:00
|
|
|
bool FirstBootProcessing() const;
|
|
|
|
void SetFirstBootProcessing(bool processingIsOn);
|
|
|
|
|
2013-09-10 20:37:59 +04:00
|
|
|
virtual status_t Archive(BMessage* archive,
|
|
|
|
bool deep = true) const;
|
|
|
|
static BArchivable* Instantiate(BMessage* archive);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static status_t _ExtractStringList(BMessage* archive,
|
|
|
|
const char* field, BStringList& _list);
|
|
|
|
|
2013-04-20 03:28:18 +04:00
|
|
|
private:
|
|
|
|
BPackageInstallationLocation fLocation;
|
|
|
|
int64 fChangeCount;
|
|
|
|
BString fTransactionDirectoryName;
|
|
|
|
BStringList fPackagesToActivate;
|
|
|
|
BStringList fPackagesToDeactivate;
|
2021-02-03 01:27:06 +03:00
|
|
|
bool fFirstBootProcessing;
|
2013-04-20 03:28:18 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_
|