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__DAEMON_CLIENT_H_ 9#define _PACKAGE__PRIVATE__DAEMON_CLIENT_H_ 10 11 12#include <Messenger.h> 13#include <package/PackageDefs.h> 14#include <String.h> 15 16#include <package/DaemonDefs.h> 17 18 19class BDirectory; 20 21 22namespace BPackageKit { 23 24 25class BCommitTransactionResult; 26class BInstallationLocationInfo; 27class BPackageInfoSet; 28 29 30namespace BPrivate { 31 32 33class BActivationTransaction; 34 35 36class BDaemonClient { 37public: 38 BDaemonClient(); 39 ~BDaemonClient(); 40 41 status_t GetInstallationLocationInfo( 42 BPackageInstallationLocation location, 43 BInstallationLocationInfo& _info); 44 status_t CommitTransaction( 45 const BActivationTransaction& transaction, 46 BCommitTransactionResult& _result); 47 // B_OK only means _result is initialized, 48 // not the success of committing the 49 // transaction 50 51 status_t CreateTransaction( 52 BPackageInstallationLocation location, 53 BActivationTransaction& _transaction, 54 BDirectory& _transactionDirectory); 55 56private: 57 status_t _InitMessenger(); 58 status_t _ExtractPackageInfoSet(const BMessage& message, 59 const char* field, BPackageInfoSet& _infos); 60 61private: 62 BMessenger fDaemonMessenger; 63}; 64 65 66} // namespace BPrivate 67} // namespace BPackageKit 68 69 70#endif // _PACKAGE__PRIVATE__DAEMON_CLIENT_H_ 71