2 * Copyright 2013, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
8 #ifndef _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_
9 #define _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_
12 #include <Archivable.h>
13 #include <package/PackageDefs.h>
14 #include <StringList.h>
17 namespace BPackageKit
{
21 class BActivationTransaction
: public BArchivable
{
23 BActivationTransaction();
24 BActivationTransaction(BMessage
* archive
,
25 status_t
* _error
= NULL
);
26 virtual ~BActivationTransaction();
28 status_t
SetTo(BPackageInstallationLocation location
,
30 const BString
& directoryName
);
32 status_t
InitCheck() const;
34 BPackageInstallationLocation
Location() const;
36 BPackageInstallationLocation location
);
38 int64
ChangeCount() const;
39 void SetChangeCount(int64 changeCount
);
41 const BString
& TransactionDirectoryName() const;
42 void SetTransactionDirectoryName(
43 const BString
& directoryName
);
45 const BStringList
& PackagesToActivate() const;
46 bool SetPackagesToActivate(
47 const BStringList
& packages
);
48 bool AddPackageToActivate(const BString
& package
);
50 const BStringList
& PackagesToDeactivate() const;
51 bool SetPackagesToDeactivate(
52 const BStringList
& packages
);
53 bool AddPackageToDeactivate(const BString
& package
);
55 virtual status_t
Archive(BMessage
* archive
,
56 bool deep
= true) const;
57 static BArchivable
* Instantiate(BMessage
* archive
);
60 static status_t
_ExtractStringList(BMessage
* archive
,
61 const char* field
, BStringList
& _list
);
64 BPackageInstallationLocation fLocation
;
66 BString fTransactionDirectoryName
;
67 BStringList fPackagesToActivate
;
68 BStringList fPackagesToDeactivate
;
72 } // namespace BPrivate
73 } // namespace BPackageKit
76 #endif // _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_