Imported Upstream version 2.8.11.2
[platform/upstream/cmake.git] / Source / CPack / cmCPackComponentGroup.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc.
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12
13 #ifndef cmCPackComponentGroup_h
14 #define cmCPackComponentGroup_h
15
16 #include "cmStandardIncludes.h"
17
18 class cmCPackComponentGroup;
19
20 /** \class cmCPackInstallationType
21  * \brief A certain type of installation, which encompasses a
22  * set of components.
23  */
24 class cmCPackInstallationType
25 {
26 public:
27   /// The name of the installation type (used to reference this
28   /// installation type).
29   std::string Name;
30
31   /// The name of the installation type as displayed to the user.
32   std::string DisplayName;
33
34   /// The index number of the installation type. This is an arbitrary
35   /// numbering from 1 to the number of installation types.
36   unsigned Index;
37 };
38
39 /** \class cmCPackComponent
40  * \brief A single component to be installed by CPack.
41  */
42 class cmCPackComponent
43 {
44 public:
45  cmCPackComponent() : Group(0), IsRequired(true), IsHidden(false),
46                       IsDisabledByDefault(false), IsDownloaded(false),
47                       TotalSize(0) { }
48
49   /// The name of the component (used to reference the component).
50   std::string Name;
51
52   /// The name of the component as displayed to the user.
53   std::string DisplayName;
54
55   /// The component group that contains this component (if any).
56   cmCPackComponentGroup *Group;
57
58   /// Whether this component group must always be installed.
59   bool IsRequired : 1;
60
61   /// Whether this component group is hidden. A hidden component group
62   /// is always installed. However, it may still be shown to the user.
63   bool IsHidden : 1;
64
65   /// Whether this component defaults to "disabled".
66   bool IsDisabledByDefault : 1;
67
68   /// Whether this component should be downloaded on-the-fly. If false,
69   /// the component will be a part of the installation package.
70   bool IsDownloaded : 1;
71
72   /// A description of this component.
73   std::string Description;
74
75   /// The installation types that this component is a part of.
76   std::vector<cmCPackInstallationType *> InstallationTypes;
77
78   /// If IsDownloaded is true, the name of the archive file that
79   /// contains the files that are part of this component.
80   std::string ArchiveFile;
81
82   /// The components that this component depends on.
83   std::vector<cmCPackComponent *> Dependencies;
84
85   /// The components that depend on this component.
86   std::vector<cmCPackComponent *> ReverseDependencies;
87
88   /// The list of installed files that are part of this component.
89   std::vector<std::string> Files;
90
91   /// The list of installed directories that are part of this component.
92   std::vector<std::string> Directories;
93
94   /// Get the total installed size of all of the files in this
95   /// component, in bytes. installDir is the directory into which the
96   /// component was installed.
97   unsigned long GetInstalledSize(const char* installDir) const;
98
99   /// Identical to GetInstalledSize, but returns the result in
100   /// kilobytes.
101   unsigned long GetInstalledSizeInKbytes(const char* installDir) const;
102
103  private:
104   mutable unsigned long TotalSize;
105 };
106
107 /** \class cmCPackComponentGroup
108  * \brief A component group to be installed by CPack.
109  */
110 class cmCPackComponentGroup
111 {
112 public:
113  cmCPackComponentGroup() : ParentGroup(0) { }
114
115   /// The name of the group (used to reference the group).
116   std::string Name;
117
118   /// The name of the component as displayed to the user.
119   std::string DisplayName;
120
121   /// The description of this component group.
122   std::string Description;
123
124   /// Whether the name of the component will be shown in bold.
125   bool IsBold : 1;
126
127   /// Whether the section should be expanded by default
128   bool IsExpandedByDefault : 1;
129
130   /// The components within this group.
131   std::vector<cmCPackComponent*> Components;
132
133   /// The parent group of this component group (if any).
134   cmCPackComponentGroup *ParentGroup;
135
136   /// The subgroups of this group.
137   std::vector<cmCPackComponentGroup*> Subgroups;
138 };
139
140 #endif