- more progress creating caches
[platform/upstream/libzypp.git] / zypp / detail / ScriptImplIf.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/detail/ScriptImplIf.h
10  *
11 */
12 #ifndef ZYPP_DETAIL_SCRIPTIMPLIF_H
13 #define ZYPP_DETAIL_SCRIPTIMPLIF_H
14
15 #include "zypp/detail/ResObjectImplIf.h"
16 #include "zypp/Pathname.h"
17
18 ///////////////////////////////////////////////////////////////////
19 namespace zypp
20 { /////////////////////////////////////////////////////////////////
21
22   class Script;
23
24   ///////////////////////////////////////////////////////////////////
25   namespace detail
26   { /////////////////////////////////////////////////////////////////
27
28     ///////////////////////////////////////////////////////////////////
29     //
30     //  CLASS NAME : ScriptImplIf
31     //
32     /** Abstract Script implementation interface.
33     */
34     class ScriptImplIf : public ResObjectImplIf
35     {
36     public:
37       typedef Script ResType;
38
39     public:
40       /** Overloaded ResObjectImpl attribute.
41        * \return The \ref doScriptLocation media number
42        * or \c 0 if do-script is inlined.
43        */
44       virtual unsigned mediaNr() const;
45
46     public:
47        /** Check whether a script is available. */
48       virtual bool doAvailable() const;
49
50      /** Return an inlined script if available.
51        * Otherwise it is available at \ref doScriptLocation.
52        */
53       virtual std::string doScriptInlined() const;
54
55       /** Location of the script, unless it is available inlined.
56        * \see \ref doScriptInlined
57        */
58       virtual OnMediaLocation doScriptLocation() const;
59
60       /** Check whether a script to undo the change is available. */
61       virtual bool undoAvailable() const;
62
63       /** Return an inlined undo script if available.
64        * Otherwise it is available at \ref undoScriptLocation.
65        */
66       virtual std::string undoScriptInlined() const;
67
68       /** Location of the undo script, unless it is available inlined.
69        * \see \ref undoScriptInlined
70        */
71       virtual OnMediaLocation undoScriptLocation() const;
72     };
73     ///////////////////////////////////////////////////////////////////
74
75     /////////////////////////////////////////////////////////////////
76   } // namespace detail
77   ///////////////////////////////////////////////////////////////////
78   /////////////////////////////////////////////////////////////////
79 } // namespace zypp
80 ///////////////////////////////////////////////////////////////////
81 #endif // ZYPP_DETAIL_SCRIPTIMPLIF_H