1500bb630SOliver Tappe/*
23b17d8ddSAndrew Lindesay * Copyright 2011-2018, Haiku, Inc.
3500bb630SOliver Tappe * Distributed under the terms of the MIT License.
4500bb630SOliver Tappe */
57d7ed9bfSOliver Tappe#ifndef _PACKAGE__REPOSITORY_CONFIG_H_
67d7ed9bfSOliver Tappe#define _PACKAGE__REPOSITORY_CONFIG_H_
7500bb630SOliver Tappe
8500bb630SOliver Tappe
935edda8fSOliver Tappe#include <Entry.h>
10500bb630SOliver Tappe#include <String.h>
11500bb630SOliver Tappe
12500bb630SOliver Tappe
137d7ed9bfSOliver Tappenamespace BPackageKit {
14500bb630SOliver Tappe
15500bb630SOliver Tappe
16733c783dSOliver Tappeclass BRepositoryConfig {
17500bb630SOliver Tappepublic:
187d7ed9bfSOliver Tappe								BRepositoryConfig();
197d7ed9bfSOliver Tappe								BRepositoryConfig(const BString& name,
20733c783dSOliver Tappe									const BString& url, uint8 priority);
217d7ed9bfSOliver Tappe								BRepositoryConfig(const BEntry& entry);
227d7ed9bfSOliver Tappe	virtual						~BRepositoryConfig();
23500bb630SOliver Tappe
24733c783dSOliver Tappe			status_t			Store(const BEntry& entry) const;
25500bb630SOliver Tappe
2635edda8fSOliver Tappe			status_t			SetTo(const BEntry& entry);
27500bb630SOliver Tappe			status_t			InitCheck() const;
28500bb630SOliver Tappe
29500bb630SOliver Tappe			const BString&		Name() const;
30733c783dSOliver Tappe			const BString&		BaseURL() const;
313b17d8ddSAndrew Lindesay			const BString&		URL() const;
32500bb630SOliver Tappe			uint8				Priority() const;
33500bb630SOliver Tappe			bool				IsUserSpecific() const;
34500bb630SOliver Tappe
3535edda8fSOliver Tappe			const BEntry&		Entry() const;
3635edda8fSOliver Tappe
37014eed80SIngo Weinhold			BString				PackagesURL() const;
38014eed80SIngo Weinhold
39500bb630SOliver Tappe			void				SetName(const BString& name);
40733c783dSOliver Tappe			void				SetBaseURL(const BString& url);
413b17d8ddSAndrew Lindesay			void				SetURL(const BString& url);
42500bb630SOliver Tappe			void				SetPriority(uint8 priority);
43500bb630SOliver Tappe			void				SetIsUserSpecific(bool isUserSpecific);
44500bb630SOliver Tappe
45500bb630SOliver Tappepublic:
46733c783dSOliver Tappe	static	const uint8			kUnsetPriority = 0;
47500bb630SOliver Tappe
48500bb630SOliver Tappeprivate:
49500bb630SOliver Tappe			status_t			fInitStatus;
50500bb630SOliver Tappe
51500bb630SOliver Tappe			BString				fName;
52733c783dSOliver Tappe			BString				fBaseURL;
533b17d8ddSAndrew Lindesay				// this URL is the URL that can be used to access the data of
543b17d8ddSAndrew Lindesay				// the repository - it points to a single mirror.
553b17d8ddSAndrew Lindesay			BString				fURL;
563b17d8ddSAndrew Lindesay				// this URL is actually an identifier for the repository
573b17d8ddSAndrew Lindesay				// that is consistent across mirrors.
58500bb630SOliver Tappe			uint8				fPriority;
59500bb630SOliver Tappe			bool				fIsUserSpecific;
6035edda8fSOliver Tappe
6135edda8fSOliver Tappe			BEntry				fEntry;
62500bb630SOliver Tappe};
63500bb630SOliver Tappe
64500bb630SOliver Tappe
657d7ed9bfSOliver Tappe}	// namespace BPackageKit
66500bb630SOliver Tappe
67500bb630SOliver Tappe
687d7ed9bfSOliver Tappe#endif // _PACKAGE__REPOSITORY_CONFIG_H_