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-02-10 22:07:21 +03:00
|
|
|
#include <ObjectList.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-02-10 22:07:21 +03:00
|
|
|
const BObjectList<BString>& LicenseNames() const;
|
|
|
|
const BObjectList<BString>& 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;
|
|
|
|
|
|
|
|
static const char* kNameField;
|
|
|
|
static const char* kURLField;
|
|
|
|
static const char* kVendorField;
|
2011-02-09 22:11:23 +03:00
|
|
|
static const char* kSummaryField;
|
2011-01-25 22:36:09 +03:00
|
|
|
static const char* kPriorityField;
|
2011-02-09 22:11:23 +03:00
|
|
|
static const char* kArchitectureField;
|
2011-02-10 22:07:21 +03:00
|
|
|
static const char* kLicenseNameField;
|
|
|
|
static const char* kLicenseTextField;
|
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-02-10 22:07:21 +03:00
|
|
|
BObjectList<BString> fLicenseNames;
|
|
|
|
BObjectList<BString> fLicenseTexts;
|
2011-01-25 22:36:09 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
|
|
|
2011-02-09 22:11:23 +03:00
|
|
|
#endif // _PACKAGE__REPOSITORY_INFO_H_
|