2011-01-25 22:36:09 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2011, Haiku, Inc.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2011-02-09 22:11:23 +03:00
|
|
|
#ifndef _PACKAGE__REPOSITORY_INFO_H_
|
|
|
|
#define _PACKAGE__REPOSITORY_INFO_H_
|
2011-01-25 22:36:09 +03:00
|
|
|
|
|
|
|
|
|
|
|
#include <Archivable.h>
|
2011-02-09 22:11:23 +03:00
|
|
|
#include <Entry.h>
|
2011-07-16 18:36:36 +04:00
|
|
|
#include <StringList.h>
|
2011-01-25 22:36:09 +03:00
|
|
|
#include <String.h>
|
|
|
|
|
2011-02-09 22:11:23 +03:00
|
|
|
#include <package/PackageArchitecture.h>
|
|
|
|
|
2011-01-25 22:36:09 +03:00
|
|
|
|
|
|
|
namespace BPackageKit {
|
|
|
|
|
|
|
|
|
2011-02-09 22:11:23 +03:00
|
|
|
class BRepositoryInfo : public BArchivable {
|
2011-01-25 22:36:09 +03:00
|
|
|
typedef BArchivable inherited;
|
|
|
|
|
|
|
|
public:
|
2011-02-09 22:11:23 +03:00
|
|
|
BRepositoryInfo();
|
|
|
|
BRepositoryInfo(BMessage* data);
|
|
|
|
BRepositoryInfo(const BEntry& entry);
|
|
|
|
virtual ~BRepositoryInfo();
|
2011-01-25 22:36:09 +03:00
|
|
|
|
|
|
|
virtual status_t Archive(BMessage* data, bool deep = true) const;
|
|
|
|
|
|
|
|
status_t SetTo(const BMessage* data);
|
2011-02-09 22:11:23 +03:00
|
|
|
status_t SetTo(const BEntry& entry);
|
2011-01-25 22:36:09 +03:00
|
|
|
status_t InitCheck() const;
|
|
|
|
|
|
|
|
const BString& Name() const;
|
|
|
|
const BString& OriginalBaseURL() const;
|
|
|
|
const BString& Vendor() const;
|
2011-02-09 22:11:23 +03:00
|
|
|
const BString& Summary() const;
|
2011-01-25 22:36:09 +03:00
|
|
|
uint8 Priority() const;
|
2011-02-09 22:11:23 +03:00
|
|
|
BPackageArchitecture Architecture() const;
|
2011-07-16 18:36:36 +04:00
|
|
|
const BStringList& LicenseNames() const;
|
|
|
|
const BStringList& LicenseTexts() const;
|
2011-01-25 22:36:09 +03:00
|
|
|
|
|
|
|
void SetName(const BString& name);
|
|
|
|
void SetOriginalBaseURL(const BString& url);
|
|
|
|
void SetVendor(const BString& vendor);
|
2011-02-09 22:11:23 +03:00
|
|
|
void SetSummary(const BString& summary);
|
2011-01-25 22:36:09 +03:00
|
|
|
void SetPriority(uint8 priority);
|
2011-02-09 22:11:23 +03:00
|
|
|
void SetArchitecture(BPackageArchitecture arch);
|
2011-01-25 22:36:09 +03:00
|
|
|
|
2011-02-10 22:07:21 +03:00
|
|
|
status_t AddLicense(const BString& licenseName,
|
|
|
|
const BString& licenseText);
|
|
|
|
void ClearLicenses();
|
|
|
|
|
2011-01-25 22:36:09 +03:00
|
|
|
public:
|
2011-02-09 22:11:23 +03:00
|
|
|
static BRepositoryInfo* Instantiate(BMessage* data);
|
2011-01-25 22:36:09 +03:00
|
|
|
|
|
|
|
static const uint8 kDefaultPriority;
|
|
|
|
|
2013-05-22 01:20:51 +04:00
|
|
|
static const char* const kNameField;
|
|
|
|
static const char* const kURLField;
|
|
|
|
static const char* const kVendorField;
|
|
|
|
static const char* const kSummaryField;
|
|
|
|
static const char* const kPriorityField;
|
|
|
|
static const char* const kArchitectureField;
|
|
|
|
static const char* const kLicenseNameField;
|
|
|
|
static const char* const kLicenseTextField;
|
2011-01-25 22:36:09 +03:00
|
|
|
|
2013-07-04 21:00:39 +04:00
|
|
|
private:
|
|
|
|
status_t _SetTo(const BMessage* data);
|
|
|
|
status_t _SetTo(const BEntry& entry);
|
|
|
|
|
2011-01-25 22:36:09 +03:00
|
|
|
private:
|
|
|
|
status_t fInitStatus;
|
|
|
|
|
|
|
|
BString fName;
|
|
|
|
BString fOriginalBaseURL;
|
|
|
|
BString fVendor;
|
2011-02-09 22:11:23 +03:00
|
|
|
BString fSummary;
|
2011-01-25 22:36:09 +03:00
|
|
|
uint8 fPriority;
|
2011-02-09 22:11:23 +03:00
|
|
|
BPackageArchitecture fArchitecture;
|
2011-07-16 18:36:36 +04:00
|
|
|
BStringList fLicenseNames;
|
|
|
|
BStringList fLicenseTexts;
|
2011-01-25 22:36:09 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
|
|
|
2011-02-09 22:11:23 +03:00
|
|
|
#endif // _PACKAGE__REPOSITORY_INFO_H_
|