Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / repo / ServiceRepos.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9
10 #ifndef ZYPP_REPO_SERVICE_REPOS
11 #define ZYPP_REPO_SERVICE_REPOS
12
13 #include "zypp/base/NonCopyable.h"
14 #include "zypp/ProgressData.h"
15 #include "zypp/ServiceInfo.h"
16 #include "zypp/RepoInfo.h"
17
18 namespace zypp
19 {
20   namespace repo
21   {
22     /**
23      * Retrieval of repository list for
24      * a service
25      */
26     class ServiceRepos : private base::NonCopyable
27     {
28     public:
29
30      /**
31       * Callback definition.
32       * First parameter is a \ref RepoInfo object with the resource
33       * second parameter is the resource type.
34       *
35       * Return false from the callback to get a \ref AbortRequestException
36       * to be thrown and the processing to be cancelled.
37       */
38       typedef function< bool( const RepoInfo & )> ProcessRepo;
39
40       ServiceRepos(const ServiceInfo &service,
41                    const ProcessRepo & callback,
42                    const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() );
43       ~ServiceRepos();
44
45       /** Implementation  */
46       class Impl;
47     private:
48       RW_pointer<Impl> _impl;
49     };
50   } // ns repo
51 } // ns zypp
52
53 #endif