1 /* 2 * Copyright 2013, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold <ingo_weinhold@gmx.de> 7 */ 8 #ifndef _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_ 9 #define _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_ 10 11 12 #include <package/PackageDefs.h> 13 #include <StringList.h> 14 15 16 namespace BPackageKit { 17 namespace BPrivate { 18 19 20 class BActivationTransaction { 21 public: 22 BActivationTransaction(); 23 ~BActivationTransaction(); 24 25 status_t SetTo(BPackageInstallationLocation location, 26 int64 changeCount, 27 const BString& directoryName); 28 29 status_t InitCheck() const; 30 31 BPackageInstallationLocation Location() const; 32 void SetLocation( 33 BPackageInstallationLocation location); 34 35 int64 ChangeCount() const; 36 void SetChangeCount(int64 changeCount); 37 38 const BString& TransactionDirectoryName() const; 39 void SetTransactionDirectoryName( 40 const BString& directoryName); 41 42 const BStringList& PackagesToActivate() const; 43 bool SetPackagesToActivate( 44 const BStringList& packages); 45 bool AddPackageToActivate(const BString& package); 46 47 const BStringList& PackagesToDeactivate() const; 48 bool SetPackagesToDeactivate( 49 const BStringList& packages); 50 bool AddPackageToDeactivate(const BString& package); 51 52 private: 53 BPackageInstallationLocation fLocation; 54 int64 fChangeCount; 55 BString fTransactionDirectoryName; 56 BStringList fPackagesToActivate; 57 BStringList fPackagesToDeactivate; 58 }; 59 60 61 } // namespace BPrivate 62 } // namespace BPackageKit 63 64 65 #endif // _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_ 66