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 <Archivable.h> 13 #include <package/PackageDefs.h> 14 #include <StringList.h> 15 16 17 namespace BPackageKit { 18 namespace BPrivate { 19 20 21 class BActivationTransaction : public BArchivable { 22 public: 23 BActivationTransaction(); 24 BActivationTransaction(BMessage* archive, 25 status_t* _error = NULL); 26 virtual ~BActivationTransaction(); 27 28 status_t SetTo(BPackageInstallationLocation location, 29 int64 changeCount, 30 const BString& directoryName); 31 32 status_t InitCheck() const; 33 34 BPackageInstallationLocation Location() const; 35 void SetLocation( 36 BPackageInstallationLocation location); 37 38 int64 ChangeCount() const; 39 void SetChangeCount(int64 changeCount); 40 41 const BString& TransactionDirectoryName() const; 42 void SetTransactionDirectoryName( 43 const BString& directoryName); 44 45 const BStringList& PackagesToActivate() const; 46 bool SetPackagesToActivate( 47 const BStringList& packages); 48 bool AddPackageToActivate(const BString& package); 49 50 const BStringList& PackagesToDeactivate() const; 51 bool SetPackagesToDeactivate( 52 const BStringList& packages); 53 bool AddPackageToDeactivate(const BString& package); 54 55 bool FirstBootProcessing() const; 56 void SetFirstBootProcessing(bool processingIsOn); 57 58 virtual status_t Archive(BMessage* archive, 59 bool deep = true) const; 60 static BArchivable* Instantiate(BMessage* archive); 61 62 private: 63 static status_t _ExtractStringList(BMessage* archive, 64 const char* field, BStringList& _list); 65 66 private: 67 BPackageInstallationLocation fLocation; 68 int64 fChangeCount; 69 BString fTransactionDirectoryName; 70 BStringList fPackagesToActivate; 71 BStringList fPackagesToDeactivate; 72 bool fFirstBootProcessing; 73 }; 74 75 76 } // namespace BPrivate 77 } // namespace BPackageKit 78 79 80 #endif // _PACKAGE__PRIVATE__ACTIVATION_TRANSACTION_H_ 81